Curated distribution of PyTorch-compatible Python sub-libraries (the PyTorch annex)
Project description
torchannex
torchannex is a curated distribution ("annex") of small, pure-Python
libraries that extend PyTorch. Installing torchannex gives you a set of
sub-libraries pinned to versions that are known to be compatible with a
specific PyTorch release, although these libraries are intended to be loosely
coupled with PyTorch and therefore compatible with a variety of releases.
The annex is designed to be cheap: every package in it is a lightweight pure Python package that installs instantly and pulls in no heavy native dependencies of its own beyond PyTorch.
When should I use torchannex?
You do not have to depend on torchannex directly. Two patterns are
supported:
- Batteries-included. Depend on
torchannex. You get the full curated set, versioned in lockstep with the PyTorch release you have installed. - Hand-picked. Depend on the individual annex packages you care about and pin them yourself. Useful when you have an opinion about a specific sub-library's version and do not want the whole set.
The annex packages are ordinary PyPI packages. The metapackage is a convenience, not a gate.
Installation
pip install torchannex
# or
uv pip install torchannex
If torch is already installed (or pinned elsewhere in your environment),
the resolver will select the torchannex version whose PyTorch pin matches:
pip install "torch==2.5.3" torchannex # resolves to torchannex 2.5.x
Versioning
torchannex versions track PyTorch on the X.Y components only:
| Component | Meaning |
|---|---|
X |
PyTorch major version (lockstep) |
Y |
PyTorch minor version (lockstep) |
Z |
Independent annex bugfix counter for the X.Y series |
A torchannex X.Y.Z release depends on torch ~= X.Y.0 (i.e.
>= X.Y.0, < X.(Y+1).0). This means:
- Any
torch X.Y.*patch release is compatible with anytorchannex X.Y.*. - If we ship a fix to an annex sub-library without a new PyTorch release, we
bump only the annex
Z. For example, for the PyTorch 2.5 series:torchannex 2.5.0— first annex release for torch 2.5torchannex 2.5.1— bugfix to an annex sub-library (torch unchanged)torchannex 2.5.2— another annex bugfix
- When PyTorch 2.6 ships we start a new series at
torchannex 2.6.0.
Relationship between torch Z and torchannex Z
They are independent. torchannex 2.5.7 does not imply torch 2.5.7;
it simply means the 8th annex release cut for the 2.5 series. Whatever torch 2.5.* you have installed is fine.
What's in the annex?
In the short term, we plan to put spmd_types in the annex to allow for some
closer integration with DTensor local map.
Building and releasing
torchannex is a pure metapackage — no Python source — built with
setuptools. The empty py-modules / packages entries in pyproject.toml
tell setuptools there is nothing to find.
uv build # produces sdist and wheel
uv publish # uploads to PyPI (requires credentials)
See TESTING.md for the manual acceptance tests to run before a release.
License
BSD-3-Clause.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torchannex-0.0.0.tar.gz.
File metadata
- Download URL: torchannex-0.0.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5541fd59e2216f8e284b672a42d0958bc792ed1f63d71cf8ab71e6d2d914bb30
|
|
| MD5 |
349d607b0c48d48d937c5a78f3253a9c
|
|
| BLAKE2b-256 |
19a448996db5d0d7eb5f632945794767dbe75c216e1a7ed6499c8461bb3221fc
|
File details
Details for the file torchannex-0.0.0-py3-none-any.whl.
File metadata
- Download URL: torchannex-0.0.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
271194a0a9a7e99ba668d9fb1b0ef887c0514d07206c1359bd0249995e452997
|
|
| MD5 |
fec8415283ae5ba4227da3835367a8dd
|
|
| BLAKE2b-256 |
1d6fb5aa44bf039554d43ed838afcc088499633d3d98682179f5e4e61c6e0709
|