Skip to content

Commit

Permalink
chore: bump actions to v1.12.0
Browse files Browse the repository at this point in the history
use cached weights for scheduled tests
  • Loading branch information
johnnv1 committed Aug 18, 2024
1 parent 1536f20 commit 9890c9d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 19 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/pr_test_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
outputs:
hash: ${{ steps.hashid.outputs.weights-hash }}
steps:
- uses: kornia/workflows/.github/actions/env@v1.11.0
- uses: kornia/workflows/.github/actions/env@v1.12.0
- uses: actions/cache@v4
id: cache-weights
with:
Expand All @@ -43,8 +43,7 @@ jobs:
os: ['Ubuntu-latest', 'Windows-latest']
pytorch-dtype: ['float32', 'float64']

# TODO: release this workflow
uses: kornia/workflows/.github/workflows/tests.yml@main
uses: kornia/workflows/.github/workflows/[email protected]
with:
os: ${{ matrix.os }}
python-version: '["3.8", "3.12"]'
Expand All @@ -57,7 +56,8 @@ jobs:
model-weights-
tests-cpu-macos:
uses: kornia/workflows/.github/workflows/tests.yml@main
needs: [pre-tests]
uses: kornia/workflows/.github/workflows/[email protected]
with:
os: 'MacOS-latest'
python-version: '["3.8", "3.12"]'
Expand All @@ -70,7 +70,8 @@ jobs:
coverage:
uses: kornia/workflows/.github/workflows/coverage.yml@main
needs: [pre-tests]
uses: kornia/workflows/.github/workflows/[email protected]
with:
cache-path: weights/
cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}
Expand All @@ -79,13 +80,14 @@ jobs:
model-weights-
typing:
uses: kornia/workflows/.github/workflows/mypy.yml@v1.10.1
uses: kornia/workflows/.github/workflows/mypy.yml@v1.12.0

tutorials:
uses: kornia/workflows/.github/workflows/tutorials.yml@v1.10.1
uses: kornia/workflows/.github/workflows/tutorials.yml@v1.12.0

docs:
uses: kornia/workflows/.github/workflows/docs.yml@main
needs: [pre-tests]
uses: kornia/workflows/.github/workflows/[email protected]
with:
python-version: '["3.11"]'
cache-path: weights/
Expand All @@ -94,7 +96,6 @@ jobs:
model-weights-${{ needs.pre-tests.outputs.hash }}
model-weights-
collector:
needs: [coverage, tests-cpu, tutorials, typing, docs]
if: always()
Expand All @@ -106,6 +107,7 @@ jobs:

tests-nightly:
if: contains(github.event.pull_request.labels.*.name, 'nightly')
needs: [pre-tests]
name: ${{ matrix.os }} - torch-nightly, ${{ matrix.pytorch-dtype }}

strategy:
Expand All @@ -114,7 +116,7 @@ jobs:
os: ['Ubuntu-latest', 'Windows-latest'] #, 'MacOS-latest'] add it when https://github.com/pytorch/pytorch/pull/89262 be merged
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@main
uses: kornia/workflows/.github/workflows/tests.yml@v1.12.0
with:
os: ${{ matrix.os }}
pytorch-version: '["nightly"]'
Expand Down
68 changes: 59 additions & 9 deletions .github/workflows/scheduled_test_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,107 @@ concurrency:
cancel-in-progress: true

jobs:
pre-tests:
runs-on: ubuntu-latest
outputs:
hash: ${{ steps.hashid.outputs.weights-hash }}
steps:
- uses: kornia/workflows/.github/actions/[email protected]
- uses: actions/cache@v4
id: cache-weights
with:
path: weights/
key: model-weights-${{ hashFiles('.github/download-models-weights.py') }}
enableCrossOsArchive: true

- name: Download models weights...
if: steps.cache-weights.outputs.cache-hit != 'true'
run: python .github/download-models-weights.py -t weights/

- name: write hashid
id: hashid
run: echo "weights-hash=${{ hashFiles('.github/download-models-weights.py') }}" >> "$GITHUB_OUTPUT"

tests-cpu-ubuntu:
needs: [pre-tests]
strategy:
fail-fast: false
matrix:
# os: ['Ubuntu-latest', 'Windows-latest', 'MacOS-latest']
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@v1.10.1
uses: kornia/workflows/.github/workflows/tests.yml@v1.12.0
with:
os: 'Ubuntu-latest'
python-version: '["3.8", "3.9", "3.10", "3.11", "3.12"]'
pytorch-version: '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.1"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}
pytest-extra: '--runslow'


cache-path: weights/
cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}
cache-restore-keys: |
model-weights-${{ needs.pre-tests.outputs.hash }}
model-weights-
tests-cpu-windows:
needs: [pre-tests]
strategy:
fail-fast: true
matrix:
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@v1.10.1
uses: kornia/workflows/.github/workflows/tests.yml@v1.12.0
with:
os: 'Windows-latest'
python-version: '["3.12"]'
pytorch-version: '["1.9.1", "2.3.1"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}
cache-path: weights/
cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}
cache-restore-keys: |
model-weights-${{ needs.pre-tests.outputs.hash }}
model-weights-
tests-cpu-mac:
needs: [pre-tests]
strategy:
fail-fast: true
matrix:
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@v1.10.1
uses: kornia/workflows/.github/workflows/tests.yml@v1.12.0
with:
os: 'MacOS-latest'
pytorch-dtype: ${{ matrix.pytorch-dtype }}
cache-path: weights/
cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}
cache-restore-keys: |
model-weights-${{ needs.pre-tests.outputs.hash }}
model-weights-
coverage:
uses: kornia/workflows/.github/workflows/[email protected]
needs: [pre-tests]
uses: kornia/workflows/.github/workflows/[email protected]
with:
cache-path: weights/
cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}
cache-restore-keys: |
model-weights-${{ needs.pre-tests.outputs.hash }}
model-weights-
typing:
uses: kornia/workflows/.github/workflows/mypy.yml@v1.10.1
uses: kornia/workflows/.github/workflows/mypy.yml@v1.12.0

tutorials:
uses: kornia/workflows/.github/workflows/tutorials.yml@v1.10.1
uses: kornia/workflows/.github/workflows/tutorials.yml@v1.12.0

docs:
uses: kornia/workflows/.github/workflows/[email protected]
needs: [pre-tests]
uses: kornia/workflows/.github/workflows/[email protected]
with:
python-version: '["3.11"]'
cache-path: weights/
cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}
cache-restore-keys: |
model-weights-${{ needs.pre-tests.outputs.hash }}
model-weights-

0 comments on commit 9890c9d

Please sign in to comment.