onnxruntime/docs/execution-providers/ROCm-ExecutionProvider.md
Faith Xu 3681048474
[Docs] Update performance sections (#15071)
### Description
Staged: https://faxu.github.io/onnxruntime/docs/performance/

Main changes:
- Restructure performance section to break into sub-categories
- Move CUDA specific perf tuning tips to [CUDA EP
page](https://faxu.github.io/onnxruntime/docs/execution-providers/CUDA-ExecutionProvider.html#performance-tuning)
- Update [Transformer optimizer
page](https://faxu.github.io/onnxruntime/docs/performance/transformers-optimization.html)
to remove version-specific content... will be supported along with
https://github.com/microsoft/onnxruntime/pull/14964
- Fix links to point to new pages
2023-03-17 15:39:22 -07:00

1.6 KiB

title description parent nav_order redirect_from
AMD - ROCm Instructions to execute ONNX Runtime with the AMD ROCm execution provider Execution Providers 10 /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

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 ROCm EP are published for most language bindings. Please reference Install ORT.

Requirements

ONNX Runtime ROCm
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_ROCm(so, device_id));

The C API details are here.

Python

Python APIs details are here.

Samples

Python

import onnxruntime as ort

model_path = '<path to model>'

providers = [
    'ROCmExecutionProvider',
    'CPUExecutionProvider',
]

session = ort.InferenceSession(model_path, providers=providers)