onnxruntime/docs/execution_providers/MIGraphX-ExecutionProvider.md
Olivia Jain 1e4b259d28
Updating EP docs with Onnxruntime API calls (#5503)
* updating examples with current api calls

* Fixing capitalization in api calls, adding RKNPU update

* Correcting nuphar and rknpu ep api calls

* Include creating session in readme
2020-10-19 12:21:21 -07:00

1.6 KiB

MIGraphX Execution Provider

ONNX Runtime's MIGraphX execution provider uses AMD's Deep Learning graph optimization engine to accelerate ONNX model on AMD GPUs.

Build

For build instructions, please see the BUILD page.

Using the MIGraphX execution provider

C/C++

Ort::Env env = Ort::Env{ORT_LOGGING_LEVEL_ERROR, "Default"};
Ort::SessionOptions sf;
int device_id = 0;
Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_MiGraphX(sf, device_id));

You can check here for a specific c/c++ program.

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.

You can check here for a python script to run an model on either the CPU or MIGraphX Execution Provider.

Performance Tuning

For performance tuning, please see guidance on this page: ONNX Runtime Perf Tuning

When/if using onnxruntime_perf_test, use the flag -e migraphx

Configuring environment variables

MIGraphX providers an environment variable ORT_MIGRAPHX_FP16_ENABLE to enable the FP16 mode.