Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move run submodule out into the new devices plugin #222

Merged
merged 23 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
jeremyfowers marked this conversation as resolved.
Show resolved Hide resolved

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
Loading