Skip to content

Commit aba2728

Browse files
Merge pull request #2949 from VWS-Python/adamtheturtle/montreal-v1
Document CPU-only torch installation to speed up pip installs
2 parents fb8313b + 99fcbf8 commit aba2728

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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)