A PyTorch stack utility package
Project description
torch-stack
Install PyTorch ecosystem with automatic version compatibility via extras.
Motivation
PyTorch's ecosystem has complex version dependencies between torch, torchvision, torchaudio, and torchtext. Finding compatible versions is tedious and error-prone - this is the "PyTorch version hell."
Before torch-stack:
# Manual version hunting and compatibility checking
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0
With torch-stack:
# Just specify torch version, get compatible ecosystem automatically
pip install torch-stack[vision,audio]==2.1.0
torch-stack solves this by:
- 🎯 Extras notation:
torch-stack[vision]==2.1.0installs compatible versions - 📦 No manual lookup: Automatically resolves ecosystem compatibility
- 🔄 Zero configuration: Works out of the box with correct version mapping
Installation
Basic Installation
# Base torch only
pip install torch-stack==2.1.0
# With torchvision (gets compatible 0.16.0)
pip install torch-stack[vision]==2.1.0
# With audio and vision
pip install torch-stack[vision,audio]==2.1.0
# Everything
pip install torch-stack[all]==2.1.0
CPU/CUDA Specific Installation
For specific hardware targets, use PyTorch's index URLs:
# CPU-only installation
pip install torch-stack[all]==2.1.0 --extra-index-url https://download.pytorch.org/whl/cpu
# CUDA 11.8
pip install torch-stack[all]==2.1.0 --extra-index-url https://download.pytorch.org/whl/cu118
# CUDA 12.1
pip install torch-stack[all]==2.1.0 --extra-index-url https://download.pytorch.org/whl/cu121
Available Index URLs
- CPU:
https://download.pytorch.org/whl/cpu - CUDA 11.8:
https://download.pytorch.org/whl/cu118 - CUDA 12.1:
https://download.pytorch.org/whl/cu121 - ROCm 5.6:
https://download.pytorch.org/whl/rocm5.6
Note: torch-stack resolves version compatibility; the index URL determines CPU/GPU variant.
Usage
Simple Installation
Replace your manual PyTorch installs:
# Instead of researching compatible versions:
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0
# Just use:
pip install torch-stack[vision,audio]==2.1.0
In requirements.txt
# Before: manual compatibility management
torch==2.1.0
torchvision==0.16.0
torchaudio==2.1.0
# After: automatic compatibility
torch-stack[vision,audio]==2.1.0
In pyproject.toml
[project]
dependencies = [
"torch-stack[vision,audio]==2.1.0"
]
Available Extras
vision- Installs compatibletorchvisionaudio- Installs compatibletorchaudiotext- Installs compatibletorchtext
Python API (for package maintainers)
from torch_stack.resolver import VersionResolver
# Get compatible versions programmatically
torch_ver = "2.1.0"
vision_ver = VersionResolver.torchvision(torch_ver) # "0.16.0"
audio_ver = VersionResolver.torchaudio(torch_ver) # "2.1.0"
Supported Versions
- PyTorch 1.8+ through latest
- Handles version exceptions and edge cases
- CPU and CUDA installation support
No more PyTorch version hell 🎉
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 pytorch_stack-0.0.0.dev0.tar.gz.
File metadata
- Download URL: pytorch_stack-0.0.0.dev0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26b756a8494e65058fd8d2756becda8e5d704cca3a806665a859913b7da1a2d1
|
|
| MD5 |
6469a6e3961191faa2af11195aae28c0
|
|
| BLAKE2b-256 |
f5f7db37c5f50e6a00a73c9c753168c4b642e90e1b58700f0ad26b06dacb2478
|
File details
Details for the file pytorch_stack-0.0.0.dev0-py3-none-any.whl.
File metadata
- Download URL: pytorch_stack-0.0.0.dev0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a195a817015d5ba1179b04189ce5833759132ec3b5a775bed42fc9b9e174388a
|
|
| MD5 |
697d5a086164155e09f6e262462e3aef
|
|
| BLAKE2b-256 |
5c404ac4aa61241ba1d7b8dd67ed24cc1584a69e6b095c430d2011ec926c9a44
|