Skip to content

Comments

Use CPU-only PyTorch index to speed up dev installation#1967

Merged
adamtheturtle merged 1 commit intomainfrom
chore/pytorch-cpu-index
Feb 18, 2026
Merged

Use CPU-only PyTorch index to speed up dev installation#1967
adamtheturtle merged 1 commit intomainfrom
chore/pytorch-cpu-index

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 18, 2026

Summary

  • vws-python-mock (a dev dependency) transitively requires torch and torchvision
  • By default, uv resolves these from PyPI which provides CUDA-enabled wheels on Linux (~916 MB for torch alone)
  • This PR follows the faster installation guide to redirect torch and torchvision to the CPU-only PyTorch index

Does it actually make installation faster?

Yes — tested empirically (in VWS-Python/vws-python#2857):

Package CUDA wheel (PyPI) CPU-only wheel Saving
torch (Linux, cp313) 916 MB 189 MB 727 MB
torchvision (Linux, cp313) 8 MB 2 MB 6 MB

~733 MB total reduction per cold-cache install on Linux CI runners.

Implementation notes

[tool.uv.sources] only applies to direct dependencies (not transitive ones), so torch and torchvision must be listed explicitly in optional-dependencies.dev for the source override to take effect. A deptry ignore is added since these packages are not directly imported in the vws-cli source code.


Note

Low Risk
Dependency/lockfile-only changes; main risk is unexpected dev environment resolution differences across platforms due to new index and platform markers.

Overview
Speeds up dev installs by explicitly adding torch and torchvision to optional-dependencies.dev and configuring uv ([tool.uv]) to source them from the PyTorch CPU-only wheel index instead of PyPI.

Updates dependency tooling to match this setup: adds deptry ignores for the now-explicit-but-not-imported deps, refreshes uv.lock to use platform-specific CPU wheels (dropping CUDA/NVIDIA-related packages), and bumps pyrefly plus vws-python-mock to newer versions.

Written by Cursor Bugbot for commit 8417eae. This will update automatically on new commits. Configure here.

@adamtheturtle adamtheturtle enabled auto-merge (squash) February 18, 2026 12:51
@adamtheturtle adamtheturtle merged commit 1543a22 into main Feb 18, 2026
16 checks passed
@adamtheturtle adamtheturtle deleted the chore/pytorch-cpu-index branch February 18, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant