Skip to content

Build flash-attn ourselves to fix missing Blackwell support - #6

Open
MarioSieg wants to merge 2 commits into
mainfrom
flash-attn-blackwell
Open

Build flash-attn ourselves to fix missing Blackwell support#6
MarioSieg wants to merge 2 commits into
mainfrom
flash-attn-blackwell

Conversation

@MarioSieg

Copy link
Copy Markdown
Member

Summary

  • The flash-attn wheel prime-rl consumes (from mjun0812/flash-attention-prebuild-wheels) is built against CUDA 12.6, which predates the CUDA 12.8 floor flash-attn's own setup.py requires before it emits sm_100/sm_120 gencodes.
  • Confirmed via cuobjdump --list-elf on the actual pinned wheel: it only contains sm_80/sm_90 cubins and no PTX, so flash_attention_2 hard-fails on every Blackwell GPU — including workstation Blackwell (SM120), which resolve_auto_attn in prime-rl explicitly falls back to FA2 for.
  • Adds flash-attn as a 5th kernel in this repo's build matrix (same pattern as deep-ep/deep-gemm/torchao), building the upstream v2.8.3 tag from source against our CUDA 12.9 container with FLASH_ATTN_CUDA_ARCHS=80;90;100;120.

Test plan

  • Built locally against CUDA 12.8 (satisfies the same >= 12.8 floor as CI's 12.9) — verified with cuobjdump that the resulting wheel contains real sm_80/sm_90/sm_100/sm_120 cubins (the old wheel had none of the last two).
  • Ran a real forward flash_attn_func call on an actual B200 (SM100) GPU against the new wheel — succeeded.
  • CI build (matrix now includes flash-attn for both x86_64/aarch64)

🤖 Generated with Claude Code

MarioSieg and others added 2 commits August 28, 2026 22:57
The mjun0812/flash-attention-prebuild-wheels build prime-rl consumed is built
against CUDA 12.6, which predates the 12.8 floor flash-attn's setup.py requires
before it emits sm_100/sm_120 gencodes. Confirmed via cuobjdump: that wheel only
ever contained sm_80/sm_90 cubins and no PTX, hard-failing flash_attention_2 on
every Blackwell GPU (the fallback path for workstation Blackwell/SM120 in
resolve_auto_attn). Building v2.8.3 from source here, against our CUDA 12.9
container with FLASH_ATTN_CUDA_ARCHS=80;90;100;120, produces a wheel with real
sm_80/90/100/120 cubins (verified locally on a B200).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Both arches OOM-killed (exit 137) within 2 minutes. flash-attn's own
NinjaBuildExtension throttles job count from actual free memory, but only
when MAX_JOBS is unset -- our shared convention of always setting MAX_JOBS=8
disabled that safety check, and with 4 archs baked into every gencode list
each nvcc job peaks far above the ~8-9GB flash-attn's own heuristic assumes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant