* Added conda/mamba section to blackwell installation readme * fix conda creation suffix and vllm install syntax |
||
|---|---|---|
| .. | ||
| blackwell.requirements.txt | ||
| README.md | ||
| test_llama32_sft.py | ||
| test_qwen3_grpo.py | ||
Unsloth Blackwell Compatibility
Overview
Blackwell (sm100+) requires all dependent libraries to be compiled with cuda 12.8.
The core libs for running unsloth which have dependencies on CUDA version are:
bitsandbytes- already has wheels built withCUDA 12.8sopip installshould work out of the boxtriton- requirestriton>=3.3.1torch- requires installing withpip install torch --extra-index-url https://download.pytorch.org/whl/cu128vllm- safest is to use the nightly build:uv pip install -U vllm --torch-backend=cu128 --extra-index-url https://wheels.vllm.ai/nightlyxformers- as of 6/26,xformerswheels are not yet built withsm100+enabled as support was only recently added so will require a source build (see below).
Installation
Using uv
The installation order is important, since we want the overwrite bundled dependencies with specific versions (namely, xformers and triton).
-
I prefer to use
uvoverpipas it's faster and better for resolving dependencies, especially for libraries which depend ontorchbut for which a specificCUDAversion is required per this scenario.Install
uvcurl -LsSf https://astral.sh/uv/install.sh | sh && source $HOME/.local/bin/envCreate a project dir and venv:
mkdir `unsloth-blackwell` && cd `unsloth-blackwell` uv venv .venv --python=3.12 --seed source .venv/bin/activate -
Install
vllmuv pip install -U vllm --torch-backend=cu128 --extra-index-url https://wheels.vllm.ai/nightlyNote that we have to specify
cu128, otherwisevllmwill installtorch==2.7.0but withcu126. -
Install
unslothdependenciesuv pip install unsloth unsloth_zoo bitsandbytes -
Download and build
xformers# First uninstall xformers installed by previous libraries uv pip uninstall xformers # Clone and build git clone --depth=1 https://github.com/facebookresearch/xformers --recursive cd xformers export TORCH_CUDA_ARCH_LIST="12.0" python setup.py installNote that we have to explicitly set
TORCH_CUDA_ARCH_LIST=12.0. -
Update
tritonuv pip install -U triton>=3.3.1triton>=3.3.1is required forBlackwellsupport. -
transformerstransformers >= 4.53.0breaksunslothinference. Specifically,transformerswithgradient_checkpointingenabled will automatically switch off caching.When using
unslothFastLanguageModeltogeneratedirectly after training withuse_cache=True, this will result in mismatch between expected and actual outputs here.Temporary solution is to switch off
gradient_checkpointing(e.g.,model.disable_gradient_checkpointing()) before generation if using4.53.0or stick with4.52.4for now:uv pip install -U transformers==4.52.4
Using conda or mamba
-
Install
conda/mambacurl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"Run the installation script
bash Miniforge3-$(uname)-$(uname -m).shCreate a conda or mamba environment
conda create --name unsloth-blackwell python==3.12 -yActivate newly created environment
conda activate unsloth-blackwell -
Install
vllmMake sure you are inside the activated conda/mamba environment. You should see the name of your environment as a prefix to your terminal shell like this your
(unsloth-blackwell)user@machine:pip install -U vllm --extra-index-url https://download.pytorch.org/whl/cu128 --extra-index-url https://wheels.vllm.ai/nightlyNote that we have to specify
cu128, otherwisevllmwill installtorch==2.7.0but withcu126. -
Install
unslothdependenciesMake sure you are inside the activated conda/mamba environment. You should see the name of your environment as a prefix to your terminal shell like this your
(unsloth-blackwell)user@machine:pip install unsloth unsloth_zoo bitsandbytes -
Download and build
xformersMake sure you are inside the activated conda/mamba environment. You should see the name of your environment as a prefix to your terminal shell like this your
(unsloth-blackwell)user@machine:# First uninstall xformers installed by previous libraries pip uninstall xformers # Clone and build git clone --depth=1 https://github.com/facebookresearch/xformers --recursive cd xformers export TORCH_CUDA_ARCH_LIST="12.0" python setup.py installNote that we have to explicitly set
TORCH_CUDA_ARCH_LIST=12.0. -
Update
tritonMake sure you are inside the activated conda/mamba environment. You should see the name of your environment as a prefix to your terminal shell like this your
(unsloth-blackwell)user@machine:pip install -U triton>=3.3.1triton>=3.3.1is required forBlackwellsupport. -
Transformerstransformers >= 4.53.0breaksunslothinference. Specifically,transformerswithgradient_checkpointingenabled will automatically switch off caching.When using
unslothFastLanguageModeltogeneratedirectly after training withuse_cache=True, this will result in mismatch between expected and actual outputs here.Temporary solution is to switch off
gradient_checkpointing(e.g.,model.disable_gradient_checkpointing()) before generation if using4.53.0or stick with4.52.4for now:Make sure you are inside the activated conda/mamba environment. You should see the name of your environment as a prefix to your terminal shell like this your
(unsloth-blackwell)user@machine:pip install -U transformers==4.52.4
If you are using mamba as your package just replace conda with mamba for all commands shown above.
Post Installation notes:
After installation, your environment should look similar to blackwell.requirements.txt.
Note, might need to downgrade numpy<=2.2 after all the installs.
Test
Both test_llama32_sft.py and test_qwen3_grpo.py should run without issue if correct install. If not, check diff between your installed env and blackwell.requirements.txt.