Repository navigation
[Config] Retune Qwen3-VL MXFP4 MoE without stage-2 reduce kernels - #5155
Conversation
Replace the 32 registry-eligible FlyDSL stage-2 reduce selections with their atomic counterparts. Preserve all shape keys and timing metadata because this updates dispatch selection rather than retuning the shapes.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
Retune all 60 Qwen3-VL MXFP4 MoE shapes with reduce candidates excluded. Refresh both kernel selections and all generated timing metadata instead of replacing kernelName2 in selected rows. Co-authored-by: Santosh Hiremath <[email protected]>
Move the 60-row atomic-constrained retune into the existing qwen3_vl config, retaining its four non-overlapping TP1 tiers. Expand the matching untuned manifest to all 64 unique keys and remove the duplicate q3vl table so runtime selection cannot depend on merge order. Signed-off-by: Vorapol Assavasangthong <[email protected]> Co-authored-by: Santosh Hiremath <[email protected]>
|
LGTM. there is a Non-blocking follow-up (not a request to change this PR): The 4 E=128 rows at token 512 / 8192 / 16384 / 32768 are carried over unchanged from
|
2a70f92 to
cc793fd
Compare
|
@yzhou103 Thank you for the review! I just with updated the co-author to added my colleague contribution and remove AI agent from the commit. Also I merged to main, This trigger new CI test. Please feel free to merge them once the CI passed. |
|
@yzhou103 a few of the CI test failed would it be possible to rerun those tests for me |
Resolve qwen3_vl_fp4_tuned_fmoe.csv per row against ROCm#4789, which retuned the same 16 TP1 shapes. For each contested shape keep whichever side's tuner recorded the lower total time, copying that row whole so kernel names, block_m, ksplit and timings stay internally consistent. ROCm#4789 wins tokens 1/2/4 and the four non-overlapping tiers 512/8192/16384/32768; this branch wins the remaining nine. The 48 TP2/4/8 shapes only exist here and carry over unchanged. Signed-off-by: Vorapol Assavasangthong <[email protected]> Co-authored-by: Santosh Hiremath <[email protected]>
|
@yzhou103 I think the CI is broken, I restarted the
test 3 times and it keep failing. I don't think this is related to my qwen3 vl tuned csv, the test is something to do with kimi k2.7 code mxfp4 accuracy test. |
There was a problem hiding this comment.
🟡 Changes recommended
Final-head serving validation and reproducible tuner provenance are still unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR retunes and consolidates Qwen3-VL MXFP4 MoE configurations while excluding stage-2 _reduce kernels.
Changes:
- Consolidates tuned and untuned manifests to 64 keys.
- Refreshes kernel selections and timing metadata.
- Removes the duplicate short-name tuned configuration.
File summaries
| File | Summary |
|---|---|
aiter/configs/model_configs/qwen3_vl_fp4_untuned_fmoe.csv |
Expanded matching untuned manifest. |
aiter/configs/model_configs/qwen3_vl_fp4_tuned_fmoe.csv |
Consolidated tuned dispatch table; final-head serving validation and reproducible TUNE_ONLY provenance remain required. |
aiter/configs/model_configs/q3vl_fp4_tuned_fmoe.csv |
Removed duplicate tuned configuration. |
Review details
Suppressed comments (1)
aiter/configs/model_configs/qwen3_vl_fp4_tuned_fmoe.csv:6
- [verified] This row selects a CKTile/legacy-compatible stage-2 result, but the documented tuner command does not set
TUNE_ONLY;gemm_moe_tune.py:4978-4995defaults an unset value toflydslv2, which only generates the layout-v2 task family and cannot produce this CKTile/legacy row (the same applies to the claimed 57/60 composition). That makes the retune provenance and candidate-count evidence non-reproducible unless an inherited environment variable was part of the run. Author must include the actualTUNE_ONLYsetting (or rerun with it explicitly set) so the command reproduces the committed candidates.
gfx950,256,2,4096,1536,16,7,ActivationType.Silu,torch.bfloat16,torch.float4_e2m1fn_x2,torch.float4_e2m1fn_x2,QuantType.per_1x32,1,0,32,0,17.7596,flydsl_moe1_afp4_wfp4_bf16_t32x128x256_bnt0_fp4,0.1%,12.6474,moe_ck2stages_gemm2_256x32x128x128_1x4_MulABScaleExpertWeightShuffled_v3_Nswizzle0_Quant3_MulRoutedWeight1_FP4X2_FP4X2_B16,2.5%,30.407,0,0,0,17.38,9932.4,
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -1,17 +1,65 @@ | |||
| gfx,cu_num,token,model_dim,inter_dim,expert,topk,act_type,dtype,q_dtype_a,q_dtype_w,q_type,use_g1u1,doweight_stage1,block_m,ksplit,us1,kernelName1,err1,us2,kernelName2,err2,us,run_1stage,xbf16,flat,tflops,bw,_tag | |||
| gfx950,256,1,4096,1536,16,7,ActivationType.Silu,torch.bfloat16,torch.float4_e2m1fn_x2,torch.float4_e2m1fn_x2,QuantType.per_1x32,1,0,32,0,12.9148,flydsl_moe1_afp4_wfp4_bf16_t32x64x256_w4_bnt0_kw2_fp4,0.9%,9.1452,flydsl_moe2_layout_afp4_wfp4_bf16_t32x128x256_atomic_sbm32,1.1%,22.06,0,0,0,11.98,13690.04, | |||
Summary
kernelName2values with a generated 60-shape MoE retune that refreshes both kernel stages and all generated timing metadata.qwen3_vl_fp4_tuned_fmoe.csv, retain its four non-overlapping TP1 tiers, expand the matching untuned manifest, and remove the duplicateq3vl_fp4_tuned_fmoe.csv.mainand resolve the overlap with #4789 per row, keeping whichever side's tuner measured the lower time for each shape._reducekernels from the tuner candidate space while leaving atomic and CKTile candidates eligible.Motivation and duplicate-config resolution
#4556 proposed forcing atomic stage-2 kernels at runtime. Maintainer feedback recommended expressing the model-specific choice in the tuned configuration instead. The first version of this PR did that by replacing 32 eligible stage-2 kernel names while retaining the old tuning metadata.
This revision addresses the follow-up feedback to update the complete tuner-generated config: all 60
q3vlshape keys were retuned under the non-reduce constraint rather than changingkernelName2after tuning.During serving validation, I also found that two model-config files described the same Qwen3-VL MXFP4 workload. They overlapped on 12 TP1 runtime keys. The production config merger keeps the first matching key, so the longer-named
qwen3_vl_fp4_tuned_fmoe.csvshadowed the retunedq3vlrows at TP1. That made the original TP1 serving result invalid as evidence for those 12 replacements: it had measured the old effective kernels.The committed layout now has one source of truth:
qwen3_vl_fp4_tuned_fmoe.csv: 64 unique runtime keys (all 60 retunedq3vlkeys plus four non-overlapping existing TP1 tiers).qwen3_vl_fp4_untuned_fmoe.csv: the same 64 unique runtime keys.q3vl_fp4_tuned_fmoe.csv: removed.Tuner provenance
The retune ran the AITER FMoE tuner on MI355X (
gfx950) with four visible GPUs and the complete set of 60q3vlinput shape keys:TUNE_MOE_KERNEL_REGEX='^(?!.*_reduce)' \ TUNE_MOE_EXPERT_BALANCE=False \ AITER_FLYDSL_FORCE=1 \ AITER_FLYDSL_FORCE_ATOMIC=0 \ AITER_FLYDSL_FORCE_REDUCE=0 \ python3 gemm_moe_tune.py \ -i q3vl_fp4_full.csv \ -o q3vl_fp4_tuned_fmoe.csv \ -o2 retuned_all_candidates.csv \ --all --mp 4 --batch 5 --sort True \ --timeout 1800 --warmup 5 --iters 101Generated-output validation:
_reducecandidate passed the candidate filter.46a2ec113dfd647990ef43ea64e64cb687e07bec5fddd945cd5ae238dcd5ddb7.Relative to the previous PR config (
baea2c37...):kernelName1changed for 57/60 rows andkernelName2changed for 57/60 rows.After consolidation and the
mainmerge below, the committed 64-row canonical config has 61 atomic (47 layout + 14 legacy) + 3 CKTile stage-2 selections and no reduce selection. Exact committed checksums:cc107c0aaf8d2526045044dedc11e62c6e53dd58cdc965659776a4957f44263e4976668431c73ebacbe87c7e19730fcb33876cfaab19656ae0cb952352f5928cMerge resolution against #4789
#4789 landed on
mainwhile this PR was open and retuned all 16 TP1E=128rows ofqwen3_vl_fp4_tuned_fmoe.csv-- the same file this PR rewrites -- so the two conflicted on 12 rows.Rather than taking either side wholesale, the merge resolves the file per shape: for each contested key, keep whichever side's tuner recorded the lower total time. Each winning row is copied whole (kernel names,
block_m,ksplit,us1/us2/us, error columns), so no row mixes fields from two different tuning runs. Both sides' headers are identical and neither selects a_reducestage-2 kernel, so the atomic-only property of this PR is preserved.Outcome over the 16 shared shapes:
The merged file therefore takes 7 rows from #4789 and 57 from this branch (9 contested winners plus the 48 TP2/4/8 shapes, which exist only here and which #4789 does not touch). By tuned time over the 16 shared shapes this is a 6.76% geomean improvement over #4789 alone and 5.81% over this branch alone.
This also closes the reviewer's non-blocking follow-up about the four
E=128rows at tokens 512 / 8192 / 16384 / 32768. They were deliberately carried over unchanged here (deleting them is unsafe:_PADDED_M_TIERS = [32768, 131072]means the tier fallback in_lookup_cfgonly applies fortoken > 32768, so 512 / 8192 / 16384 would miss the config entirely). #4789 retuned all four, and the merge adopts its faster rows -- token 512 goes 295.64 us -> 224.26 us, in line with the 212.74 us the reviewer measured locally.Scope of the serving numbers below: they were measured on the pre-merge canonical config (
cab43a49...). The merge only substitutes rows where the other tuner measured strictly faster on the same shape, so it is not expected to regress those results, but the serving sweep was not re-run after the merge.Serving performance
The benchmark compares the original PR #5155 runtime configuration against the consolidated canonical configuration. Both arms use the same PR binary and server settings; the candidate image is the baseline image with only the canonical tuned/untuned CSVs replaced and the duplicate short-name tuned CSV removed.
AITER_FLYDSL_FORCE_ATOMIC=0andAITER_FLYDSL_FORCE_REDUCE=0in both arms, so runtime forcing did not select the kernels.Baseline identity clarification: because of the duplicate-file merge behavior, the original effective TP1 rows came from
qwen3_vl_fp4_tuned_fmoe.csv(5af89c8c...), while the original TP2/TP4/TP8 rows came fromq3vl_fp4_tuned_fmoe.csv(baea2c37...). The candidate for every topology is the consolidated canonical file (cab43a49...). The canonical file contains the exact generated retune rows used by the earlier TP2/TP4/TP8 measurements.Hardware/model: one 8× MI355X node,
amd/Qwen3-VL-235B-A22B-Instruct-MXFP4, expert parallel enabled. Each arm ran the same 12 serving workloads at TP1, TP2, TP4, and TP8. Deltas below are canonical versus the original effective PR configuration; positive throughput and negative latency favor the canonical config. Intervals are descriptive 95% bootstrap intervals over the 12 workload rows; each topology has one independent paired sweep, so these intervals do not estimate run-to-run variation.Performance test script
The following is the complete per-server invocation and 12-case client loop. It was run separately for each
TP=1,2,4,8and checksum-pinned arm. Run it inside the corresponding benchmark image, setHIP_VISIBLE_DEVICEStoTPGPUs, and setARMtobaselineorcanonical:Performance comparison
The final comparison set contains 96 successful serving cases: 4 topologies × 2 configs × 12 workloads. Strict pre-shutdown log checks found no failed requests, fatal engine errors, OOMs, or runtime-forcing events. TP8 used
--gpu-memory-utilization 0.94for both arms; an earlier 0.96 attempt was discarded after ROCm HSA resource exhaustion. This was a serving-only performance run; no GPQA or other accuracy benchmark was included.The corrected TP1 result confirms the shadowing diagnosis: once the consolidated file actually dispatched the 12 replacement kernel pairs, TP1 improved as well. Total-token throughput is positive across all four tested topologies.
Test plan
q3vlshapes.mainand resolve the [Config] update gemm stage2 v2 kernel #4789 overlap per shape on measured tuner time.op_tests.tuning_tests.test_config_shape_collision(17 passed, including the real runtime merge and both self-check controls) andop_tests.tuning_tests.test_csv_validation(15 passed) on the merged tree.