Skip to content

Add ROCm CDNA5 (gfx1250) support - #2023

Merged
matthewdouglas merged 1 commit into
bitsandbytes-foundation:mainfrom
zjin-lcf:feat/gfx1250-cdna5-support
Jul 28, 2026
Merged

Add ROCm CDNA5 (gfx1250) support#2023
matthewdouglas merged 1 commit into
bitsandbytes-foundation:mainfrom
zjin-lcf:feat/gfx1250-cdna5-support

Conversation

@zjin-lcf

@zjin-lcf zjin-lcf commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds ROCm CDNA5 (gfx1250) support to bitsandbytes.

  • Include gfx1250 in the ROCm 7.14+ build architecture list (.github/scripts/build-rocm.sh).
  • Add an IS_CDNA5 macro (gfx1250/gfx1251) in csrc/common.cuh. CDNA5 runs in Wave32 mode and is deliberately kept out of IS_CDNA (Wave64), so the default warp size stays 32 (unchanged from upstream).
  • Route CDNA5 into the fp32-FMA 4-bit GEMM path (IS_CDNA || IS_CDNA5) rather than the RDNA v_dot2 path, which CDNA5 does not implement (no dot12-insts / v_dot2_f32_* builtins — they fail to compile for gfx1250).
  • Route gfx125x through the existing gfx12 SIMT-vs-dequant crossover (M<=8) in bitsandbytes/backends/cuda/ops.py; dedicated calibration is left as a follow-up.
  • Document gfx1250 in README.md and docs/source/installation.mdx.

Rationale

Despite its gfx125x target number, CDNA5 behaves like CDNA (Wave32 but no SIMT dot instructions), so it needs the fp32-FMA math path for correct/accurate bf16/fp16 4-bit GEMM rather than the RDNA v_dot2 path.

Test plan

  • Build with ROCm 7.14+ including gfx1250 in the arch list.

- Include gfx1250 in the ROCm 7.14+ build architecture list.
- Add IS_CDNA5 macro (gfx1250/gfx1251). CDNA5 runs in Wave32 mode and is
  kept out of IS_CDNA (Wave64) so the default warp size stays 32.
- Route CDNA5 into the fp32-FMA 4-bit GEMM path (IS_CDNA || IS_CDNA5)
  rather than the RDNA v_dot2 path, which CDNA5 does not implement.
- Route gfx125x through the existing gfx12 SIMT-vs-dequant crossover
  (M<=8); dedicated calibration left as follow-up.
- Document gfx1250 in README and installation docs.
@zjin-lcf
zjin-lcf force-pushed the feat/gfx1250-cdna5-support branch from 8fc8337 to 092e9bf Compare July 27, 2026 22:40
@matthewdouglas matthewdouglas added this to the v0.50.1 milestone Jul 28, 2026
@github-actions

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@matthewdouglas

Copy link
Copy Markdown
Member

LGTM, thanks!

@matthewdouglas
matthewdouglas merged commit 4e007ec into bitsandbytes-foundation:main Jul 28, 2026
86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants