mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-15 18:23:41 +00:00
#### Description This PR adds docs of Ascend CANN excution provider. #### Changes - Preview Github page: [https://fffrog.github.io/](https://fffrog.github.io/) - Add onnxruntime build with CANN: [https://fffrog.github.io/docs/build/eps.html#cann](https://fffrog.github.io/docs/build/eps.html#cann) - Add CANN ExecutionProvider Page: [https://fffrog.github.io/docs/execution-providers/CANN-ExecutionProvider.html](https://fffrog.github.io/docs/execution-providers/CANN-ExecutionProvider.html)
1.5 KiB
1.5 KiB
| title | description | parent | nav_order | redirect_from |
|---|---|---|---|---|
| ROCm (AMD) | Instructions to execute ONNX Runtime with the AMD ROCm execution provider | Execution Providers | 12 | /docs/reference/execution-providers/ROCm-ExecutionProvider |
ROCm Execution Provider
{: .no_toc }
The ROCm Execution Provider enables hardware accelerated computation on AMD ROCm-enabled GPUs.
Contents
{: .no_toc }
- TOC placeholder {:toc}
Install
Pre-built binaries of ONNX Runtime with ROCm EP are published for most language bindings. Please reference Install ORT.
Requirements
| ONNX Runtime | ROCm |
|---|---|
| main | 5.2.3 |
| 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_ROCm(so, device_id));
The C API details are here.
Python
Python APIs details are here.
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 = [
'ROCmExecutionProvider',
'CPUExecutionProvider',
]
session = ort.InferenceSession(model_path, providers=providers)