Commit 5af9aac0 authored by charlie's avatar charlie
Browse files

Merge branch 'dyn_batch_pass' of github.com:ROCmSoftwarePlatform/AMDMIGraphX into dyn_test_runner

parents 7b2516e0 05e81ed3
...@@ -134,6 +134,11 @@ void set_offload_copy(compile_options& options, bool value) { options.offload_co ...@@ -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_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_file_format(file_options& options, const char* format) { options.format = format; }
void set_default_dim_value(onnx_options& options, size_t value) void set_default_dim_value(onnx_options& options, size_t value)
......
...@@ -22,9 +22,12 @@ ...@@ -22,9 +22,12 @@
# THE SOFTWARE. # THE SOFTWARE.
##################################################################################### #####################################################################################
cd /onnxruntime cd /onnxruntime
pip3 install -r requirements.txt pip3 install -r requirements-dev.txt
# Add newer cmake to the path # Add newer cmake to the path
export PATH="/opt/cmake/bin:$PATH" export PATH="/opt/cmake/bin:$PATH"
export CXXFLAGS="-D__HIP_PLATFORM_HCC__=1 -w" export CXXFLAGS="-D__HIP_PLATFORM_AMD__=1 -w"
./build.sh --config Release --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) --test --use_migraphx ./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`
# pip3 install /code/onnxruntime/build/Linux/Release/dist/*.whl
cd build/Linux/Release
#Add test launcher for onnxrt tests
../../../tools/ci_build/github/pai/migraphx_test_launcher.sh
...@@ -26,10 +26,12 @@ ...@@ -26,10 +26,12 @@
if [ -z "$ONNX_HOME" ] if [ -z "$ONNX_HOME" ]
then 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 fi
model_dir=$ONNX_HOME/.onnx/models model_dir=$ONNX_HOME/models
tmp_dir=$ONNX_HOME/tmp/ tmp_dir=$ONNX_HOME/tmp/
mkdir -p $model_dir mkdir -p $model_dir
mkdir -p $tmp_dir mkdir -p $tmp_dir
...@@ -42,7 +44,6 @@ models="bvlc_alexnet \ ...@@ -42,7 +44,6 @@ models="bvlc_alexnet \
for name in $models for name in $models
do 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 tar -xzvf $tmp_dir/$name.tar.gz --directory $model_dir && rm $tmp_dir/$name.tar.gz
done done
...@@ -66,6 +66,7 @@ any_ptr get_queue_context(T&) ...@@ -66,6 +66,7 @@ any_ptr get_queue_context(T&)
{ {
return {}; return {};
} }
template <class T> template <class T>
void wait_for_context(T&, any_ptr) void wait_for_context(T&, any_ptr)
{ {
...@@ -87,6 +88,7 @@ void finish_on_context(T&, any_ptr){} ...@@ -87,6 +88,7 @@ void finish_on_context(T&, any_ptr){}
{ {
v = ctx.to_value(); v = ctx.to_value();
} }
inline void migraphx_from_value(const value& v, context& ctx) { ctx.from_value(v); } inline void migraphx_from_value(const value& v, context& ctx) { ctx.from_value(v); }
#endif #endif
......
...@@ -140,6 +140,8 @@ template <class T> ...@@ -140,6 +140,8 @@ template <class T>
auto compute_shape_op(rank<2>, const T& x, const std::vector<shape>& inputs) auto compute_shape_op(rank<2>, const T& x, const std::vector<shape>& inputs)
-> decltype(x.normalize_compute_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; dependent_type<operation, T> y = x;
normalize_attributes(y, inputs[0].max_lens()); normalize_attributes(y, inputs[0].max_lens());
return any_cast<T>(y).normalize_compute_shape(inputs); return any_cast<T>(y).normalize_compute_shape(inputs);
......
...@@ -57,7 +57,7 @@ echo "Dependencies are installed at $PREFIX" ...@@ -57,7 +57,7 @@ echo "Dependencies are installed at $PREFIX"
rbuild prepare -d $PREFIX -s develop rbuild prepare -d $PREFIX -s develop
# install onnx package for unit tests # 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 # pin version of protobuf in Python for onnx runtime unit tests
pip3 install protobuf==3.20.0 pip3 install protobuf==3.20.0
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
import string, sys, re import string, sys, re
trivial = [ 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 = ''' headers = '''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment