Skip to content

Commit cd529e9

Browse files
InfantLabclaude
andcommitted
fix(ci): make CUDA torch index Linux-only so non-Linux installs work
The cu124 torch/torchvision/torchaudio index was applied to every platform, but CUDA wheels exist only for Linux/Windows, so `uv sync` failed on macOS (and any CPU-only box) and the macOS CI leg could never install. Restrict the cu124 index to sys_platform == 'linux'; macOS/Windows now resolve torch from PyPI. Also set fail-fast: false so one matrix leg failing no longer cancels the others. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d55bc56 commit cd529e9

3 files changed

Lines changed: 180 additions & 59 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
test:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
16+
fail-fast: false
1617
matrix:
1718
os: [ubuntu-latest, windows-latest, macos-latest]
1819
python-version: ["3.12"]

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,12 @@ name = "pytorch-cu124"
156156
url = "https://download.pytorch.org/whl/cu124"
157157
explicit = true
158158

159+
# CUDA wheels only exist for Linux/Windows; restrict the cu124 index to Linux
160+
# so macOS and other platforms resolve torch from PyPI (CPU build).
159161
[tool.uv.sources]
160-
torch = { index = "pytorch-cu124" }
161-
torchvision = { index = "pytorch-cu124" }
162-
torchaudio = { index = "pytorch-cu124" }
162+
torch = [{ index = "pytorch-cu124", marker = "sys_platform == 'linux'" }]
163+
torchvision = [{ index = "pytorch-cu124", marker = "sys_platform == 'linux'" }]
164+
torchaudio = [{ index = "pytorch-cu124", marker = "sys_platform == 'linux'" }]
163165

164166
[tool.ruff]
165167
line-length = 88 # Keep existing Black line length for consistency

0 commit comments

Comments
 (0)