Skip to content

Add gpu install extra and document CPU/GPU install paths - #147

Open
ParamThakkar123 wants to merge 1 commit into
mainfrom
codex/modify-torchwm-for-gpu/cpu-installation
Open

ParamThakkar123 wants to merge 1 commit into
mainfrom
codex/modify-torchwm-for-gpu/cpu-installation

Conversation

@ParamThakkar123

Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple opt-in way to install CUDA-enabled PyTorch wheels when a GPU is available via pip install torchwm[gpu] while keeping pip install torchwm CPU-first for portable installs.
  • Make project metadata and package index routing compatible with uv so the CUDA PyTorch index is only used when the gpu extra is requested.

Description

  • Add a gpu optional-dependency to pyproject.toml under [project.optional-dependencies] and to extras_require in setup.py that includes torch, torchvision, and torchaudio.
  • Update uv configuration in pyproject.toml ([tool.uv] / [tool.uv.sources] and [[tool.uv.index]]) so torch, torchvision, and torchaudio are routed to the CUDA 12.1 PyTorch index when the gpu extra is requested and are not forced to the CUDA index by default.
  • Update documentation: README.md, docs/source/installation.md, and docs/source/getting_started.md now document pip install torchwm (CPU/default) and pip install torchwm[gpu] (CUDA-enabled) with guidance about uv behavior.
  • Update the project lock/metadata (uv.lock entries) so the new gpu extra is reflected and package metadata include extra == 'gpu' markers for the PyTorch packages.

Testing

  • Verified pyproject.toml parsing and presence of the gpu extra with a small tomllib validation script (passed).
  • Performed an editable-install dry-run with python -m pip install -e . --dry-run --no-deps --no-build-isolation which reported the package would install (passed).
  • Ran python setup.py egg_info which completed and generated metadata (passed).
  • Built a source distribution with uv build --sdist --no-build-isolation which succeeded and produced dist/torchwm-*.tar.gz (passed).
  • Ran uv lock --offline --dry-run which failed due to the offline lock cache missing ale-py for the Python >=3.14 resolution split; this failure is an offline cache/network issue and not caused by the gpu extra change (warning/failure unrelated to metadata changes).

Codex Task

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ParamThakkar123.github.io/torchwm/pr-preview/pr-147/

Built to branch gh-pages at 2026-05-31 14:25 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant