MOE: add AITER_MOE_FORCE_BF16_ACT to force bf16 activations (opt-in)#3593
Open
sphinx07 wants to merge 1 commit into
Open
MOE: add AITER_MOE_FORCE_BF16_ACT to force bf16 activations (opt-in)#3593sphinx07 wants to merge 1 commit into
sphinx07 wants to merge 1 commit into
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
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
Adds an opt-in environment variable,
AITER_MOE_FORCE_BF16_ACT, that forcesbf16 activations for the
per_1x32(MXFP4) SwiGLU MoE paths infused_moe_.By default the activation dtype is auto-selected:
bf16for small M,fp4x2for large M (prefill)fp8on gfx950 for large MMake the per_1x32 SwiGLU bf16→fp8 activation threshold configurable via
AITER_MOE_BF16_FP8_BOUND (default 512) to avoid the gfx950 fp8 prefill regression for MXFP4 w4a16. This flag lets them opt in without code changes.
Behavior
AITER_MOE_FORCE_BF16_ACT=1→q_dtype_a = bf16on theper_1x32SwiGLUpaths, for both small and large M.
0(default) → no change; the existing auto-selection logic runsexactly as before.
The flag is process-scoped and default-off, so it has no impact on existing
users, other models, quant types, or architectures.
Trade-off
Forcing bf16 activations skips the fp4x2/fp8 fast paths, trading throughput for
activation precision. It is intentionally opt-in so only deployments that need
it pay that cost.
Test plan
per_1x32 SwiGLU separated/interleaved cases (bf16/fp4x2/fp8 as before).
AITER_MOE_FORCE_BF16_ACT=1: verified the MoE dispatch stays on the bf16activation path for both decode (small M) and prefill (large M) on gfx950
with an MXFP4 W4A16 model; no fp4x2/fp8 activation path taken.