Skip to content

Blackwell Support聽#1395

Open
Open

Description

@HowToDoThis

馃悰 Bug

Command

Disclaimer: I'm not expert on this area, it should be fixes with proper ways

I wanted to play with webui dev branch (probably change to forge instead, gonna try future)
I can't build from pip and since its the efficient modules that can save memory while generating images, so I try to fix it to myself by building from sources

I created a environment with venv and torch installed, and here are the scripts

py -V:3.10 -m venv venv
call .\venv\Scripts\activate

# update pip to latest version
python -m pip install --upgrade pip

# build tools (setuptools < 82 due to others)
pip install setuptools<82 ninja

# tested torch-2.13.0.dev20260429
# --force-reinstall --no-deps
pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu132
pip install -U "triton-windows<3.7"

# init for ninja + nvcc
SET MAX_JOBS=1
SET NVCC_THREADS=5
SET FLASH_ATTN_CUDA_ARCHS=75;120
SET CUDA_ARCH_LIST=7.5+PTX
SET TORCH_CUDA_ARCH_LIST=%CUDA_ARCH_LIST%

# flash-attention init
SET DISTUTILS_USE_SDK=1
SET FLASH_ATTENTION_FORCE_BUILD=TRUE

git clone --single-branch --depth 1 --filter=blob:none https://github.com/Dao-AILab/flash-attention.git src\flash-attention
cd src\flash-attention
git submodule update --init --recursive --depth 1 --filter=blob:none
# flash-attention 2
python setup.py install
# flash-attention 3 (not working, due to 128 alignment issue)
cd hopper
python setup.py install

# back to workdir
cd ../../../

git clone --single-branch -b v0.0.35 --depth 1 --filter=blob:none https://github.com/facebookresearch/xformers.git src\xformers
cd src\xformers
git submodule update --init --recursive --depth 1 --filter=blob:none
pip install --no-build-isolation -e .

after successfully installed xformers package, run with python -m xformers.info shows that fa2/fa3/blackwell was unavailable
I do trying to install flash-attn by installing from source (hopper/fa3 I can't build with CUDA v13.1 for now, there is issues while building, finding a way to fix it) and now shows with

(venv) D:\AI\src\xformers>python -m xformers.info
xFormers 0.0.35+03b91d7.d20260430
memory_efficient_attention.ckF:                    unavailable
memory_efficient_attention.ckB:                    unavailable
memory_efficient_attention.ck_splitKF:             unavailable
memory_efficient_attention.cutlassF-pt:            available
memory_efficient_attention.cutlassB-pt:            available
memory_efficient_attention.cutlassF-blackwell:     unavailable
memory_efficient_attention.cutlassB-blackwell:     unavailable
memory_efficient_attention.fa2F@2.8.4:             available
memory_efficient_attention.fa2B@2.8.4:             available
memory_efficient_attention.fa3F@0.0.0:             unavailable
memory_efficient_attention.fa3B@0.0.0:             unavailable
memory_efficient_attention.fa3F_splitKV@0.0.0:     unavailable
memory_efficient_attention.triton_splitKF:         available

then I get back to webui, generating image shows that my GPU are too new

so I found out that at too new appears related to CUDA_MAXIMUM_COMPUTE_CAPABILITY
and it shows that at xformers/ops/fmha/cutlass.py and xformers/ops/fmha/flash3.py written CUDA_MAXIMUM_COMPUTE_CAPABILITY = (9, 0)

then I patched both files with the line to CUDA_MAXIMUM_COMPUTE_CAPABILITY = (12, 0), reinstall with pip install --no-build-isolation -e .

now the image can be generated normally

hope that there is patches coming up

referenced:
#1356 (comment)

Environment

PyTorch version: 2.13.0.dev20260429+cu132
Is debug build: False
CUDA used to build PyTorch: 13.2
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Pro (10.0.26200 64-bit)

Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.26200-SP0
Is CUDA available: True
CUDA runtime version: 13.2.78
CUDA_MODULE_LOADING set to:
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 5070
Nvidia driver version: 596.21
cuDNN version: Could not collect

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions