Rocm ep acc test support#13306
Conversation
| import onnxruntime | ||
|
|
||
| if use_gpu and "CUDAExecutionProvider" not in onnxruntime.get_available_providers(): | ||
| if use_gpu and "CUDAExecutionProvider" and "ROCMExecutionProvider" not in onnxruntime.get_available_providers(): |
There was a problem hiding this comment.
address py lint "CUDAExecutionProvider" and "ROCMExecutionProvider"
| assert "CUDAExecutionProvider" or "ROCMExecutionProvider" in session.get_providers() # Make sure there is GPU | ||
|
|
||
| assert os.path.exists(optimized_model_path) and os.path.isfile(optimized_model_path) | ||
| logger.debug("Save optimized model by onnxruntime to {}".format(optimized_model_path)) |
There was a problem hiding this comment.
py lint. This can be changed to logger.debug("Save optimized model by onnxruntime to %s", optimized_model_path) to delay the string formation.
|
This pull request fixes 1 alert when merging 2b6e010 into 7a3486c - view on LGTM.com fixed alerts:
|
|
This pull request fixes 1 alert when merging 8561cd8 into 928c988 - view on LGTM.com fixed alerts:
|
| onnx_model_path, sess_options, providers=gpu_ep, **kwargs | ||
| ) | ||
| assert "CUDAExecutionProvider" in session.get_providers() # Make sure there is GPU | ||
| assert any(gpu_ep in session.get_providers() for gpu_ep in ["CUDAExecutionProvider","ROCMExecutionProvider"]) # Make sure there is GPU |
There was a problem hiding this comment.
Remove this line since I think session creation will fail if no CUDA or Rocm EP, and line 76 has checked.
There was a problem hiding this comment.
Tested and removed. I agree.
Update benchmark_helper.py to support ROCm back end.
8561cd8 to
5c4e255
Compare
|
This pull request introduces 1 alert when merging 5c4e255 into b1e1b25 - view on LGTM.com new alerts:
|
|
/azp run Windows CPU CI Pipeline,Windows GPU CI Pipeline,Windows GPU TensorRT CI Pipeline,ONNX Runtime Web CI Pipeline,Linux CPU CI Pipeline,Linux CPU Minimal Build E2E CI Pipeline,Linux GPU CI Pipeline,Linux GPU TensorRT CI Pipeline,Linux OpenVINO CI Pipeline,MacOS CI Pipeline |
|
/azp run orttraining-amd-gpu-ci-pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,orttraining-ortmodule-distributed,onnxruntime-python-checks-ci-pipeline,onnxruntime-binary-size-checks-ci-pipeline |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
Azure Pipelines successfully started running 10 pipeline(s). |
Add GPU environment check.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
This pull request fixes 1 alert when merging 75ac09b into 3e9e5e9 - view on LGTM.com fixed alerts:
Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. It looks like GitHub code scanning with CodeQL is already set up for this repo, so no further action is needed 🚀. For more information, please check out our post on the GitHub blog. |
|
This pull request fixes 1 alert when merging 2461ad6 into 3e9e5e9 - view on LGTM.com fixed alerts:
Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. It looks like GitHub code scanning with CodeQL is already set up for this repo, so no further action is needed 🚀. For more information, please check out our post on the GitHub blog. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
| assert ( | ||
| "CUDAExecutionProvider" in onnxruntime.get_available_providers() | ||
| ), "Please install onnxruntime-gpu package to test GPU inference." | ||
| assert any( |
There was a problem hiding this comment.
Please use set disjoint test for readibility:
set(onnxruntime.get_available_providers()).isdisjoint(["CUDAExecutionProvider", "ROCMExecutionProvider"])
| import onnxruntime | ||
|
|
||
| if use_gpu and "CUDAExecutionProvider" not in onnxruntime.get_available_providers(): | ||
| if use_gpu and not any( |
| gpu_ep.append("ROCMExecutionProvider") | ||
|
|
||
| session = onnxruntime.InferenceSession(onnx_model_path, sess_options, providers=gpu_ep, **kwargs) | ||
| assert any( |
Allows MIGraphX EP to run the following additional tests. Also adds support to get MIGraphX to run eval_squad.py Reference to the Rocm EP changes: #13306 Co-authored-by: Joseph Groenenboom <joseph.groenenboom@amd.com> Co-authored-by: Ted Themistokleous <tthemist@amd.com>
|
The changes in this PR were rolled into and merged with #13455. Closing. |
Allows MIGraphX EP to run the following additional tests. Also adds support to get MIGraphX to run eval_squad.py Reference to the Rocm EP changes: microsoft#13306 Co-authored-by: Joseph Groenenboom <joseph.groenenboom@amd.com> Co-authored-by: Ted Themistokleous <tthemist@amd.com>
Allows MIGraphX EP to run the following additional tests. Also adds support to get MIGraphX to run eval_squad.py Reference to the Rocm EP changes: microsoft#13306 Co-authored-by: Joseph Groenenboom <joseph.groenenboom@amd.com> Co-authored-by: Ted Themistokleous <tthemist@amd.com>
Description
Add support for ROCm EP in accuracy tests
Motivation and Context
This allows ONNXRT accuracy tests to be ran on the ROCm EP.