From 586225e78e57676953135ef8caedb5c4d17b3edb Mon Sep 17 00:00:00 2001 From: Artur Wojcik Date: Wed, 17 Jul 2024 15:57:03 +0200 Subject: [PATCH 1/3] create package for migraphx ep --- setup.py | 6 +++++- tools/ci_build/build.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 082695163b67c..1ea7aa5998602 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,8 @@ def parse_arg_remove_string(argv, arg_name_equal): elif parse_arg_remove_boolean(sys.argv, "--use_rocm"): is_rocm = True rocm_version = parse_arg_remove_string(sys.argv, "--rocm_version=") + if parse_arg_remove_boolean(sys.argv, "--use_migraphx"): + is_migraphx = True elif parse_arg_remove_boolean(sys.argv, "--use_migraphx"): is_migraphx = True elif parse_arg_remove_boolean(sys.argv, "--use_openvino"): @@ -89,8 +91,10 @@ def parse_arg_remove_string(argv, arg_name_equal): elif parse_arg_remove_boolean(sys.argv, "--use_qnn"): package_name = "onnxruntime-qnn" -if is_rocm or is_migraphx: +if is_rocm: package_name = "onnxruntime-rocm" if not nightly_build else "ort-rocm-nightly" +elif is_migraphx: + package_name = "onnxruntime-migraphx" if not nightly_build else "ort-migraphx-nightly" # PEP 513 defined manylinux1_x86_64 and manylinux1_i686 # PEP 571 defined manylinux2010_x86_64 and manylinux2010_i686 diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 9a72f4da15fe0..63213872b83b5 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -2224,6 +2224,8 @@ def build_python_wheel( args.append("--use_rocm") if rocm_version: args.append(f"--rocm_version={rocm_version}") + if use_migraphx: + args.append("--use_migraphx") elif use_migraphx: args.append("--use_migraphx") elif use_openvino: From abf981a72c1bc5bea9520a024ba1f2c5f31b9045 Mon Sep 17 00:00:00 2001 From: Artur Wojcik Date: Thu, 18 Jul 2024 07:46:42 +0200 Subject: [PATCH 2/3] add migrahx to the gpu providers for benchmark.py --- onnxruntime/python/tools/transformers/benchmark.py | 1 + 1 file changed, 1 insertion(+) diff --git a/onnxruntime/python/tools/transformers/benchmark.py b/onnxruntime/python/tools/transformers/benchmark.py index 89f9947688583..975fde95b5572 100644 --- a/onnxruntime/python/tools/transformers/benchmark.py +++ b/onnxruntime/python/tools/transformers/benchmark.py @@ -117,6 +117,7 @@ def run_onnxruntime( if ( use_gpu and ("CUDAExecutionProvider" not in onnxruntime.get_available_providers()) + and ("MIGraphXExecutionProvider" not in onnxruntime.get_available_providers()) and ("ROCMExecutionProvider" not in onnxruntime.get_available_providers()) and ("DmlExecutionProvider" not in onnxruntime.get_available_providers()) ): From 1b9109074c24e648a9db36bae64ff17837b7195e Mon Sep 17 00:00:00 2001 From: Artur Wojcik Date: Thu, 18 Jul 2024 07:49:54 +0200 Subject: [PATCH 3/3] remove rocm from migraphx perfs tests --- onnxruntime/test/perftest/ort_test_session.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/onnxruntime/test/perftest/ort_test_session.cc b/onnxruntime/test/perftest/ort_test_session.cc index 9679ca6159464..1c5d711723675 100644 --- a/onnxruntime/test/perftest/ort_test_session.cc +++ b/onnxruntime/test/perftest/ort_test_session.cc @@ -610,10 +610,6 @@ select from 'TF8', 'TF16', 'UINT8', 'FLOAT', 'ITENSOR'. \n)"); } else if (provider_name_ == onnxruntime::kMIGraphXExecutionProvider) { #ifdef USE_MIGRAPHX Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_MIGraphX(session_options, 0)); - OrtROCMProviderOptions rocm_options; - rocm_options.miopen_conv_exhaustive_search = performance_test_config.run_config.cudnn_conv_algo; - rocm_options.do_copy_in_default_stream = !performance_test_config.run_config.do_cuda_copy_in_separate_stream; - session_options.AppendExecutionProvider_ROCM(rocm_options); #else ORT_THROW("MIGraphX is not supported in this build\n"); #endif