Repository navigation
Conversation
… backend A fused_moe call with per_Token FP8 and an active swiglu_limit on gfx942 was routed to the FlyDSL whole-graph backend, by two paths: the clamped-SiLU fallback added in #7820, and the flydsl_gfx942_row exemption from #8178 that let a tuned impl__flydsl_gfx942__ row survive the "this row cannot clamp" discard. That backend clamps inaccurately, and worse the tighter the bound. Max per-row relative L2 error against a torch fp32 reference with no fp8 intermediate requantization, per_Token, token=64, on gfx942: limit fused_moe (FlyDSL) two-stage reference routed to None 0.0275 0.0274 CK 7.0 0.0497 0.0202 FlyDSL 1.0 0.1140 0.0089 FlyDSL It is not a swapped clamp order: the test's own swapped reference scores > 0.2, FlyDSL scores 0.09-0.11. Close both paths so a clamped call stays on CK, which also restores the inter_dim % 128 guard below for these shapes. #8334 tracks the accuracy problem itself; this only stops the routing. Co-Authored-By: Claude Opus 5 (1M context) <[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 |
|
Closing this: routing around the problem is the wrong fix, and testing it Gating the whole-graph backend does stop the inaccurate clamp and does unbreak FlyDSL needs only a multiple of 64, which is why it was serving those shapes. The accuracy problem itself is the thing to fix, and it is written up with One more thing surfaced while testing this and is worth a look independently: The instance is present in a locally JIT-built runtime-clamp module, so this Reopen this if the call is "raise rather than compute wrong" — the change and |
|
Superseded by #8353, which takes the narrow version of this: CK-capable FP8 |
|
Correction to my closing comment above: the accuracy claim in it is wrong, and The gfx942 FlyDSL decode kernels read bf16 activations; my fp32 reference fed That does not change the outcome for this PR: the broad gate still caused the |
Fixes the routing half of #8334.
Summary
On gfx942, a
fused_moecall with per_Token FP8 and an activeswiglu_limitwas routed to the FlyDSL whole-graph backend, which clamps inaccurately — and
worse the tighter the bound. This closes both paths that reach it so a clamped
call stays on CK.
Two entry points, both removed:
flydsl_gfx942_rowexemption from [FlyDSL] [MoE] gfx942: check the CK swiglu_limit limits after the FlyDSL backend #8178, which let a tunedimpl__flydsl_gfx942__row survive the "this row cannot clamp" discardEvidence
Max per-row relative L2 error against a torch fp32 reference with no fp8
intermediate requantization (per_Token, token=64, gfx942):
Not a swapped clamp order: the test's own swapped reference
(
silu(gate).clamp(max=L) * up.clamp(-L,L)) scores > 0.2, FlyDSL scores0.09–0.11. Full matrix and an unverified lead into
gfx9_fp8/gemm1.pyare in#8334.
This also unbreaks main
The routing is why
test_plain_fp8_swiglu_limit_dispatchdies withAttributeError: 'NoneType' object has no attribute 'keywords'on MI300X (run44408312107, shard 5/8): the whole-graph metadata carries
stage1=None. Withthis change that test passes unmodified, including its
inter_dim=192 must raise NotImplementedErrorexpectation — the guard it checksis the
inter_dim % 128one that the FlyDSL fallback was bypassing.#8294 was opened to revert #7361 for that crash. It is not needed if this lands.
Validation
Run on gfx942 (MI308X, cu=80), aiter built from this branch:
test_plain_fp8_swiglu_limit_dispatch— passes, source unmodifiedtest_plain_fp8_swiglu_limit, all 30 (quant, token, limit) combinations —30/30 pass. Before: every case an active clamp routed to FlyDSL failed
(row error 0.0906 / 0.1141, and 42% outside rtol/atol at limit=7); after,
those cases sit at 0.0041–0.0048.
black --check,ruff checkclean.Not verified by me: the CI runner is MI300X (cu=304) and tuned config lookup
keys on
cu_num, so the exact dispatch can differ. The dispatch failure matchedthe CI log line for line; the numerical matrix has not been independently
confirmed at cu=304.
ci:mi300xis set on this PR.Trade-off for the reviewers
#7820 added the fallback because the default heuristics take the 1-stage kernel,
which cannot clamp. With it closed, such a call falls back to CK and an
unsupported shape raises
NotImplementedErrorinstead of silently computing adifferently-clamped result. That is the intended direction — raise rather than
compute wrong — but it is a behavior change for callers that relied on the
fallback, so it is your call whether to take this or to fix the FlyDSL clamp
first.