Repository navigation
[fix][fmoe] propagate flat_mode through fmoe_g1u1 dispatch - #4675
Merged
Merged
Conversation
PR #4558 added flat_mode to get_heuristic_kernel() and fmoe_fp8_blockscale_g1u1 but missed fmoe_g1u1. On gfx950, when the tuned config selects a flat kernel for the xbf16 MXFP4 path (e.g. Qwen3.5-397B), fmoe_g1u1 calls get_heuristic_kernel with the default flat_mode=0, triggering the AITER_CHECK(cfg.flat == flat_mode) assertion. Add int flat_mode to the fmoe_g1u1 C++ entrypoint and Python stub, and forward it from fused_moe_1stage.
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Both Python and C++ read cfg.flat directly from the config, so passing flat_mode as a parameter was redundant. The AITER_CHECK(cfg.flat == flat_mode) added in PR #4558 caused a crash on gfx950 because fmoe_g1u1 was never wired up to pass it. Remove flat_mode from get_heuristic_kernel, fmoe_g1u1, and fmoe_fp8_blockscale_g1u1. Hardcode cfg.flat == 0 in the heuristic filter to exclude flat kernels (they are always dispatched by explicit kernel name from the tuned config CSV).
valarLip
approved these changes
Aug 11, 2026
valarLip
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cfg.flatdirectly from the config, so theflat_modeparameter added in PR [PERF] gfx942 FMoE: a16 kernel dispatch for GLM-5 decode (T=16-256) #4558 was redundantAITER_CHECK(cfg.flat == flat_mode)caused a crash on gfx950 becausefmoe_g1u1was never wired up to passflat_mode, defaulting to 0 while the config hadflat=1flat_modefromget_heuristic_kernel,fmoe_g1u1, andfmoe_fp8_blockscale_g1u1entirelycfg.flat == 0in the heuristic filter to exclude flat kernels (they are always dispatched by explicit kernel name from the tuned config CSV)Test plan