Repository navigation
Conversation
The whole-graph batch-1 and decode kernels clamp BF16 activations, so a per-token call that CK can clamp was missing the per-token reference and crashing the dispatch test on stage1 being None. Co-authored-by: Cursor <[email protected]> (cherry picked from commit de8b016)
get_gfx() returns the last GPU_ARCHS entry, so a gfx942;gfx950 wheel dropped the gfx942 MulABScale instances that tuned swiglu_limit rows name. Co-authored-by: Cursor <[email protected]> (cherry picked from commit a298b9a)
_iter_csv_cases selects every tuned row whose kernelName1 contains "flydsl_" and runs it under FLYDSL_RUNTIME_RUN_ONLY=1. The AOT replay in aiter/aot/flydsl/moe.py prebuilds only rows whose kernelName1 starts with "flydsl_" or "cktile_", so it skips the whole-graph impl__flydsl_gfx942__ rows. #8064 added the first such rows for 304 CUs. On MI300X the first of them fails with "FLYDSL_RUNTIME_RUN_ONLY=1 but no usable AOT cache for launch_batch1". Let those rows compile on demand, as the targeted and SiTUv2 cases already do. They still run and are still compared with the reference.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
NOT 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 |
| @@ -0,0 +1,100 @@ | |||
| # SPDX-License-Identifier: MIT | |||
There was a problem hiding this comment.
I checked how CI runs this file and found a real problem. aiter_test.sh runs it as python3 <file>, and the file had only pytest functions, so CI imported it and ran no case. MI300X shard 4 reports it as passed in 0.035 s.
8fb15b7 adds the pytest.main entry point that other pytest-style files in op_tests/ use, for example op_tests/test_mha_optional_flydsl.py. With the CI invocation python3 op_tests/test_moe_ck_codegen_arches.py:
- This head: 2 passed.
- The same file on
main2eb9ef3: 1 failed. TheGPU_ARCHS=gfx942;gfx950lookup lacks 12 tuned gfx942 kernel names. That is the MI300X shard 5 failureUnknown or incompatible CK MoE kernel.
The test checks only the generated lookup and instance sources. It needs no GPU and no hipcc.
Is this what you meant? If you think this check should not be a test, or should live in another place, tell me which and I will change it.
There was a problem hiding this comment.
we prefer pure gpu op test here
aiter_test.sh runs op_tests files as `python3 <file>`. This file had only pytest functions and no entry point, so CI imported it and reported a pass without running a case (0.035 s on MI300X). Add the pytest.main entry point that the other pytest-style files in op_tests use.
|
@zufayu @jatseng-ai Could you review this? It is the hotfix for the
The only failing check of #6277 is this file on MI300X. |
|
@aiter-bot review |
|
aiter-bot — queued behind 1 review(s); expect to start in about 19 min. The box reviews one PR at a time. |
|
@aiter-bot review |
aiter-bot
left a comment
There was a problem hiding this comment.
[ROCm/aiter] PR #8476 — [CK] [FlyDSL] [Bugfix] [Test] test_moe_2stage on MI300X: compile whole-graph impl__ rows on demand (stacked on #8353)
Review (advisory): 🔴 HIGH RISK
Validation (deterministic): NOT RUN — triage required a run (runtime + test families; target op_tests/test_moe_ck_codegen_arches.py) but auto-validation was disabled (REVIEW_AUTO_VALIDATE=0), so no head-matched report exists
Perf (advisory): NOT RUN — the PR's test target exposes no benchmark entry point (CPU-only codegen test); no base-vs-head latency was measured for the fused_moe reroute
Size: 275 lines / 6 files
Design (advisory): stacked on #8353 so one PR turns MI300X green — a test-only fix demonstrably leaves MI300X shard 5 red at the next impl__ row
Human: recommend valarLip review the aiter/fused_moe.py default-dispatch reroute this PR carries from #8353 (keep CK-capable clamped SiLU off the gfx942 FlyDSL whole-graph default): is that the right default for downstream MoE callers on untuned shapes?
🔴 aiter/fused_moe.py changes the default dispatch for gfx942 per-Token FP8 clamped SiLU calls with no tuned row (the new not ck_can_clamp_silu term moves them off the FlyDSL whole-graph default onto the CK runtime-limit stage-1), but the path's de-facto owner has not signed off: the top committer of fused_moe.py is @valarLip (Lingpeng Jin, 16 commits) and the PR carries a single approval (zufayu) with no valarLip review — a downstream-facing contract change landing on CI plus one non-owner approval is the #3593 revert pattern. [verified] Reviewer must @-mention valarLip in a PR comment requesting explicit sign-off for the fused_moe.py dispatch change (carried from #8353) before merge.
1 finding(s) posted inline, on the lines they are about:
op_tests/test_moe_2stage.py:1058— The PR no longer applies to main: its headline hunk (check_aot_cache exempting impl__ rows in…
| # AOT cache entry, so let those cases compile on demand. | ||
| # AOT cache entry, so let those cases compile on demand. Neither do | ||
| # whole-graph impl__ rows, until aiter/aot/flydsl/moe.py replays them. | ||
| kwargs["check_aot_cache"] = ( |
There was a problem hiding this comment.
|
aiter-bot — queued behind 1 review(s); expect to start in about 19 min. The box reviews one PR at a time. |
|
I closed this PR because it is a duplicate of #8353.
|
Summary
op_tests/test_moe_2stage.pyno longer requires a prebuilt FlyDSL AOT entry for whole-graphimpl__rows. This branch also carries the two commits of #8353, because the MI300X run cannot reach this case without them, and it makes #8353's codegen test run in CI.Motivation
op_tests/test_moe_2stage.pyhas failed on MI300X onmainsince 2026-11-16. Of the 41 completedmainruns since #7361, 38 show this failure, and the other three have no retrievable test log for that shard. The file stops at its first exception, so three independent failures hide one another:AttributeError: 'NoneType' object has no attribute 'keywords'intest_plain_fp8_swiglu_limit_dispatch(main run)Unknown or incompatible CK MoE kernel: moe_ck2stages_gemm1_256x16x64x256_1x4_MulABScale_...at per-token limit 7.0 (main run before #7820)GPU_ARCHS=gfx942;gfx950wheelFLYDSL_RUNTIME_RUN_ONLY=1 but no usable AOT cache for launch_batch1(#8353 atf0e28ecae)Cause of failure 3:
_iter_csv_casesselects each tuned row whosekernelName1containsflydsl_and runs it underFLYDSL_RUNTIME_RUN_ONLY=1._reaches_flydslinaiter/aot/flydsl/moe.py) prebuilds only rows whosekernelName1starts withflydsl_orcktile_. It skipsimpl__flydsl_gfx942__rows, so the wheel has nolaunch_batch1entry.impl__flydsl_gfx942__rows for 304 CUs. The earlier rows of this kind are for 80 CUs, and no CI runner has 80 CUs.A PR that fixes only one of the three cannot show a green MI300X run.
ci:mi300xPRs such as #6277 stay blocked onAiter Test Gateuntil all three are fixed.Changes
op_tests/test_moe_2stage.py:check_aot_cacheis false for rows whosekernelName1starts withimpl__. These rows compile on demand, as the targeted and SiTUv2 cases already do. They still run and are still compared with the reference.op_tests/test_moe_ck_codegen_arches.py(commit 4): add thepytest.mainentry point that other pytest-style files inop_tests/use.aiter_test.shruns the file aspython3 <file>. Without the entry point, CI imported the file and reported a pass without running a case.a298b9aa9, cherry-picked unchanged. After [FlyDSL] [fused_moe] Keep CK-capable clamped SiLU off the gfx942 FlyDSL default #8353 merges, a rebase reduces this PR to commits 3 and 4.Trade-off: the test stops asserting that
impl__rows are prebuilt. In the shipped tuned tables this covers 4 rows at 304 CUs and 153 rows at 80 CUs, allimpl__flydsl_gfx942__, and no row at 256 CUs. The wheel does not prebuild them today, so the assertion can return when the replay covers them.Testing
MI300X was tested by CI only, on
0209455e0(this head without commit 4): bothci:mi300xruns pass all 8 MI300X shards andAiter Test Gate(run 45115924822, run 45115924612). The CI run of the current head is the check for commit 4.Documentation
The change of this PR is in a test.
Dependencies
Breaking Changes
None.
PR Self-Review
Reviewed revision
8fb15b7
Behavior and intent
Commit 3 changes test behavior only. Tuned rows whose
kernelName1starts withimpl__now run withoutFLYDSL_RUNTIME_RUN_ONLY=1, so their FlyDSL kernels compile on demand. The existing behavior is insufficient because the test requires an AOT entry that the wheel build does not produce, and MI300X fails on the first 304-CUimpl__flydsl_gfx942__row.Commit 4 changes test execution only.
python3 op_tests/test_moe_ck_codegen_arches.py, which is howaiter_test.shruns the file, now runs its two cases. Before, it ran none and exited 0.Commits 1 and 2 behave as described in #8353.
Validation and unverified scope
python3 op_tests/test_moe_ck_codegen_arches.py:main2eb9ef3: 1 failed. TheGPU_ARCHS=gfx942;gfx950lookup lacks 12 kernel names ofa8w8_plain_tuned_swiglu_limit_fmoe_gfx942.csv, which is failure 2.0209455e0, without the entry point: exit 0 in 0.02 s and no case runs. CI shows the same: MI300X shard 4 reports the file as passed in 0.035 s._iter_csv_casesand both versions of thecheck_aot_cachecondition to the tuned fmoe tables underaiter/configs. The condition changes for 4 rows at 304 CUs and 153 rows at 80 CUs, allimpl__flydsl_gfx942__, and for no row at 256 CUs. The scan reads the tables directly and does not reproduce the runtime merge.0209455e0(this head without commit 4),GPU_ARCHS=gfx942;gfx950wheel:op_tests/test_moe_2stage.pypasses in both runs (shard 5, shard 5). The file last passed on MI300X onmainin run 43787819317 (2026-11-16, before [CK] [JIT] [aiter] Clamp FP8 per_Token / per_Tensor SiLU on #7019's runtime swiglu_limit #7361).moe_ck2stages_gemm1_256x16x64x256_1x4_MulABScale_.... The wheel contains the kernel, and the limit cases complete without an assertion.impl__flydsl_gfx942__rows compile on demand and passstrict_accuracy:logits_diffis 1.13e-5 to 1.28e-5 over both runs, against a gate of 0.01. Their element-wise check atatol=rtol=0.01reports 17.3% to 19.2% of elements outside the tolerance. The other cases of the shard that print this check report 12.7% to 68.1%, median 17.7%. That check does not gate on its own.main2eb9ef3): [FlyDSL] [fused_moe] Keep CK-capable clamped SiLU off the gfx942 FlyDSL default #8353 ata298b9aa9, which is this branch without commits 3 and 4, fails MI300X shard 5 at the first 304-CUimpl__flydsl_gfx942__row withno usable AOT cache for launch_batch1.Unverified:
impl__flydsl_gfx942__rows for 80 CUs. No CI runner has 80 CUs, so no run exercises them before or after this change.PR-specific question
Question: which architecture, dtype and shape boundaries select the changed kernel path, and what invariant prevents unsupported inputs from reaching it?
Commits 3 and 4 change no kernel path. Commit 3 changes only whether
test_moe_2stage.pysetsFLYDSL_RUNTIME_RUN_ONLY=1forimpl__rows. Commit 4 changes only how CI invokes the codegen test.Commits 1 and 2 (#8353):
get_2stage_cfgs(aiter/fused_moe.py). The gfx942 FlyDSL whole-graph default is taken only on gfx942, for SiLU with an activeswiglu_limit,QuantType.per_Token, FP8 weights and no usable tuned row. The new termnot ck_can_clamp_siluremoves the calls with FP8 activations andinter_dim % 128 == 0. Those calls stay on the CK runtime-limit stage 1. Other shapes, for exampleinter_dim576 or 192, keep the FlyDSL default. A tunedimpl__flydsl_gfx942__row is resolved before this branch (full_impl is not None) and is not affected.gen_instances.py. AGPU_ARCHS=gfx942;gfx950build adds the gfx942 instance list to the lookup. gfx942-only tiles are wrapped in#if !defined(__HIP_DEVICE_COMPILE__) || defined(__gfx942__), so the gfx950 device pass does not compile them. The heuristic still followsget_gfx(). A gfx942-only tile is reached only through a tuned row that names it, and tuned rows are keyed bygfxandcu_num.Changed op tests
op_tests/test_moe_2stage.py(commit 3): covers tuned-row dispatch and numerics throughfused_moe. The change only stops requiring a prebuilt AOT entry forimpl__rows.op_tests/test_moe_ck_codegen_arches.py(commit 4): the entry point makes CI run its two cases. The cases are [FlyDSL] [fused_moe] Keep CK-capable clamped SiLU off the gfx942 FlyDSL default #8353's: aGPU_ARCHS=gfx942;gfx950codegen keeps every tuned gfx942 kernel name in the lookup, and a gfx942-only codegen is unchanged. No other test covers the codegen without a GPU and hipcc.op_tests/test_moe_2stage.pyandop_tests/test_flydsl_moe_gfx942.py(commits 1 and 2): unchanged from [FlyDSL] [fused_moe] Keep CK-capable clamped SiLU off the gfx942 FlyDSL default #8353; see its PR Self-Review.