Skip to content

[FlyDSL] Fix a16wfp4 stage2 cache-key test for FlyDSL 0.5.0 - #7774

Merged
zufayu merged 1 commit into
ROCm:mainfrom
micmelesse:micmelesse/fix-flydsl-cache-key-test
Nov 11, 2026
Merged

zufayu merged 1 commit into
ROCm:mainfrom
micmelesse:micmelesse/fix-flydsl-cache-key-test

Conversation

@micmelesse

@micmelesse micmelesse commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

test_stage2_lds_variants_have_distinct_cache_keys in op_tests/test_flydsl_moe_a16wfp4.py fails on main. It fails in every PR that runs Standard Tests, on MI300X and MI35X:

ImportError: cannot import name '_jit_function_cache_key' from 'flydsl.compiler.jit_function'

#7600 bumped FlyDSL to 0.5.0. FlyDSL 0.5.0 removed _jit_function_cache_key, and #7600 moved the library code off it. #6995 merged about 10 hours later. It added this test, which still imports the removed function.

Technical Details

  • FlyDSL 0.5.0 keys its cache on the traced IR, not on the launcher source. A cache key now exists only for a launch.
  • The test takes the key of each reuse_lds variant as aiter's AOT replay takes it. It launches the variant under dry_run("gfx942", 304) and identified_kernels(). The launch stops at its cache key. Nothing is compiled or run.
  • The test checks that each variant gives a key, and that the two variants share no key. This is the property the test checked before.
  • No other code in aiter uses _jit_function_cache_key or the other FlyDSL internals that 0.5.0 removed.
  • Only the test changes.

Test Plan

All tests ran on MI355X, gfx950.

  • pytest op_tests/test_flydsl_moe_a16wfp4.py -k "cache_keys or stage2_rejects or stage2_reuse" on main and on this branch.
  • pytest op_tests/test_flydsl_moe_a16wfp4.py tests/test_flydsl_aot_replay.py on this branch.

Test Result

  • On main, the cache-key test failed with the ImportError above. The 6 other selected tests passed.
  • On this branch, all 7 selected tests passed.
  • In the full run, the cache-key test and test_flydsl_aot_replay.py passed. 43 tests failed, because the test image had no tabulate, no prebuilt module_moe_asm and a 120 s timeout. These tests pass in main's CI. dry_run restores all its patches on exit, so the new test does not affect later tests.

PR Self-Review

Reviewed revision

aa25ae112

Behavior and intent

The test checks that the stage2 kernels with and without LDS reuse never share a cache entry. It used a FlyDSL function that 0.5.0 removed. It now takes the key through FlyDSL 0.5.0, as aiter's AOT replay does. The library code does not change.

Validation and unverified scope

Validated on MI355X, gfx950. pytest op_tests/test_flydsl_moe_a16wfp4.py -k "cache_keys or stage2_rejects or stage2_reuse" failed the cache-key test on main and passed all 7 tests on this branch. The cache-key test and tests/test_flydsl_aot_replay.py also passed in a full run of both files.

Unverified: the other tests of test_flydsl_moe_a16wfp4.py were not run in CI's image locally. Their 43 local failures come from the image (no tabulate, no prebuilt module_moe_asm, a 120 s timeout), and they pass in main's CI. MI300X and MI35X were not tested locally. The Standard Tests of this PR run the file there.

PR-specific question

Before this PR, test_stage2_lds_variants_have_distinct_cache_keys failed on FlyDSL 0.5.0 with an ImportError, before it checked anything. With this PR, it fails if the stage2 kernels with and without LDS reuse trace to the same cache key, or if a launch gives no key. No existing test covers this. test_moe_clamped_silu runs both variants for numerics, but it does not check that they have separate cache entries. tests/test_flydsl_aot_replay.py tests the replay hooks, not this kernel.

Changed op tests

  • test_flydsl_moe_a16wfp4.py::test_stage2_lds_variants_have_distinct_cache_keys keeps its check. The stage2 kernels with and without LDS reuse must have different cache keys, or one would load the other's kernel. The test now reads the keys with FlyDSL 0.5.0. No other test checks this.

test_stage2_lds_variants_have_distinct_cache_keys imported
flydsl.compiler.jit_function._jit_function_cache_key, which FlyDSL 0.5.0
removed (ROCm#7600 moved the library off it; ROCm#6995 added the test after). It
failed on main and on every PR that runs Standard Tests.

FlyDSL 0.5.0 keys its cache on the traced IR, so take each variant's key
the way aiter's AOT replay does: launch it under dry_run and
identified_kernels, which stops the launch at its key without compiling
or running it, and check the two variants' keys are disjoint.
@micmelesse
micmelesse requested review from a team and a balanced review from Copilot November 10, 2026 21:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

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 7774 --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.

@github-actions github-actions Bot changed the title [FlyDSL] [CI] Fix a16wfp4 stage2 cache-key test for FlyDSL 0.5.0 [FlyDSL] Fix a16wfp4 stage2 cache-key test for FlyDSL 0.5.0 Nov 10, 2026
@aiter-bot

aiter-bot commented Nov 10, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision aa25ae112b08 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

The test checks that the stage2 kernels with and without LDS reuse never share a cache entry. It used a FlyDSL function that 0.5.0 removed. It now takes the key through FlyDSL 0.5.0, as aiter's AOT replay does. The library code does not change.

Validation and unverified scope

Validated on MI355X, gfx950. `pytest op_tests/test_flydsl_moe_a16wfp4.py -k "cache_keys or stage2_rejects or stage2_reuse"` failed the cache-key test on main and passed all 7 tests on this branch. The cache-key test and `tests/test_flydsl_aot_replay.py` also passed in a full run of both files.

Unverified: the other tests of `test_flydsl_moe_a16wfp4.py` were not run in CI's image locally. Their 43 local failures come from the image (no `tabulate`, no prebuilt `module_moe_asm`, a 120 s timeout), and they pass in main's CI. MI300X and MI35X were not tested locally. The Standard Tests of this PR run the file there.

PR-specific question

Before this PR, `test_stage2_lds_variants_have_distinct_cache_keys` failed on FlyDSL 0.5.0 with an `ImportError`, before it checked anything. With this PR, it fails if the stage2 kernels with and without LDS reuse trace to the same cache key, or if a launch gives no key. No existing test covers this. `test_moe_clamped_silu` runs both variants for numerics, but it does not check that they have separate cache entries. `tests/test_flydsl_aot_replay.py` tests the replay hooks, not this kernel.

Changed op tests

- `test_flydsl_moe_a16wfp4.py::test_stage2_lds_variants_have_distinct_cache_keys` keeps its check. The stage2 kernels with and without LDS reuse must have different cache keys, or one would load the other's kernel. The test now reads the keys with FlyDSL 0.5.0. No other test checks this.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot could not review the current head (for example, quota or service failure)

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

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

@micmelesse micmelesse added the ci:mi300x Run MI300X standard and OPUS CI on PRs label Nov 10, 2026
@micmelesse micmelesse removed the ci:mi300x Run MI300X standard and OPUS CI on PRs label Nov 11, 2026
@zufayu
zufayu merged commit 1350def into ROCm:main Nov 11, 2026
zufayu added a commit that referenced this pull request Nov 11, 2026
The previous run's merge commit was computed before #7774 landed, so it still
carried the FlyDSL 0.5.0 test breakage. Nothing in this branch changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zufayu added a commit that referenced this pull request Nov 11, 2026
The previous run's merge commit was computed before #7774 landed, so it still
carried the FlyDSL 0.5.0 test breakage. Nothing in this branch changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zufayu added a commit to zufayu/aiter that referenced this pull request Nov 11, 2026
Brings in ROCm#7774, which fixes test_flydsl_moe_a16wfp4's import of a private
FlyDSL symbol removed in 0.5.0. That fix has been on main since 05:21Z, but
CI checks out the PR head directly rather than a merge with main, so a
branch cut before it keeps failing however many times the run is repeated.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
vedenev-amd added a commit that referenced this pull request Nov 11, 2026
CI on ff7c915 failed only in test_flydsl_moe_a16wfp4.py, which imported a FlyDSL helper
that FlyDSL 0.5.0 no longer has; main fixed the test in #7774 after the previous merge.
No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
zufayu added a commit that referenced this pull request Nov 11, 2026
…cumented (#7787)

* docs(plugin): document every routed contract, and gate that it stays documented

`plugin_contracts.json` pins a routed op's signature, which is names and
arity. It cannot say what a parameter MEANS -- and the pair whose meanings
differ is routinely the pair whose signatures look alike. An out-of-tree
provider implements against the prose or against nothing.

Four of the five routed ops on main had no docstring at all
(`pertoken_quant`, `rmsnorm` v2, `rmsnorm_with_add`,
`gemm_a8w8_blockscale_bpreshuffle`), and the fifth,
`gemm_a8w8_blockscale`, documented its backend dispatch at length without
ever saying what it returns. All five now state parameter meanings, shapes
and -- the fact a signature cannot carry -- whether the op returns a new
tensor or writes into the caller's.

`fused_qk_norm_rope_cache_quant_shuffle` is documented here too. It is not
routed on main; #7728 routes it, and this way that PR does not also have to
carry the prose.

Three gates keep it that way: every routed op has a docstring; every
docstring says what it returns or writes; and the scan is pinned against
the contract baseline so neither gate can pass by finding nothing.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(tests): pin the vacuity gate to the baseline, not to a count

The gate asserted `>= 10` routed ops -- a number taken from a tree where
#7728 had already landed its seven. On `main` there are five, so the gate
failed on the very thing it was added to protect.

A count was the wrong pin anyway: it has to be revised every time an op is
routed, and it is a weaker statement than the one already available. The
cross-check against `plugin_contracts.json` is what actually proves the scan
is live, so a non-empty scan plus that equality is the whole invariant.

Also applies Black, which the repo's style gate runs and which disagrees with
`ruff format` on how to wrap this file's asserts.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* ci: retrigger against main carrying #7774

The previous run's merge commit was computed before #7774 landed, so it still
carried the FlyDSL 0.5.0 test breakage. Nothing in this branch changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: zufayu <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
zufayu added a commit that referenced this pull request Nov 12, 2026
…lings converge (#7791)

* feat(plugin): route MLA sparse prefill where its two spellings converge

`mla_sparse_prefill` and `pa_sparse_prefill_opus` are one op under two public
names: identical arguments, forwarded unchanged to the same
`_opus_sparse_prefill`, the second differing only by pinning the backend the
first would have chosen anyway (`_check_backend` admits only "opus").

Every downstream caller on the DSV4.1 prefill path uses the backend-named
spelling -- vLLM, SGLang and ATOM all import `pa_sparse_prefill_opus`, none
imports the neutral name. Routing either spelling alone would therefore
cover nobody, and routing `_opus_sparse_prefill` would put a backend in the
contract. So the route goes on the layer both call, which is the pattern
`rmsnorm` already uses for `rms_norm` / `rmsnorm2d_fwd`.

`backend=` stays above that layer. It picks which native implementation AITER
would run, which the dispatcher settles before the op begins; a provider has
one kernel rather than a choice of AITER's, so being handed a pin naming
AITER's would leave it declining every call from the spelling that pins.

No behaviour change and no downstream change: both names take the same path
they took before, one frame lower.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* ci: retrigger against main carrying #7774

The previous run's merge commit was computed before #7774 landed, so it still
carried the FlyDSL 0.5.0 test breakage. Nothing in this branch changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* ci: retrigger after a submodule fetch failure

Triton shard 7 failed on 'GnuTLS recv error' fetching composable_kernel,
not on anything in this branch. The run could not be re-run through the
API, so this takes a fresh one.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Revert an unrelated reformat of sparse_mla_fp8.py

Resolving the last conflict I ran black over aiter/ and tests/ wholesale
instead of the files this branch touches. That collapsed two @gluon.jit
signatures in sparse_mla_fp8.py onto 200-character lines -- lines whose
author had marked '# fmt: skip' precisely so a formatter would leave them
alone. The local black evidently treats that marker on a multi-line
signature differently from the one CI pins, and the file was passing the
style gate on main either way, so the change was loss with no gain.

Back to main's version. Nothing else in this branch touches that file.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: zufayu <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
vpietila-amd pushed a commit that referenced this pull request Nov 12, 2026
…lings converge (#7791)

* feat(plugin): route MLA sparse prefill where its two spellings converge

`mla_sparse_prefill` and `pa_sparse_prefill_opus` are one op under two public
names: identical arguments, forwarded unchanged to the same
`_opus_sparse_prefill`, the second differing only by pinning the backend the
first would have chosen anyway (`_check_backend` admits only "opus").

Every downstream caller on the DSV4.1 prefill path uses the backend-named
spelling -- vLLM, SGLang and ATOM all import `pa_sparse_prefill_opus`, none
imports the neutral name. Routing either spelling alone would therefore
cover nobody, and routing `_opus_sparse_prefill` would put a backend in the
contract. So the route goes on the layer both call, which is the pattern
`rmsnorm` already uses for `rms_norm` / `rmsnorm2d_fwd`.

`backend=` stays above that layer. It picks which native implementation AITER
would run, which the dispatcher settles before the op begins; a provider has
one kernel rather than a choice of AITER's, so being handed a pin naming
AITER's would leave it declining every call from the spelling that pins.

No behaviour change and no downstream change: both names take the same path
they took before, one frame lower.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* ci: retrigger against main carrying #7774

The previous run's merge commit was computed before #7774 landed, so it still
carried the FlyDSL 0.5.0 test breakage. Nothing in this branch changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* ci: retrigger after a submodule fetch failure

Triton shard 7 failed on 'GnuTLS recv error' fetching composable_kernel,
not on anything in this branch. The run could not be re-run through the
API, so this takes a fresh one.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Revert an unrelated reformat of sparse_mla_fp8.py

Resolving the last conflict I ran black over aiter/ and tests/ wholesale
instead of the files this branch touches. That collapsed two @gluon.jit
signatures in sparse_mla_fp8.py onto 200-character lines -- lines whose
author had marked '# fmt: skip' precisely so a formatter would leave them
alone. The local black evidently treats that marker on a multi-line
signature differently from the one CI pins, and the file was passing the
style gate on main either way, so the change was loss with no gain.

Back to main's version. Nothing else in this branch touches that file.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: zufayu <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
eppaneamd added a commit that referenced this pull request Nov 13, 2026
Brings in #7774, which ports op_tests/test_flydsl_moe_a16wfp4.py's
stage-2 cache-key test to FlyDSL 0.5.0. The version this branch last
merged imports _jit_function_cache_key, which FlyDSL 0.5.0 does not have,
so that test failed in CI. No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Rony Leppänen <[email protected]>
eppaneamd added a commit that referenced this pull request Nov 13, 2026
Brings in #7774, which ports op_tests/test_flydsl_moe_a16wfp4.py's
stage-2 cache-key test to FlyDSL 0.5.0. The version this branch last
merged imports _jit_function_cache_key, which FlyDSL 0.5.0 does not have,
so that test failed in CI. No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Rony Leppänen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants