Repository navigation
[FlyDSL] [gfx1250] Pass arg_scale_out on every cached launch_gemm_a8w8 launch - #7920
Conversation
…8 launch #7178 appended the defaulted runtime pointer arg_scale_out to launch_gemm_a8w8. Only the first launch of a specialization goes through flyc.compile, which applies signature defaults; later launches call the cached CompiledFunction positionally, and it reads each runtime argument by its signature index. The dense mxfp8_128 / mxfp8_32, ptpc and batched mxfp8_128 wrappers stop before arg_scale_out, so their second launch raised IndexError: tuple index out of range (DeepSeek-V4-Pro wqkv_a during CUDA graph capture). Pass the trailing b_scale_32x32 / k_tail constexprs and arg_scale_out explicitly, as the batched mxfp8_32 wrapper already does, and cover each wrapper's cached second launch in test_gemm_host_dispatch_cache.py. Co-authored-by: Cursor <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
test_gemm_a8w8_mxfp8_bpreshuffle.py and test_flydsl_batched_gemm.py already fail on gfx1250 without the fix. Co-authored-by: Cursor <[email protected]>
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 |
|
LGTM. The missing parameters have been filled in. |
Resolve the memory-path _launch_gemm_a8w8 call in the mxfp8 dense runner by keeping main's k_tail and arg_scale_out (#7920) and passing w_scale_32x32 as b_scale_32x32.
Summary
Fix
IndexError: tuple index out of rangeon the second launch of the gfx1250 FlyDSLlaunch_gemm_a8w8wrappers. It breaks DeepSeek-V4-Pro on main during CUDA graph capture (layers.1.attnwqkv_a).Motivation
#7178 appended a defaulted runtime pointer,
arg_scale_out, tolaunch_gemm_a8w8._run_compiledsends only the first launch of a specialization throughflyc.compile, which applies signature defaults. Every later launch calls the cachedCompiledFunction, which applies no defaults: it reads each runtime argument by signature index from the positional tuple.arg_scale_outis parameter 31, and three wrappers stop earlier:mxfp8_bpreshuffle_gemm_gfx1250.py, non compute-bound)IndexErrorbpreshuffle_gemm_gfx1250.py)IndexErrorbatched_gemm_a8w8_gfx1250.py)IndexErrorThe batched mxfp8_32 wrapper, the one #7178 changed, already passes
arg_scale_out. DeepSeek-V4-Pro on main, all four ranks:Changes
The three wrappers now pass the trailing
b_scale_32x32/k_tailconstexprs andarg_scale_outexplicitly, as the batched mxfp8_32 wrapper does. The pointer isOutand is not read withoutfuse_quant_out. Constexpr values and specialization keys do not change, so the kernels, and the FlyDSL AOT cache built for them, stay the same.No other
@flyc.jitlauncher inaiter/ops/flydslhas a defaulted runtime parameter that a caller leaves out.Testing
On MI455X (
gfx1250), inrocm/fw-bringup-mlperf:gfx1250-atom-20261111with ATOM main373a27fband aiter main40565597(FlyDSL 0.5.0):python3 op_tests/test_gemm_a8w8_mxfp8_bpreshuffle.pyIndexErrorpython3 op_tests/test_flydsl_batched_gemm.pyIndexErrortest_batched_gemm_a8w8_mxscale_bpreshuffle.py,test_gemm_group32_interface.py,test_bmm_a8w8_fused_quant_supported.py,test_gemm_host_dispatch_cache.pypython3 -m aiter.aot.flydsl.gemm, gfx1250 rows of the DeepSeek-V4 dense mxfp8_128 / mxfp8_32 / batched mxfp8_128 tables and the MiniMax-M3 ptpc table)--checkagainst the cache built from main passes455-CI-recipe.md: DP4 attention + EP4 MoE, CUDA graphs)IndexErrorwhile capturing bs=512Existing tests already cover the fix: the first two fail on
gfx1250without it, so this PR adds no test. A standalone run that launches each of the four wrappers twice also matches a dequantized torch reference (cosine 0.999999) on both launches.Black and Ruff (0.16.0) pass.
Documentation
Dependencies
Breaking Changes
None.
PR Self-Review
Reviewed revision
ed35fe7fba46f1433ed2fcd6658c9e2d0e09dcb8Behavior and intent
Second and later launches of the dense mxfp8_128 / mxfp8_32, ptpc and batched mxfp8_128 gfx1250 GEMMs get every runtime argument and run the kernel the first launch compiled. Before, they raised
IndexError. The first launch and the kernels are unchanged.Validation and unverified scope
See Testing. MI250X and MI300X were not tested because all changed wrappers are gfx1250-only. DeepSeek-V4-Pro also needs #7924 to finish CUDA graph capture.
PR-specific question
op_tests/test_gemm_a8w8_mxfp8_bpreshuffle.pyandop_tests/test_flydsl_batched_gemm.pyfail ongfx1250without this PR and pass with it.Changed op tests
None.