From 99fcbf89868d7d0e40609dab6100363ef4a3a04b Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 18 Feb 2026 10:07:56 +0000 Subject: [PATCH] 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 --- docs/source/installation.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index ce56603b2..753d68829 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -6,3 +6,29 @@ Installation $ pip install vws-python-mock This requires Python |minimum-python-version|\+. + +Faster installation +~~~~~~~~~~~~~~~~~~~ + +This package depends on `PyTorch`_, which pip installs from PyPI as a large CUDA-enabled build (~873 MB) even on CPU-only machines. +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: + +.. code-block:: console + + $ pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu + $ pip install vws-python-mock + +If you manage dependencies with ``uv``, add the following to your ``pyproject.toml`` instead: + +.. code-block:: toml + + [[tool.uv.index]] + name = "pytorch-cpu" + url = "https://download.pytorch.org/whl/cpu" + explicit = true + + [tool.uv.sources] + torch = { index = "pytorch-cpu" } + torchvision = { index = "pytorch-cpu" } + +.. _PyTorch: https://pytorch.org