Repository navigation
[FlyDSL] Fix attention A2A MX Q-scale backing for mha_v4 query-tile gather - #7804
Conversation
…ather #6575 made the mha_v4 launcher require MX Q descales to be backed out to a whole 256-row query tile (check_scale_backing_storage), but the fused intranode A2A op (#5815) still allocated packed Q scales unpadded. Whenever world_size * sequence is not a multiple of 256, feeding its packed MX Q scales to mha_v4 failed, e.g. in test_attention_a2a.py e4m3_pc at ws=4 s=1184 h=8: MX Q descale needs 38912 mapped bytes ... but only 37888 are backed Reserve the same zeroed slack as mha_v4_quant.query_block_scale for mxfp4/mxfp6/mxfp8 Q scales in packed return. Logical shape and strides are unchanged; aligned sequences and non-MX Q codecs get no padding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
…ather (#7804) #6575 made the mha_v4 launcher require MX Q descales to be backed out to a whole 256-row query tile (check_scale_backing_storage), but the fused intranode A2A op (#5815) still allocated packed Q scales unpadded. Whenever world_size * sequence is not a multiple of 256, feeding its packed MX Q scales to mha_v4 failed, e.g. in test_attention_a2a.py e4m3_pc at ws=4 s=1184 h=8: MX Q descale needs 38912 mapped bytes ... but only 37888 are backed Reserve the same zeroed slack as mha_v4_quant.query_block_scale for mxfp4/mxfp6/mxfp8 Q scales in packed return. Logical shape and strides are unchanged; aligned sequences and non-MX Q codecs get no padding. Co-authored-by: TennyWang1223 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…kreduce-sp-rs-ag Brings in #7804, which makes the attention A2A op reserve the MX Q-scale slack that the mha_v4 query-tile gather requires. Without it, op_tests/multigpu_tests/test_attention_a2a.py fails in the 8-GPU job. No conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Rony Leppänen <[email protected]>
Summary
Fixes the main-branch Multi-GPU CI failure in
op_tests/multigpu_tests/test_attention_a2a.pyon MI350X. The fused intranode A2A op now reserves the zeroed 256-row query-tile slack that the mha_v4 launcher requires behind packed MX Q scales.Motivation
#6575 made the mha_v4 launcher check that MX Q descales are backed out to a whole 256-row query tile (
check_scale_backing_storageincsrc/py_itfs_cu/asm_mha_v4_fwd.cu). The A2A op from #5815, merged before #6575, still allocates packed Q scales unpadded (its comment said "Q scales are unpadded since #6841"). Wheneverworld_size * sequenceis not a multiple of 256, passing its packed MX Q scales to mha_v4 fails. For example,e4m3_pcat ws=4, s=1184, h=8 (CI run 42930574634):Changes
aiter/ops/flydsl/attention_a2a_intranode.py_scale_padding_size: for role Q withmxfp4/mxfp6/mxfp8in packed return, add(ceil(seq/256)*256 - seq) * heads_local * 4bytes of slack. This matchesmha_v4_quant.query_block_scale(batch is 1 and head_dim is 128, which the op already enforces).Testing
Documentation
This is an internal allocation fix with no API change.
Dependencies
Breaking Changes
None
PR Self-Review
Reviewed revision
e340012
Behavior and intent
Packed MX Q scales returned by
AttentionA2AIntraNodeOpnow carry the zeroed query-tile slack that mha_v4 requires. They can be consumed directly bymha_v4_packedfor any sequence length, which is what the op's packed return is for.Validation and unverified scope
e4m3_pc) and the other packed MX / v4-consumer recipes are gfx950-only, and the only machine I had was gfx942. I'm relying on this PR's Multi-GPU (MI350X) CI job to verify the fix. That run also covers the gfx950 recipes aftere4m3_pc, which never ran on main because the test exits at the first failure.PR-specific question
To be answered after the automated PR Self-Review comment.
Changed op tests
None
🤖 Generated with Claude Code