Skip to content

Commit 385e7f0

Browse files
authored
ci: Test with torch nightly (#707)
1 parent 4826347 commit 385e7f0

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎.github/actions/install-deps/action.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ inputs:
1212
description: 'Dependency groups to install (space-separated, e.g., "test doc")'
1313
required: false
1414
default: ''
15+
torch_channel:
16+
description: 'PyTorch channel to use. Use "nightly" to upgrade torch and torchvision to the latest nightly build.'
17+
required: false
18+
default: 'stable'
1519

1620
runs:
1721
using: composite
@@ -45,3 +49,10 @@ runs:
4549
# Print and execute the command
4650
echo $cmd
4751
eval $cmd
52+
53+
- name: Upgrade to torch nightly
54+
if: ${{ inputs.torch_channel == 'nightly' }}
55+
shell: bash
56+
run: |
57+
uv pip install --pre --upgrade torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
58+
uv run python -c "import torch, torchvision; print('torch:', torch.__version__, '| torchvision:', torchvision.__version__)"

‎.github/workflows/checks.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
tests:
1818
# Default config: py3.14, ubuntu-latest, float32, full options.
1919
# The idea is to make each of those params vary one by one, to limit the number of tests to run.
20-
name: Tests (py${{ matrix.python-version || '3.14' }}, ${{ matrix.os || 'ubuntu-latest' }}, ${{ matrix.dtype || 'float32' }}, ${{ matrix.options || 'full' }}${{ matrix.extra_groups && format(', {0}', matrix.extra_groups) || '' }})
20+
name: Tests (py${{ matrix.python-version || '3.14' }}, ${{ matrix.os || 'ubuntu-latest' }}, ${{ matrix.dtype || 'float32' }}, ${{ matrix.options || 'full' }}${{ matrix.extra_groups && format(', {0}', matrix.extra_groups) || '' }}${{ matrix.torch_channel == 'nightly' && ', torch-nightly' || '' }})
2121
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
2222
strategy:
2323
fail-fast: false
@@ -39,6 +39,8 @@ jobs:
3939
# Lower-bounds of all dependencies and Python version.
4040
- python-version: '3.10.0'
4141
extra_groups: 'lower_bounds'
42+
# Latest: torch nightly build.
43+
- torch_channel: 'nightly'
4244

4345
steps:
4446
- name: Checkout repository
@@ -53,6 +55,7 @@ jobs:
5355
with:
5456
options: ${{ matrix.options || 'full' }}
5557
groups: test ${{ matrix.extra_groups }}
58+
torch_channel: ${{ matrix.torch_channel || 'stable' }}
5659

5760
- name: Run unit tests
5861
run: uv run pytest -W error tests/unit --cov=src --cov-report=xml

0 commit comments

Comments
 (0)