Skip to content

Commit cb845fe

Browse files
authored
[README] Add instructions to build torch for Blackwell (#5727)
1 parent b39c1e1 commit cb845fe

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

README.md

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,68 @@ You can install the latest stable release of Triton from pip:
2222
pip install triton
2323
```
2424

25-
Binary wheels are available for CPython 3.8-3.12 and PyPy 3.8-3.9.
25+
Binary wheels are available for CPython 3.9-3.13.
2626

27-
And the latest nightly release:
27+
# Enabling Blackwell Support
2828

29-
```shell
30-
pip install -U --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/Triton-Nightly/pypi/simple/ triton-nightly
29+
The main branch now features support for NVIDIA Blackwell GPUs using 5th
30+
generation tensor cores. To enable this, you will need two additional steps:
31+
32+
1. Build a pre-release PyTorch from source with CUDA 12.8
33+
2. Build triton from the latest source
34+
35+
36+
First, to build pytorch you need to have CUDA 12.8 installed locally. If not,
37+
follow the [instructions for your platform](https://developer.nvidia.com/cuda-downloads)
38+
```bash
39+
# Clone and checkout pytorch 2.6 release candidate
40+
git clone https://github.com/pytorch/pytorch
41+
cd pytorch
42+
git checkout v2.6.0-rc9
43+
git submodule sync
44+
git submodule update --init --recursive -j 8
45+
46+
# Install build dependencies (assumes you already have a system compiler)
47+
pip install -r requirements.txt
48+
pip install mkl-static mkl-include wheel
49+
50+
# Build PyTorch (will take a long time)
51+
export CUDA_HOME=/usr/local/cuda-12.8
52+
export CUDA_PATH=$CUDA_HOME
53+
export TORCH_CUDA_ARCH_LIST=Blackwell
54+
python setup.py develop
55+
56+
# Optional, package build into a wheel to install on other machines.
57+
python setup.py bdist_wheel
58+
ls dist # Wheel should be output in this directory
3159
```
3260

61+
Note that if you use the domain libraries (`torchvision`, `torchtext`,
62+
`torchaudio`, etc.) these will need to be built from source as well, otherwise
63+
their custom PyTorch extensions will not work.
64+
65+
Finally, follow the instructions below to install triton from source.
66+
3367
# Install from source
3468

3569
```shell
36-
git clone https://github.com/triton-lang/triton.git;
37-
cd triton;
70+
git clone https://github.com/triton-lang/triton.git
71+
cd triton
3872

39-
pip install ninja cmake wheel pybind11; # build-time dependencies
73+
pip install ninja cmake wheel pybind11 # build-time dependencies
4074
pip install -e python
4175
```
4276

4377
Or with a virtualenv:
4478

4579
```shell
46-
git clone https://github.com/triton-lang/triton.git;
47-
cd triton;
80+
git clone https://github.com/triton-lang/triton.git
81+
cd triton
4882

49-
python -m venv .venv --prompt triton;
50-
source .venv/bin/activate;
83+
python -m venv .venv --prompt triton
84+
source .venv/bin/activate
5185

52-
pip install ninja cmake wheel pybind11; # build-time dependencies
86+
pip install ninja cmake wheel pybind11 # build-time dependencies
5387
pip install -e python
5488
```
5589

0 commit comments

Comments
 (0)