[MOE] Add fused dynamic MXFP8 quant + moe_sort HIP path#3312
Draft
yadaish wants to merge 1 commit into
Draft
Conversation
Adds fused_dynamic_mxfp8_quant_moe_sort_hip that quantizes activations to fp8 with e8m0 group scales and writes the swizzled scale layout consumed by the FlyDSL a8w4 stage1/stage2 GEMM. Wires it into fused_moe_2stages to replace the Triton fused_quant_fp8_sort path, with AITER_MOE_A8W4_BYPASS_QUANT to fall back to the prior unquantized behavior. For e8m0-scaled fp8 output, the divisor is switched to 1/floor_pow2(max) so row_scale stays a pure power of two and matches the 2^(byte-127) dequant scale encoded in the e8m0 byte. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
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.
Adds fused_dynamic_mxfp8_quant_moe_sort_hip that quantizes activations to fp8 with e8m0 group scales and writes the swizzled scale layout consumed by the FlyDSL a8w4 stage1/stage2 GEMM. Wires it into fused_moe_2stages to replace the Triton fused_quant_fp8_sort path, with AITER_MOE_A8W4_BYPASS_QUANT to fall back to the prior unquantized behavior.
For e8m0-scaled fp8 output, the divisor is switched to 1/floor_pow2(max) so row_scale stays a pure power of two and matches the 2^(byte-127) dequant scale encoded in the e8m0 byte.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist