Skip to content

[quant] fused_dynamic_mx_quant_moe_sort: support hidden up to 16384 - #3

Draft
nholmber wants to merge 1 commit into
mainfrom
fix/mx-quant-moe-sort-wide-hidden
Draft

nholmber wants to merge 1 commit into
mainfrom
fix/mx-quant-moe-sort-wide-hidden

Conversation

@nholmber

Copy link
Copy Markdown
Owner

Draft.

Problem

fused_dynamic_mx_quant_moe_sort dispatches by row width only up to cols <= 32 * BlockSize (8192). Wider rows abort the process:

[AITER] csrc/kernels/quant_kernels.cu:3406 input last dim has exceeded the maximum value 8192

The MXFP8 MoE path hits this at small token counts. For example, hidden 10496 with 256 or 1024 tokens aborts. Larger token counts take another path and run.

Fix

One more dispatch case: cols <= 64 * BlockSize uses 32 values per thread with 2 * BlockSize threads. The other quant kernels in this file already use the doubled block size for wide rows. The error message now reports the new limit (16384).

Validation

MI355X, MXFP8 per_1x32 MoE (gate_mode=INTERLEAVE), hidden 10496, inter 1024, 8 experts, top-2:

  • 256 tokens: abort → rel L2 0.0664 vs bf16, 0.246 ms.
  • 1024 tokens: abort → rel L2 0.0661, 0.284 ms.

TODO before ready: add a hidden > 8192, small-token case to the quant / MoE op tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant