Skip to content

fix(flydsl-aot): map Situv2 activation in MoE AOT parse_csv - #4429

Merged
valarLip merged 5 commits into
mainfrom
fix-kimik3-situv2-aot
Jul 29, 2026
Merged

valarLip merged 5 commits into
mainfrom
fix-kimik3-situv2-aot

Conversation

@coderfeli

Copy link
Copy Markdown
Collaborator

The FlyDSL MoE AOT precompiler collapsed every non-Swiglu activation to "silu" when building compile jobs. ActivationType.Situv2 (used by the new kimik3_a8w4_tuned_fmoe.csv) therefore compiled its stage1 kernel under an act="silu" cache key, while runtime (fused_moe._flydsl_stage1_wrapper) looks it up under act="situv2". Under FLYDSL_RUNTIME_RUN_ONLY=1 that mismatch surfaces as "no usable AOT cache for launch_mixed_moe_gemm1", failing test_moe_2stage.

Mirror the runtime three-way mapping (and the existing grouped_moe AOT parser): Swiglu -> "swiglu", Situv2 -> "situv2", else "silu".

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

The FlyDSL MoE AOT precompiler collapsed every non-Swiglu activation to
"silu" when building compile jobs. ActivationType.Situv2 (used by the new
kimik3_a8w4_tuned_fmoe.csv) therefore compiled its stage1 kernel under an
act="silu" cache key, while runtime (fused_moe._flydsl_stage1_wrapper) looks
it up under act="situv2". Under FLYDSL_RUNTIME_RUN_ONLY=1 that mismatch surfaces
as "no usable AOT cache for launch_mixed_moe_gemm1", failing test_moe_2stage.

Mirror the runtime three-way mapping (and the existing grouped_moe AOT parser):
Swiglu -> "swiglu", Situv2 -> "situv2", else "silu".

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@coderfeli
coderfeli requested a review from a team July 29, 2026 01:26
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 4429 --add-label <label>

@zufayu
zufayu requested a review from yadaish July 29, 2026 01:56
@valarLip
valarLip merged commit a177781 into main Jul 29, 2026
42 checks passed
@valarLip
valarLip deleted the fix-kimik3-situv2-aot branch July 29, 2026 14:56
zufayu added a commit that referenced this pull request Sep 7, 2026
FlyDSL needs patching after merge 1.66x as often as the repo average: 20 of
the 98 fix-commits that reference another PR touch it, against a 12.3% share
of all commits (194/1577), one-sided binomial p=0.015, measured on aiter main
636098e. Its revert rate is NOT elevated -- 5 of 40, against that same
12.3% -- but n=40 has no power in either direction, so that is "cannot tell",
not "no". The patching is where the signal is, and post-merge patching is
what review is for.

Of its 21 precise fixes, 9 fall into two mechanisms and neither had a rule.

B8 -- a buffer or descriptor bound not tied to the tensor's real extent.
de9f1f8 bound arg_scale_a with max_size=True while scale_a is per-row(M)
and M is ragged; the comment it also corrected ("B and scales are
exact-multiple in N") was false for scale_a, so the code was written to match
a premise that did not hold. Nothing covered this class: num_records,
max_size, buffer_resource and oob_ appear nowhere in rules.md, and B2 -- the
one out-of-bounds rule -- is tl.load without a mask, which cannot fire on a
backend that has no tl. A FlyDSL PR deriving memory-safety got B2 D1 G1.

D12 -- a new ops-side contract the AOT pre-compiler was not taught. #4397
added resolve_flydsl_stage1_tile_n and resolve_flydsl_stage2_tile_k in one
commit, wired only stage2 into AOT, and the stage1 drift lived 32 commits
until #4429.

Both collectors were checked against the commits that introduced the defects,
not only against fixtures. flydslbounds reports arg_scale_a on 3910ab3 and
falls silent on de9f1f8, so the fix does not trip its own rule. aotpair
reports resolve_flydsl_stage1_tile_n on 3135022 and stays quiet about
stage2 -- which that same commit did wire in -- which is the distinction the
rule exists to make.

The first cut of D12 looked for "ops changed, AOT untouched" and would have
found nothing: #4397 does touch AOT (grouped_moe.py +19, moe.py +9). The
defect is a path missed, not a side skipped.

Separately, the card gate had exactly one way through and it was dishonest.
On wave5 PR4862 an agent found a CI problem at Step 7 that no rule covered,
the gate called it UNBACKED, and the only move that clears that gate is for
the finding to have been known earlier -- so it edited answers.txt, a file
that had already passed its own gate, and described this itself as "slightly
dishonest bookkeeping". A gate whose only path through is fabrication trains
fabrication. `-- late finding:` backed by an append-only late_findings.txt is
the exit; a hash ledger keyed on the FIRST passing hash is the lock. Neither
half works alone: the exit alone leaves the door open, the lock alone leaves
a reviewer who genuinely found something late with nowhere to put it.

Two changes planned from reading the code and dropped after measuring them:
adding .cpp to is_kernel (aiter has 12 .cpp/.cc files and none contains a
device kernel, so excluding them is correct) and dropping the .py test in
flydsl-kernel (non-Python is deliberately left to the C path, and a test
says so).
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.

3 participants