From c55c6dc7afddf375bd5b0d0b615dfe7fb37549c1 Mon Sep 17 00:00:00 2001 From: Jeremy Fowers <80718789+jeremyfowers@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:00:42 -0500 Subject: [PATCH 1/2] Upload a new example onnx file and fix the test and tutorial (#45) * Upload a new example onnx file and fix the tutorial Signed-off-by: Jeremy Fowers * Re-enable the ONNX example test Signed-off-by: Jeremy Fowers --------- Signed-off-by: Jeremy Fowers --- .github/workflows/test_turnkey.yml | 3 +-- examples/cli/onnx/hello_world.onnx | Bin 0 -> 466 bytes examples/cli/onnx/sample.onnx | 3 --- examples/cli/readme.md | 24 +++++++++++------------- 4 files changed, 12 insertions(+), 18 deletions(-) create mode 100644 examples/cli/onnx/hello_world.onnx delete mode 100644 examples/cli/onnx/sample.onnx diff --git a/.github/workflows/test_turnkey.yml b/.github/workflows/test_turnkey.yml index ac4712c..8549736 100644 --- a/.github/workflows/test_turnkey.yml +++ b/.github/workflows/test_turnkey.yml @@ -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/ diff --git a/examples/cli/onnx/hello_world.onnx b/examples/cli/onnx/hello_world.onnx new file mode 100644 index 0000000000000000000000000000000000000000..fb7d878179dbb3467768bf0e4d10afb256e1070a GIT binary patch literal 466 zcmd;J7h*4{EXglQ&X8g?(lgLAwA#tcWy8f-!Nr%KmseqB<(pXITbdJZCM2w%maGru z<(HNel$OLBNO2(qmDnJXT>4z>X~}v?nTf?**z^c7no6;Qv^l1vC@}*GAx^OU@mZNA zTFM-(0*p>D{azycwdHmb{nGc8iu&ziV6m~gzhu9y)>lRjZm>EuCwkps6c>}XE8kRX z^OeDW@1x~C`$Cp0?Q?PC*mt?@q3sJD)_p6FPuiEgSiUHC6HNJCZqN-#H;!yR)C#?3B~&?FuTV z+jW`UK-b#rL*-eY$r+-Xy!3o#}QllGFA+a9M4; wx58@Qu2bH2PJc74Cm)_^7sU^Z79lP!4h}{k7A__Z?j)dqDUtxI6O#ZR09YTX)Bpeg literal 0 HcmV?d00001 diff --git a/examples/cli/onnx/sample.onnx b/examples/cli/onnx/sample.onnx deleted file mode 100644 index fd3676d..0000000 --- a/examples/cli/onnx/sample.onnx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:83fa7cc9761867250a047c13fcb65d83289382ad16b42ac2f2915774234a7afb -size 572 diff --git a/examples/cli/readme.md b/examples/cli/readme.md index 3787a86..a181b3c 100644 --- a/examples/cli/readme.md +++ b/examples/cli/readme.md @@ -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! From e77ac156cc03e163a23256ff870000fa94bce334 Mon Sep 17 00:00:00 2001 From: Daniel Holanda Date: Fri, 1 Dec 2023 11:17:52 -0800 Subject: [PATCH 2/2] Add slurm Ci test back (#46) --- .github/workflows/test_turnkey.yml | 26 ++++++++++++-------------- src/turnkeyml/cli/setup_venv.sh | 0 2 files changed, 12 insertions(+), 14 deletions(-) mode change 100644 => 100755 src/turnkeyml/cli/setup_venv.sh diff --git a/.github/workflows/test_turnkey.yml b/.github/workflows/test_turnkey.yml index 8549736..915bc47 100644 --- a/.github/workflows/test_turnkey.yml +++ b/.github/workflows/test_turnkey.yml @@ -106,21 +106,19 @@ jobs: sudo service slurmd start sudo service slurmctld start sudo service munge start - # TODO: Slurm test is commented out because it isn't working in OMZ CI - # @Daniel to fix and un-comment - # - name: Test turnkey on Slurm - # if: runner.os != 'Windows' - # shell: bash -el {0} - # run: | - # # Create conda environment for Slurm using srun (sbatch + wait) - # export SKIP_REQUIREMENTS_INSTALL="True" - # export TORCH_CPU="True" - # srun src/turnkeyml/cli/setup_venv.sh + - name: Test turnkey on Slurm + if: runner.os != 'Windows' + shell: bash -el {0} + run: | + # Create conda environment for Slurm using srun (sbatch + wait) + export SKIP_REQUIREMENTS_INSTALL="True" + export TORCH_CPU="True" + srun src/turnkeyml/cli/setup_venv.sh - # # Run tests on Slurm - # export TURNKEY_SLURM_USE_DEFAULT_MEMORY="True" - # turnkey benchmark models/selftest/linear.py --build-only --use-slurm --cache-dir local_cache - # bash test/helpers/check_slurm_output.sh slurm-2.out + # Run tests on Slurm + export TURNKEY_SLURM_USE_DEFAULT_MEMORY="True" + turnkey benchmark models/selftest/linear.py --build-only --use-slurm --cache-dir local_cache + bash test/helpers/check_slurm_output.sh slurm-2.out # Below tests are commented out as the GitHub runner runs out of space installing the requirements # - name: Check installation of requirements.txt and their compatibility with turnkey diff --git a/src/turnkeyml/cli/setup_venv.sh b/src/turnkeyml/cli/setup_venv.sh old mode 100644 new mode 100755