Skip to content

Commit 99fcbf8

Browse files
adamtheturtleclaude
andcommitted
Document CPU-only torch installation to speed up pip installs
pip users get CUDA torch from PyPI by default (~873 MB). Document how to pre-install torch and torchvision from PyTorch's CPU index (~200 MB) before installing the package, and the equivalent uv pyproject.toml configuration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 772c4f0 commit 99fcbf8

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

docs/source/installation.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,29 @@ Installation
66
$ pip install vws-python-mock
77
88
This requires Python |minimum-python-version|\+.
9+
10+
Faster installation
11+
~~~~~~~~~~~~~~~~~~~
12+
13+
This package depends on `PyTorch`_, which pip installs from PyPI as a large CUDA-enabled build (~873 MB) even on CPU-only machines.
14+
To get a much smaller CPU-only build (~200 MB, no CUDA dependencies), install ``torch`` and ``torchvision`` from PyTorch's CPU index before installing this package:
15+
16+
.. code-block:: console
17+
18+
$ pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
19+
$ pip install vws-python-mock
20+
21+
If you manage dependencies with ``uv``, add the following to your ``pyproject.toml`` instead:
22+
23+
.. code-block:: toml
24+
25+
[[tool.uv.index]]
26+
name = "pytorch-cpu"
27+
url = "https://download.pytorch.org/whl/cpu"
28+
explicit = true
29+
30+
[tool.uv.sources]
31+
torch = { index = "pytorch-cpu" }
32+
torchvision = { index = "pytorch-cpu" }
33+
34+
.. _PyTorch: https://pytorch.org

0 commit comments

Comments
 (0)