Repository navigation
fix(attention): zero empty decode rows in unified attention - #6566
XiaobingSuper wants to merge 1 commit into
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
Co-authored-by: Cursor <cursoragent@cursor.com>
a0d5fd0 to
09edafe
Compare
|
MiniMax-M3 decode on gfx1250 now goes through FlyDSL (ROCm/ATOM#2710), so it no longer reaches unified attention with zero-length padding rows. Closing; happy to reopen if the unified-attention fallback needs this. |
Summary
unified_attentionreturn deterministic zeros for all-decode rows whose KV length is zero[2048, 0, 0, 0]Root cause
CUDA-graph buckets can pad a decode batch with query rows whose
seqused_kvalue is zero. The gfx1250 3D Gluon path returns before writing those rows, leaving NaN/uninitialized output. Later model layers consume the padding values and can produce repeated or non-terminating generations.This was reproduced while bringing up MiniMax-M3 TP4 on MI455 for LLM-Booster #201 and the fallback in ATOM #1410. A standalone BF16 shuffled-cache check showed:
finite_by_row=[True, False, False, False]finite_by_row=[True, True, True, True]0.99999619Validation
test_unified_attention_zero_kv_decode_rows: passed0/8before ->3/8after; the same result holds with the ATOM-side workaround removedruff check: passedblack --check: passedDraft for correctness and performance review because the post-op mask adds a small decode kernel.