Skip to content

Commit a279179

Browse files
leofangclaude
andcommitted
Fix nightly CI: merge installs, fix test cmd, skip noisy steps
- Merge optional dep install with cuda-python wheel install into single pip call (nightly-pytorch / nightly-numba-cuda modes in run-tests) to avoid costly uninstall/reinstall from version conflicts - Fix numba-cuda test command: python -m numba.runtests numba.cuda.tests - Skip noisy "Display structure of downloaded cuda-python artifacts" step in nightly mode (ls -lahR . lists the entire repo) - run-tests now does pip list at the end of nightly installs - Use --extra-index-url for PyTorch so pip can resolve both PyPI and PyTorch index packages together Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9286598 commit a279179

3 files changed

Lines changed: 64 additions & 58 deletions

File tree

.github/workflows/test-wheel-linux.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ jobs:
203203
rmdir cuda-python-wheel
204204
205205
- name: Display structure of downloaded cuda-python artifacts
206+
if: ${{ inputs.test-mode == 'standard' }}
206207
run: |
207208
pwd
208209
ls -lahR .
@@ -343,41 +344,31 @@ jobs:
343344
CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: all_must_work
344345
run: run-tests pathfinder
345346

346-
# ── Nightly: install all cuda-python wheels ──
347-
- name: Install cuda-python wheels for nightly testing
348-
if: ${{ inputs.test-mode != 'standard' }}
347+
# ── Nightly: install wheels + optional dep together ──
348+
- name: Install cuda-python wheels + PyTorch
349+
if: ${{ inputs.test-mode == 'nightly-pytorch' }}
349350
env:
350351
CUDA_VER: ${{ matrix.CUDA_VER }}
351352
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
352-
run: run-tests nightly-install
353+
TORCH_VER: ${{ matrix.TORCH_VER }}
354+
TORCH_CUDA: ${{ matrix.TORCH_CUDA }}
355+
run: run-tests nightly-pytorch
353356

354-
# ── Nightly: PyTorch interop tests ──
355-
- name: Install PyTorch
356-
if: ${{ inputs.test-mode == 'nightly-pytorch' }}
357-
run: |
358-
TORCH_VER="${{ matrix.TORCH_VER }}"
359-
TORCH_CUDA="${{ matrix.TORCH_CUDA }}"
360-
if [[ "$TORCH_VER" == "latest" ]]; then
361-
pip install torch --index-url "https://download.pytorch.org/whl/${TORCH_CUDA}"
362-
else
363-
pip install "torch==${TORCH_VER}" --index-url "https://download.pytorch.org/whl/${TORCH_CUDA}"
364-
fi
365-
python -c "import torch; print(f'PyTorch {torch.__version__}, CUDA {torch.version.cuda}')"
357+
- name: Install cuda-python wheels + numba-cuda
358+
if: ${{ inputs.test-mode == 'nightly-numba-cuda' }}
359+
env:
360+
CUDA_VER: ${{ matrix.CUDA_VER }}
361+
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
362+
run: run-tests nightly-numba-cuda
366363

364+
# ── Nightly: run tests ──
367365
- name: Run PyTorch interop tests
368366
if: ${{ inputs.test-mode == 'nightly-pytorch' }}
369367
run: |
370368
pushd cuda_core
371369
pytest -rxXs -v --durations=0 tests/test_utils.py tests/example_tests/
372370
popd
373371
374-
# ── Nightly: numba-cuda tests ──
375-
- name: Install numba-cuda
376-
if: ${{ inputs.test-mode == 'nightly-numba-cuda' }}
377-
run: |
378-
pip install numba-cuda
379-
python -c "import numba_cuda; print(f'numba-cuda installed')"
380-
381372
- name: Run numba-cuda tests
382373
if: ${{ inputs.test-mode == 'nightly-numba-cuda' }}
383-
run: python -m numba_cuda.numba.cuda.tests
374+
run: python -m numba.runtests numba.cuda.tests

.github/workflows/test-wheel-windows.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ jobs:
189189
Remove-Item -Path cuda-python-wheel -Force
190190
191191
- name: Display structure of downloaded cuda-python artifacts
192+
if: ${{ inputs.test-mode == 'standard' }}
192193
run: |
193194
Get-Location
194195
Get-ChildItem -Recurse -Force | Select-Object Mode, LastWriteTime, Length, FullName
@@ -320,29 +321,26 @@ jobs:
320321
shell: bash --noprofile --norc -xeuo pipefail {0}
321322
run: run-tests pathfinder
322323

323-
# ── Nightly: install all cuda-python wheels ──
324-
- name: Install cuda-python wheels for nightly testing
325-
if: ${{ inputs.test-mode != 'standard' }}
324+
# ── Nightly: install wheels + optional dep together ──
325+
- name: Install cuda-python wheels + PyTorch
326+
if: ${{ inputs.test-mode == 'nightly-pytorch' }}
326327
env:
327328
CUDA_VER: ${{ matrix.CUDA_VER }}
328329
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
330+
TORCH_VER: ${{ matrix.TORCH_VER }}
331+
TORCH_CUDA: ${{ matrix.TORCH_CUDA }}
329332
shell: bash --noprofile --norc -xeuo pipefail {0}
330-
run: run-tests nightly-install
333+
run: run-tests nightly-pytorch
331334

332-
# ── Nightly: PyTorch interop tests ──
333-
- name: Install PyTorch
334-
if: ${{ inputs.test-mode == 'nightly-pytorch' }}
335+
- name: Install cuda-python wheels + numba-cuda
336+
if: ${{ inputs.test-mode == 'nightly-numba-cuda' }}
337+
env:
338+
CUDA_VER: ${{ matrix.CUDA_VER }}
339+
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
335340
shell: bash --noprofile --norc -xeuo pipefail {0}
336-
run: |
337-
TORCH_VER="${{ matrix.TORCH_VER }}"
338-
TORCH_CUDA="${{ matrix.TORCH_CUDA }}"
339-
if [[ "$TORCH_VER" == "latest" ]]; then
340-
pip install torch --index-url "https://download.pytorch.org/whl/${TORCH_CUDA}"
341-
else
342-
pip install "torch==${TORCH_VER}" --index-url "https://download.pytorch.org/whl/${TORCH_CUDA}"
343-
fi
344-
python -c "import torch; print(f'PyTorch {torch.__version__}, CUDA {torch.version.cuda}')"
341+
run: run-tests nightly-numba-cuda
345342

343+
# ── Nightly: run tests ──
346344
- name: Run PyTorch interop tests
347345
if: ${{ inputs.test-mode == 'nightly-pytorch' }}
348346
shell: bash --noprofile --norc -xeuo pipefail {0}
@@ -351,15 +349,7 @@ jobs:
351349
pytest -rxXs -v --durations=0 tests/test_utils.py tests/example_tests/
352350
popd
353351
354-
# ── Nightly: numba-cuda tests ──
355-
- name: Install numba-cuda
356-
if: ${{ inputs.test-mode == 'nightly-numba-cuda' }}
357-
shell: bash --noprofile --norc -xeuo pipefail {0}
358-
run: |
359-
pip install numba-cuda
360-
python -c "import numba_cuda; print(f'numba-cuda installed')"
361-
362352
- name: Run numba-cuda tests
363353
if: ${{ inputs.test-mode == 'nightly-numba-cuda' }}
364354
shell: bash --noprofile --norc -xeuo pipefail {0}
365-
run: python -m numba_cuda.numba.cuda.tests
355+
run: python -m numba.runtests numba.cuda.tests

ci/tools/run-tests

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if [[ ${#} -ne 1 ]]; then
1313
echo "Error: This script requires exactly 1 argument. You provided ${#}"
1414
exit 1
1515
fi
16-
if [[ "${1}" != "bindings" && "${1}" != "core" && "${1}" != "pathfinder" && "${1}" != "nightly-install" ]]; then
17-
echo "Error: Invalid test module '${1}'. Must be 'bindings', 'core', 'pathfinder', or 'nightly-install'"
16+
if [[ "${1}" != "bindings" && "${1}" != "core" && "${1}" != "pathfinder" && "${1}" != "nightly-pytorch" && "${1}" != "nightly-numba-cuda" ]]; then
17+
echo "Error: Invalid test module '${1}'. Must be 'bindings', 'core', 'pathfinder', 'nightly-pytorch', or 'nightly-numba-cuda'"
1818
exit 1
1919
fi
2020

@@ -91,9 +91,12 @@ elif [[ "${test_module}" == "core" ]]; then
9191
${SANITIZER_CMD} pytest -rxXs -v --durations=0 --randomly-dont-reorganize tests/cython
9292
fi
9393
popd
94-
elif [[ "${test_module}" == "nightly-install" ]]; then
95-
# Install all wheels (pathfinder already installed above) without running tests.
96-
# Used by nightly optional-dependency pipelines (pytorch, numba-cuda).
94+
elif [[ "${test_module}" == "nightly-pytorch" || "${test_module}" == "nightly-numba-cuda" ]]; then
95+
# Nightly optional-dependency testing.
96+
# Install bindings, core, and the optional dep in as few pip calls as
97+
# possible so that pip can resolve version constraints in one shot and
98+
# avoid costly uninstall/reinstall cycles.
99+
97100
echo "Installing bindings wheel"
98101
pushd ./cuda_bindings
99102
if [[ "${LOCAL_CTK}" == 1 ]]; then
@@ -104,7 +107,6 @@ elif [[ "${test_module}" == "nightly-install" ]]; then
104107
popd
105108

106109
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${CUDA_VER})"
107-
echo "Installing core wheel"
108110

109111
FREE_THREADING=""
110112
if python -c 'import sys; assert not sys._is_gil_enabled()' 2> /dev/null; then
@@ -117,9 +119,32 @@ elif [[ "${test_module}" == "nightly-install" ]]; then
117119
if [[ "${LOCAL_CTK}" != 1 ]]; then
118120
WHL_EXTRA=("${WHL_EXTRA[0]}[cu${TEST_CUDA_MAJOR}]")
119121
fi
120-
pip install "${WHL_EXTRA[@]}" --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" "cuda-toolkit==${CUDA_VER_MINOR}.*"
122+
123+
# Build the pip install command — core wheel + test group + optional dep
124+
# all in one invocation so pip resolves everything together.
125+
PIP_ARGS=(
126+
"${WHL_EXTRA[@]}"
127+
--group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}"
128+
"cuda-toolkit==${CUDA_VER_MINOR}.*"
129+
)
130+
131+
if [[ "${test_module}" == "nightly-pytorch" ]]; then
132+
# TORCH_VER and TORCH_CUDA must be set by the caller.
133+
echo "Installing core wheel + PyTorch ${TORCH_VER} (${TORCH_CUDA})"
134+
if [[ "${TORCH_VER}" == "latest" ]]; then
135+
PIP_ARGS+=(torch)
136+
else
137+
PIP_ARGS+=("torch==${TORCH_VER}")
138+
fi
139+
PIP_ARGS+=(--extra-index-url "https://download.pytorch.org/whl/${TORCH_CUDA}")
140+
elif [[ "${test_module}" == "nightly-numba-cuda" ]]; then
141+
echo "Installing core wheel + numba-cuda"
142+
PIP_ARGS+=(numba-cuda)
143+
fi
144+
145+
pip install "${PIP_ARGS[@]}"
121146
popd
122147

123-
echo "All cuda-python wheels installed for nightly testing"
124-
pip list | grep -i "cuda\|pathfinder"
148+
echo "Nightly install complete — installed packages:"
149+
pip list
125150
fi

0 commit comments

Comments
 (0)