Skip to content

[FlyDSL] AOT replay: pass out= so blockscale bpreshuffle jobs reach FlyDSL - #8433

Merged
zufayu merged 1 commit into
mainfrom
felix/aot-replay-bypass-route
Nov 23, 2026
Merged

zufayu merged 1 commit into
mainfrom
felix/aot-replay-bypass-route

Conversation

@coderfeli

Copy link
Copy Markdown
Collaborator

Motivation

#8291 routed gemm_a8w8_blockscale_bpreshuffle through a registered custom op whenever out is None. The FlyDSL AOT replay (python -m aiter.aot.flydsl.gemm) calls each entry on FakeTensors inside dry_run, and there a custom op runs only its fake. The FlyDSL dispatch is never reached, so the replay reported the rows as [UNREACHED] ... request no FlyDSL kernel and built nothing for them.

On main, replaying 3 rows from a8w8_blockscale_bpreshuffle_tuned_gemm and 3 from a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm gives 9 ok, 0 failed but [UNREACHED] 9 rows.

Change

_a8w8_blockscale_bpreshuffle and _a8w8_blockscale_mxscale_bpreshuffle in aiter/aot/flydsl/gemm.py now pass out=. The op's docstring documents that passing out= bypasses routing and runs the native path, which is the one the replay is meant to drive. out only supplies Y.

Open question

gemm_a8w8_blockscale (the _a8w8_blockscale job) is routed too and has many FlyDSL rows, but it has no out= and so no bypass. Its rows are probably unreached in the same way. It needs a different fix (for example, the replay calling the native function directly), which this PR does not include.

Test

  • Static: gemm_a8w8_blockscale_bpreshuffle takes the routed custom op only when out is None (aiter/ops/gemm_op_a8w8.py).
  • The replay could not be re-run locally: the host's GPU driver hung during this work and every GPU process is stuck in D state. This PR is a draft until the replay above shows the rows reached.

🤖 Generated with Claude Code

Since #8291, gemm_a8w8_blockscale_bpreshuffle without out= goes through a
routed custom op, and under the AOT dry run's FakeTensors only its fake
runs. The replay jobs never reached the FlyDSL dispatch, so their rows were
reported [UNREACHED] and no kernel was built. Naming out= takes the native
path, which is the one the replay is meant to drive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 8433 --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.

@coderfeli
coderfeli marked this pull request as ready for review November 22, 2026 09:17
@coderfeli
coderfeli requested a review from a team November 22, 2026 09:17
@github-actions github-actions Bot changed the title AOT replay: pass out= so blockscale bpreshuffle jobs reach FlyDSL [FlyDSL] AOT replay: pass out= so blockscale bpreshuffle jobs reach FlyDSL Nov 22, 2026
@aiter-bot

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 8236a274432f · 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 is the most important boundary or failure mode introduced by this change, and what evidence covers it?
  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 — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

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

@yitingw1

Copy link
Copy Markdown
Contributor

I tested this on gfx950, since the PR says it couldn't be tested on a GPU. It fixes the gap, and on main the gap is silent, so I think it should land soon.

Setup: aiter main 18f8fdc05a (includes #8356 and #8291), flydsl==0.5.2, CI image rocm/atom-dev@sha256:f3c2fcd6…. I took 20 gfx950 FlyDSL rows from dsv4_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv (8 flydsl_bmm_mxfp8, 10 flydsl_mxfp8_8w, 2 flydsl_mxpsh) and ran GPU_ARCHS=gfx950 python -m aiter.aot.flydsl.gemm --csv <subset> with a separate AITER_FLYDSL_AOT_CACHE_DIR for each arm. For the second arm I applied this PR's two caller changes as-is.

arm replay summary [UNREACHED] .o built time exit
main 20 ok, 0 failed 20 rows 0 4.5 s 0
main + #8433 20 ok, 0 failed 0 85 (bmm_a8w8_mxscale 75, mxfp8_8wave 8, mxscale_preshuffle + splitk_reduce 2) 207 s 0

On main the replay prints 20 ok, exits 0 and ends with Cache is ready., so the build gives no sign of the problem. The only clue is the [UNREACHED] line. Callers such as ATOM's linear.py also call gemm_a8w8_blockscale_bpreshuffle without out=, and at runtime the routed op does run the FlyDSL kernel. So in an image built from current main, all of these kernels miss the AOT cache and fall back to JIT on first use. On DeepSeek-V4-Pro (8× gfx950, DP attention, 8k/1k, c64), the gap between a hit and a miss is the difference between +13.3% and −17%. I measured those numbers on #8356; I have not rerun them end to end on main.

Asks:

  1. Please merge this soon. The table above can serve as the GPU check.
  2. Could the replay warn when UNREACHED is a large share of a table's rows, or fail the build? A routing change silently emptied this table, and the next one will too unless something flags it.
  3. a8w8_blockscale_tuned_gemm (gemm_a8w8_blockscale) already had 13094 UNREACHED rows in my [FlyDSL] [CI] [Build] Add an on-disk AOT cache for the FlyDSL GEMM launchers #8356 prebuild, and this PR doesn't cover it. Is that expected, for example because those rows are served by another backend, or is it a follow-up?
  4. The symlink realpath fix and the CalledProcessError fallback for objcopy from [FlyDSL] Fix the AOT cache and export gfx942 MoE launchers #8435 are not on main, and [FlyDSL] [CI] Launch FlyDSL AOT cache entries through _run_compiled #8451 doesn't carry them either. Which PR will they land in?

@zufayu
zufayu merged commit 309ba2d into main Nov 23, 2026
91 checks passed
@zufayu
zufayu deleted the felix/aot-replay-bypass-route branch November 23, 2026 05:49
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