-Add MIGraphX-EP page for install/example -Update version info for ROCm version for both MIGraphx and ROCm EPs to 5.4 -Update hooks to the latest ROCm Pytorch supported (1.12.1 -> 1.13) -Remove (Preview) from MIGraphx and ROCm EP notes -Update ROCm & MIGraphX EP.md files with ROCm version and pytorch links ### Description <!-- Describe your changes. --> Update documentation about ROCm and MIGraphx with newest ROCm 5.4 stack ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Update things for whats able to be supported. Co-authored-by: Ted Themistokleous <tthemist@amd.com>
2.6 KiB
| title | description | parent | nav_order | redirect_from |
|---|---|---|---|---|
| AMD - MIGraphX | Instructions to execute ONNX Runtime with the AMD MIGraphX execution provider | Execution Providers | 10 | /docs/reference/execution-providers/MIGraphX-ExecutionProvider |
MIGraphX Execution Provider
{: .no_toc }
The MIGraphX execution provider uses AMD's Deep Learning graph optimization engine to accelerate ONNX model on AMD GPUs.
Contents
{: .no_toc }
- TOC placeholder {:toc}
Install
NOTE Please make sure to install the proper version of Pytorch specified here PyTorch Version.
For Nightly PyTorch builds please see Pytorch home and select ROCm as the Compute Platform.
Pre-built binaries of ONNX Runtime with MIGraphX EP are published for most language bindings. Please reference Install ORT.
Requirements
| ONNX Runtime | MIGraphX |
|---|---|
| main | 5.4 |
| 1.13 | 5.4 |
| 1.13 | 5.3.2 |
| 1.12 | 5.2.3 |
| 1.12 | 5.2 |
Build
For build instructions, please see the BUILD page.
Usage
C/C++
Ort::Env env = Ort::Env{ORT_LOGGING_LEVEL_ERROR, "Default"};
Ort::SessionOptions so;
int device_id = 0;
Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_MIGraphX(so, device_id));
The C API details are here.
Python
When using the Python wheel from the ONNX Runtime build with MIGraphX execution provider, it will be automatically prioritized over the default GPU or CPU execution providers. There is no need to separately register the execution provider.
Python APIs details are here.
Note that the next release (ORT 1.10) will require explicitly setting the providers parameter if you want to use execution provider other than the default CPU provider when instantiating InferenceSession.
You can check here for a python script to run an model on either the CPU or MIGraphX Execution Provider.
Configuration Options
MIGraphX providers an environment variable ORT_MIGRAPHX_FP16_ENABLE to enable the FP16 mode.
Performance Tuning
For performance tuning, please see guidance on this page: ONNX Runtime Perf Tuning
Samples
Python
import onnxruntime as ort
model_path = '<path to model>'
providers = [
'MIGraphXExecutionProvider',
'CPUExecutionProvider',
]
session = ort.InferenceSession(model_path, providers=providers)