Skip to main content

uv-torch-compass

日本語

By using uv-torch-compass, you can test official PyTorch package indexes against both your version requirements and the current Linux machine, then safely write the first verified choice to the target project's pyproject.toml.

An index is a package download location. PyTorch publishes separate official indexes for CPU and NVIDIA CUDA builds. This tool checks more than whether a package can be installed. By default, it rejects CUDA builds newer than the selected NVIDIA driver normally supports, then runs PyTorch, NumPy, the selected GPU, cuBLAS, cuDNN, and optional torchvision or torchaudio checks before applying a choice.

Quick start

You need Linux, a recent uv, internet access, and Python 3.10–3.14. The target pyproject.toml must contain torch, torchvision, or torchaudio in base dependencies or in a selected extra or dependency group.

For a minimal project:

[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.10,<3.15"
dependencies = ["torch>=2.5"]

From the target project, run a version published on PyPI to verify a candidate and preview the change:

uvx uv-torch-compass plan

To try a local checkout or wheel instead, select it explicitly:

uvx --from /path/to/uv_torch_compass uv-torch-compass plan

If the plan is suitable, apply it. This updates pyproject.toml, locks the workspace, synchronizes the selected project environment, and verifies the result again:

uvx uv-torch-compass apply

Later, validate the recorded source, lockfile, synchronized environment, and installed runtime without changing them:

uvx uv-torch-compass check

When using a local checkout, replace /path/to/uv_torch_compass with this repository's path and keep the same --from prefix for apply and check. Add --pyproject /path/to/project/pyproject.toml when running from another directory.

Choosing what to test

The default --backend auto --cuda-compatibility strict policy behaves as follows:

  • When an NVIDIA GPU is visible, it tests only concrete CUDA builds that the driver normally supports, from newer to older. It does not silently switch to CPU when those candidates fail.
  • When no NVIDIA GPU is visible, it tests the official CPU build.

The command stops at the first candidate that passes. It does not benchmark every candidate or claim to choose the fastest build. This also means that a machine whose nvidia-smi output says CUDA Version: 12.4 will not accept cu129 under the default policy.

You can narrow the policy:

uv-torch-compass plan --backend cpu
uv-torch-compass plan --backend cuda
uv-torch-compass plan --backend cu128
uv-torch-compass plan --channel nightly
uv-torch-compass plan --probe-profile compile

stable is the default channel. nightly is used only when explicitly selected. CUDA minor-version compatibility is also opt-in with --cuda-compatibility minor; it can use a newer CUDA runtime within the same major family, but a successful result is reported with a warning. See backend and runtime selection for the exact order and checks.

Safety at a glance

  • plan installs and tests candidates in temporary environments but does not change the target pyproject.toml, uv.lock, or project environment.
  • apply creates timestamped backups and treats a workspace member's pyproject.toml and the shared root uv.lock as one transaction.
  • Writes use same-directory temporary files and atomic replacement. A workspace lock prevents two apply processes from updating together.
  • Lock, sync, final validation, timeout, SIGINT, and SIGTERM failures trigger file rollback and an environment recovery attempt.
  • Logs and JSON reports redact common credential forms and are created with private file permissions.

Review git diff after plan and apply. Backups remain after success; recovery and troubleshooting explains their names and limitations.

Supported scope

  • plan, apply, and check run on Linux. --help and --version work on other systems.
  • CPU and NVIDIA CUDA builds are supported. AMD ROCm and Intel XPU are rejected.
  • Stable and nightly official PyTorch indexes are supported; stable never falls back to nightly automatically.
  • Base dependencies, selected extras, selected dependency groups, uv workspaces, torchvision, and torchaudio are supported.
  • CUDA success requires GPU tensor, cuBLAS, cuDNN, architecture, and selected companion-package checks. --probe-profile compile additionally tests torch.compile.
  • NVIDIA drivers are never installed or updated. Re-run plan and apply after updating a driver.
  • Exit codes are 0 for success, 1 for configuration or operational failure, and 2 for invalid command syntax.

Documentation

Goal Guide
Learn the commands and options CLI usage
Configure project defaults and environment variables Configuration
Understand the process flow, backend, channel, GPU, Python, and runtime checks How selection works
Use extras, groups, and workspaces Projects and dependency scopes
Consume text and JSON results Reports and automation
Recover files or diagnose a failure Recovery and troubleshooting
Test, build, and prepare artifacts Development

See the documentation index for the complete map.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uv_torch_compass-0.2.0.tar.gz (100.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uv_torch_compass-0.2.0-py3-none-any.whl (55.7 kB view details)

Uploaded Python 3

File details

Details for the file uv_torch_compass-0.2.0.tar.gz.

File metadata

  • Download URL: uv_torch_compass-0.2.0.tar.gz
  • Upload date:
  • Size: 100.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for uv_torch_compass-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d71b4a40f45162af923c30665cb1941193b6f9617a0b9b6297757f5475a10b70
MD5 c8f224cf23664d530b6cd045910f6f53
BLAKE2b-256 436af52d667943e2d50fb455c787373407b4702e8bf1a1d02aa1d87cc4f3f436

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_torch_compass-0.2.0.tar.gz:

Publisher: publish.yml on Onely7/uv_torch_compass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uv_torch_compass-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for uv_torch_compass-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aab904d43ff08ddaa5ca28b4098d1cec08402f97c5a87e5bce5ec7ffca0cf4fd
MD5 61431ef74b98ba100506506f96f726a7
BLAKE2b-256 d919504d5499ce4ef7cac8a3b4806448a5585fcc5831fb71e61eaddfc2509845

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_torch_compass-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Onely7/uv_torch_compass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page