Add full 16-tier Qwen3-VL FP4 MoE tuned config for gfx950 - #4759
Open
johannes-graner wants to merge 3 commits into
Open
Add full 16-tier Qwen3-VL FP4 MoE tuned config for gfx950#4759johannes-graner wants to merge 3 commits into
johannes-graner wants to merge 3 commits into
Conversation
No tuned fmoe config existed for the Qwen3-VL W4A4 FP4 MoE shapes on gfx950, so fused_moe fell back to a slower base stage2 kernel across most token counts. Add a complete 16-tier config (tokens 1..32768) matching the row density and completeness of peer fmoe configs, with every row fully measured. Small tiers (1-1024) use the isolated-tuner winners; large tiers (2048-32768) select the cumul3 stage2 kernel (flydsl_moe2_afp4_wfp4_bf16_t64x128x256_atomic_persist_async_w4_cumul3), whose large-tier selection was validated on the real fused end-to-end path rather than isolated per-kernel timing. Config-data only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds complete per-model FP4 MoE (fused_moe) config coverage for Qwen3-VL on gfx950 by extending both tuned and untuned CSV shape grids to the full 16-tier padded power-of-two token set, enabling consistent best-kernel dispatch across token counts.
Changes:
- Added a full 16-tier (1..32768) untuned shape list for Qwen3-VL FP4 MoE.
- Added a full 16-tier tuned table with measured stage1/stage2 kernel selections and perf metrics for each tier.
- Standardized large-tier selections onto the validated stage2 kernel for 2048–32768 tokens.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| aiter/configs/model_configs/qwen3_vl_fp4_untuned_fmoe.csv | Adds the 16-tier padded token grid of Qwen3-VL FP4 MoE shapes for tuning/lookup coverage. |
| aiter/configs/model_configs/qwen3_vl_fp4_tuned_fmoe.csv | Adds measured tuned rows per tier so fused_moe can dispatch the intended best-performing kernels across token sizes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Adopt the 29-column peer FP4 fmoe schema (gfx-first, +xbf16/flat, per glm5_fp4/kimik3_fp4/minimax_m3_fp4) so the target arch (gfx950) is explicit rather than relying on the legacy cu_num->gfx backfill. Values unchanged; collision guard passes. Addresses PR review feedback. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
The Qwen3-VL W4A4 FP4 MoE path on gfx950 had no tuned config for its dominant shapes, so
fused_moefell back to a slower base stage2 kernel across most token counts. This ships acomplete, peer-matching tuned config so the FP4 MoE path dispatches its best-known kernel at
every padded token tier.
Technical Details
aiter/configs/model_configs/qwen3_vl_fp4_tuned_fmoe.csv: expanded to the full 16-tier paddedpower-of-two grid (tokens 1..32768), matching the row density/completeness of peer
fmoeconfigs. Every row is fully measured (
us1/us2/us/tflops/bwpopulated).aiter/configs/model_configs/qwen3_vl_fp4_untuned_fmoe.csv: expanded to the same 16 tiers(superset of the tuned shapes).
(2048–32768) select the existing
flydsl_moe2_afp4_wfp4_bf16_t64x128x256_atomic_persist_async_w4_cumul3stage2 kernel, whoselarge-tier selection was validated against the real fused end-to-end
fused_moepath (notjust isolated per-kernel timing).
Test Plan
aiter.fused_moe(..., quant_type=QuantType.per_1x32)on theQwen3-VL FP4 shapes, gated on cosine similarity against the torch reference.
python3 -m unittest op_tests.tuning_tests.test_config_shape_collision.--run_config) across the large-tier grid (2048–32768)against the naive isolated-tuner pick.
Test Result
Correctness passes at every tuned tier (cosine-gated). Collision guard passes. Large tiers
match or beat the naive isolated-tuner pick when validated end-to-end, up to −22% at the
16384-token tier; dominant-shape stage2 improves ~19.8% over the untuned fallback.
Submission Checklist