Skip to content

Commit

Permalink
Upload a new example onnx file and fix the test and tutorial (#45)
Browse files Browse the repository at this point in the history
* Upload a new example onnx file and fix the tutorial

Signed-off-by: Jeremy Fowers <jeremy.fowers@amd.com>

* Re-enable the ONNX example test

Signed-off-by: Jeremy Fowers <jeremy.fowers@amd.com>

---------

Signed-off-by: Jeremy Fowers <jeremy.fowers@amd.com>
  • Loading branch information
jeremyfowers authored Dec 1, 2023
1 parent 00c1b5b commit c55c6dc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test_turnkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ jobs:
rm -rf ~/.cache/turnkey
turnkey examples/cli/scripts/two_models.py
rm -rf ~/.cache/turnkey
# TODO: sample.onnx test is commented because it throws an error in CI
# turnkey examples/cli/onnx/sample.onnx
turnkey examples/cli/onnx/hello_world.onnx
# E2E tests
cd test/
Expand Down
Binary file added examples/cli/onnx/hello_world.onnx
Binary file not shown.
3 changes: 0 additions & 3 deletions examples/cli/onnx/sample.onnx

This file was deleted.

24 changes: 11 additions & 13 deletions examples/cli/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,28 +214,26 @@ multiple_invocations.py:

## ONNX Benchmarking

If you already happen to have an ONNX file, `turnkey` can benchmark it for you. We can demonstrate this with the ONNX file in `examples/cli/onnx/sample.onnx`.
If you already happen to have an ONNX file, `turnkey` can benchmark it for you. We can demonstrate this with the ONNX file in `examples/cli/onnx/hello_world.onnx`.

Run the following command:

```
turnkey onnx/sample.onnx
turnkey onnx/hello_world.onnx
```

To get a result like:

```
Building "sample"
✓ Receiving ONNX Model
✓ Finishing up
Woohoo! Saved to ~/turnkeyml/examples/cli/onnx/tmp_cache/sample
Info: Benchmarking on local x86...
Info: Performance of build sample on x86 device Intel(R) Xeon(R) CPU @ 2.20GHz is:
Mean Latency: 0.042 milliseconds (ms)
Throughput: 23921.9 inferences per second (IPS)
hello_world.onnx:
Model Type: ONNX File (.onnx)
Parameters: 60 (240.0 B)
Input Shape: 'x': (11,)
Hash: 17ecd07e
Build dir: /home/jfowers/.cache/turnkey/hello_world_17ecd07e
Status: Successfully benchmarked on AMD Ryzen 9 7940HS w/ Radeon 780M Graphics (ort v1.15.1)
Mean Latency: 0.007 milliseconds (ms)
Throughput: 152240.4 inferences per second (IPS)
```

# Thanks!
Expand Down

0 comments on commit c55c6dc

Please sign in to comment.