Skip to content

[FlyDSL] Fix the AOT cache and export gfx942 MoE launchers - #8435

Closed
coderfeli wants to merge 3 commits into
mainfrom
felix/fix-flydsl-aot-cache
Closed

coderfeli wants to merge 3 commits into
mainfrom
felix/fix-flydsl-aot-cache

Conversation

@coderfeli

Copy link
Copy Markdown
Collaborator

Summary

Follow up on #8356 with AOT cache fixes and persistent exports for the gfx942 whole-MoE and two-stage A16W launchers.

Changes

  • Return the empty preshuffle GEMM output before GPU dispatch.
  • Record the resolved paths of traced sources and reject disk hits whose source files changed after process start. Advance the cache schema to rebuild entries with incomplete dependencies.
  • Fall back to JIT when objcopy --strip-debug fails. Keep --check read-only and report missing exported objects when AOT is enabled.
  • Export and load Gate/Up, Down, sorted reduction and per-tensor FP8 quantization for gfx942 whole-MoE, plus both A16W GEMM stages. Replay stock gfx942 whole-MoE tuning rows during prebuild.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • User guide updated
  • No new third-party dependencies added

Breaking Changes

The fingerprint schema bump causes a one-time cold AOT cache rebuild. With AOT enabled, --check now fails when an exported object is missing. AITER_FLYDSL_AOT_CACHE=0 checks the underlying FlyDSL cache alone.

PR Self-Review

Reviewed revision

b96c1a4ec511a2119603a25069e096aeab4b73d0

Behavior and intent

The MoE prebuild reaches the same launcher wrappers as runtime dispatch. Those wrappers include the compile options, argument types and device in their in-memory keys. An AOT disk hit reuses the exported host launcher and GPU binary.

Validation and unverified scope

  • Black, Ruff and git diff --check passed.
  • CPU validation with FlyDSL 0.5.1 passed 28 cache and replay tests. The GPU GEMM test was deselected because local ROCm device initialization is blocked.
  • The empty preshuffle path returned its caller-provided zero-row output before querying a CUDA stream.
  • CPU-only gfx942 replay covered three shipped Hunyuan FP8 rows and Kimi K3 A16W4 and A16WI4 rows. It produced 11 exported objects. JIT, export and run-only replay requested identical FlyDSL kernel keys, and run-only mode left the exported files unchanged.
  • The ci:mi300x job runs the added prefill comparison on hardware. Runtime gfx942 correctness and steady-state timing are pending that job.

PR-specific question

Run-only mode rejects an export cache miss before acquiring a write lock. A hit still checks the underlying FlyDSL artifact so replay can identify the kernel.

Changed op tests

op_tests/test_flydsl_moe_gfx942.py compares JIT and a true disk AOT hit for BF16 prefill. It checks both against the Torch reference, asserts identical outputs and reports warm timings for each mode.

Resolve source paths before recording dependencies, and reject entries whose sources changed after process start. Keep run-only checks read-only, fall back to JIT on objcopy failure, and skip empty preshuffle launches.
Route the A16W stages and gfx942 whole-MoE launchers through the export cache, and replay tuned whole-MoE rows. Compare AOT and JIT correctness and steady-state time on gfx942 prefill.
@coderfeli
coderfeli requested a review from a team November 22, 2026 01:07
@coderfeli coderfeli added the ci:mi300x Run MI300X standard and OPUS CI on PRs label Nov 22, 2026
@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 8435 --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.

@aiter-bot

aiter-bot commented Nov 22, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 8013322eb817 · mode shadow

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

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — validation answer must explicitly state what remains unverified (or say none with a reason)

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

Extend the AOT-vs-JIT test from bf16 prefill to FP8 per-tensor prefill
(absmax and quant caches), batch-1 and both decode paths. Explain why
whole-graph gfx942 rows get no num_local_tokens replay variant, and size
the quant kernels' grid from the tensor's device.

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

Labels

ci:mi300x Run MI300X standard and OPUS CI on PRs FlyDSL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants