onnxruntime/docs/execution-providers/ROCm-ExecutionProvider.md

78 lines
1.8 KiB
Markdown
Raw Normal View History

[Add] add Rocm ep doc (#12971) **Description**: Describe your changes. add rocm ep doc. Perview Github page : https://ytaous.github.io/onnxruntime/ Added items Home page - [ ] Update matrix on home page: https://ytaous.github.io/onnxruntime/ - [ ] Link "Installation Instruction Follow build instructions from here" to onnxruntime build with ROCm(inference) page.(This link now point to preview page, will change later) Installation - [ ] Update installation page: https://ytaous.github.io/onnxruntime/docs/install/#training-install-table-for-all-languages Build onnxruntime - [ ] Add onnxruntime build with ROCm(inference): https://ytaous.github.io/onnxruntime/docs/build/eps.html#amd-rocm - [ ] Update onnxruntime build with ROCm(training): https://ytaous.github.io/onnxruntime/docs/build/training.html#gpu--rocm ExecutionProvider - [ ] Add ROCm ExecutionProvider navitagation: https://ytaous.github.io/onnxruntime/docs/execution-providers/ - [ ] Add ROCm-ExecutionProvider page: https://ytaous.github.io/onnxruntime/docs/execution-providers/ROCm-ExecutionProvider.html Performance - [ ] Add enable_rocm_profiling introcduction: https://ytaous.github.io/onnxruntime/docs/performance/tune-performance.html#profiling-and-performance-report - [ ] Add graph-optimation for ROCm ep: https://ytaous.github.io/onnxruntime/docs/performance/graph-optimizations.html#extended-graph-optimizations Co-authored-by: Ethan Tao <ettao@microsoft.com@orttrainingdev7.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net> Co-authored-by: ytaous <4484531+ytaous@users.noreply.github.com>
2022-09-20 19:04:20 +00:00
---
title: AMD - ROCm
[Add] add Rocm ep doc (#12971) **Description**: Describe your changes. add rocm ep doc. Perview Github page : https://ytaous.github.io/onnxruntime/ Added items Home page - [ ] Update matrix on home page: https://ytaous.github.io/onnxruntime/ - [ ] Link "Installation Instruction Follow build instructions from here" to onnxruntime build with ROCm(inference) page.(This link now point to preview page, will change later) Installation - [ ] Update installation page: https://ytaous.github.io/onnxruntime/docs/install/#training-install-table-for-all-languages Build onnxruntime - [ ] Add onnxruntime build with ROCm(inference): https://ytaous.github.io/onnxruntime/docs/build/eps.html#amd-rocm - [ ] Update onnxruntime build with ROCm(training): https://ytaous.github.io/onnxruntime/docs/build/training.html#gpu--rocm ExecutionProvider - [ ] Add ROCm ExecutionProvider navitagation: https://ytaous.github.io/onnxruntime/docs/execution-providers/ - [ ] Add ROCm-ExecutionProvider page: https://ytaous.github.io/onnxruntime/docs/execution-providers/ROCm-ExecutionProvider.html Performance - [ ] Add enable_rocm_profiling introcduction: https://ytaous.github.io/onnxruntime/docs/performance/tune-performance.html#profiling-and-performance-report - [ ] Add graph-optimation for ROCm ep: https://ytaous.github.io/onnxruntime/docs/performance/graph-optimizations.html#extended-graph-optimizations Co-authored-by: Ethan Tao <ettao@microsoft.com@orttrainingdev7.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net> Co-authored-by: ytaous <4484531+ytaous@users.noreply.github.com>
2022-09-20 19:04:20 +00:00
description: Instructions to execute ONNX Runtime with the AMD ROCm execution provider
parent: Execution Providers
nav_order: 10
[Add] add Rocm ep doc (#12971) **Description**: Describe your changes. add rocm ep doc. Perview Github page : https://ytaous.github.io/onnxruntime/ Added items Home page - [ ] Update matrix on home page: https://ytaous.github.io/onnxruntime/ - [ ] Link "Installation Instruction Follow build instructions from here" to onnxruntime build with ROCm(inference) page.(This link now point to preview page, will change later) Installation - [ ] Update installation page: https://ytaous.github.io/onnxruntime/docs/install/#training-install-table-for-all-languages Build onnxruntime - [ ] Add onnxruntime build with ROCm(inference): https://ytaous.github.io/onnxruntime/docs/build/eps.html#amd-rocm - [ ] Update onnxruntime build with ROCm(training): https://ytaous.github.io/onnxruntime/docs/build/training.html#gpu--rocm ExecutionProvider - [ ] Add ROCm ExecutionProvider navitagation: https://ytaous.github.io/onnxruntime/docs/execution-providers/ - [ ] Add ROCm-ExecutionProvider page: https://ytaous.github.io/onnxruntime/docs/execution-providers/ROCm-ExecutionProvider.html Performance - [ ] Add enable_rocm_profiling introcduction: https://ytaous.github.io/onnxruntime/docs/performance/tune-performance.html#profiling-and-performance-report - [ ] Add graph-optimation for ROCm ep: https://ytaous.github.io/onnxruntime/docs/performance/graph-optimizations.html#extended-graph-optimizations Co-authored-by: Ethan Tao <ettao@microsoft.com@orttrainingdev7.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net> Co-authored-by: ytaous <4484531+ytaous@users.noreply.github.com>
2022-09-20 19:04:20 +00:00
redirect_from: /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](../install/#training-install-table-for-all-languages).
For Nightly PyTorch builds please see [Pytorch home](https://pytorch.org/) and select ROCm as the Compute Platform.
[Add] add Rocm ep doc (#12971) **Description**: Describe your changes. add rocm ep doc. Perview Github page : https://ytaous.github.io/onnxruntime/ Added items Home page - [ ] Update matrix on home page: https://ytaous.github.io/onnxruntime/ - [ ] Link "Installation Instruction Follow build instructions from here" to onnxruntime build with ROCm(inference) page.(This link now point to preview page, will change later) Installation - [ ] Update installation page: https://ytaous.github.io/onnxruntime/docs/install/#training-install-table-for-all-languages Build onnxruntime - [ ] Add onnxruntime build with ROCm(inference): https://ytaous.github.io/onnxruntime/docs/build/eps.html#amd-rocm - [ ] Update onnxruntime build with ROCm(training): https://ytaous.github.io/onnxruntime/docs/build/training.html#gpu--rocm ExecutionProvider - [ ] Add ROCm ExecutionProvider navitagation: https://ytaous.github.io/onnxruntime/docs/execution-providers/ - [ ] Add ROCm-ExecutionProvider page: https://ytaous.github.io/onnxruntime/docs/execution-providers/ROCm-ExecutionProvider.html Performance - [ ] Add enable_rocm_profiling introcduction: https://ytaous.github.io/onnxruntime/docs/performance/tune-performance.html#profiling-and-performance-report - [ ] Add graph-optimation for ROCm ep: https://ytaous.github.io/onnxruntime/docs/performance/graph-optimizations.html#extended-graph-optimizations Co-authored-by: Ethan Tao <ettao@microsoft.com@orttrainingdev7.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net> Co-authored-by: ytaous <4484531+ytaous@users.noreply.github.com>
2022-09-20 19:04:20 +00:00
Pre-built binaries of ONNX Runtime with ROCm EP are published for most language bindings. Please reference [Install ORT](../install).
## Requirements
|ONNX Runtime|ROCm|
|---|---|
|main|5.4|
|1.13|5.4|
|1.13|5.3.2|
[Add] add Rocm ep doc (#12971) **Description**: Describe your changes. add rocm ep doc. Perview Github page : https://ytaous.github.io/onnxruntime/ Added items Home page - [ ] Update matrix on home page: https://ytaous.github.io/onnxruntime/ - [ ] Link "Installation Instruction Follow build instructions from here" to onnxruntime build with ROCm(inference) page.(This link now point to preview page, will change later) Installation - [ ] Update installation page: https://ytaous.github.io/onnxruntime/docs/install/#training-install-table-for-all-languages Build onnxruntime - [ ] Add onnxruntime build with ROCm(inference): https://ytaous.github.io/onnxruntime/docs/build/eps.html#amd-rocm - [ ] Update onnxruntime build with ROCm(training): https://ytaous.github.io/onnxruntime/docs/build/training.html#gpu--rocm ExecutionProvider - [ ] Add ROCm ExecutionProvider navitagation: https://ytaous.github.io/onnxruntime/docs/execution-providers/ - [ ] Add ROCm-ExecutionProvider page: https://ytaous.github.io/onnxruntime/docs/execution-providers/ROCm-ExecutionProvider.html Performance - [ ] Add enable_rocm_profiling introcduction: https://ytaous.github.io/onnxruntime/docs/performance/tune-performance.html#profiling-and-performance-report - [ ] Add graph-optimation for ROCm ep: https://ytaous.github.io/onnxruntime/docs/performance/graph-optimizations.html#extended-graph-optimizations Co-authored-by: Ethan Tao <ettao@microsoft.com@orttrainingdev7.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net> Co-authored-by: ytaous <4484531+ytaous@users.noreply.github.com>
2022-09-20 19:04:20 +00:00
|1.12|5.2.3|
|1.12|5.2|
## Build
For build instructions, please see the [BUILD page](../build/eps.md#amd-rocm).
## Usage
### C/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](../get-started/with-c.md).
### Python
Python APIs details are [here](https://onnxruntime.ai/docs/api/python/api_summary.html).
## Performance Tuning
For performance tuning, please see guidance on this page: [ONNX Runtime Perf Tuning](../performance/tune-performance.md)
## Samples
### Python
```python
import onnxruntime as ort
model_path = '<path to model>'
providers = [
'ROCmExecutionProvider',
'CPUExecutionProvider',
]
session = ort.InferenceSession(model_path, providers=providers)
```