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
5af9aac0
Commit
5af9aac0
authored
Feb 21, 2023
by
charlie
Browse files
Merge branch 'dyn_batch_pass' of github.com:ROCmSoftwarePlatform/AMDMIGraphX into dyn_test_runner
parents
7b2516e0
05e81ed3
Changes
147
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
10 deletions
+24
-10
tools/api/api.cpp
tools/api/api.cpp
+5
-0
tools/build_and_test_onnxrt.sh
tools/build_and_test_onnxrt.sh
+7
-4
tools/download_models.sh
tools/download_models.sh
+5
-4
tools/include/context.hpp
tools/include/context.hpp
+2
-0
tools/include/operation.hpp
tools/include/operation.hpp
+2
-0
tools/install_prereqs.sh
tools/install_prereqs.sh
+1
-1
tools/te.py
tools/te.py
+2
-1
No files found.
tools/api/api.cpp
View file @
5af9aac0
...
...
@@ -134,6 +134,11 @@ void set_offload_copy(compile_options& options, bool value) { options.offload_co
void
set_fast_math
(
compile_options
&
options
,
bool
value
)
{
options
.
fast_math
=
value
;
}
void
set_exhaustive_tune_flag
(
compile_options
&
options
,
bool
value
)
{
options
.
exhaustive_tune
=
value
;
}
void
set_file_format
(
file_options
&
options
,
const
char
*
format
)
{
options
.
format
=
format
;
}
void
set_default_dim_value
(
onnx_options
&
options
,
size_t
value
)
...
...
tools/build_and_test_onnxrt.sh
View file @
5af9aac0
...
...
@@ -22,9 +22,12 @@
# THE SOFTWARE.
#####################################################################################
cd
/onnxruntime
pip3
install
-r
requirements.txt
pip3
install
-r
requirements
-dev
.txt
# Add newer cmake to the path
export
PATH
=
"/opt/cmake/bin:
$PATH
"
export
CXXFLAGS
=
"-D__HIP_PLATFORM_HCC__=1 -w"
./build.sh
--config
Release
--update
--build
--parallel
--cmake_extra_defines
ONNXRUNTIME_VERSION
=
$(
cat
./VERSION_NUMBER
)
--test
--use_migraphx
# pip3 install /code/onnxruntime/build/Linux/Release/dist/*.whl
export
CXXFLAGS
=
"-D__HIP_PLATFORM_AMD__=1 -w"
./build.sh
--config
Release
--cmake_extra_defines
CMAKE_HIP_COMPILER
=
/opt/rocm/llvm/bin/clang++
--update
--build
--parallel
--cmake_extra_defines
ONNXRUNTIME_VERSION
=
$(
cat
./VERSION_NUMBER
)
--skip_tests
--rocm_home
/opt/rocm
--use_migraphx
--migraphx_home
/opt/rocm
--rocm_version
=
`
cat
/opt/rocm/.info/version-dev
`
cd
build/Linux/Release
#Add test launcher for onnxrt tests
../../../tools/ci_build/github/pai/migraphx_test_launcher.sh
tools/download_models.sh
View file @
5af9aac0
...
...
@@ -26,10 +26,12 @@
if
[
-z
"
$ONNX_HOME
"
]
then
ONNX_HOME
=
$HOME
# The onnx library uses ONNX_HOME, by default if it doesn't exist
# the path of " ~/.onnx " is used
ONNX_HOME
=
$HOME
/.onnx
fi
model_dir
=
$ONNX_HOME
/
.onnx/
models
model_dir
=
$ONNX_HOME
/models
tmp_dir
=
$ONNX_HOME
/tmp/
mkdir
-p
$model_dir
mkdir
-p
$tmp_dir
...
...
@@ -42,7 +44,6 @@ models="bvlc_alexnet \
for
name
in
$models
do
curl https://
s3.amazonaws.com/download.onnx/models/opset_9
/
$name
.tar.gz
--output
$tmp_dir
/
$name
.tar.gz
curl https://
download.onnxruntime.ai/onnx/models
/
$name
.tar.gz
--output
$tmp_dir
/
$name
.tar.gz
tar
-xzvf
$tmp_dir
/
$name
.tar.gz
--directory
$model_dir
&&
rm
$tmp_dir
/
$name
.tar.gz
done
tools/include/context.hpp
View file @
5af9aac0
...
...
@@ -66,6 +66,7 @@ any_ptr get_queue_context(T&)
{
return
{};
}
template
<
class
T
>
void
wait_for_context
(
T
&
,
any_ptr
)
{
...
...
@@ -87,6 +88,7 @@ void finish_on_context(T&, any_ptr){}
{
v
=
ctx
.
to_value
();
}
inline
void
migraphx_from_value
(
const
value
&
v
,
context
&
ctx
)
{
ctx
.
from_value
(
v
);
}
#endif
...
...
tools/include/operation.hpp
View file @
5af9aac0
...
...
@@ -140,6 +140,8 @@ template <class T>
auto
compute_shape_op
(
rank
<
2
>
,
const
T
&
x
,
const
std
::
vector
<
shape
>&
inputs
)
->
decltype
(
x
.
normalize_compute_shape
(
inputs
))
{
if
(
inputs
.
empty
())
MIGRAPHX_THROW
(
"At least one input is required for "
+
x
.
name
());
dependent_type
<
operation
,
T
>
y
=
x
;
normalize_attributes
(
y
,
inputs
[
0
].
max_lens
());
return
any_cast
<
T
>
(
y
).
normalize_compute_shape
(
inputs
);
...
...
tools/install_prereqs.sh
View file @
5af9aac0
...
...
@@ -57,7 +57,7 @@ echo "Dependencies are installed at $PREFIX"
rbuild prepare
-d
$PREFIX
-s
develop
# install onnx package for unit tests
pip3
install
onnx
==
1.10.
0
numpy
==
1.21.6
typing
==
3.7.4
pytest
==
6.0.1
packaging
==
16.8
pip3
install
onnx
==
1.10.
2
numpy
==
1.21.6
typing
==
3.7.4
pytest
==
6.0.1
packaging
==
23.0
# pin version of protobuf in Python for onnx runtime unit tests
pip3
install
protobuf
==
3.20.0
tools/te.py
View file @
5af9aac0
...
...
@@ -24,7 +24,8 @@
import
string
,
sys
,
re
trivial
=
[
'std::size_t'
,
'instruction_ref'
,
'support_metric'
,
'const_module_ref'
'std::size_t'
,
'instruction_ref'
,
'support_metric'
,
'const_module_ref'
,
'bool'
,
'any_ptr'
]
headers
=
'''
...
...
Prev
1
…
4
5
6
7
8
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