-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (83 loc) · 3.16 KB
/
Copy pathtest-slow.yml
File metadata and controls
97 lines (83 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Slow Tests
# DISABLED: This workflow requires a self-hosted GPU runner to be available.
# Currently disabled because no GPU-enabled runners are available.
# Can be manually triggered via workflow_dispatch if a GPU runner becomes available.
on:
workflow_dispatch:
jobs:
test-slow-gpu:
name: Slow Tests on GPU
runs-on: [self-hosted, Windows, X64, gpu]
timeout-minutes: 60
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
lfs: true
- name: Create venv in RUNNER_TEMP
# Python 3.11 is required because the base dependency nvidia-physicsnemo
# requires Python >= 3.11.
run: |
& "C:\Program Files\Python311\python.exe" -m venv "$env:RUNNER_TEMP\monai-physio-venv"
echo "$env:RUNNER_TEMP\monai-physio-venv\Scripts" >> $env:GITHUB_PATH
- name: Check GPU availability
run: nvidia-smi
- name: Cache uv packages
uses: actions/cache@v4
with:
path: ~\AppData\Local\uv\cache
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Cache test data
uses: actions/cache@v4
with:
path: |
tests/data/
tests/results/
key: test-data-${{ hashFiles('tests/test_*.py') }}-v2
restore-keys: |
test-data-
- name: Upgrade pip and build tools
run: |
python -m pip install --upgrade pip setuptools wheel uv
- name: Install package with test dependencies
# uv respects [tool.uv.sources], routing torch to pytorch-cu130 for cuda13.
# PhysicsNeMo is a base dependency, so it is always installed; it is
# what --run-physicsnemo (Tutorial 9 and any tests marked
# requires_physicsnemo) needs.
# Invoke via python -m uv so uv targets the active venv interpreter.
run: |
python -m uv pip install -e ".[dev_cuda13]" --no-build-isolation-package torch-scatter
- name: Assert CUDA is accessible
run: |
python -c "
import sys, torch
print(f'PyTorch {torch.__version__} | CUDA toolkit {torch.version.cuda}')
if not torch.cuda.is_available():
print('ERROR: torch.cuda.is_available() returned False', file=sys.stderr)
sys.exit(1)
n = torch.cuda.device_count()
if n == 0:
print('ERROR: torch.cuda.device_count() == 0', file=sys.stderr)
sys.exit(1)
print(f'OK: {n} GPU(s) visible')
"
- name: Run slow tests
# Self-hosted GPU runner: enable every opt-in bucket via --run-all.
# Tests whose host requirements (e.g. a licensed Simpleware install)
# aren't met on the runner will runtime-skip cleanly via their
# internal availability guards.
run: |
pytest tests/ -v --run-all --cov=monai_physio --cov-report=xml --cov-report=term
env:
CUDA_VISIBLE_DEVICES: 0
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: slow-tests-gpu
name: codecov-slow-gpu
fail_ci_if_error: false