Skip to content

Conversation

@rwfsmith
Copy link

@rwfsmith rwfsmith commented Jan 22, 2026

Some pretty simple changes to get bitsandbytes to build for AMD ROCm on Windows. I've been running this for a few days for inference and training, and it seems to be working well. Running unit tests now.

How to build this:

Clone repo

# Install bitsandbytes from source
# Clone bitsandbytes repo
git clone https://github.com/bitsandbytes-foundation/bitsandbytes.git && cd bitsandbytes/

Build and install

Build doesn't work with the Visual Studio compiler, so make sure ROCM_HOME is set to your ROCm root folder and that Ninja is installed
This should work with ROCm 7.1.1 or newer, including the TheRock nightly builds

PowerShell

cmake -B build -G Ninja `
-DCOMPUTE_BACKEND=hip -DCMAKE_BUILD_TYPE=Release `
-DCMAKE_CXX_COMPILER="$($env:ROCM_HOME)/lib/llvm/bin/clang++.exe" `
-DCMAKE_HIP_COMPILER="$($env:ROCM_HOME)/lib/llvm/bin/clang++.exe" ` 
-DCMAKE_PREFIX_PATH="$($env:ROCM_HOME)" `
-DBNB_ROCM_ARCH="gfx1151"

cmake --build build --config Release

Cmd

cmake -B build -G Ninja ^
-DCOMPUTE_BACKEND=hip ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_CXX_COMPILER="%ROCM_HOME%/lib/llvm/bin/clang++.exe" ^
-DCMAKE_HIP_COMPILER="%ROCM_HOME%/lib/llvm/bin/clang++.exe" ^
-DCMAKE_PREFIX_PATH="%ROCM_HOME%" ^
-DBNB_ROCM_ARCH="gfx1151"

cmake --build build --config Release

Then install


pip install -e .

or

pip wheel -e . -w dist

resolves #1844

@rwfsmith
Copy link
Author

164 unit tests failed, seems to be accuracy issues with test_gemv_4bit

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Windows for ROCm Builds

1 participant