Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
fd0bc60e
Commit
fd0bc60e
authored
Aug 18, 2023
by
Ted Themistokleous
Browse files
Updating readme
parent
7d59c0e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
10 deletions
+37
-10
examples/onnxruntime/resnet50/README.md
examples/onnxruntime/resnet50/README.md
+37
-10
No files found.
examples/onnxruntime/resnet50/README.md
View file @
fd0bc60e
...
...
@@ -9,25 +9,52 @@ This example demonstrates how to perform an MIGraphX Python API inference throug
-
[
**Running this Example**
](
#Running-this-Example
)
## Basic Setup
Before running inference we must first install MIGraphX via the Docker method as it also downloads onnxruntime into the dockerfile created.
Before running inference we must first install MIGraphX via the Docker method as it also downloads onnxruntime into the dockerfile created.
## Running this Example
Starting from project root:
```
$ cd AMDMIGraphX
$ docker build -t migraphx .
$ docker --device='/dev/kfd' --device='/dev/dri' <your docker settings and mounts> --group-add video -it migraphx
```
The dockerfile will install the latest supported version of ROCm with all the depandacnies needed for MIGraphX
This directory contains everything needed to perform an inference once MIGraphX has been installed in the docker contaienr
Once the docker file has been installed and you're inside the folder run
```
$ mkdir build
$ cd build
$ CXX=/opt/rocm/llvm/bin/clang++ cmake ..
$ make -j$(nproc) package
$ dpkg -i *.deb
$ rbuild develop -d deps -B build
$ cd build
$ make -j$(nproc) package && dpkg -i *.deb
```
Once you've build and installed MIGraphX as a deb package go to the examples folder, run the pre-req script to build and install
onnxruntime and then install the approrpaite version of pytorch
to verify migraphx has been installed correclty in the docker run dpkg --list or dpkg -l
```
$ dpkg -l | grep migraphx
$ ii migraphx 2.7.0 amd64 AMD's graph optimizer
$ ii migraphx-dev 2.7.0 amd64 AMD's graph optimizer
```
## Running this Example
This directory contains everything needed to perform an inference once MIGraphX has been installed in the docker container
Once you've build and installed MIGraphX as a deb package, go to the examples folder, run the pre-req script to build and install
onnxruntime and then install the approrpaite version of pytorch from project root.
```
$
$ cd examples/onnxruntime/resnet50
$ ./prereq_steps.sh
$ pip list | grep onnxruntime
$ python resnet50.py
```
example output:
African grey 0.5883207
kite 0.06284781
goldfinch 0.01847724
macaw 0.014789124
fire screen 0.013297303
resnet50, time = 88.89 ms
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment