File size: 3,750 Bytes
aa034eb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | ---
license: unlicense
tags:
- wheels
- pip
- flash-attention
- gpu
- build-cache
pretty_name: GPU Build Wheel Cache
---
# gpu-wheels
Personal cache of prebuilt Python wheels for packages that are slow to compile from source (flash-attn, etc.), so rented GPU instances (vast.ai and similar) don't have to recompile from scratch every time.
Compiling `flash-attn` from source can take 45-90 minutes. If a new instance has the **exact same** `torch` version, CUDA version, Python version, and C++ ABI as a wheel already in this repo, installing from the cached wheel takes seconds instead.
## Repo layout
```
<package>/torch<torch_version>-py<python_version>-cxx11abi<True|False>/<wheel_filename>.whl
```
Example:
```
flash-attn/torch2.12.0+cu130-py3.12-cxx11abiTrue/flash_attn-2.8.3.post1-cp312-cp312-linux_x86_64.whl
```
The folder name is the compatibility key. A wheel only works on an environment matching **all** of: package version, torch version (incl. CUDA suffix), Python version, and cxx11abi flag.
## Available wheels
| Package | Torch | CUDA | Python | cxx11abi | GPU built on | Path |
|---|---|---|---|---|---|---|
| flash-attn 2.8.3.post1 | 2.12.0 | 13.0 | 3.12 | True | RTX 3090 (sm86) | `flash-attn/torch2.12.0+cu130-py3.12-cxx11abiTrue/` |
CUDA kernel wheels are generally GPU-arch-agnostic across NVIDIA GPUs (they embed multiple SM targets), so a wheel built on one GPU normally works on others — the torch/CUDA/Python/ABI match is what matters, not the specific GPU model.
## Usage: install a cached wheel
```bash
pip install huggingface_hub
python3 -c "
from huggingface_hub import hf_hub_download
path = hf_hub_download(
repo_id='DanielTobi0/gpu-wheels',
repo_type='dataset',
filename='flash-attn/torch2.12.0+cu130-py3.12-cxx11abiTrue/flash_attn-2.8.3.post1-cp312-cp312-linux_x86_64.whl',
)
print(path)
"
pip install <path printed above>
```
Or in one line once you know the filename:
```bash
pip install "$(python3 -c "from huggingface_hub import hf_hub_download; print(hf_hub_download(repo_id='DanielTobi0/gpu-wheels', repo_type='dataset', filename='flash-attn/torch2.12.0+cu130-py3.12-cxx11abiTrue/flash_attn-2.8.3.post1-cp312-cp312-linux_x86_64.whl'))")"
```
**Before installing**, check your new instance's versions match the folder name:
```bash
python3 -c "import torch; print(torch.__version__, torch.version.cuda, torch._C._GLIBCXX_USE_CXX11_ABI)"
```
If they don't match, the wheel likely won't install (or worse, may install but be ABI-incompatible) — build fresh instead and add the new combo to this repo (see below).
## Adding a new wheel after a fresh build
1. Build normally (e.g. `pip install flash-attn --no-build-isolation`).
2. Locate the built wheel. With `uv`, it's cached under `~/.cache/uv/sdists-v9/pypi/<package>/<version>/*/*.whl`. With plain `pip`, add `--no-clean -v` or build explicitly with `pip wheel <package> --no-build-isolation -w /tmp/wheelhouse`.
3. Record your environment's compatibility key:
```bash
python3 -c "import torch; print(f'torch{torch.__version__}-py{__import__(\"platform\").python_version()[:4]}-cxx11abi{torch._C._GLIBCXX_USE_CXX11_ABI}')"
```
4. Upload:
```python
from huggingface_hub import HfApi
api = HfApi()
api.upload_file(
path_or_fileobj="/path/to/built.whl",
path_in_repo="<package>/<compat-key>/<wheel_filename>.whl",
repo_id="DanielTobi0/gpu-wheels",
repo_type="dataset",
)
```
5. Add a row to the table above.
## Notes
- This repo is **private** — wheels may be built against specific local paths/configs and aren't intended for public redistribution.
- Wheels are large (100-300MB+ for CUDA extensions); this is a personal cache, not a package index.
|