update moe_smooth_quant dispatch and v2 supports block_m is a multiple of 16#2333
Merged
update moe_smooth_quant dispatch and v2 supports block_m is a multiple of 16#2333
Conversation
…ck_m is a multiple of 16
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the MoE smooth-per-token scaled quantization dispatch to better support block_m values that are multiples of 16, and adjusts the Python-side routing logic for small-token MoE stage1 cases.
Changes:
- Update
moe_smooth_per_token_scaled_quant_v2dispatch math to use a fixedblock_split=16and enforceblock_m % 16 == 0. - Add an
is_balancedflag tomoe_smooth_per_token_scaled_quantto control whether stage1 uses the v1 kernel or asmooth_per_token_scaled_quantfallback for smallM. - Remove outdated commented call examples in
fused_moe_bf16_asm.py.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
csrc/kernels/quant_kernels.cu |
Enforces block_m divisibility by 16 and changes v2 block splitting/indexing to be consistent for non-power-of-2 block_m (as long as divisible by 16). |
aiter/ops/quant.py |
Adds is_balanced flag and changes stage1 small-M dispatch behavior (v1 vs smooth-quant fallback). |
aiter/fused_moe_bf16_asm.py |
Removes commented-out alternative quant call paths around asm_moe. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
valarLip
approved these changes
Mar 19, 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.
…
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist