Repository navigation
Conversation
The launchers the MegaMoE replay (aiter.aot.flydsl.mega_moe) compiles now launch through the export_to_c cache: prepare, the stage-1 bundle, the small- and large-input stage 1, stage 2, the aligned-pair stage 2, the 1x32 MX quant and the combine after the fused GEMM2. MegaMoE warms its kernels up with tensor_shim._preload_compiled, which called flyc.compile itself, so a bound launcher never reached the cache: - _preload_compiled of a bound launcher builds its entry in a prebuild, and in a process that serves loads the entry without launching it; with no entry it preloads on the JIT path as before. - _compile_and_keep does the same for a caller that keeps the compiled function and calls it directly (the combine). - The Stage1Config variants of the bundle are keyed by their field values. The fixed-slot stage 1, compile_gemm1, the scale-sort quant, dispatch and the regular combine are not compiled by the replay and stay on the JIT path, as do the TP, internode and gfx1250 MegaMoE. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision 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
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
…alization key Co-Authored-By: Claude Fable 5.2 <[email protected]>
…s branch The conv dispatch keeps the function its first launch got through tensor_shim._compile_and_keep, which replaces aot_launch.loaded_kernel: a key with no entry no longer goes through _run_compiled on every launch. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Summary
Follow-up to #8565. The launchers the gfx950 MegaMoE replay (
python -m aiter.aot.flydsl.mega_moe) compiles now launch and preload through the FlyDSLexport_to_cAOT cache, so a serving process loads prebuilt objects instead of tracing them.Motivation
MegaMoE was the last AOT replay whose launchers took the JIT path: every process traced them on first use or in
preload_aot_bundles().Changes
mega_moe_preparecompile_mega_moe_prepare(also the fast EP8 prepare it returns)aot_factorymega_moe_stage1_bundlecompile_mega_moe_stage1_bundleaot_factory; itsStage1Configvariants are keyed by their field valuesmega_moe_small_m_stage1,mega_moe_large_m_stage1compile_mega_moe_stage1ofmega_moe_small_m.py/mega_moe_large_m.pyaot_factorymega_moe_stage2,mega_moe_stage2_aligned_paircompile_mega_moe_stage2,compile_mega_moe_stage2_aligned_pairaot_factory(replaces module-level dicts)mega_moe_mx_quantbuild_per_1x32_mx_quant_moduleaot_factorymega_moe_combineskip_stage1)aot_factory; the op keeps the function it getsShared code:
tensor_shim._preload_compiledcalledflyc.compileitself, so a bound launcher never reached the cache. For a bound launcher it now builds the entry in a prebuild, and in a process that serves loads the entry without launching it; with no entry it preloads on the JIT path as before (one error logged).tensor_shim._compile_and_keep: the same for a caller that keeps the compiled function and calls it directly (the combine).aot_launch.preload_bound,FlyDSLAotCache.preload.Not converted: the fixed-slot stage 1,
compile_gemm1, the scale-sort quant, dispatch and the regularcombine()(the replay does not compile them;aiter.distuses the last two outside MegaMoE), and the TP, internode and gfx1250 MegaMoE.Performance (if applicable)
Host time of the lookups that changed, per launch, CPU only: stage 2 2.7 → 1.6 us, stage-1 bundle 1.7 → 2.5 us, prepare 0.32 → 0.36 us, quant 0.11 → 0.18 us. The combine's hot path is unchanged. Kernel code is unchanged (same FlyDSL IR; see Testing). No GPU timing was taken.
Testing
All compile-only, on MI308X (gfx942) with FlyDSL 0.5.3 and no MORI,
GPU_ARCHS=gfx950. MegaMoE runs on gfx950 with MORI only, so nothing here launched a MegaMoE kernel.python -m aiter.aot.flydsl.mega_moe --experts-per-rank 48 --mtpr 8192(16 jobs), twice on one cache directory: 674 entries (prepare 352, small-input stage 1 112, stage 2 96, combine 80, bundle 16, large-input stage 1 8, aligned pair 8, quant 2); the second run builds 0; no launch takes the JIT path. Run twice independently with the same result.flyc.compileof that replay logged: 1176 calls, all made by the cache.AITER_FLYDSL_AOT_CACHE=verifyon that directory: no stale entry.python -m aiter.aot.flydsl.mega_moe, 234 jobs): 7655 entries, 634 MB, 444 s; a second run builds 0 in 148 s.tests/test_flydsl_aot_launch.pyandtests/test_flydsl_aot_cache.pyunder1,verifyand0(34 / 34 / 27 passed, 7 skipped).Unverified:
preload_aot_bundles()in a serving process, the combine's kept function.per_1x32_mx_quantis also the internode MegaMoE's quant, so that now launches throughmega_moe_mx_quant; a size the intranode replay does not build logs one error and traces.Documentation
docs/flydsl_aot_cache.md(§4.4, new §5.5, §7) and.claude/skills/flydsl-aot-export/SKILL.md.Dependencies
Breaking Changes
_preload_compiledof a launcher bound to the cache returns the loaded function (or None in a prebuild) instead of FlyDSL's compiled handle.🤖 Generated with Claude Code