Repository navigation
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
28d1732 to
8810af9
Compare
|
Rebased onto the current #7668 head Rebase conflict. #7667 now has a gfx1250 run at All 11 buckets have 0 scale mismatches and at most a one-code e4m3 difference, as before the rebase. Description is updated with the PR Self-Review section (Reviewed revision |
0f8a0db to
d3c9932
Compare
|
Rebased onto #7668's new head The tiles in gfx1250 at |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (6)
- Reject
swiglu_limit <= 0and non-finite limits inrun_gate_up_silu_mxfp8_32_gfx1250, or give0the no-clamp meaning. In aitersilu_and_mul,0means "no clamp" and a negative limit is rejected (activation_kernels.cu:1450-1453). The fused_actalways clamps, solimit=0returns all zeros, a negative limit returns garbage, andinfraisesOverflowErrorinint(act_limit * 1000)(kernels/gemm_a8w8_gfx1250.py:316). Probe:probe/probe_limit0.py. ATOM #3446 only avoids this because it checksswiglu_limit > 0itself. That is a copy of an aiter rule on the consumer side. Also fix the "bit-matching ... silu_and_mul" docstring (batched_gemm_a8w8_gfx1250.py:795-797) and the "all ... bit-matching" kernel comment. Your own test allows one-code e4m3 differences. - Make the picker safe to call from a traced forward. ATOM calls
gate_up_silu_kernel_forinsidetorch.compile. Dynamo ignoreslru_cacheand traces intoparse_bmm_mx32_kernel_name. With symbolic M andfullgraph=True, it fails atre.Match.groupdict(probe/probe_picker.py). Precompute the bucket table as plain ints at import (no regex at call time). Also add atorch_compile_guardop with a fake for the launch inaiter/ops/batched_gemm_op_a8w8.py, declaringOutandy_scale_outas mutated, so callers do not launch raw FlyDSL from a traced region. - Pin the K loop in
_GATE_UP_SILU_TILESinstead of inheriting #7668's default pick. All 8 tiles currently resolve topipelined=1only throughdefault_pipelined_k_loop(). #7668 has changes requested to remove that rule. Write_pl(or_nopl) explicitly on each tile, matching the loop you timed. - Return
Nonefromgate_up_silu_kernel_forfor shapes that were never measured, or move the table into a tuned CSV. The comment says the buckets were measured only at 2I=4608, K=5120. The function still returns a tile for any divisible shape, e.g.(512, 3072, 7168). It also ignorescu_num. Other mxscale bmm entries read(gfx, cu_num, M, N, K)rows fromaiter/configs. - Add CPU tests, and make the gfx1250 test unable to pass vacuously. No CI job runs
test_gate_up_silu_fused: the standard shards are MI35X/gfx950, and the FFM label only runstriton_tests. Add CPU cases next toop_tests/test_gemm_host_dispatch_cache.pyfor the picker buckets and rejections,gate_up_silu_kernel_ok, and the limit and shape validation. In_run_gate_up_silu, fail if no bucket returned a kernel. - Land #7667, then #7668, then rebase. Both are open with changes requested. Only
d3c99322abelongs to this PR.
Optional: parenthesise far in the test ((... != 0) | (... > 1)). It works today only because | binds tighter than >. Use round() (or repr) for the _silu suffix. Use get_gfx_runtime() for the dispatch gate (aiter/ops/flydsl/AGENTS.md:40). Share the scale-row store and the e4m3 TDM store with the existing accumulator-quant epilogue.
The gather strides, [g,g,u,u] lane mapping, amax shuffle, LDS sizes and OOB guards all check out. The default path is unchanged: everything is behind const_expr(fuse_act_mul), and existing names are unchanged. CI: MI35X shard 4 died in the middle of test_gemm_a8w8_blockscale.py, which this PR does not touch, and the Test Gate fails because of that shard.
Reviewed at d3c9932 (own commit only; stacked on #7668 @ 292a532 / #7667 @ 6807132).
|
Thanks for the review. All six points and the optional items are addressed in
Optional items: Validation: CPU (no GPU visible) |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (3)
-
Move the per-M tile choice inside the registered op, and stop calling
gate_up_silu_kernel_for"safe in a traced forward". The picker picks the bucket with Python compares onm(aiter/ops/flydsl/batched_gemm_a8w8_gfx1250.py:809-827). That is only correct while Dynamo re-checks guards. ATOM compiles the forward once at--level 3(the default) and then reruns the first compiled code for every M without checking guards (atom/utils/decorators.py:546-589).- ATOM's warmup first M is
max_num_batched_tokens(16384 > 4096). The picker returns None there, so the fused path is never taken. - With DP8 the first M is 2048, so the t192x128 tile runs for every M, including M > 4096.
- Both cases were reproduced on CPU with ATOM's bytecode-hook and code-swap mechanism. Numerics stay correct; the feature is dead or mis-tiled.
- Fix: let
gate_up_silu_mxfp8_32/run_*pick the tile from the runtimeXQ.shape[0]whenkernel_nameis None, and give callers a query that does not depend on M (arch, CU count,(n2, k)). The M > 4096 split then has to be decided inside the op as well. - Also,
kernel_name or GATE_UP_SILU_DEFAULT_KERNEL(:886) silently runs the default tile when it gets the picker's None. The op docstring (batched_gemm_op_a8w8.py) tells callers to pass exactly that value. - This came from my earlier ask #2; sorry for steering it there.
- ATOM's warmup first M is
-
Validate XQ/WQ like the sibling runner does.
run_gate_up_silu_mxfp8_32_gfx1250(:869-905) hard-codeslda = kand passes rawdata_ptrs, but never checks:- XQ/WQ element size or dtype;
XQ.stride() == (k, 1);WQ.is_contiguous();- Out dtype (it checks only
element_size()).
A bf16 XQ, a row-strided fp8 XQ view or a non-contiguous WQ launches and silently writes wrong activations (CPU probe). Reuse the checks in
_check_bmm_operands(:399-459). -
Land #7667, then #7668, then rebase. Both are still open with changes requested. Only
d3c99322aanda484d81c0belong to this PR.
Also before merge: run op_tests/test_flydsl_batched_gemm.py on gfx1250 at this head. The refactor of the existing accumulator fused-quant epilogue (_quant_group_to_lds / _store_quant_tile) reads op-for-op identical to the base, but it has not run on its only arch, and no CI runner covers it.
Nits:
_actclamps the gate in f32.silu_and_mulroundsfminf(g, L)back to bf16 (activation_kernels.cu:80-83), so limits that bf16 cannot represent exactly (7.3, 1e-3) differ on clamped elements, while the docstring/comment blames only exp/rcp. Either round the clamped gate to bf16 or fix the text. L = 10 and L = 0 are unaffected.- The
_silu{repr}qsuffix gets a+for limits ≥ 1e16 (1e+16), andformat_kernel_namemaps only-. llvm-mc rejects that symbol. Map+too. _gate_up_silu_device_measuredcatches onlyRuntimeError, so KeyError (unknown arch), AssertionError (mixed CU counts) and ValueError (badCU_NUM) escape the picker instead of returning None.
Already fixed: limit semantics (0 = no clamp; negative/NaN rejected; inf allowed), _pl pins, None for unmeasured shapes and CU counts, CPU host test (collected by the standard shards), gfx1250 test can no longer pass vacuously, far, repr suffix, get_gfx_runtime, shared quant helpers. CI: the MI35X shards fail in "Run the container" after about 1.5 min (infra, not this PR). No gfx1250 runner.
Reviewed at a484d81 (Deep; full A–C on own commits d3c9932 + a484d81, stacked on unmerged #7668 @ 292a532 / #7667 @ 6807132; 6 hunters, 2 verifiers + C2). Already fixed: r40 asks 1, 3, 4, 5 and all optional items; ask 2 fixed as asked but see 1.
|
Thanks. All three points and the nits are addressed in
On running Nits:
Other validation: CPU host test passes (black 26.10.1, ruff clean). On gfx950, |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (3)
- Round the clamped gate to bf16 in
_act, or stop promising "the same scales".aiter/ops/flydsl/kernels/gemm_a8w8_gfx1250.py:1440-1441clamps the gate in f32 (minnumf(g, L)).silu_and_mulroundsfminf(g, L)to bf16 (csrc/kernels/activation_kernels.cu:78-83). This was my r42 nit; the new text names the f32 clamp but still says "the same scales and the same e4m3 codes up to one step" (batched_gemm_a8w8_gfx1250.py:880, andop_tests/test_flydsl_batched_gemm.py:636: "e8m0 scales must match exactly").- That is false for limits bf16 cannot hold. Example: L = 7.49 (bf16 7.5) with a saturated element. The kernel gives 56.0 and the reference gives 56.25, so e8m0 is 124 vs 125. The group's scale halves and all 32 e4m3 codes move by a binade. L = 5.02 and 5.14 flip it the other way. About 0.2% of non-bf16 L in [0.5, 64] hit this (CPU probes, two verifiers).
- L = 10 and L = 0 are unaffected, which is all the tests use.
- Fix:
g = fx.Float32(fx.minnumf(g, lim)).to(out_cls).to(fx.Float32). That is one cvt and gives bit-equal clamp semantics for every L. Then add a non-bf16 limit (e.g. 5.02) toGATE_UP_SILU_LIMITS.
- Make the M=1 case of
test_gate_up_silu_fusedcarry data, then runop_tests/test_flydsl_batched_gemm.pyon gfx1250 at this head. At m = 1,x[: max(m//8,1)] *= 8,x[m//4 : …] *= 1e-3andx[m - 1] = 0all hit row 0 (op_tests/test_flydsl_batched_gemm.py:651-653). The only 1-row (decode) check is therefore all zeros against all zeros, including the op-vs-launch compare. No other M leaves a 1-row last tile. Guard the zero row withif m > 1. The description still says "gfx1250 validation pending". That run is also the only check of the refactored accumulator fused-quant epilogue (_quant_group_to_lds/_store_quant_tile), which is an existing gfx1250 path. - Land #7667, then #7668, then rebase. Both are still open with changes requested. Only
d3c99322a,a484d81c0and7aa707829belong to this PR.
Nits:
gate_up_silu_limitchecks the Python double. A limit in (0, ~7e-46) is accepted, and the kernel takes the clamp branch with an f32 bound of 0, so every activation is 0.silu_and_mulgets0.0fand does not clamp. Comparenp.float32(limit) > 0instead (batched_gemm_a8w8_gfx1250.py:848-859).test_flydsl_batched_gemm.pymain()never runs_run_gate_up_siluongfx1250-strict: it returns early in theepilogue_onlybranch (:801, :866-873)._GFX1250_ARCHSstill serves that arch.- "Above the last bound the 2-D compute GEMM … was faster" (
:737-740) and "past MAX_ROWS … computes the same values" (op and launch docstrings) have no measurement or GPU run past M = 4096. Say "not measured" instead.
Pre-existing: the launch, like _check_bmm_operands, never checks that all operands are on XQ's device or that base pointers are 16-byte aligned for TDM (a4w4_mxscale_bpreshuffle_gemm_gfx1250.py does). ATOM #3446 is not exposed.
Already fixed (r42): ask 1 (the tile is picked from runtime rows inside the launch and op, :823-846 / :931; gate_up_silu_supported; functional op batched_gemm_op_a8w8.py:532-578; default kernel removed), ask 2 (operand checks, :897-930), the + in the symbol (kernels/…:325), device-check exceptions (:809). CI: shard 5 fails in test_flydsl_allreduce_rank_agreement.py, which this PR does not touch, and the Test Gate fails on that shard. The new host test passes in shard 6.
Reviewed at 7aa7078 (Deep; full A–C on own commits d3c9932..7aa7078, stacked on #7668 @ 292a532 / #7667 @ 6807132; 4 hunters + 4 verifiers + C2). Already fixed: r42 asks 1, 2, nits 2 and 3; nit 1 only half (text).
|
Thanks. Addressed in
Nits:
Validation:
Description and Self-Review are updated. |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (2)
- Run
op_tests/test_flydsl_batched_gemm.pyon gfx1250 at this head (r44 ask 2, second half). The kernel change in_act(aiter/ops/flydsl/kernels/gemm_a8w8_gfx1250.py:1445-1447) and the shared-helper refactor of the existing accumulator fused-quant epilogue (_quant_group_to_lds/_store_quant_tile, sincea484d81c0) have not run on their only arch. No CI runner covers them. The host-test clamp model cannot stand in for this run:_epilogue_model(round_gate=True)performs the same ops as_silu_and_mul_ref, sonew == refholds by construction. The 5.02 limit you added does catch the old f32 clamp, but only through the e4m3 code-mismatch budget: a CPU model of the test data gives about 39% one-step codes and 0 scale flips. So the run must show 0 scale and 0 far mismatches at 5.02 as well. - Land #7667, then #7668, then rebase. Both are still open with changes requested (#7667 @ 6807132, #7668 @ 292a532). Only
d3c99322a,a484d81c0,7aa707829and3ecba659bbelong to this PR.
Nits:
gate_up_silu_limit(batched_gemm_a8w8_gfx1250.py:855-863) still tests the sign on the double, and it recognises f32 inf only when the double is itself inf.-1e-46is -0.0f tosilu_and_mul, which runs it as no clamp, but here it raises ValueError.1e39is inf as f32, but it is returned as is. It warns "overflow encountered in cast" on every call, here and again atkernels/…:143, and builds a separate_silu1e39qclamp kernel. The values still matchsilu_and_mul.- Fix: take
f = np.float32(limit)undernp.errstate(over="ignore"), then raise ifnot f >= 0and return 0.0 ifnot (np.isfinite(f) and f > 0).
- The PR body says operand "dtypes … shapes … are validated before the arch check".
x_scale/w_scaledtype and shape are checked only by_check_e8m0(:955-956), which runs afterget_gfx_runtime()(:950-952). Reword the sentence, or check the scales before the arch check. op_tests/test_flydsl_batched_gemm.py:23-30still says gfx1250-strict runs the fused-quant check "and the compute kernelName cases alone". It now also runs_run_gate_up_silu(:877-878), and the gate_up check is not mentioned at all.
Pre-existing: _check_bmm_operands and the other batched runners still have no device or 16-byte base checks. You said you will handle that in a separate PR.
Already fixed (r44): the clamped gate is rounded to bf16 (kernels/…:1446), and the gate is now taken where f32 L > 0 (:143). 5.02 is in GATE_UP_SILU_LIMITS. M=1 keeps its row as data (test_flydsl_batched_gemm.py:653-657). The f32-zero limit is handled. gfx1250-strict now runs the gate_up check. The "not measured" wording is in. Device and alignment checks are in this launch.
CI: Black, Ruff and the build pass. Standard Tests (MI35X) are still pending. There is no gfx1250 runner.
Reviewed at 3ecba65 (Deep; full A–C on own commits d3c9932..3ecba65 on #7668 @ 292a532 / #7667 @ 6807132; 4 hunters, 2 verifiers, C2). Already fixed: r44 ask 1, the M=1 half of ask 2, nits 1-3, and the device / alignment checks.
|
Thanks. Nits addressed in
Nits:
Pre-existing: Validation:
Description and Self-Review are updated. |
|
gfx1250 run at
End to end through ROCm/ATOM#3446 at The full log is kept. |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (4)
- Run
op_tests/test_flydsl_batched_gemm.pyon gfx1250 at the final head and post the output (r44/r46 ask, still open). No gfx1250 run has been posted yet. The PR body says "gfx1250: validation pending at this head". Two things have never run on their only arch: the bf16-rounded gate clamp in_act(aiter/ops/flydsl/kernels/gemm_a8w8_gfx1250.py:1447) and the shared-helper refactor of the accumulator fused-quant epilogue. The run must show 0 scale mismatches and 0 far mismatches at all three limits (10, 0 and 5.02), with the per-case one-step counts from item 3. - Land #7667, then #7668, then rebase (still open). Both PRs are OPEN with changes requested, and their heads are unchanged (#7667 @ 6807132, #7668 @ 292a532).
- Apply the one-step e4m3 allowance per case, not pooled. At
op_tests/test_flydsl_batched_gemm.py:737-742,code_bad * 10000 > totalsums over all 33 (M, limit) cases, which is about 82M codes, so up to about 8,225 one-step codes are allowed in total. The three M=1 cases have 6,912 codes, so every M=1 code could be one step off and the test would still pass. That contradicts the docstring (:31-34, "in a negligible fraction, for every tile bucket") and the "M = 1 keeps its row as data" claim. Fix: fail when any case hasr[1] > max(2, m * (n2 // 2) // 10000). The test is seeded and the expected rate is about 1e-7, so this cannot make it flaky. - Use the existing clamp helpers in
_act. Atkernels/gemm_a8w8_gfx1250.py:1447-1448the clamp is written by hand:fx.minnumf(g, lim)andfx.maxnumf(fx.minnumf(u, lim), nlim). The repo already hasfmin_f32/fclamp_f32inkernels/gemm_common_gfx1250.py:161/166, and the existing gfx1250 SwiGLU clamp uses them (fused_silu_swiglu_elem,:186-187).- Use
u = fclamp_f32(u, nlim, lim)andg = fx.Float32(fmin_f32(g, lim)).to(out_cls).to(fx.Float32), and add the two names to the existing import at:18. - This uses v_med3 as
silu_and_muldoes (activation_kernels.cu:83), so it matches the "fmed3 clamp" the comment at:1441names, including for a NaN up value (+L today vs -L in silu_and_mul). - Output is identical for non-NaN inputs.
- Use
Already fixed (r46 nits):
gate_up_silu_limitnow reads the limit as the f32silu_and_mulreceives (batched_gemm_a8w8_gfx1250.py:848-863).-1e-46and1e39both give 0.0 without a warning, and every limit class agrees with silu_and_mul and with the builder (kernels/…:135-144).- The PR body's validation-order wording now matches the code.
- The op-test header (
:23-34) now names the gate_up check and says gfx1250-strict runs it.
Pre-existing, not required for this PR: _check_bmm_operands still has no device or 16-byte base checks (you said a separate PR will handle this).
CI at bed4bc4: only the pull_request_target workflows have run (PR Self-Review and the title check pass). Checks / Aiter Test have not run at this head. At 3ecba65, the Standard Tests (MI35X) failures were in test_flydsl_hgemm.py (graph replay mismatch) and in test_flydsl_allreduce_rank_agreement.py (CustomAllreduce has no _is_gfx1250). This PR does not touch those files.
Reviewed at bed4bc4 (Deep; full A–C on own commits d3c9932..bed4bc4 on #7668 @ 292a532, plus D; 3 hunters, 3 verifiers, C2). Items 3-4 are in code from earlier commits that earlier rounds missed. Already fixed: r46 nits 1-3.
|
gfx1250 run at
Per case (2I = 4608, K = 5120):
The one-step counts are the same for all three limits. They are consistent with the earlier run at |
|
Thanks. Addressed in
The description and Self-Review are updated (gfx1250 result at this head). black 26.10.1 and ruff are clean on the changed files. |
|
gfx950 at |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (4)
- Land #7667, then #7668, then rebase this PR onto main (still open). #7667 was rebased onto main
e8baf0696at305f898e7b; #7668 (292a532f84) and this PR still sit on the old #7667 head68071323b6, and all three are CONFLICTING. Post a fresh gfx1250 run ofop_tests/test_flydsl_batched_gemm.pyafter the rebase. - Limit
gate_up_silu_kernel_okto the tile shapes the GPU test runs.aiter/ops/flydsl/batched_gemm_a8w8_gfx1250.py:760. Every_GATE_UP_SILU_TILESentry hastile_n // n_warp == 64, so the epilogue loop atkernels/gemm_a8w8_gfx1250.py:~1455only runsblk == 0on gfx1250, yet the predicate and the publickernel_name=accept 108 untested names (e.g. t64x256 nw2, and tile_n=192 tiles whosevec<3 x i8>scale store at 1-byte offsets has never run). Fix:cfg["tile_n"] in (128, 256) and cfg["tile_n"] // cfg["n_warp"] == 64(== 64alone still accepts t64x192 nw3), and add a 128-cols/wave and a tile_n=192 name totest_kernel_ok_rejects. Checked: all 8 table tiles pass, all existing reject names stay rejected. - Count e4m3 NaN codes as "far" in the one-step metric.
op_tests/test_flydsl_batched_gemm.py:708-709:|(a&0x7F)-(r&0x7F)| == 1accepts 0x7F (NaN) vs 0x7E (448) and 0xFF vs 0xFE as an allowed one-step code. Mark a mismatching pair far when(a & 0x7F) == 0x7F or (r & 0x7F) == 0x7F; replayed over all 256×256 pairs, only those 4 NaN pairs change. - Fix the text that no longer matches the code.
- The
run_gate_up_silu_mxfp8_32_gfx1250docstring (batched_gemm_a8w8_gfx1250.py:884-889) and kernel comment (kernels/gemm_a8w8_gfx1250.py:1320-1324) name only a one-step e4m3 code; when the differing activation is its group's amax at 448·2^k, the e8m0 scale moves by one instead (448 vs 450 → 127 vs 128) and all 32 codes change. Say so. - This repo squash-merges with COMMIT_MESSAGES, so reword/squash during the rebase:
a484d81c0("declared mutated, no-op fake"; head is functional,mutates_args=[],batched_gemm_op_a8w8.py:532-569),7aa707829(gate "clamped in f32"; head rounds to bf16,kernels/…:1449),d3c99322a(tile "at shapes the tiles divide"; head returns one only for the measured device/shape,:813-845). - PR description: drop "kernel side is the pending gfx1250 run", "(gfx1250 check pending)" and "this head changes only host-side…" (
3d4ffbac7also changes_act).
- The
Checked and correct at this head: _act now matches silu_and_mul (all bf16 patterns × 13 limits, 0 differences incl. NaN up); the per-case one-step budget counts m·I codes and a fully wrong M=1 case fails; the posted gfx1250 table matches the test; no default-path cost; no open review threads.
Reviewed at 3d4ffba (Deep; two independent full A–C passes on own commits 292a532..3d4ffba plus D; 6 hunters, 8 verifiers, 2 C2). Items 2-4 are in code/text earlier rounds missed. Already fixed: r47 items 1 (gfx1250 run posted), 3 (per-case budget), 4 (fmin_f32/fclamp_f32).
|
Thanks. Items 2–4 are addressed in
CPU host test passes at this head (62 cases); black 26.10.1 and ruff clean. This round does not use gfx1250. |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (4)
- Land #7667, then #7668, then rebase this PR onto main, and reuse #7667's quant helpers when you do (still open, extended). All three PRs are still CONFLICTING. #7667 (
e552b7c00) now has085326080, which moves the accumulator group-32 quant intokernels/quant_utils.py:emit_mxfp8_group32_scale,emit_mxfp8_acc_pair_to_ldsandemit_mxfp8_scale_rows_store. This PR's nested_group_scale,_quant_group_to_ldsand the scale-row loop of_store_quant_tile(kernels/gemm_a8w8_gfx1250.py:1336-1413) do the same work, op for op.- On rebase, call those helpers from both the accumulator and SwiGLU epilogues, and keep only the local e4m3 TDM store.
- Passing the already bf16-rounded
hsthrough the helper's.to(out_cls).to(f32)is a no-op. We checked every bf16 pattern, including inf, NaN, ±0 and subnormals. - Then post a fresh gfx1250
op_tests/test_flydsl_batched_gemm.pyrun at the rebased head.
- Fix the squash text when you rebase (still open, plus four more false claims). Besides the three already listed (
a484d81c0"declared mutated, no-op fake",7aa707829"clamped in f32",d3c99322a"at shapes the tiles divide"), these also contradict the head:d3c99322a"Scales match the unfused chain exactly". The docstring atbatched_gemm_a8w8_gfx1250.py:884-893says the scale can move by one at 448·2^k.a484d81c0"gate_up_silu_kernel_for is safe inside torch.compile". Its docstring at:837-842says not to branch on it in a traced forward.a484d81c0"e4m3 codes match … up to one step". The scale can move instead.a484d81c0"validates … before the arch check, so all of it is testable without a GPU"._check_e8m0forx_scale/w_scaleruns after the arch check (:954-958).- No need to rewrite history: write the corrected text as the squash message when merging, or post it in the description.
- Make
gate_up_silu_kernel_okmatch its docstring.batched_gemm_a8w8_gfx1250.py:760-774. Our r48 predicate was incomplete. It still accepts names the gfx1250 test never runs:_nopl, names with no K-loop suffix, and t16x128x128 mw1 nw2 or t256x256x512 mw4 nw4. tile_k and m_warp change the new gate/up gather and the epilogue'swmb. The docstring (:761-764) says "the only ones the gfx1250 op test runs".- Fix:
return name in {n for _, n in _GATE_UP_SILU_TILES}, and keep the structural check in_check_gate_up_silu_tiles. - Replayed: all 8 table tiles are accepted, every
test_kernel_ok_rejectsname is still rejected, andtest_run_rejects_kerneland the runtime pick still pass. ATOM#3446 passes nokernel_name.
- Fix:
- Fix the clamp formula in the kernel header comment.
kernels/gemm_a8w8_gfx1250.py:132saysbf16(silu(min(g, L)) * clamp(u, -L, L)). Since3ecba659b,_act(:1450-1451) rounds the clamped gate first. Writebf16(silu(bf16(min(g, L))) * clamp(u, -L, L)). The two differ for limits bf16 cannot hold, such as 5.02.
Items 2 (extra claims), 3 and 4 are in text and code that earlier rounds missed. Nothing else is open: CPU host test 62 passed under stubs; no default-path change (the plain-GEMM names and steps are unchanged; the import-time table check is about 23 µs and pure Python); limit handling, gather mapping, M-tail masking and the NaN/one-step metric all checked. CI at head: only evaluate and tag-title have run (both pass); Aiter Test has not run, and no lane runs the gfx1250 op test.
Reviewed at 4136bc7 (Deep; full A–C on own commits 292a532..4136bc7 plus D; 3 hunters + review-pr skill agents, 2 verifiers, C2). Already fixed: r48 items 2 (tile_n / per-wave limits), 3 (NaN codes far), 4a (scale-move wording), 4c (PR description).
4136bc7 to
4ebcaa8
Compare
|
@valarLip Thanks. Rebased onto #7668's new head 1. Rebase, reusing #7667's quant helpers. Done in
2. Squash text. The rebase conflicted with #7667's helper move in most of the seven commits, so I squashed them into
The PR description is updated to match. 3.
4. Clamp comment. Done in Validation at
|
4ebcaa8 to
9c9ff68
Compare
|
Rebased onto #7668's new head |
…ed entry runs the tuned row Fused MXFP8 epilogue: when the warp tile holds an even number of 16-column WMMA tiles (even wmma_n_rep), the group-32 quant reads the accumulators instead of staging the bf16 C tile in LDS and re-reading it per group. A lane holds 8 consecutive columns of one row per 16x16 tile, so a 32-column group is two adjacent tiles across lanes l and l^16 and its amax is one shuffle_xor(16). Values are rounded to the output dtype first, exactly as the bf16 path stores them, so the e4m3 codes and e8m0 scales are unchanged; the e4m3 and scale bytes still go through LDS for the TDM store. An odd wmma_n_rep keeps the LDS-staged quant. The epilogue has three peer branches (bf16 store, accumulator quant, LDS-staged quant) with the quant setup and the group-32 scale step shared by the two quant branches. batched_gemm_a8w8_mxscale_bpreshuffle_fused_quant looks the shape up in the same preshuffle table as the bf16 entry and passes a flydsl row's kernelName to the runner, so both entries run the same tuned tile. No row, an opus row or a compute-kernel row leaves the tile to the runner; any other name is passed through, so a name the runner does not accept raises, as for the bf16 entry. Tests: op_tests/test_flydsl_batched_gemm.py checks the fused quant on tuned tiles that pin each epilogue branch (two LDS-staged, seven accumulator) at ragged M against quantize_fp8 of the bf16 GEMM on the same tile; op_tests/test_bmm_a8w8_fused_quant_tuned_row.py is a CPU test of the tuned-row lookup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the merge with main's gfx950 fused quant, one _fused_quant_tuned_kernel serves both arches. The CPU test now also checks a gfx950 flydsl row (passed through) and a gfx950 opus row or no row (runner's choice). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The batched mxfp8_32 kernel's accumulator quant and the 256x256 compute kernel's fused epilogue emitted the same per-group step (round to the output dtype, h0/h1 amax with one shuffle_xor(16), 1e-10 floor, RoundUp e8m0, scaled fp8 conversion, e4m3 and scale bytes into LDS) and the same scale-row store. Both now call emit_mxfp8_acc_pair_to_lds and emit_mxfp8_scale_rows_store in kernels/quant_utils.py, next to emit_mx_e8m0_scale; emit_mxfp8_group32_scale (floor + RoundUp scale) is also used by the batched kernel's LDS-staged quant. Each kernel keeps its own e4m3 TDM store. No change in the emitted code is intended. Co-Authored-By: Claude Opus 5.5 <[email protected]>
FUSED_QUANT_TILES adds t64x32x512 mw4 nw1 (one quant group per tile row) and t160x128x256 nw2 (more tile rows than threads, so the scale rows take a second pass), both shipped DSv4.1 rows on the accumulator branch that no test pinned. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The scale-row store loops ceil(tile_m / block) times, so a thread copies rows tid, tid + block, ...; say that in the helper docstring and at both kernel call sites instead of "one row per thread". In quant_utils, the native-scale helper no longer refers to a function that does not exist, and the module docstring names the dtypes _DTYPE_CFG actually defines. The gfx950 tuned-row test uses the DSv4 batched preshuffle table's row for its shape. Comments and test data only; no kernel change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…red group-32 scale _fused_quant_tuned_kernel imports the gfx1250 compute-kernel name check only on gfx1250, after the table lookup; gfx950 returns the flydsl row's name directly, as before the merge with the gfx1250 lookup. The gfx950 bmm fused epilogue calls emit_mxfp8_group32_scale instead of its own copy of the same steps (1e-10 floor, RoundUp e8m0, f32 scale). Two docstrings no longer say the fused epilogue always quantizes the bf16 C tile. Tests: FUSED_QUANT_TILES also pins the DSv4.1 wo_a tuned tiles the fused entry runs (t192x128x256, t128x256x256 mw1 nw4, t96x128x256, and the LDS-staged t32x32x512); the gfx1250 tuned-row fixture uses a CU count other than the gfx950 one so the lookup must forward the caller's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
6b2409f to
62a8807
Compare
|
Re-stacked on #7668 |
Two LDS-staged tiles (t16x64 nw4, t32x32 nw2) and seven accumulator tiles, as the tuple and the module docstring list them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fragments of k-step g+1 are read from LDS while the WMMAs of k-step g run, across K-tile boundaries too, so LDS reads, WMMAs and the TDM refill overlap. The fence before the next K-tile is split into signal/wait (the primitives the 256x256 compute kernel already uses) around the two halves of the last k-step's WMMAs, and the per-stage LDS read bases are formed a tile ahead. Every accumulator sees its k-steps in the same order with the same operands, so results are bit-identical to the single-fence loop. New pipelined constexpr, appended after fuse_quant_out: -1 (default) takes the pipelined loop for mxfp8_32, no scale preload, no cluster, split_k 1, tile_k >= 256 when the accumulators plus two in-flight fragment sets fit the register estimate; 1 forces it (batched kernel names may end in _pl; tile_k < 256 is rejected), 0 keeps the old loop. No new environment variable. The DSv4.1 mxscale table rows for N=5120, K=8192 at M 672/768 and for N=32768, K=1280 at M 576/672/768 are replaced in place with tiles that use the pipelined loop. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pipelined constexpr now defaults to 0 and takes only 0 or 1; the automatic rule that moved every eligible mx32 tile onto the new loop is gone, so existing tuned rows keep the loop they were timed on. A trailing _pl in a batched or 2-D mxfp8_32 kernelName is the only way to select it, and check_pipelined_k_loop() is the single place that rejects it where the loop does not apply (it replaces the batched runner's tile_k check). The DSv4.1 rows validated with the pipelined loop now carry _pl: N=5120, K=8192 at M 576 / 672 / 768 (the latter two are the t192x128x256 rows that relied on the automatic rule); the N=32768, K=1280 rows already did. Also drop the unused pipelined argument of bmm_mx32_kernel_name, share the fragment join of load_a / load_b and the serpentine WMMA order with the pipelined loop, and fix the tail fence comment. Tests: CPU checks of the _pl name round trip (batched and 2-D) and of the rejections in op_tests/test_gemm_host_dispatch_cache.py; on gfx1250, op_tests/test_flydsl_batched_gemm.py compares _pl with the single-fence loop bit for bit on a ragged K and on a shipped _pl row, and runs the fused quant epilogue on a _pl tile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…in's tile; test nb3/nb4 Re-timed the pipelined rows against the retuned tiles now on main for the six DSv4.1 2-D keys on one gfx1250 box. The pipelined t192x256x256 tile stays ahead at M 576 and 768 for N=32768, K=1280; the other four keys keep main's rows. PIPELINED_CASES also compares the pipelined and single-fence loops on a three-buffer and a four-buffer tile, where the tail fences differ from the steady loop. Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the fence wait the wave refills the stage tile kt held and then reads the first fragments of tile kt+1; the comment had the two steps swapped. Comment only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The us, tflops and bw of the two kept _pl rows (N=32768, K=1280 at M 576 and 768) were main's values scaled by a paired ratio. Replace them with values measured on gfx1250 through the MXFP8 GEMM tuner's harness (its data generation, B=1 batched run path, mp_tuner timing, error check and throughput formula), bw in the unit of the neighbouring gfx1250 rows. The kernelName of both rows is unchanged, so dispatch is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`_pl` stays the only switch of the software-pipelined K loop: a kernelName without it runs the single-fence loop it was tuned on, in the batched and the 2-D paths alike. CPU tests pin that: - untagged 2-D names on which the pipelined loop would apply (tile_k 256, split_k 1, before and after cluster_m is fitted to M) resolve to the single-fence loop, and their `_pl` names to the pipelined one; no other suffix parses; - every mxfp8_32 kernelName in the shipped tuned tables runs the pipelined loop exactly when it ends in `_pl`. Kernel comments: the early per-stage LDS bases are formed a tile ahead only when `early` holds, and the tail's max(..., 0) only touches the last tile's unused fence count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shared expert whose down projection reads MXFP8 runs the gate_up GEMM (bf16 [M, 2I]), silu_and_mul and quantize_fp8 as three launches. The batched mxfp8_32 gfx1250 kernel now applies the SwiGLU before its fused group-32 MXFP8 epilogue, so the three become one GEMM. Kernel (kernels/gemm_a8w8_gfx1250.py), new fuse_act_mul / act_limit constexprs (batched mxfp8_32, 32x32 B scale, fuse_quant_out, no K tail): - B is the unmodified [gate; up] weight. Each CTA gathers its tile_n B rows, and their scale rows, as tile_n/64 blocks of [32 gate rows, the matching 32 up rows] through one nested TDM view, so a wave's 64 columns hold gate and up of the same 32 outputs in the same lanes. - The epilogue rounds the accumulators to bf16 and forms bf16(silu(bf16(min(g, L))) * clamp(u, -L, L)) as aiter silu_and_mul does (L = 0: no clamp), then quantizes each 32-column group with ROCm#7667's emit_mxfp8_acc_pair_to_lds / emit_mxfp8_scale_rows_store; only the e4m3 TDM store stays local, shared with the accumulator-quant epilogue. - Against the bf16 GEMM + silu_and_mul + quantize_fp8 chain, a SwiGLU value can sit one bf16 step from silu_and_mul's (exp/rcp rounding), so an e4m3 code can differ by one step; where that value is its group's amax at 448 * 2**k, the group's e8m0 scale moves by one instead (and so all 32 codes). - The kernel name gets a _silu<limit>q suffix, so it never collides with the plain GEMM; fuse_act_mul defaults to off. Host (batched_gemm_a8w8_gfx1250.py): - run_gate_up_silu_mxfp8_32_gfx1250: the raw launch. Operand dtypes, strides, shapes, devices, alignment, the limit and the kernel name are checked before the arch check; the e8m0 x_scale / w_scale checks run after it. swiglu_limit is read as the f32 silu_and_mul receives. kernel_name=None picks the tile from the runtime row count. - gate_up_silu_supported(n2, k): gfx1250 with the measured CU count at the measured [2I, K]; independent of the row count. - gate_up_silu_kernel_for(m, n2, k): the table tile for the measured device and shape only, else None. A host helper for code that sees the real row count; not for branching in a traced forward. - The table tiles end in _pl (the pipelined K loop). Op (batched_gemm_op_a8w8.py): functional registered op gate_up_silu_mxfp8_32 (mutates_args=[]) that picks the tile from the runtime row count and returns the e4m3 / e8m0 outputs. Tests: op_tests/test_flydsl_gate_up_silu_host.py (CPU: gating, picker, limit and operand validation, functional op under fullgraph dynamic shapes) and test_gate_up_silu_fused in op_tests/test_flydsl_batched_gemm.py (gfx1250: every tile bucket, limits 10, 0 and 5.02, vs the unfused chain). Co-Authored-By: Claude Opus 5.5 <[email protected]>
gate_up_silu_kernel_ok now accepts exactly the kernelNames of _GATE_UP_SILU_TILES, the ones the gfx1250 op test runs; another tile_k, m_warp or K loop changes the gate/up gather or the epilogue's rows. The structural check (split-K / cluster 1, tile_n 128 or 256 with 64 columns per wave, `_pl`) moves to _check_gate_up_silu_tiles, which runs once at import. The CPU test rejects a table tile without `_pl` and two table-like shapes the op test does not run. The kernel header comment gives the clamp as the epilogue computes it, bf16(silu(bf16(min(g, L))) * clamp(u, -L, L)). Co-Authored-By: Claude Opus 5.5 <[email protected]>
62a8807 to
7d78cf6
Compare
Motivation
A shared expert whose down projection reads MXFP8 runs three launches after the input quant: the gate_up GEMM (bf16
[M, 2*I]),silu_and_mul(bf16[M, I]) andquantize_fp8(e4m3[M, I]+ e8m0[M, I/32]), with two round trips of the activation through HBM. On gfx1250 the batched mxfp8_32 FlyDSL GEMM already has a fused group-32 MXFP8 epilogue (#7667); this PR lets the same kernel apply the SwiGLU activation before that quant, so the three launches become one.Stacked on #7668 (which is on #7667); only the last two commits are new here. Please merge #7667, then #7668; this PR will be rebased onto main after that.
Technical Details
launch_gemm_a8w8(aiter/ops/flydsl/kernels/gemm_a8w8_gfx1250.py) gainsfuse_act_mul/act_limitconstexprs (batched mxfp8_32 with a 32x32 B scale,fuse_quant_out, no K tail, 64-column multiples per tile and per wave):[gate; up]weight. Each CTA gathers itstile_nB rows astile_n/64blocks of[32 gate rows, the matching 32 up rows]through one nested TDM view, and the 32x32 scale rows the same way, so each wave's 64-column block holds gate and up of the same 32 outputs in the same lanes.bf16(silu(bf16(min(g, L))) * clamp(u, -L, L))is formed like aitersilu_and_mul(L = 0skips the clamp, assilu_and_muldoes; the gate is clamped withfmin_f32and rounded back to bf16 and the up value withfclamp_f32(v_med3), assilu_and_muldoes, so the clamp matches it for everyL; the clamp is taken whereLas f32 is positive), and each 32-column group is quantized to e4m3 + e8m0 (amax floored at 1e-10, ceil pow2 of amax/448). The per-group quant to LDS and the scale-row store are [FlyDSL] [gfx1250] Batched mxfp8 GEMM fused-quant epilogue: quantize from the accumulators, use the tuned row #7667'semit_mxfp8_acc_pair_to_lds/emit_mxfp8_scale_rows_store(kernels/quant_utils.py); only the e4m3 TDM store is a local helper, shared with the accumulator-quant epilogue. Against the unfused chain an e4m3 code can differ by one step; where the differing value is its group's amax at 448·2^k, the group's e8m0 scale moves by one instead (and so all 32 codes).act_limitmust be finite and>= 0; the kernel name gets a_silu<exact limit>qsuffix (symbol-safe), so it never collides with the plain GEMM.aiter/ops/flydsl/batched_gemm_a8w8_gfx1250.pyadds:gate_up_silu_supported(n2, k): whether this device and a[n2, k]gate_up weight have fused tiles (gfx1250 with the measured CU count, the measured DSV4.1 shared-expert[2I, K]). Independent of the row count, so a model decides once when it is built.run_gate_up_silu_mxfp8_32_gfx1250(XQ, WQ, x_scale, w_scale, Out, y_scale_out, swiglu_limit, kernel_name=None): the raw launch.XQ [M, K]e4m3, row-contiguous, with row-majorx_scale [M, K/32];WQ [2I, K]contiguous, 16x16-preshuffled, with its raw[2I/32, K/32]32x32 scale; writesOut [M, I]e4m3 andy_scale_out [M, I/32]e8m0 (uint8 storage also accepted). The dtypes, strides and shapes ofXQ,WQ,Outandy_scale_out, the devices and 16-byte base alignment of all operands, the limit and the kernel name are validated before the arch check; the e8m0x_scale/w_scaledtype and shape after it (_check_e8m0, which loads FlyDSL).swiglu_limitis read as the f32silu_and_mulreceives: a finite positive f32 clamps; 0, -0.0, f32 inf and+infclamp nothing; a negative or NaN f32 raisesValueError.kernel_name=Nonepicks the tile from the runtime row count; pastGATE_UP_SILU_MAX_ROWSthat is the largest bucket's tile (not measured there).gate_up_silu_kernel_for(m, n2, k): the table tile for1 <= m <= GATE_UP_SILU_MAX_ROWSwheregate_up_silu_supported, elseNone. A host helper for code that sees the real row count (eager code, the body of a custom op); not for branching in a traced forward.gate_up_silu_kernel_ok(name)(only the table's kernelNames, the ones the gfx1250 op test runs; the structural check runs once on the table at import),gate_up_silu_limit(limit),GATE_UP_SILU_MAX_ROWS. Each table tile pins its K loop with_pl.aiter/ops/batched_gemm_op_a8w8.pyadds the functional registered opgate_up_silu_mxfp8_32(XQ, WQ, x_scale, w_scale, swiglu_limit) -> (act, act_scale): picks the tile inside from the runtime row count, allocates and returns e4m3 / e8m0 outputs, mutates nothing. A compiled graph replayed for other row counts without guard checks still runs each call's tile. A caller that keeps its own unfused chain aboveGATE_UP_SILU_MAX_ROWSmakes that split inside its own op, where the row count is real (ATOM#3446 does).No new environment variables; existing kernels and their names are unchanged.
Test Plan
op_tests/test_flydsl_gate_up_silu_host.py(new, CPU):gate_up_silu_supportedand the picker buckets / rejections (unmeasured shapes, other arch or CU count, undeterminable device),_plpins,gate_up_silu_kernel_ok, limit semantics (including f32-zero limits), a CPU model of the clamp step that documents why the gate is rounded to bf16 (its bf16-rounded model performs the same operations as itssilu_and_mulmodel, so their agreement holds by construction; it does not test the kernel), launch validation (dtypes, strides, shapes, buffers, kernel name, arch), the runtime tile pick of the launch (kernel launch stubbed), and the functional op in one fullgraph dynamic-shape graph across row counts, each call launching its own row count's tile.op_tests/test_flydsl_batched_gemm.py(gfx1250)test_gate_up_silu_fused: for every tile bucket (M = 1, 7, 384, 500, 640, 768, 960, 1152, 1345, 2048, 4096) at 2I = 4608, K = 5120, withswiglu_limit10, 0 and 5.02 (a limit bf16 cannot hold), the fused launch vs the bf16 GEMM on the same tile +aiter.silu_and_mul+ the torch mirror of ATOMquantize_fp8(scales exact, e4m3 codes at most one step apart, and per case at most max(2, 1/10000 of its codes) of them), and the registered op byte-equal to the launch. The M = 1 case keeps its one row as data. Fails if, on the measured part, the picker misses a bucket.gfx1250-strictruns it too.op_tests/test_flydsl_batched_gemm.py,op_tests/test_gemm_host_dispatch_cache.pyand the fused-quant tuned-row tests for regressions of the existing batched / fused-quant / pipelined paths.Test Result
7d78cf69e(this head; the stack rebased onto main3fd42598c): CPU host + dispatch-cache tests 86 passed; the 10 failures are CUDA-only cases that fail the same way on main. black / ruff clean. No idle gfx950 GPU for a rerun. The results below are at4ebcaa840, whose own commits are replayed here unchanged.4ebcaa840(flydsl 0.5.0, null pointers, no GPU), final ISA: the seven SwiGLU configs (the five table tiles at limit 10, t64x128 at limit 0, t128x256 at limit 5.02) match the previous head4136bc792opcode for opcode; the only difference is two scalar registers that hold constants swapping numbers (limit 0: byte-identical). Same VGPR counts (312 to 551), no VGPR / SGPR spill, no scratch. Nine plain / fused-quant /_plconfigs are byte-identical to [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668's heade9476df89.4ebcaa840:python op_tests/test_flydsl_batched_gemm.pyexits 0 and prints the same correctness columns as [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668's head on the same box (the gfx1250 kernel is not reached there).4ebcaa840(GPU-less container):python -m pytest op_tests/test_flydsl_gate_up_silu_host.py op_tests/test_gemm_host_dispatch_cache.py84 passed, 16 skipped; the one failure is the pre-existingtest_mxscale_config_precheck_matches_padded_walk, which needs CUDA and fails the same way at4136bc792.3d4ffbac7:op_tests/test_flydsl_batched_gemm.pyexit 0, gate_up SwiGLU 33 cases with 0 scale and 0 far mismatches.PR Self-Review
Reviewed revision
7d78cf6
Behavior and intent
d4016d527, on main3fd42598c) and [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668 (1683901ce) as they are now, plus two commits.95d0ca59ais the previous seven commits squashed while rebasing (the epilogue conflicted with [FlyDSL] [gfx1250] Batched mxfp8 GEMM fused-quant epilogue: quantize from the accumulators, use the tuned row #7667's shared quant helpers); its message is the corrected squash text and describes this head (functional op withmutates_args=[]; the gate clamp rounded to bf16; the picker returns a tile only for the measured device and shape; the scale can move by one at 448·2^k;gate_up_silu_kernel_foris not for branching in a traced forward; the e8m0 scale checks run after the arch check).7d78cf69elimitsgate_up_silu_kernel_okto the table's names and fixes the clamp formula in the kernel header comment. Previous heads kept asbak/8057-pre1123a/-pre1123b/-pre1125a/-pre1127aon the fork.95d0ca59a/7d78cf69eare8e8af1776/4ebcaa840replayed unchanged.silu_and_mulandquantize_fp8: three launches and two activation round trips through HBM.gate_up_silu_supportedholds, the launch or the functional registered op runs them as one GEMM; the tile follows the runtime row count, so it stays right in a graph compiled once and replayed for every row count.swiglu_limitfollowssilu_and_mul. Existing kernels and their names do not change:fuse_act_muldefaults to off, and the plain fused-quant kernels compile to the same ISA as [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668's head.Validation and unverified scope
4136bc792opcode for opcode (two scalar constant registers swap numbers), no spill or scratch; plain / fused-quant /_plISA byte-identical to [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668's head.op_tests/test_flydsl_batched_gemm.pyexits 0, same correctness columns as [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668's head.3d4ffbac7(same epilogue instructions as this head, per the ISA comparison above):python op_tests/test_flydsl_batched_gemm.pyexits 0 (one GPU). Fused quant and pipelined checks ALL BIT-EXACT; gate_up SwiGLU 33 cases with 0 scale and 0 far mismatches at limits 10, 0 and 5.02; registered op byte-equal to the launch; picker right for every bucket.PR-specific question
Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
batched_gemm_a8w8_gfx1250.py, keyed by M bucket, and apply only to gfx1250 with the measured CU count at gate_up[2I, K]=[4608, 5120]; only the new launch and op read them. The configuration change in this branch comes from [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668:dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csvrowsgfx1250, cu_num 256, 32x32, (M, N, K)=(576, 32768, 1280)and(768, 32768, 1280); see [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668.fuse_act_mul, and the kernel name of every existing configuration is unchanged, so their selection and compiled kernels are the same as before; the plain fused-quant kernels compile to the same gfx1250 ISA as [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668's head.Changed op tests
op_tests/test_bmm_a8w8_fused_quant_tuned_row.py: comes from [FlyDSL] [gfx1250] Batched mxfp8 GEMM fused-quant epilogue: quantize from the accumulators, use the tuned row #7667 (CPU test of the fused entry's tuned-row lookup); unchanged here.op_tests/test_gemm_host_dispatch_cache.py: comes from [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668 (CPU checks that only_plselects the pipelined loop); unchanged here.op_tests/test_flydsl_batched_gemm.py(gfx1250):test_gate_up_silu_fusedcompares the fused launch with the bf16 GEMM on the same tile +aiter.silu_and_mul+ the torch mirror of ATOMquantize_fp8, for every tile bucket, with limits 10, 0 and 5.02, rows past the clamp, tiny rows and a zero row (M = 1 keeps its one row as data), checks the registered op byte-equal to the launch, and fails if the picker misses a bucket on the measured part. Not redundant: it is the only numerical test of the new epilogue and of the gate/up gather.op_tests/test_flydsl_gate_up_silu_host.py(new, CPU): shape / device gating,_plpins, limit and operand validation, a numerical model of the clamp step, the runtime tile pick and the functional op under a fullgraph dynamic-shape compile. Before the follow-up commits it fails (no limit or operand checks, no runtime pick, no functional op). Not redundant: CI's standard shards run no gfx1250 kernel, so this is the only CI coverage of the host side.🤖 Generated with Claude Code