Skip to content

Commit

Permalink
Move run submodule out into the new devices plugin (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfowers authored Aug 27, 2024
1 parent f10d58a commit 37f5e8d
Show file tree
Hide file tree
Showing 44 changed files with 1,648 additions and 1,076 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python -m pip install --upgrade pip
pip install dist/*.whl
models=$(turnkey models-location --quiet)
turnkey -i $models/selftest/linear.py discover export-pytorch benchmark
turnkey -i $models/selftest/linear.py discover export-pytorch
- name: Publish distribution package to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/test_devices_plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Lint and Test Devices Plugin

# on:
# push:
# branches: ["main"]
# paths:
# - plugins/devices/src/turnkeyml_plugin_devices/common/**
# - plugins/devices/src/turnkeyml_plugin_devices/onnxrt/**
# - plugins/devices/src/turnkeyml_plugin_devices/torchrt/**
# - plugins/devices/src/turnkeyml_plugin_devices/tensorrt/**
# - plugins/devices/setup.py
# - .github/workflows/test_devices_plugin.yml
# pull_request:
# branches: ["main"]
# paths:
# - plugins/devices/src/turnkeyml_plugin_devices/common/**
# - plugins/devices/src/turnkeyml_plugin_devices/onnxrt/**
# - plugins/devices/src/turnkeyml_plugin_devices/torchrt/**
# - plugins/devices/src/turnkeyml_plugin_devices/tensorrt/**
# - plugins/devices/setup.py
# - .github/workflows/test_devices_plugin.yml

permissions:
contents: read

jobs:
build-devices-plugin:
env:
TURNKEY_TRACEBACK: True
strategy:
matrix:
python-version: ["3.8", "3.11"]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Miniconda with 64-bit Python
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: tkml
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
conda install pylint
pip install pytest
pip install -e plugins/devices
pip install transformers timm
python -m pip check
- name: Lint with PyLint
shell: bash -el {0}
run: |
pylint plugins/devices/src --rcfile .pylintrc --disable E0401,E0203
- name: Test with unittest
shell: bash -el {0}
run: |
python plugins/devices/test/unit.py
python plugins/devices/test/benchmark.py
18 changes: 1 addition & 17 deletions .github/workflows/test_turnkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
conda install pylint
pip install pytest
pip install -e .
pip install -e plugins/devices
pip install transformers timm
python -m pip check
- name: Lint with PyLint
Expand Down Expand Up @@ -73,26 +74,9 @@ jobs:
- name: Test example plugins
shell: bash -el {0}
run: |
rm -rf ~/.cache/turnkey
pip install -e examples/cli/plugins/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_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 -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
python plugins.py
- name: Install and Start Slurm
if: runner.os != 'Windows'
shell: bash -el {0}
Expand Down
8 changes: 0 additions & 8 deletions examples/cli/plugins/example_combined/setup.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions examples/cli/plugins/example_rt/setup.py

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 37f5e8d

Please sign in to comment.