Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
6711780a
Commit
6711780a
authored
Oct 24, 2023
by
Artur Wojcik
Browse files
Merge branch 'develop' into uif2-initial
parents
c0563b9e
d1abf06f
Changes
167
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
103 additions
and
6 deletions
+103
-6
test/verify/test_squeeze_conv_relu.cpp
test/verify/test_squeeze_conv_relu.cpp
+45
-0
test/verify/test_unsqueeze_conv_relu.cpp
test/verify/test_unsqueeze_conv_relu.cpp
+45
-0
tools/CMakeLists.txt
tools/CMakeLists.txt
+1
-1
tools/accuracy/accuracy_checker.py
tools/accuracy/accuracy_checker.py
+8
-2
tools/accuracy/requirements.txt
tools/accuracy/requirements.txt
+1
-1
tools/build_and_test_onnxrt.sh
tools/build_and_test_onnxrt.sh
+1
-1
tools/install_prereqs.sh
tools/install_prereqs.sh
+2
-1
No files found.
test/verify/test_squeeze_conv_relu.cpp
0 → 100644
View file @
6711780a
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
test_squeeze_conv_relu
:
verify_program
<
test_squeeze_conv_relu
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
1
,
3
,
3
}});
input
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"squeeze"
,
{{
"axes"
,
{
2
}}}),
input
);
auto
weights
=
mm
->
add_parameter
(
"w"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}});
auto
conv
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
input
,
weights
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"relu"
),
conv
);
return
p
;
}
};
test/verify/test_unsqueeze_conv_relu.cpp
0 → 100644
View file @
6711780a
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
test_unsqueeze_conv_relu
:
verify_program
<
test_unsqueeze_conv_relu
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
3
,
3
}});
auto
weights
=
mm
->
add_parameter
(
"w"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
3
,
3
}});
weights
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
weights
);
auto
conv
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
input
,
weights
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"relu"
),
conv
);
return
p
;
}
};
tools/CMakeLists.txt
View file @
6711780a
...
...
@@ -28,7 +28,7 @@ if(NOT Python_EXECUTABLE)
return
()
endif
()
find_program
(
CLANG_FORMAT clang-format PATHS /opt/rocm/llvm
$
ENV
{
HIP_PATH
}
)
find_program
(
CLANG_FORMAT clang-format PATHS /opt/rocm/llvm ENV
HIP_PATH
PATH_SUFFIXES bin
)
if
(
NOT CLANG_FORMAT
)
message
(
WARNING
"clang-format not found - skipping 'generate' target!"
)
return
()
...
...
tools/accuracy/accuracy_checker.py
View file @
6711780a
...
...
@@ -220,10 +220,16 @@ def main():
else
:
test_input
=
np
.
zeros
(
in_shape
).
astype
(
get_np_datatype
(
in_type
))
test_inputs
[
name
]
=
test_input
params
[
name
]
=
migraphx
.
argument
(
test_input
)
migraphx_arg
=
migraphx
.
argument
(
test_input
)
if
not
args
.
offload_copy
:
migraphx_arg
=
migraphx
.
to_gpu
(
migraphx_arg
)
params
[
name
]
=
migraphx_arg
if
not
args
.
ort_run
:
pred_migx
=
np
.
array
(
model
.
run
(
params
)[
-
1
])
if
not
args
.
offload_copy
:
pred_migx
=
np
.
array
(
migraphx
.
from_gpu
(
model
.
run
(
params
)[
-
1
]))
else
:
pred_migx
=
np
.
array
(
model
.
run
(
params
)[
-
1
])
if
use_onnx
:
sess_op
=
ort
.
SessionOptions
()
...
...
tools/accuracy/requirements.txt
View file @
6711780a
...
...
@@ -22,4 +22,4 @@
# THE SOFTWARE.
#####################################################################################
numpy==1.21.6
onnxruntime==1.1
0.0
onnxruntime==1.1
6.1
tools/build_and_test_onnxrt.sh
View file @
6711780a
...
...
@@ -40,4 +40,4 @@ echo 'InferenceSessionTests.CheckRunProfilerWithSessionOptions' >> ../../../tool
echo
'InferenceSessionTests.CheckRunProfilerWithSessionOptions2'
>>
../../../tools/ci_build/github/pai/migraphx-excluded-tests.txt
echo
'InferenceSessionTests.Test3LayerNestedSubgraph'
>>
../../../tools/ci_build/github/pai/migraphx-excluded-tests.txt
echo
'InferenceSessionTests.Test2LayerNestedSubgraph'
>>
../../../tools/ci_build/github/pai/migraphx-excluded-tests.txt
../../../tools/ci_build/github/pai/
migraphx
_test_launcher.sh
||
(
gdb ./onnxruntime_test_all core
-batch
-ex
bt
&&
exit
1
)
../../../tools/ci_build/github/pai/
pai
_test_launcher.sh
||
(
gdb ./onnxruntime_test_all core
-batch
-ex
bt
&&
exit
1
)
tools/install_prereqs.sh
View file @
6711780a
...
...
@@ -3,7 +3,7 @@
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-202
2
Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2015-202
3
Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
...
...
@@ -51,6 +51,7 @@ else
openmp-extras
\
python3-dev
\
python3-pip
\
python3-venv
\
rocblas-dev
\
rocm-cmake
fi
...
...
Prev
1
…
5
6
7
8
9
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment