Skip to content

[Hotfix] Align ReLU2 dispatch with legacy and refresh snapshots - #9129

Merged
gyohuangxin merged 4 commits into
ROCm:mainfrom
zufayu:fix-moe-dispatch-snapshot
Dec 3, 2026
Merged

gyohuangxin merged 4 commits into
ROCm:mainfrom
zufayu:fix-moe-dispatch-snapshot

Conversation

@zufayu

@zufayu zufayu commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two red checks on main (inherited by any PR that rebases) share one root cause: #7139 intentionally added a NotImplementedError guard to legacy (aiter/fused_moe.py) for several ReLU2 + A16W4 + per_1x32 configurations it used to accept, but aiter.moev2's ranking table never learned the matching exclusion — so v2 can still hand some of those configurations a plan for a kernel that was never built.

  • test_legacy_dispatch_matches_golden_snapshot (golden snapshot staleness — the golden records legacy's get_2stage_cfgs decisions only, and [CK] aiter#6643: relu2 for legacy ck_gemm_moe_2stages kernel #7139 changed those for 918 keys per arch; the golden had not been regenerated)
  • test_dispatch_plans_match_legacy (v2/legacy dispatch mismatch — confirmed directly via tests/moe_dispatch/differential.py --check)

Changes

  1. aiter/moev2/segments/ck_tile.py: cktile_split_k now excludes ActivationType.Relu2 outright, the same way it already excludes fp4x2 Swiglu. There is no gate-only ReLU2 split-K kernel instance. The ranking table's a16w4_relu2 entry tries cktile_relu2 first and falls back to cktile_split_k only when that said no — which happens whenever the output dtype isn't bf16, the activation/weight dtypes don't match, the weights aren't both preshuffled, or the call carries scatter/activation-scales. cktile_split_k had no activation check at all, so any of those configurations with a default split-K above 1 fell through to it and got handed a plan for a kernel that was never built — this covers both the half-prepacked case and the fp16-output case (an earlier revision of this PR only fixed the former; see commit history). cktile_relu2 itself is refactored to delegate to a new cktile_relu2_instance_exists, so the "both weights preshuffled, bf16 in/out" condition exists in one place instead of being re-derived at each call site.
  2. tests/moe_dispatch/golden/*.jsonl.gz: regenerated via python tests/moe_dispatch/snapshot.py --update. All 918 changed keys per arch (gfx942, gfx942_cu80, gfx950, gfx1201) are [CK] aiter#6643: relu2 for legacy ck_gemm_moe_2stages kernel #7139's own ReLU2 rejections across its 6 variants (act_scales, input_act_scales, fp8_input, scatter, unshuffled, half_shuffled) — this PR does not introduce any new legacy behavior, it only makes v2 stop disagreeing with it. snapshot.py --check is identical on all four archs after this update.
  3. tests/test_moev2_dispatch.py: extends test_a16w4_defaults with two cases this PR fixes — a half-prepacked ReLU2 call and the fp16-output decode case from review — both with a monkeypatched default_ksplit so the test exercises cktile_split_k directly rather than depending on its heuristic for a particular shape.

Verification

  • python tests/moe_dispatch/snapshot.py --check: identical on all 4 archs.
  • python tests/moe_dispatch/differential.py --check: full run passed (tests/test_moev2_differential.py::test_dispatch_plans_match_legacy, ~38 min).
  • pytest tests/test_moev2_dispatch.py::test_a16w4_defaults: passes with this fix; verified both new assertions fail against the pre-fix ck_tile.py (confirmed by swapping in the prior commit's version of the file) and against an earlier revision of this PR that only patched the shuffle condition in aiter/moev2/migration/a16w4.py (did not cover the fp16-output case).
  • pytest tests/test_moev2_dispatch.py -k "a16w4 or relu2 or situv2 or swiglu or ck_tile": passes, including the existing gfx942-decline and gfx950-accept Relu2 cases this PR does not change.

cc @qli88 (moev2 owner, per this module's coordination note).


Thanks to @valarLip for the detailed review that caught the fp16-output gap, the test not exercising the fix, and the attribution error in an earlier revision's commit message/PR body — addressed above.

PR Self-Review

Reviewed revision

4eac7a7

Behavior and intent

Before this PR, the ranking table's a16w4_relu2 entry (default ranking, no tuned row) falls back to cktile_split_k whenever cktile_relu2 does not cover a ReLU2 call (wrong output dtype, wrong activation/weight dtype, not fully preshuffled, or scatter/activation-scales present). cktile_split_k has no activation check, so a call with a default split-K above 1 gets handed a real MOEMetadata CK-Tile split-K plan — but there is no gate-only ReLU2 split-K kernel instance (csrc/ck_tile_gemm_moe_2stages/gen_instances.py builds none). Legacy raises NotImplementedError for the same configurations (post-#7139). This is insufficient because the golden dispatch snapshot records legacy's decision, and v2's wrong plan diverges from it both in the snapshot comparison and in the direct v2-vs-legacy differential. The fix excludes ActivationType.Relu2 from cktile_split_k outright: whenever the ranking table reaches it for Relu2, cktile_relu2 has already said no, so there is nothing left for cktile_split_k to legitimately claim, regardless of arch, shuffle state, or output dtype.

Validation and unverified scope

  • snapshot.py --check: identical on all 4 archs after --update.
  • differential.py --check (full, all archs/keys, ~38 min): passed.
  • Two unit-level reproductions, each verified to fail on the pre-fix ck_tile.py and pass on the fix: (1) half-prepacked ReLU2 (opus_weights_shuffled=False) with default_ksplit monkeypatched to 14; (2) the reviewer's fp16-output decode case (token=1, topk=8, E=128, I=768, H=2048, fully preshuffled, fp16 output), same monkeypatch.
  • Directly called cktile_split_k/cktile_relu2 with the reviewer's exact repro parameters and confirmed cktile_split_k goes from True (bug) to False (fixed) at ksplit=4.
  • Not run on real GPU hardware (none available in this environment) — all verification is the CPU-only dispatch-selection path, which is what every test this PR fixes or touches exercises.

PR-specific question

Why fix cktile_split_k directly instead of adding a shared relu2_supported(p) predicate consumed by both it and a16w4.takes/why_not (the two-options root-cause suggestion from review)? Once cktile_split_k itself cannot claim Relu2, there is nothing left for a16w4.takes/why_not to additionally guard against at the outer claim gate — the existing ranking-table decline-to-legacy path (already exercised and tested for the gfx942 case, where cktile_relu2 also returns False) now handles every disqualifying Relu2 configuration, not just the arch one. Reusing a shared predicate at both layers was the "right direction, with patch-like parts" the review called out: it would still be two call sites to keep in sync. Making the inner function reject the activation it doesn't support, the same way it already does for Swiglu, isn't a redundant check layered on top of the real fix — it is the real fix, in its one necessary location. Open to being wrong about this if a case exists where a16w4.takes()/claims() returning False early (rather than True, with the resolver declining downstream) is required for correctness rather than being an optimization — I did not find one; the existing gfx942-arch-mismatch Relu2 case already relies on exactly this decline-downstream pattern.

Changed op tests

None (no op_tests/ file changed). tests/test_moev2_dispatch.py::test_a16w4_defaults gained two new assertions (half-prepacked and fp16-output ReLU2) inside the existing test rather than new test functions, since both extend that function's existing ReLU2 coverage.

Two red checks share one root cause: ROCm#7139 made legacy reject some
ReLU2 + A16W4 configs before dispatch (narrowing the CK-Tile per_1x32
quant-type check), but aiter.moev2's a16w4 migration path did not learn
the same rejection.

- aiter/moev2/migration/a16w4.py: `why_not`/`takes` now decline a
  gate-only ReLU2 call whose weights are not both opus_weights_shuffled
  (preshuffled), the same condition legacy's CK-Tile ReLU2 branch
  requires (`cktile_relu2`'s `fully_shuffled`). Without this, a
  half-prepacked ReLU2 call falls through the default ranking table's
  "a16w4_relu2" entry to `cktile_split_k`, which does not exclude
  ReLU2, and gets handed a CK-Tile split-K plan that has no gate-only
  ReLU2 split-K instance -- a wrong dispatch, not a decline. Declining
  here hands the call back to legacy, which raises `NotImplementedError`
  for it, same as before.
- tests/moe_dispatch/golden/*.jsonl.gz: regenerated
  (`tests/moe_dispatch/snapshot.py --update`) to match legacy's
  post-ROCm#7139 ReLU2 rejections (activation scales, and now also the
  half-prepacked case above). `snapshot.py --check` is identical on
  all four archs after this update.
- tests/test_moev2_dispatch.py: extends `test_a16w4_defaults` with the
  half-prepacked ReLU2 case declining back to legacy.

Fixes the `test_legacy_dispatch_matches_golden_snapshot` (golden
snapshot staleness) and `test_dispatch_plans_match_legacy` (v2/legacy
dispatch mismatch) CI failures inherited by any PR rebasing onto main
since ROCm#7139.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@zufayu
zufayu requested a review from a team December 3, 2026 08:36
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Lightweight PR hygiene checks

Heavy CI review gate:

  • GPU-heavy PR CI is gated on the current PR review state.
  • Before the latest revision is approved, heavy workflows such as Aiter Test and Triton Test stop at the CI gate and do not consume GPU runners.
  • After a reviewer approves the current revision, the approval event can start the gated heavy workflows.
  • Pushing a new commit invalidates the previous approval for CI purposes; the latest revision needs approval again before heavy CI runs.
  • ci:* labels select which extra tests to run, but labels do not bypass the review gate.
  • Pushes to main, scheduled runs, and manually dispatched workflows keep their normal behavior.

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 9129 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@aiter-bot

aiter-bot commented Dec 3, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision c44230c5102b · mode shadow

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

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What is the most important boundary or failure mode introduced by this change, and what evidence covers it?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

gyohuangxin
gyohuangxin previously approved these changes Dec 3, 2026

@valarLip valarLip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Action required before merge (4)

Thanks for the quick hotfix. The golden refresh is clean: on each of gfx942, gfx942_cu80, gfx950 and gfx1201, exactly 918 keys change (0 new, 0 missing). They split into 6 Relu2 per_1x32 variants of 153 keys each (act_scales, input_act_scales, fp8_input, scatter, unshuffled, half_shuffled), and every one goes from a CK plan to legacy's #7139 NotImplementedError. There is no unrelated drift, and the 3 commits that landed on main since your base do not touch dispatch. Four things still need changing:

1. Decline every Relu2 config legacy rejects, not only the half-prepacked one. aiter/moev2/migration/a16w4.py:91-94 and :122-127. Legacy's #7139 guard (aiter/fused_moe.py:2938-2968, on every arch) raises for Relu2 + per_1x32 + fp4x2 unless all of these hold: bf16 activations, bf16 output, no scatter, no activation scales, and both weights preshuffled. v2 already declines the activation, scatter and activation-scale cases, and this PR adds the shuffle case. fp16 output is still claimed. local.why_not accepts dtype=fp16 (local.py:191), and takes has no output-dtype term. Example: decode (token=1, topk=8, E=128, I=768, H=2048) with fp16 output and fully preshuffled weights. Then cktile_relu2 is False (ck_tile.py:368), cktile_split_k accepts fp16 (ck_tile.py:425) with ksplit=4, and the CK-Tile Cap allows fp16 (ck_tile.py:495). So the a16w4_relu2 entry returns a CK-Tile split-K plan. Legacy raises dtype=... (expected bf16) for the same call, and csrc/ck_tile_gemm_moe_2stages/gen_instances.py:626,659 builds neither fp16 C nor a Relu2 split-K instance. The snapshot grid has no fp16 Relu2 key (all 3582 Relu2 keys on gfx950 are bf16), so differential.py --check cannot catch this. Fix: see "Root cause vs patch" below. Also add a Relu2 fp16 case to the tests.

2. Make the new test exercise the change. tests/test_moev2_dispatch.py:2043-2049. _a16w4_resolve calls resolver.resolve, which never calls takes/why_not. At _a16w4_problem's shape (token=64, topk=8, E=256), get_ksplit returns 0 (defaults.py:67). The ranking therefore lands on the "CK 2-stage a16w4" decline with or without your a16w4.py change, so the new asserts also pass on main. The comment above them ("an unguarded ranking table would route it into a CK-Tile split-K plan") is false at that shape. Please replace them with direct asserts:

  • in test_why_not_names_the_per_path_refusals: a16w4.why_not(...) == "Relu2 with w1/w2 not opus_weights_shuffled";
  • a16w4.takes(relu2(token=1, opus_weights_shuffled=False)) is False.

In test_claims_and_takes_agree_on_key_fields, the gate-only Relu2 change uses untagged weights. After this PR both sides decline it, so the claimed Relu2 path no longer has a parity case. Please add a variant with is_shuffled=True weights.

3. Update the module docstring. a16w4.py:12-17 still says Relu2 "with fp16 output or weights not both preshuffled, and without split-K" goes to the CK branch. After this PR, not-both-preshuffled Relu2 is declined at the claim whatever the split-K, and item 1 changes the fp16 part. Please also add these cases to the "(legacy raises)" list on line 16.

4. Fix the squash text (aiter squashes with COMMIT_MESSAGES, so the commit message lands on main). It says the goldens were regenerated for "activation scales, and now also the half-prepacked case above". snapshot.py records legacy get_2stage_cfgs only, so the a16w4.py change cannot move a golden. All 918 keys per arch come from #7139: activation scales (act_scales, input_act_scales, fp8_input), scatter, unshuffled and half_shuffled. Also, #7139 added the per_1x32 Relu2 check; it did not narrow an existing one. In the PR body, "reverting just a16w4.py → --check 918 DIFFERENT" cannot be right for the same reason; please re-check it.

Pre-existing (not required for this PR): legacy routes gfx942 decode Relu2 (bf16, fully preshuffled) to CK-Tile split-K. For example, golden gfx942 grid|base|M=1|H=2048|I=768|E=128|k=8|Relu2|… gives cktile_moe_stage1 split_k=4. But gen_instances.py:659 builds no Relu2 split-K instance. This is likely a gap in #7139's guard (it dropped the gfx950-only gate), and v2 mirrors it. It is worth a follow-up issue.

Root cause vs patch

Root problem: v2 restates legacy's Relu2 support rule by hand, term by term. The "both weights preshuffled" condition now exists in four places (fused_moe.py:2957, ck_tile.py:370, a16w4.py:91, a16w4.py:127), and the output-dtype term was missed. Clean root fix: one predicate. Either factor legacy's per_1x32 Relu2 checks into a helper in fused_moe.py that both the legacy raise and moev2 call, or add a moev2 relu2_supported(p) used by both cktile_relu2 (plus arch == "gfx950") and a16w4.takes. Then any term #7139-style changes add is picked up by both sides. Verdict: right direction, with patch-like parts.


Reviewed at 7f11868 (aiter first review; two independent passes, code trace plus golden decode on CPU; aiter does not import on the review host). Heavy CI (Standard Tests 1 GPU) has not run on this head yet: the review gate is still closed.

Per review: the previous commit's `aiter/moev2/migration/a16w4.py` check
(decline ReLU2 unless fully preshuffled) only covered the shuffle axis of
the bug. A ReLU2 call with an unsupported *output dtype* (fp16) reaches
the exact same `cktile_split_k` gap by a different route and was still
unfixed, and the added test passed even on unpatched code (the default
split-K for its shape happened to be <=1, so `cktile_split_k` never
engaged either way).

Root-cause fix instead, in `aiter/moev2/segments/ck_tile.py`:
`cktile_split_k` now excludes `ActivationType.Relu2` outright, the same
way it already excludes fp4x2 Swiglu. There is no gate-only ReLU2
split-K kernel instance; whenever the ranking table's `a16w4_relu2`
entry reaches `cktile_split_k` for a ReLU2 call, `cktile_relu2` has
already said no (wrong output dtype, wrong activation/weight dtype,
not fully preshuffled, or scatter/activation-scales), so there is
nothing left for `cktile_split_k` to legitimately claim -- regardless
of arch or shuffle state. This also undoes the `aiter/moev2/migration/a16w4.py`
change from the previous commit: it is no longer needed once the
exclusion lives at its actual source, and keeping it would have left
the same condition duplicated in two places for no reason.
`cktile_relu2` itself now delegates to a new `cktile_relu2_instance_exists`
rather than repeating its six conditions a second time.

tests/test_moev2_dispatch.py: replaces the shuffle-only test case with
one that forces the split-K above 1 (`default_ksplit` monkeypatched, so
the test does not depend on its heuristic for a particular shape) for a
half-prepacked ReLU2 call. Verified this fails against both the
previous commit's fix and against unpatched `cktile_split_k`, and
passes with this one.

Golden snapshots are unchanged by this commit (still identical on all
four archs) -- the ReLU2 rejections they record are ROCm#7139's, not this
PR's; this PR only makes v2 agree with them.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Per review: add the specific case cited (decode token=1, topk=8, E=128,
I=768, H=2048, fp16 output, fully preshuffled) as an explicit assertion,
in addition to the half-prepacked one already there. Both now exercise
the same cktile_split_k fix from the previous commit; verified this one
also fails against the pre-fix ck_tile.py.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@zufayu

zufayu commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@valarLip Thanks for the thorough review — addressed all 4 points:

  1. fp16 output gap: fixed at the actual source instead of patching a16w4.py termwise. cktile_split_k now excludes ActivationType.Relu2 outright (same as it already excludes fp4x2 Swiglu), so it can no longer claim any Relu2 call regardless of output dtype, arch, or shuffle state — not just the half-prepacked case the first revision covered. Verified against your exact repro (token=1, topk=8, E=128, I=768, H=2048, fp16 out, fully preshuffled): cktile_split_k goes from True to False at ksplit=4.
  2. Test doesn't exercise the fix: replaced with a direct test against cktile_split_k/cktile_relu2 via _a16w4_resolve, with default_ksplit monkeypatched so it doesn't depend on _a16w4_problem's shape happening to produce ksplit>1. Added your fp16-output case as a second explicit assertion. Both verified to fail pre-fix and pass post-fix. Since the fix moved to cktile_split_k and no longer touches a16w4.py's why_not/takes at all, test_why_not_names_the_per_path_refusals and test_claims_and_takes_agree_on_key_fields are unaffected (re-ran both, still pass, no new parity case needed).
  3. Docstring: moot now — a16w4.py is fully reverted to its pre-PR state (no changes), since the fix lives entirely in ck_tile.py.
  4. Commit/PR attribution: rewrote both. All 918 keys per arch are [CK] aiter#6643: relu2 for legacy ck_gemm_moe_2stages kernel #7139's; this PR doesn't move the snapshot, it makes v2 agree with it. Removed the incorrect "reverting a16w4.py → 918 DIFFERENT" claim.

On your root-cause suggestion (shared predicate at both cktile_split_k/cktile_relu2 and a16w4.takes): I went with excluding Relu2 in cktile_split_k alone rather than also gating a16w4.takes/why_not, since once cktile_split_k can't claim it, the existing decline-to-legacy path in the ranking table (already relied on for the gfx942-arch-mismatch case) covers every disqualifying condition. Said more in the PR self-review's "PR-specific question" — genuinely open to being told this is wrong if there's a correctness reason (not just an optimization) for the outer gate to decline early too.

Full differential.py --check (all archs/keys) passed on this revision.

@zufayu

zufayu commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Correction to my last comment: the full differential.py --check that passed (~38 min) was run against the previous revision (the a16w4.py-only fix). I have not yet re-confirmed the full run against this final cktile_split_k revision — it's running now in the background and I'll report back when it finishes. The targeted unit reproductions (both new test assertions, plus direct calls to cktile_split_k/cktile_relu2 with your exact repro parameters) are confirmed against this revision, but the full scan is still outstanding.

@zufayu

zufayu commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

This merged before I could push the fix for the regression I found in the full differential.py --check (your review correctly predicted this shape of issue: cktile_relu2's arch == "gfx950" gate vs. legacy's own guard not checking arch at all). Follow-up with the corrected, narrower exclusion plus a second independent differential-tooling fix it surfaced: #9140. Full differential --check passed on it (~38 min).

zufayu added a commit that referenced this pull request Dec 3, 2026
…ential.py gap (#9140)

* Fix a regression from the last commit: don't exclude every Relu2

The full `differential.py --check` on the previous commit failed: excluding
Relu2 from `cktile_split_k` unconditionally was too broad. `cktile_relu2`
additionally requires `arch == "gfx950"`, but legacy's own per_1x32 Relu2
guard does not gate on arch at all -- a fully-supported Relu2 call (bf16,
fully preshuffled, no scatter/activation-scales) on gfx942 still reaches
legacy's real CK-Tile split-K path and gets a real plan from it. The
previous commit made v2 decline that case too, disagreeing with legacy in
the other direction: `grid|base|M=1|H=7168|I=256|E=256|k=8|Relu2|...`
(and several sibling grid variants) now declined when legacy still runs
them.

Narrowed the exclusion to match: `cktile_split_k` now excludes Relu2 only
when `cktile_relu2_instance_exists(p)` is False (the non-arch-gated
predicate -- wrong output dtype, wrong activation/weight dtype, not fully
preshuffled, or scatter/activation-scales), which is exactly the set of
configurations legacy's guard rejects. A fully-supported Relu2 call still
reaches `cktile_split_k` regardless of arch, matching legacy; only a call
`cktile_relu2_instance_exists` does not cover is excluded, regardless of
arch, closing the original bug for every arch rather than only gfx950.

Verified directly against three cases: the M=1/gfx942/fully-shuffled
regression case above (now True again, matching legacy), the
half-prepacked bug case (still False), and the fp16-output bug case
(still False). `snapshot.py --check` still identical on all 4 archs.
Full `differential.py --check` running in the background; will confirm
once it finishes rather than claim it passed before it has.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* differential.py: account for #7139's Relu2 raise under a16w4_relu2's decline

The full differential --check still failed after the previous commit, but
with a different, pre-existing problem: `legacy_decline`'s generic mapping
assumes any "CK 2-stage a16w4 is not ported" decline means legacy runs
`ck_moe_stage1`. That was true before #7139. After it, a per_1x32 Relu2
call this module's `a16w4_relu2` ranking entry declines for (the same
`cktile_relu2_instance_exists` condition the last two commits turned into
actual dispatch behavior) has legacy *raise* `NotImplementedError` instead
-- not reach `ck_moe_stage1` at all. The tool compared the wrong
expectation and reported every such key as a mismatch, independent of this
PR's dispatch fix (reproduced the same mismatch for the plain "unshuffled"
variant, whose decline through `cktile_split_k`'s `any_shuffled` check
predates this PR entirely).

`legacy_decline` now recognizes this one case and returns None (the
"legacy does not run a named 2-stage branch" result `compare()` already
checks against the golden record's "error" field) instead of the
`ck_moe_stage1` assumption.

Still verifying: full differential --check running in the background;
not claiming this passes until it finishes.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
MengqingCao added a commit that referenced this pull request Dec 3, 2026
Picks up #9129 and #9140 (ReLU2 dispatch), which the red Standard Tests need.

Co-Authored-By: Claude <[email protected]>
MengqingCao added a commit to MengqingCao/aiter that referenced this pull request Dec 4, 2026
Picks up ROCm#9129 and ROCm#9140 (ReLU2 dispatch), which the red Standard Tests need.

Co-Authored-By: Claude <[email protected]>
MengqingCao added a commit that referenced this pull request Dec 4, 2026
…-wire

Brings in aiter main (#9129) through the base branch.

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants