Skip to content

Commit

Permalink
Re-architect TurnkeyML (#200)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Fowers <[email protected]>
  • Loading branch information
jeremyfowers authored Jul 23, 2024
1 parent 1b3a712 commit 44717af
Show file tree
Hide file tree
Showing 132 changed files with 4,541 additions and 10,272 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ name: Publish Python distributions to PyPI

on:
push:
branches: ["main", "canary"]
branches: ["main", "canary", "refresh"]
tags:
- v*
- RC*
pull_request:
branches: ["main", "canary"]
branches: ["main", "canary", "refresh"]

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: tkml
Expand All @@ -31,8 +31,8 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install dist/*.whl
models=$(turnkey models location --quiet)
turnkey $models/selftest/linear.py
models=$(turnkey models-location --quiet)
turnkey -i $models/selftest/linear.py discover export-pytorch benchmark
- name: Publish distribution package to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
81 changes: 0 additions & 81 deletions .github/workflows/test_build_api.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test_gpu_turnkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: tkml
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/test_turnkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ name: Lint and Test TurnkeyML

on:
push:
branches: ["main", "canary"]
branches: ["main", "canary", "refresh"]
pull_request:
branches: ["main", "canary"]
branches: ["main", "canary", "refresh"]

permissions:
contents: read

jobs:
build-turnkey:
env:
TURNKEY_VERBOSITY: static
TURNKEY_TRACEBACK: True
strategy:
matrix:
Expand All @@ -25,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Miniconda with 64-bit Python
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: tkml
Expand All @@ -43,7 +42,7 @@ jobs:
shell: bash -el {0}
run: |
pylint src/turnkeyml --rcfile .pylintrc
pylint examples --rcfile .pylintrc --ignore-paths examples/build_api --disable E0401,E0611
pylint examples --rcfile .pylintrc --disable E0401,E0611
- name: Test with unittest
shell: bash -el {0}
run: |
Expand All @@ -53,17 +52,17 @@ jobs:
# turnkey examples
# Note: we clear the default cache location prior to each example run
rm -rf ~/.cache/turnkey
python examples/files_api/onnx_opset.py --onnx-opset 15
python examples/api/onnx_opset.py --onnx-opset 15
rm -rf ~/.cache/turnkey
turnkey examples/cli/scripts/hello_world.py
turnkey -i examples/cli/scripts/hello_world.py discover export-pytorch benchmark
rm -rf ~/.cache/turnkey
turnkey examples/cli/scripts/multiple_invocations.py
turnkey -i examples/cli/scripts/multiple_invocations.py discover export-pytorch benchmark
rm -rf ~/.cache/turnkey
turnkey examples/cli/scripts/max_depth.py --max-depth 1
turnkey -i examples/cli/scripts/max_depth.py discover --max-depth 1 export-pytorch benchmark
rm -rf ~/.cache/turnkey
turnkey examples/cli/scripts/two_models.py
turnkey -i examples/cli/scripts/two_models.py discover export-pytorch benchmark
rm -rf ~/.cache/turnkey
turnkey examples/cli/onnx/hello_world.onnx
turnkey -i examples/cli/onnx/hello_world.onnx load-onnx benchmark
# E2E tests
cd test/
Expand All @@ -74,19 +73,20 @@ jobs:
run: |
rm -rf ~/.cache/turnkey
pip install -e examples/cli/plugins/example_rt
turnkey examples/cli/scripts/hello_world.py --runtime example-rt
turnkey -i examples/cli/scripts/hello_world.py discover export-pytorch benchmark --runtime example-rt
rm -rf ~/.cache/turnkey
pip install -e examples/cli/plugins/example_seq
turnkey examples/cli/scripts/hello_world.py --sequence example-seq
pip install -e examples/cli/plugins/example_tool
turnkey -i examples/cli/scripts/hello_world.py discover export-pytorch example-plugin-tool benchmark
rm -rf ~/.cache/turnkey
pip install -e examples/cli/plugins/example_combined
turnkey examples/cli/scripts/hello_world.py --runtime example-combined-rt --rt-args delay_before_benchmarking::5
turnkey examples/cli/scripts/hello_world.py --device example_family::part1::config2
turnkey examples/cli/scripts/hello_world.py --device example_family::part1::config1
turnkey examples/cli/scripts/hello_world.py --device example_family::part1
turnkey examples/cli/scripts/hello_world.py --device example_family
turnkey -i examples/cli/scripts/hello_world.py discover export-pytorch combined-example-tool benchmark --runtime example-combined-rt --rt-args delay_before_benchmarking::5
turnkey -i examples/cli/scripts/hello_world.py discover export-pytorch combined-example-tool benchmark --device example_family::part1::config2
turnkey -i examples/cli/scripts/hello_world.py discover export-pytorch combined-example-tool benchmark --device example_family::part1::config1
turnkey -i examples/cli/scripts/hello_world.py discover export-pytorch combined-example-tool benchmark --device example_family::part1
turnkey -i examples/cli/scripts/hello_world.py discover export-pytorch combined-example-tool benchmark --device example_family
# E2E tests
cd test
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
# 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
turnkey -i models/selftest/linear.py --use-slurm --cache-dir local_cache discover export-pytorch
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
Expand Down
Loading

0 comments on commit 44717af

Please sign in to comment.