Repository navigation
[FlyDSL] AOT: prebuild the fused-quant entry of the batched mxscale GEMM - #8702
Conversation
The batched table has two public entries: batched_gemm_a8w8_mxscale_bpreshuffle (bf16) and its _fused_quant twin, which fuses the output's group-32 MXFP8 quant into the epilogue. fuse_quant_out is a Constexpr, so the twin is another kernel of the same row, and the replay only called the bf16 entry: every fused launch missed the cache and traced on the JIT path (DeepSeek-V4.1 wo_a on gfx950). Replay the fused entry as a variant of each batched row. It runs FlyDSL at an OPUS row as well (the runner's own pick), so those rows get the variant too. Co-Authored-By: Claude Fable 5.2 <[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 |
Co-Authored-By: Claude Fable 5.2 <[email protected]>
…again; keep main's fused-quant and FlyDSL-only AOT variants alongside the decode strided_a variant. The one conflict was in _variants of aiter/aot/flydsl/gemm.py, where main (#8702) added the batched GEMM fused-quant entry and the rule that non-FlyDSL rows have no variant, and this branch added the strided_a variant for decode rows with M > 1. Decode rows are FlyDSL rows, so both apply: the AOT replay of the Kimi-K3 bf16 CSV still lists all 154 decode rows, with a strided_a job for each M > 1 row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
ATOM's DeepSeek-V4.1 accuracy job on gfx950 logs, for every model runner:
16 distinct keys x 8 GPUs, all B=2, N=1024, K=4096, 32x32 w_scale, and all with
fuse_quant_out=True. Nothing fails (a miss traces on the JIT path), but each process pays the compiles at warmup.Cause
The batched table has two public entries:
batched_gemm_a8w8_mxscale_bpreshuffle(bf16) andbatched_gemm_a8w8_mxscale_bpreshuffle_fused_quant(#8101).fuse_quant_outis a Constexpr, so the fused entry launches another kernel of the same tuned row.aiter/aot/flydsl/gemm.pyreplayed only the bf16 entry, so no fused kernel was ever prebuilt.--checkcould not see it either: it checks only what the replay itself requests.Fix
Replay the fused entry as a caller-side variant of each batched row, as
_variantsalready does for the output dtype of the FP32 blockscale GEMMs. The fused entry runs FlyDSL at an OPUS row as well (the runner's own pick), so those rows get the variant too; they still get no bf16 job.Verification
test_batched_rows_replay_the_fused_quant_entry_too;tests/test_flydsl_aot_replay.py: 30 passed.python -m aiter.aot.flydsl.gemmbuild with compilation.Cost
Identify-only count over the gfx950 rows of
dsv4_batched_gemm_a8w8_blockscale_mxscale_bpreshuffle_tuned.csv(row ends plus bisection): the bf16 jobs request 202 distinctbmm_a8w8_mxscale_gfx950launchers; the fused variant adds 192 (95 for 128x128 w_scale, 97 for 32x32), 16 to 21 per (B, w_scale block). On gfx1250 the fused variant requests 5 kernels at the 32x32 rows' own M; the 20 128x128 rows have no fused epilogue there and are reported as[SKIP].Open question for review: ATOM calls the fused entry for DeepSeek-V4.1 (32x32) only. Restricting the variant to 32x32 rows would halve the added kernels, at the price of restating a caller's choice in the AOT module.
🤖 Generated with Claude Code