Repository navigation
[FlyDSL] Fix a16wfp4 stage2 cache-key test for FlyDSL 0.5.0 - #7774
Conversation
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.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
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 |
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]>
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]>
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]>
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]>
…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]>
…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]>
…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]>
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]>
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]>
Motivation
test_stage2_lds_variants_have_distinct_cache_keysinop_tests/test_flydsl_moe_a16wfp4.pyfails on main. It fails in every PR that runs Standard Tests, on MI300X and MI35X:#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
reuse_ldsvariant as aiter's AOT replay takes it. It launches the variant underdry_run("gfx942", 304)andidentified_kernels(). The launch stops at its cache key. Nothing is compiled or run._jit_function_cache_keyor the other FlyDSL internals that 0.5.0 removed.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.pyon this branch.Test Result
ImportErrorabove. The 6 other selected tests passed.test_flydsl_aot_replay.pypassed. 43 tests failed, because the test image had notabulate, no prebuiltmodule_moe_asmand a 120 s timeout. These tests pass in main's CI.dry_runrestores all its patches on exit, so the new test does not affect later tests.PR Self-Review
Reviewed revision
aa25ae112Behavior 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 andtests/test_flydsl_aot_replay.pyalso passed in a full run of both files.Unverified: the other tests of
test_flydsl_moe_a16wfp4.pywere not run in CI's image locally. Their 43 local failures come from the image (notabulate, no prebuiltmodule_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_keysfailed on FlyDSL 0.5.0 with anImportError, 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_siluruns both variants for numerics, but it does not check that they have separate cache entries.tests/test_flydsl_aot_replay.pytests the replay hooks, not this kernel.Changed op tests
test_flydsl_moe_a16wfp4.py::test_stage2_lds_variants_have_distinct_cache_keyskeeps 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.