Skip to content

MUSA: enable CAR-RMSNorm by default under contract - #199

Draft
Elon-yf wants to merge 6 commits into
MooreThreads:v0.28.0-devfrom
Elon-yf:codex/musa60030-default-on-qwen36-v028-20260825
Draft

Elon-yf wants to merge 6 commits into
MooreThreads:v0.28.0-devfrom
Elon-yf:codex/musa60030-default-on-qwen36-v028-20260825

Conversation

@Elon-yf

@Elon-yf Elon-yf commented Aug 27, 2026 •

Copy link
Copy Markdown

Default-enable MUSA CAR-RMSNorm with per-model batch routing

Summary

The original PR #140 added CAR-RMSNorm support but did not enable it by
default. This update enables it by default for supported routes. A normal
vllm serve command needs no CAR-specific override.

To disable only CAR-RMSNorm while keeping compilation and CUDAGraph enabled,
pass -cc.pass_config.fuse_allreduce_rms=False. The nested field syntax merges with the
existing -cc.mode and -cc.cudagraph_mode arguments.

Scenario Configuration Result
Supported model/TP/precision/range pass_config.fuse_allreduce_rms unspecified (auto/default) Eligible rows use CAR-RMSNorm; native rows fall back to native
Any configuration -cc.pass_config.fuse_allreduce_rms=False CAR-RMSNorm disabled; use native
Unsupported model/TP/precision/range pass_config.fuse_allreduce_rms unspecified (auto/default) Use native

Problem

CAR-RMSNorm support depends on the model family, tensor-parallel size, hidden
size, explicit BF16 or FP8 format, active rows, and compile range. A broad global
switch cannot safely decide every row. Unsupported configurations and compile
ranges that cross a native boundary must remain on the native path.

Implementation

  • Enable CAR-RMSNorm by default at the platform layer.
  • Use one routing predicate for model properties, active rows, and the compile
    range.
  • Keep unsupported configurations and ranges crossing a native boundary on
    the native path.
  • Use the standard vLLM compilation config as the sole user-visible OFF
    control: -cc.pass_config.fuse_allreduce_rms=False.

Supported routing matrix

TP2 contract

Model Hidden Precision Native rows Compile endpoints Row routing
Qwen3.5/3.6-27B 5120 BF16 [16] [3,4,15,16,63] Eligible [[1,3],[4,4],[5,15],[17,63],[64,8192]]; Native [[16,16]]
Qwen3.5/3.6-27B 5120 FP8 weights, BF16 activations [4,16] [3,4,15,16,63] Eligible [[1,3],[5,15],[17,63],[64,8192]]; Native [[4,4],[16,16]]

TP4 contract

Model Hidden Precision Native rows Compile endpoints Row routing
Qwen3.5/3.6-35B-A3B 2048 BF16 [16,64] [15,16,63,64] Eligible [[1,15]]; Native [[16,16],[17,63],[64,64],[65,8192]]
Qwen3.5/3.6-35B-A3B 2048 FP8 weights, BF16 activations [64] [15,16,63,64] Eligible [[1,15],[16,16],[17,63],[65,8192]]; Native [[64,64]]

Other / unsupported

Model Hidden Precision Native rows Compile endpoints Row routing
Unsupported - - [] [] Native [[1,8192]]

Compile endpoints split the graph into stable intervals. If a requested range
crosses a native row, the provider uses the native path for that range; the
endpoint partition keeps adjacent fused intervals separate.

Qwen3.5 serve and benchmark

Run the benchmark once per reported BS (1, 4, 16, or 64); set
--num-prompts and --max-concurrency to that same BS, with
--request-rate inf. The command below shows the 4096/1024 form; use the same
BS mapping for the 2500/1500 rows by changing the two random-length arguments.

The serve command below is the default-ON arm:

vllm serve <MODEL_PATH> \
  --tensor-parallel-size 4 \
  --host 127.0.0.1 --port 39720 \
  --served-model-name <NAME> \
  --max-model-len 5184 --max-num-seqs 64 \
  --gpu-memory-utilization 0.8 \
  --no-enable-chunked-prefill --no-enable-prefix-caching \
  -ac.backend FLASH_ATTN \
  -cc.cudagraph_mode=FULL_DECODE_ONLY \
  --trust-remote-code

For the matched OFF arm, append this argument to the same serve command:

-cc.pass_config.fuse_allreduce_rms=False
vllm bench serve \
  --backend openai-chat \
  --base-url http://127.0.0.1:39720 \
  --model <NAME> --tokenizer <MODEL_PATH> \
  --trust-remote-code \
  --dataset-name random \
  --random-input-len 4096 --random-output-len 1024 \
  --random-range-ratio 0 \
  --num-prompts <BS> --request-rate inf --max-concurrency <BS> \
  --endpoint /v1/chat/completions \
  --temperature 0 --seed 0 --ignore-eos \
  --save-detailed --save-result \
  --result-dir <RESULT_DIR> --result-filename result.json \
  --percentile-metrics ttft,tpot,itl,e2el \
  --metric-percentiles 50,90,95,99

Validation

The existing FULL_DECODE_ONLY report is copied without re-aggregation:

  • 8 model/shape combinations.
  • 32 batch cells, with BS 1, 4, 16, and 64 for every model/shape.
  • All four report metrics: output throughput, TTFT, TPOT, and E2E.
  • 7 cells identify pooled n=10 repeated data;
    25 cells retain the report's unavailable sample count.
  • The report observed zero fused operator rewrites, so the ON/OFF differences
    are not attributed to fused execution.

FULL_DECODE_ONLY measures the decode graph path; mixed execution is outside
this report.

Complete results

Qwen3.5-35B-A3B-BF16 · 4096/1024 · TP4 · BF16

Batch Output tok/s OFF Output tok/s ON Δ TTFT ms OFF TTFT ms ON Δ TPOT ms/token OFF TPOT ms/token ON Δ E2E ms OFF E2E ms ON Δ
1 107.659 107.677 +0.016% 138.889 132.939 -4.284% 9.162 9.166 +0.047% 9511.144 9509.553 -0.017%
4 235.084 235.799 +0.304% 314.709 305.605 -2.893% 16.701 16.658 -0.257% 17400.034 17347.035 -0.305%
16 772.098 773.469 +0.177% 983.281 979.171 -0.418% 19.658 19.626 -0.165% 21093.438 21056.213 -0.176%
64 2071.835 2081.693 +0.476% 3955.759 3907.095 -1.230% 26.443 26.347 -0.363% 31006.594 30859.936 -0.473%

Qwen3.5-35B-A3B-BF16 · 2500/1500 · TP4 · BF16

Batch Output tok/s OFF Output tok/s ON Δ TTFT ms OFF TTFT ms ON Δ TPOT ms/token OFF TPOT ms/token ON Δ E2E ms OFF E2E ms ON Δ
1 108.351 108.525 +0.161% 117.775 114.069 -3.147% 9.157 9.144 -0.134% 13843.379 13821.272 -0.160%
4 241.122 242.627 +0.624% 249.507 242.773 -2.699% 16.428 16.329 -0.603% 24874.633 24720.359 -0.620%
16 822.195 823.547 +0.164% 594.325 590.756 -0.601% 19.050 19.020 -0.157% 29149.608 29101.621 -0.165%
64 2545.598 2550.594 +0.196% 2064.172 2028.081 -1.748% 23.644 23.619 -0.107% 37506.679 37432.655 -0.197%

Qwen3.5-27B-BF16 · 4096/1024 · TP2 · BF16

Batch Output tok/s OFF Output tok/s ON Δ TTFT ms OFF TTFT ms ON Δ TPOT ms/token OFF TPOT ms/token ON Δ E2E ms OFF E2E ms ON Δ
1 35.389 34.993 -1.119% 523.734 525.983 +0.429% 27.773 28.090 +1.143% 28935.471 29262.525 +1.130%
4 74.167 74.187 +0.027% 1401.545 1398.062 -0.249% 52.543 52.532 -0.021% 55153.487 55138.267 -0.028%
16 272.059 272.071 +0.004% 4757.672 4766.073 +0.177% 53.858 53.848 -0.019% 59854.785 59852.130 -0.004%
64 748.831 750.589 +0.235% 18933.805 18920.050 -0.073% 65.529 65.348 -0.276% 85969.845 85770.715 -0.232%

Qwen3.5-27B-BF16 · 2500/1500 · TP2 · BF16

Batch Output tok/s OFF Output tok/s ON Δ TTFT ms OFF TTFT ms ON Δ TPOT ms/token OFF TPOT ms/token ON Δ E2E ms OFF E2E ms ON Δ
1 35.865 35.420 -1.242% 330.049 331.331 +0.388% 27.680 28.030 +1.265% 41822.397 42348.384 +1.258%
4 76.591 76.751 +0.209% 1127.543 1119.179 -0.742% 51.490 51.387 -0.200% 78311.387 78148.967 -0.207%
16 301.952 301.991 +0.013% 3218.372 3210.642 -0.240% 50.800 50.798 -0.004% 79367.236 79357.052 -0.013%
64 1057.008 1058.454 +0.137% 11583.176 11512.706 -0.608% 52.527 52.491 -0.069% 90320.781 90197.366 -0.137%

Qwen3.5-27B-FP8 · 4096/1024 · TP2 · FP8

Batch Output tok/s OFF Output tok/s ON Δ TTFT ms OFF TTFT ms ON Δ TPOT ms/token OFF TPOT ms/token ON Δ E2E ms OFF E2E ms ON Δ
1 48.961 50.371 +2.880% 459.468 458.781 -0.150% 19.994 19.423 -2.856% 20913.597 20328.585 -2.797%
4 90.605 90.770 +0.182% 1163.026 1153.730 -0.799% 42.997 42.927 -0.163% 45148.964 45068.124 -0.179%
16 333.660 333.264 -0.119% 3936.323 3939.922 +0.091% 43.858 43.912 +0.123% 48803.123 48861.877 +0.120%
64 915.251 914.882 -0.040% 15847.792 15853.100 +0.033% 53.276 53.301 +0.047% 70349.157 70379.614 +0.043%

Qwen3.5-27B-FP8 · 2500/1500 · TP2 · FP8

Batch Output tok/s OFF Output tok/s ON Δ TTFT ms OFF TTFT ms ON Δ TPOT ms/token OFF TPOT ms/token ON Δ E2E ms OFF E2E ms ON Δ
1 49.642 51.266 +3.271% 285.110 285.212 +0.036% 19.967 19.329 -3.195% 30215.264 29258.683 -3.166%
4 94.286 94.045 -0.256% 882.141 884.404 +0.257% 41.850 41.957 +0.256% 63614.751 63777.853 +0.256%
16 371.998 372.202 +0.055% 2505.177 2505.294 +0.005% 41.305 41.282 -0.056% 64421.031 64386.840 -0.053%
64 1329.534 1331.112 +0.119% 9014.335 9001.902 -0.138% 41.883 41.835 -0.115% 71796.492 71712.146 -0.117%

Qwen3.5-35B-A3B-FP8 · 4096/1024 · TP4 · FP8

Batch Output tok/s OFF Output tok/s ON Δ TTFT ms OFF TTFT ms ON Δ TPOT ms/token OFF TPOT ms/token ON Δ E2E ms OFF E2E ms ON Δ
1 85.902 86.839 +1.091% 132.523 135.304 +2.099% 11.522 11.394 -1.111% 11919.723 11791.255 -1.078%
4 176.691 176.456 -0.133% 349.138 350.302 +0.333% 22.288 22.318 +0.135% 23150.218 23181.260 +0.134%
16 674.272 672.817 -0.216% 1032.731 1035.399 +0.258% 22.586 22.635 +0.217% 24138.303 24191.030 +0.218%
64 2209.678 2214.483 +0.217% 4090.591 4036.377 -1.325% 24.331 24.316 -0.062% 28981.454 28912.119 -0.239%

Qwen3.5-35B-A3B-FP8 · 2500/1500 · TP4 · FP8

Batch Output tok/s OFF Output tok/s ON Δ TTFT ms OFF TTFT ms ON Δ TPOT ms/token OFF TPOT ms/token ON Δ E2E ms OFF E2E ms ON Δ
1 86.399 87.360 +1.112% 126.968 125.794 -0.925% 11.497 11.370 -1.105% 17360.884 17169.900 -1.100%
4 180.829 180.439 -0.216% 271.039 270.480 -0.206% 21.946 21.994 +0.219% 33168.815 33240.196 +0.215%
16 721.262 718.422 -0.394% 621.708 622.701 +0.160% 21.750 21.836 +0.395% 33224.416 33355.148 +0.393%
64 2790.471 2791.989 +0.054% 2174.998 2150.839 -1.111% 21.350 21.354 +0.019% 34179.295 34159.903 -0.057%

Standalone Qwen3.6-27B case

This case is reported separately from the Qwen3.5 matrix.

Qwen3.6-27B serve and benchmark

The serve command below is the default-ON arm:

vllm serve <MODEL_PATH> \
  --tensor-parallel-size 2 \
  --dtype bfloat16 \
  --max-model-len 4096 --max-num-seqs 64 --max-num-batched-tokens 8192 \
  --gpu-memory-utilization 0.80 \
  --cudagraph-capture-sizes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \
    17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 64 \
  --no-enable-chunked-prefill --no-enable-prefix-caching --no-enable-dbo \
  --async-scheduling \
  -ac.backend FLASH_ATTN -cc.mode=3 \
  -cc.cudagraph_mode=FULL_DECODE_ONLY \
  --trust-remote-code

For the matched OFF arm, append this argument to the same serve command:

-cc.pass_config.fuse_allreduce_rms=False
vllm bench serve \
  --backend openai-chat \
  --base-url http://127.0.0.1:39720 \
  --model <NAME> --tokenizer <MODEL_PATH> \
  --trust-remote-code \
  --dataset-name random \
  --random-input-len 2500 --random-output-len 1500 \
  --random-range-ratio 0 \
  --num-prompts 20 --request-rate 4 --max-concurrency 4 \
  --endpoint /v1/chat/completions \
  --temperature 0 --seed 0 --ignore-eos \
  --save-detailed --save-result \
  --result-dir <RESULT_DIR> --result-filename result.json \
  --percentile-metrics ttft,tpot,itl,e2el \
  --metric-percentiles 50,90,95,99
Metric SGLang-MUSA vLLM OFF OFF gain vLLM ON ON gain
Input throughput (tok/s) 213.110 219.570 +3.03% 218.354 +2.46%
Output throughput (tok/s) 125.640 131.742 +4.86% 131.012 +4.28%
Mean TTFT (ms) 1114.950 904.651 +18.86% 893.138 +19.89%
Median TTFT (ms) 1293.040 1082.950 +16.25% 1069.033 +17.32%
P90 TTFT (ms) 1345.530 1086.036 +19.29% 1071.941 +20.33%
P99 TTFT (ms) 1347.960 1090.544 +19.10% 1073.799 +20.34%
Mean TPOT (ms/token) 31.110 29.754 +4.36% 29.931 +3.79%
Median TPOT (ms/token) 30.980 29.658 +4.27% 29.834 +3.70%
P90 TPOT (ms/token) 31.630 30.094 +4.86% 30.266 +4.31%
P99 TPOT (ms/token) 32.310 30.102 +6.83% 30.273 +6.31%

Gain is relative to SGLang. Positive values are better; throughput uses
higher-is-better, while TTFT and TPOT use lower-is-better.

Limitations

  • TP8 is outside the current CAR-RMSNorm contract and remains on native CAR +
    RMSNorm; ordinary custom all-reduce transport is unchanged.
  • Sample coverage differs by cell and is shown directly in the result table.
  • Cells whose sample count was not reported must not be interpreted as pooled
    n=10 measurements.
  • Zero observed rewrites means these results compare configuration behavior;
    they do not establish fused-operator performance benefit.

@Elon-yf
Elon-yf force-pushed the codex/musa60030-default-on-qwen36-v028-20260825 branch from e69cf29 to c7532bc Compare August 27, 2026 10:47
@yeahdongcn
yeahdongcn marked this pull request as draft September 25, 2026 05:17
@Elon-yf
Elon-yf force-pushed the codex/musa60030-default-on-qwen36-v028-20260825 branch from c7532bc to 3c5c5ad Compare October 10, 2026 07:41

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge verdict: 2 blocking finding(s) — not ready to merge.

Findings: P1 two 0109- patch files make the repo's own check-series gate exit 1; P1 the new fused_add_rms_norm contract gate reads a VllmConfig that is unbound while Inductor lowers the op, so native-row routing and the added registered/raw_needed conditions never reach that provider.

Earlier: none — round 1/3; gh pr checks 199 reports no checks on this branch.

severity location note
nit patches/series/README.md still says "180 patches"; the series now has 181
nit layers/layernorm.py Gemma residual path re-resolves the contract per call when the cached flag is false

auto-review round 1/3 · verdict: blockers

Comment thread vllm_musa/kernels/musa_ops.py Resolved

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge verdict: 2 blocking findings — not ready to merge.

Two round-1 P1s persist at head 1a1dcf4: duplicate 0109- patch numbering and a provider gate that cannot see the config where it runs.

Findings: 2 blocking · 5 nit
Earlier: both round-1 P1s unfixed at 1a1dcf4; both round-1 nits persist.

nit location problem fix
nit patches/series/README.md:20 says 180 patches; 181 in tree say 181
nit layers/layernorm.py:139 contract re-resolved per forward cache the off result
nit tests/test_default_on_dispatch_parity.py:213 "former copy" narrates history describe the seam now
nit optimization_contract/car_rmsnorm.py:245 phase/path/registered unused at runtime drop or document
nit commit 1a1dcf4b subject tracker ID in a commit message conventional subject
What changed · what I could not verify

Round-2 delta — 1a1dcf4b72f2 sits on round-1's 3c5c5ad47303 and rewrites 9 files (+180/−105):

  • vllm_musa/optimization_contract/car_rmsnorm.py gains car_rmsnorm_default_on() / resolve_car_rmsnorm_enabled() as the single default-on rule; platform.apply_config_platform_defaults and layernorm._car_rmsnorm_ir_fusion_enabled now consume it. vllm_musa/tuning.py returns to the base file; the removed constants (FUSED_ALLREDUCE_RMSNORM_TP2_MIN_ROWS, …_TP4_POLICY, …_TP4_SINGLETON_ROWS) have no remaining references anywhere in the head tree.
  • Tests re-patch the family seam inside the contract module, which is where the rule now resolves.
  • This delta does not touch vllm_musa/patches/ or vllm_musa/kernels/musa_ops.py, which is why both round-1 P1s survive.

P1-1 — duplicate 0109- prefix (unfixed). Verified at head: vllm_musa/patches/series/ holds 181 .patch files with 180 distinct NNNN prefixes; 0109-MUSA-keep-compile-warmup-outside-CUDAGraph.patch and 0109-fix-avoid-CUDA-FA2-import-on-MUSA.patch both claim 0109. tools/musa_sync.py:1806 emits the ("series/0109", "duplicate-number", …) row, and cmd_check_series (lines 1963-1969) prints FAIL (… numbering=1) and returns 1. docs/mdm-developer-guide.md:181 requires numbering "unique and contiguous from 0001"; line 170 puts the verify gate before every PR; lines 206-210 note nothing invokes it automatically, so a reviewer types the command. Round 1 asked for 0181, still free (highest in use is 0180). sorted() orders 0109-MUSA-… before 0109-fix-…, so the apply order is incidental — both entries patch different upstream files, so the replay itself is not what fails.

P1-2 — provider contract gate (unfixed). vllm_musa/kernels/musa_ops.py is unchanged from the round-1 head, and _can_use_fused_add_rmsnorm_under_contract still has exactly one call site (line 288). At the pin (VLLM_COMMIT=2cf0a6915ce544dc493a0990f2ea38d81601128a): vllm/compilation/passes/ir/lowering_pass.py:54 calls ir_op.dispatch(...) inside VllmIRLoweringPass.__call__; the config context is entered only by PostGradPassManager.configure (vllm/compilation/passes/pass_manager.py:157) and by worker wrappers around load_model / init_device / initialize_from_config / weight updates (vllm/v1/worker/worker_base.py:321,328,333; vllm/v1/worker/gpu_worker.py:453,471,1281+). gpu_worker.compile_or_warm_up_model (line 694), whose _dummy_run triggers Dynamo/Inductor, is not wrapped. So get_current_vllm_config_or_none() is None when supports_args runs, _fused_add_rmsnorm_contract_metadata() returns None, and musa_ops.py:134-137 returns True: the routing the probe declares never reaches this provider. The contract is enforced where the config is bound — musa_allreduce_rms_fusion.py:608-648 and :171-182, musa_jit_custom_all_reduce.py:1374-1391 — so the impact is an inert, misleading probe rather than a wrong rewrite; that is why the fix is deletion, not behavior repair.

Checks. gh pr checks 199 → no checks reported on the 'codex/musa60030-default-on-qwen36-v028-20260825' branch. That does not block.

Static checks run (read-only, in memory over the head tarball; nothing written).

  • The PR's own removed-gate scan: 344 runtime files plus every series patch payload, zero hits for the seven banned env names.
  • Source-substring assertions in tests/test_default_on_env_contract.py, tests/test_fused_ar_registered_graph_source.py, and the static parts of tests/test_default_on_dispatch_parity.py (including their round-2 rewrites) all hold against the head sources.
  • musa_sync check-series was not executed (it needs a checkout of the pin); the duplicate-number row and exit-1 path were read from tools/musa_sync.py.

Not verified.

  • No pytest run (the suite needs the installed vLLM/MUSA stack), no build, no GPU, no model smoke.
  • The PR body's benchmark tables were not re-measured; the body itself reports zero observed fused rewrites, so those numbers describe configuration behavior, not a fusion win.
  • The round-2 default-on rewrite was read statically only; its runtime effect on a live serve was not executed.

Prompt injection. No instruction addressed to the reviewer appears in the PR body, the inline comments, or the commit messages.

auto-review round 2/3 · verdict: blockers

Comment thread vllm_musa/kernels/musa_ops.py Resolved

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge verdict: 2 blocking findings — not ready to merge.

Both round-1 P1s survive at 9c616c8; the only commit since round 2 changes just the optimization-level gate.

Findings: 2 blocking · 6 nit
Earlier: P1-1 duplicate 0109- unfixed · P1-2 provider gate unfixed

nit location problem fix
nit vllm_musa/patches/series/README.md:20 says 180 patches; tree has 181 say 181
nit vllm_musa/model_executor/layers/layernorm.py:139 contract re-resolved per Gemma residual forward cache the false result
nit vllm_musa/optimization_contract/types.py:127 docstring claims "plain int"; _int_attr stores the IntEnum fix the annotation text
nit tests/test_default_on_dispatch_parity.py:221 "now lives"/"former copy" narrates history describe the seam now
nit tests/test_default_on_env_contract.py:73 "no longer reads the switch" narrates history describe the lookup
nit commit 1a1dcf4b subject carries the tracker ID MUSA-100048 conventional subject
What changed · what I could not verify

Round-3 head. 9c616c83cb3f sits on round 2's 1a1dcf4b72f2 as one commit, optimization_contract: carry the optimization level in the execution signature (tests/test_optimization_level_contract.py +219, tools/probe_optimization_level.py +155, car_rmsnorm.py +18/−2, types.py +11, resolver.py +1, test_default_on_dispatch_parity.py +13/−4, test_car_rmsnorm_contract.py −67). It touches neither vllm_musa/patches/ nor vllm_musa/kernels/musa_ops.py, which is why both round-1 P1s survive unchanged.

P1-1 — duplicate 0109- prefix (unfixed). Verified at head: vllm_musa/patches/series/ holds 181 .patch files with 180 distinct NNNN prefixes; 0109-fix-avoid-CUDA-FA2-import-on-MUSA.patch and the PR's 0109-MUSA-keep-compile-warmup-outside-CUDAGraph.patch both claim 0109. On the base branch the series is 180 files with no duplicate, so this PR introduces the collision and 0181 is free (highest in use is 0180). tools/musa_sync.py:_series_numbering_rows (lines 1762-1819) emits ("series/0109", "duplicate-number", …) for that pair, and cmd_check_series (1928-1969) returns 1 whenever any numbering row exists; _SERIES_FATAL (line 160) covers only a missing/empty series and git problems, so nothing short-circuits it. docs/mdm-developer-guide.md:181 makes unique contiguous numbering part of that gate, line 170 says to run it before every PR, and lines 206-210 record that nothing invokes it automatically. Renaming moves the entry from 9th to last, so re-run check-series --replay --repo <checkout at the pin> after the rename.

P1-2 — provider gate that cannot fire (unfixed). vllm_musa/kernels/musa_ops.py is unchanged from the round-1 head and _can_use_fused_add_rmsnorm_under_contract still has its single call site at line 288. At the pin (third_party/PINS → VLLM_COMMIT=2cf0a6915ce544dc493a0990f2ea38d81601128a): vllm/config/vllm.py:2589 makes _current_vllm_config a module global that set_current_vllm_config (2594-2645) restores in finally, and get_current_vllm_config_or_none (2667-2668) returns it directly. The compile that exercises this provider runs from Worker.compile_or_warm_up_model (vllm/v1/worker/gpu_worker.py:694, reached from vllm/v1/engine/core.py:331), whose warmup _dummy_run (line 723) and capture_model (line 732) are not wrapped; the set_current_vllm_config sites in that file are load_model (453), reload_weights (471) and the weight-transfer paths (1281, 1289, 1338, 1356), and in gpu_model_runner.py only profile_cudagraph_memory's KV-cache setup (6781) and indexes_kv_by_block_stride (7931). So _fused_add_rmsnorm_contract_metadata() returns None, musa_ops.py:134-137 returns True, and the row and compile-range routing never reaches this selector — raw_needed/registered are also never supplied by any caller. The contract is enforced where the config or the owner's own state is bound: the pass at musa_allreduce_rms_fusion.py:608-648, :884, :1328 and the pattern gate at :171, and the communicator at musa_jit_custom_all_reduce.py:587, :1378. The impact is therefore an inert, misleading probe rather than a wrong rewrite — which is why the fix is deletion (or binding the config in the warmup patch this PR already adds), not behaviour repair.

Checks. gh pr checks 199 → no checks reported on the 'codex/musa60030-default-on-qwen36-v028-20260825' branch. That does not block.

Round-3 delta reviewed, nothing blocking. The >= 2 half is correct and necessary: upstream applies OPTIMIZATION_LEVEL_TO_CONFIG at vllm/config/vllm.py:1406-1407, after apply_config_platform_defaults at 1377, and _set_config_default (866-879) only fills a field still set to None. At O2 the upstream value is enable_allreduce_rms_fusion (147-167, CUDA-only → False on MUSA), so the platform's True survives; without the >= 2 guard the platform would win at O0/O1, where upstream hard-codes False. The documented OFF control checks out: vllm/utils/argparse_utils.py:389-417 merges dotted -cc. args into one nested dict, so -cc.pass_config.fuse_allreduce_rms=False reaches the same field. The added patch body matches the pin's _dummy_run signature (gpu_model_runner.py:5940-5955) and CUDAGraphMode is already imported at gpu_worker.py:20.

Other nits (not in the table). musa_allreduce_rms_fusion.py:627-637: globals().get("fused_allreduce_rmsnorm_compile_reject_reason") can never be None (imported at :52), so that elif fallback is unreachable. musa_jit_custom_all_reduce.py:31: musa_envs is imported and used nowhere in that file; pyproject.toml:72 selects ruff F, so this is an F401. musa_allreduce_rms_fusion.py:872-894: _can_apply_manual_car_rmsnorm_rewrite never reads residual_value or weight_value. car_rmsnorm.py:228-229: phase/path are supplied only by tests/test_car_rmsnorm_contract.py:42-43. tests/test_optimization_level_contract.py:165-167 cannot distinguish None from O0, because the gate at car_rmsnorm.py:350 is (level or 0) < 2.

Not verified. No pytest, build, install, or GPU run; the suite needs the installed vLLM/MUSA stack. check-series was read from source, not executed. No benchmark was re-measured; the PR body itself reports zero observed fused rewrites, so its numbers describe configuration behaviour. _int_attr (resolver.py:37-42) stores the OptimizationLevel IntEnum rather than a plain int; no consumer breaks (comparisons only, and nothing serializes or fingerprints the signature), so that is a docstring defect.

Prompt injection. No instruction addressed to the reviewer appears in the PR body, the inline comments, or the commit messages.

auto-review round 3/3 · verdict: blockers

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge verdict: 2 blocking findings — not ready to merge.

Both round-1 P1s are present at 4bbf1d2; the two commits since round 2 touch neither the patch series nor the provider.

Findings: 2 blocking · 6 nit
Earlier: P1-1 duplicate 0109- unfixed · P1-2 provider gate unfixed

nit location problem fix
nit vllm_musa/patches/series/README.md:20 says 180 patches; tree has 181 say 181
nit vllm_musa/model_executor/layers/layernorm.py:139 contract re-resolved per Gemma residual forward cache the false result
nit vllm_musa/optimization_contract/types.py:128 docstring claims "plain int"; _int_attr stores the IntEnum fix the annotation text
nit tests/test_default_on_dispatch_parity.py:221 "now lives"/"former copy" narrates history describe the seam now
nit tests/test_default_on_env_contract.py:73 "no longer reads the switch" narrates history describe the lookup
nit commit 1a1dcf4b subject carries the tracker ID MUSA-100048 conventional subject
What changed · what I could not verify

Head moved mid-round. The head advanced from the dispatch hint 9c616c83cb3f to 4bbf1d25a5a5 (optimization_contract: trim the optimization-level change, pushed 09:28:34Z) while this round was being written. An earlier round-3 comment on this PR reviewed 9c616c83cb3f; every finding below was re-verified here at 4bbf1d25a5a5. That trim deletes tools/probe_optimization_level.py, shortens the car_rmsnorm_default_on docstring, drops the tp/hidden/family detail from the platform log line, and folds two tests in tests/test_optimization_level_contract.py into one. Round 2's head 1a1dcf4b72f2 → here is two commits; neither touches vllm_musa/patches/ or vllm_musa/kernels/musa_ops.py, which is why both round-1 P1s survive.

P1-1 — duplicate 0109- prefix (unfixed). Verified at head: vllm_musa/patches/series/ holds 181 .patch files with 180 distinct NNNN prefixes; 0109-fix-avoid-CUDA-FA2-import-on-MUSA.patch and the PR's 0109-MUSA-keep-compile-warmup-outside-CUDAGraph.patch both claim 0109. On the base branch the series is 180 files with no duplicate, so this PR introduces the collision and 0181 is free (highest in use is 0180). tools/musa_sync.py:_series_numbering_rows (lines 1762-1819) emits ("series/0109", "duplicate-number", …) for that pair, and cmd_check_series (1928-1969) returns 1 whenever any numbering row exists; _SERIES_FATAL (line 160) covers only a missing/empty series and git problems, so nothing short-circuits it. docs/mdm-developer-guide.md:181 makes unique contiguous numbering part of that gate, line 170 says to run it before every PR, and lines 206-210 record that nothing invokes it automatically. Renaming moves the entry from 9th to last, so re-run check-series --replay --repo <checkout at the pin> afterwards.

P1-2 — provider gate that cannot fire (unfixed). vllm_musa/kernels/musa_ops.py is unchanged from the round-1 head; _can_use_fused_add_rmsnorm_under_contract still has its single call site at line 288, and its early return True at 134-137 is still reached. At the pin (third_party/PINS → VLLM_COMMIT=2cf0a6915ce544dc493a0990f2ea38d81601128a): vllm/config/vllm.py:2589 makes _current_vllm_config a module global that set_current_vllm_config (2594-2645) restores in finally, and get_current_vllm_config_or_none (2667-2668) returns it directly. The compile that exercises this provider runs from Worker.compile_or_warm_up_model (vllm/v1/worker/gpu_worker.py:694, reached from vllm/v1/engine/core.py:331), whose warmup _dummy_run (line 723) and capture_model (line 732) are not wrapped; the set_current_vllm_config sites in that file are load_model (453), reload_weights (471) and the weight-transfer paths (1281, 1289, 1338, 1356), and in gpu_model_runner.py only profile_cudagraph_memory's KV-cache setup (6781) and indexes_kv_by_block_stride (7931). So _fused_add_rmsnorm_contract_metadata() returns None, line 137 is taken, and the row and compile-range routing never reaches this selector — raw_needed/registered are also never supplied by any caller. The contract is enforced where the config or the owner's own state is bound: the pass at musa_allreduce_rms_fusion.py:608-648, :884, :1328 and the pattern gate at :171, and the communicator at musa_jit_custom_all_reduce.py:587, :1378. The impact is therefore an inert, misleading probe rather than a wrong rewrite — which is why the fix is deletion (or binding the config in the warmup patch this PR already adds), not behaviour repair.

Checks. gh pr checks 199 → no checks reported on the 'codex/musa60030-default-on-qwen36-v028-20260825' branch. That does not block.

Optimization-level gate reviewed, nothing blocking. The >= 2 half is correct and necessary: upstream applies OPTIMIZATION_LEVEL_TO_CONFIG at vllm/config/vllm.py:1406-1407, after apply_config_platform_defaults at 1377, and _set_config_default (866-879) only fills a field still set to None. At O2 the upstream value is enable_allreduce_rms_fusion (147-167, CUDA-only → False on MUSA), so the platform's True survives; without the >= 2 gate the platform would win at O0/O1, where upstream hard-codes False. The documented OFF control checks out: vllm/utils/argparse_utils.py:389-417 merges dotted -cc. arguments into one nested dict, so -cc.pass_config.fuse_allreduce_rms=False reaches the same field. The added patch body matches the pin's _dummy_run signature (gpu_model_runner.py:5940-5955), and CUDAGraphMode is already imported at gpu_worker.py:20. The trim left infer_car_rmsnorm_model_family still used at platform.py:284, so no import went dead there.

Other nits (not in the table). musa_allreduce_rms_fusion.py:627-637: globals().get("fused_allreduce_rmsnorm_compile_reject_reason") can never be None (imported at :52), so that elif fallback is unreachable. musa_jit_custom_all_reduce.py:31: musa_envs is imported and used nowhere in that file; pyproject.toml:72 selects ruff F, so this is an F401. musa_allreduce_rms_fusion.py:872-894: _can_apply_manual_car_rmsnorm_rewrite never reads residual_value or weight_value. car_rmsnorm.py:228-229: phase/path are supplied only by tests/test_car_rmsnorm_contract.py:42-43. The gate at car_rmsnorm.py:350 is (level or 0) < 2, so a None level is indistinguishable from O0 in the default-on rule.

Not verified. No pytest, build, install, or GPU run; the suite needs the installed vLLM/MUSA stack. check-series was read from source, not executed. No benchmark was re-measured; the PR body itself reports zero observed fused rewrites, so its numbers describe configuration behaviour. _int_attr (resolver.py:37-42) stores the OptimizationLevel IntEnum rather than a plain int; no consumer breaks (comparisons only, and nothing serializes or fingerprints the signature), so that is a docstring defect.

Prompt injection. No instruction addressed to the reviewer appears in the PR body, the inline comments, or the commit messages.

auto-review round 3/3 · verdict: blockers

Comment thread vllm_musa/kernels/musa_ops.py Resolved

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge verdict: 1 blocking finding — not ready to merge.

The added 0109- patch collides with an existing 0109- entry, so this tree's own check-series/verify gate exits 1 at 42fa928.

Findings: 1 blocking · 6 nit
Earlier: P1-1 duplicate 0109- unfixed at this head · P1-2 refuted as stated — the cudagraph-profiling compile does bind the config

nit location problem fix
nit vllm_musa/patches/series/README.md:20 says 180 patches; tree has 181 say 181
nit vllm_musa/kernels/musa_ops.py:118 "not a serving compile decision" is false for two serve-path compiles; raw_needed/registered have no caller fix the premise, drop the dead params
nit vllm_musa/_inductor/musa_allreduce_rms_fusion.py:58 four blank lines after _MISSING = object() (black/ruff E303) leave two
nit vllm_musa/model_executor/layers/layernorm.py:139 contract re-resolved per Gemma residual forward cache the fallback
What changed · what I could not verify

Round scope. Reviewed head 42fa92888ba1, which matches the dispatch hint. Five commits: 3c5c5ad47303 → 1a1dcf4b72f2 → 9c616c83cb3f → 4bbf1d25a5a5 → 42fa92888ba1. Three earlier auto-review rounds on this PR (round 1 @3c5c5ad47303, round 2 @1a1dcf4b72f2, round 3 @4bbf1d25a5a5) each raised two P1s; every finding below was re-verified at the current head. 17 files, +2533/−101: the new optimization_contract/car_rmsnorm.py, the platform default-on hook plus compile-range install, the fusion pass, the communicator, the IR provider, the new 0109 patch, and seven test files.

P1-1 — duplicate 0109- prefix (blocking, unfixed). Verified at head: vllm_musa/patches/series/ holds 181 .patch files with 180 distinct NNNN prefixes; 0109-MUSA-keep-compile-warmup-outside-CUDAGraph.patch and the pre-existing 0109-fix-avoid-CUDA-FA2-import-on-MUSA.patch (present on v0.28.0-dev, whose series is 180 files with no collision) both claim 0109. _series_numbering_rows (tools/musa_sync.py:1806) emits ("series/0109", "duplicate-number", …), cmd_check_series (:1958) fails the verdict on any numbering row and returns 1 at :1969, and _SERIES_FATAL (:160) does not cover duplicate-number, so nothing short-circuits it. docs/mdm-developer-guide.md:181 makes unique contiguous numbering part of that gate and :170 says to run it before every PR; :206-210 record that nothing invokes it automatically. 0181 is free (highest in use is 0180). sorted() orders 0109-MUSA-… before 0109-fix-…, so the apply order of the two entries is incidental; they touch different upstream files, so the replay itself is not what fails.

P1-2 — refuted as stated. The earlier rounds argued that no VllmConfig is current while Inductor lowers this op, so _can_use_fused_add_rmsnorm_under_contract always returns True at musa_ops.py:120. That is not true at this head. get_current_vllm_config_or_none returns the module global _current_vllm_config (vllm/config/vllm.py:2667-2668), restored in finally by set_current_vllm_config (:2642). compile_or_warm_up_model (vllm/v1/worker/gpu_worker.py:694) and profile_run (gpu_model_runner.py:6558, called at gpu_worker.py:519) are indeed unwrapped — but profile_cudagraph_memory (gpu_model_runner.py:6780) wraps its entire body in set_current_vllm_config, including the capture loop at :6861-6882 that calls _warmup_and_capture → _dummy_run → self.model(...) (:6266), which is the first compile of the decode cudagraph sizes. MUSA returns True from is_cuda_alike() (vllm_musa/platform.py:345-347), so gpu_worker.py:528-532 runs that path on MUSA. The decode compile ranges — the ones this PR's contract routes — therefore do evaluate the gate against a bound config, and it agrees with the pass, which passes the same raw_needed=None/registered=None. What survives is the nit in the table: the fallback comment's premise ("this is not a serving compile decision") is false for the profile_run and compile_or_warm_up_model compiles, which are serve-path compiles, and raw_needed/registered are supplied by no caller — the single call site is musa_ops.py:271.

Unconfirmed. For the ranges compiled in the unwrapped phases the gate is inert, so if any other producer emits ir.ops.fused_add_rms_norm in a range the contract routes native, the MUSA fused provider stays selectable there. Confirming it needs a run with a graph dump from a range compiled outside profile_cudagraph_memory; I could not establish that such a graph exists, so it is not a finding.

Checked and sound, nothing blocking. The compile-range install is safe because _set_compile_ranges runs at vllm/config/vllm.py:1611, after check_and_update_config at :1595, so the platform's endpoints are re-derived with max_num_batched_tokens back on the end (:2153-2161) — the final range still reaches max_num_batched_tokens, which PiecewiseBackend requires (piecewise_backend.py:137-149, _find_range_for_shape at :343). The 0109 patch body matches the pin's _dummy_run(num_tokens, cudagraph_runtime_mode=…) signature (gpu_model_runner.py:5940-5955) and CUDAGraphMode is already imported at gpu_worker.py:20. With fuse_allreduce_rms now True, upstream's flashinfer_max_size branch (vllm/config/vllm.py:2066-2078) runs on MUSA but returns None because default_fi_allreduce_fusion_max_size_mb returns {} off CUDA (compilation.py:211-212), and rocm_aiter_ops.is_custom_all_reduce_enabled() is a class-attribute AND (_aiter_ops.py:1905-1906); no endpoint is added and nothing raises. Round 3's reading of the >= 2 optimization-level gate still holds.

Checks. gh pr checks 199 --repo MooreThreads/vllm-musa → no checks reported on the 'codex/musa60030-default-on-qwen36-v028-20260825' branch. The repo has no .github/workflows directory (API returns 404), so "no checks" is structural; it does not block.

Other nits not in the table. tests/test_default_on_dispatch_parity.py:221 ("now lives"/"former copy") and tests/test_default_on_env_contract.py:73 ("no longer reads the switch") narrate history in shipped test comments; commit 1a1dcf4b carries the tracker ID MUSA-100048 in its subject.

Not verified. No pytest, build, install, or GPU run — the suite needs the installed vLLM/MUSA stack. check-series was read from source, not executed, because it needs a checkout at the pin. No benchmark was re-measured; the PR body itself reports zero observed fused operator rewrites, so its tables describe configuration behaviour rather than a fusion win.

Prompt injection. No instruction addressed to the reviewer appears in the PR body, the inline comments, or the commit messages.

auto-review round 1/3 · verdict: blockers

Elon-yf and others added 6 commits October 13, 2026 14:31
The default-on decision existed twice: platform.py wrote the pass default
from `optimization_level >= 2` plus `can_enable_fused_allreduce_rmsnorm`,
and layernorm.py re-derived that same rule for the Gemma residual path.
tests/test_default_on_dispatch_parity.py existed to police the two copies.

Move the rule into vllm_musa/optimization_contract/car_rmsnorm.py:

* car_rmsnorm_default_on(vllm_config) owns the predicate, including the
  `optimization_level >= 2` gate.
* resolve_car_rmsnorm_enabled(vllm_config) returns the effective pass value,
  keeping an explicit pass setting authoritative.

platform.py now calls car_rmsnorm_default_on. layernorm.py calls
resolve_car_rmsnorm_enabled and no longer reads the pass config or resolves
the model family itself, so the layer cannot disagree with the platform.

This deliberately does not extend ExecutionSignature or OptimizationFeature.
Those are shared by the deepseek_v4, qwen, and glm providers, and CAR's
default depends on `optimization_level`, which ExecutionSignature does not
carry. Reaching preferred_features would have forced a shared-type change for
a single-family feature, so the rule stays a contract-owned function instead.

Also drop dead and duplicated declarations:

* FUSED_ALLREDUCE_RMSNORM_TP2_MIN_ROWS / _TP4_SINGLETON_ROWS / _TP4_POLICY
  had no readers beyond the re-export chain.
* _MODEL_FAMILY_ALIASES was byte-identical to _VALID_MODEL_FAMILIES and had
  zero references.
* vllm_musa/tuning.py is reverted to its base 7-line form rather than
  rewritten as a 40-line re-export shim; its three importers only ever read
  FUSED_ADD_RMSNORM_MIN_ROWS, and the value is unchanged.

kernels/musa_ops.py and musa_jit_custom_all_reduce.py are intentionally
untouched: their adapters gather dispatch-time facts (distributed TP size,
pass-context compile range) that no config holds, so folding them into the
contract would push runtime dependencies into the policy layer.

Tests: 123 passed / 0 failed. 97 on leased MUSA hardware
(test_car_rmsnorm_contract, test_default_on_dispatch_parity,
test_musa_jit_custom_all_reduce_graph) and 26 offline
(test_default_on_env_contract, test_compile_warmup_cudagraph_source,
test_fused_ar_registered_graph_source). Source -33 lines, tests +108,
mostly new contract coverage plus a guard that keeps the hand-listed compile
endpoints consistent with CAR_RMSNORM_POLICY_TABLE.
…signature

`VllmConfig.optimization_level` is a real field with a real default:

    optimization_level: OptimizationLevel = OptimizationLevel.O2

so the `>= 2` half of the CAR-RMSNorm default-on rule already holds for a
plain `vllm serve`. It is also the field upstream uses to decide the very pass
this rule overrides -- `OPTIMIZATION_LEVEL_TO_CONFIG` sets `fuse_allreduce_rms`
from `enable_allreduce_rms_fusion` on O2 and to a hard-coded `False` on O1/O0 --
and that predicate is CUDA-only, so on MUSA it answers `False`.

The platform hook writes the pass value before the optimization-level presets
run and `_set_config_default` only fills a still-`None` field, so the hook wins
on O2 and must yield on O1/O0. Measured on a real MUSA VllmConfig
(tp=2, Qwen3.5-27B, hidden 5120, bf16):

    -O2 (default)  level=2  contract accepts  upstream wanted False  ->  True
    -O1            level=1  contract accepts  upstream wanted False  ->  False
    -O0            level=0  contract accepts  upstream wanted False  ->  False
    level=None                              rejected by validation

Record the level on `ExecutionSignature` and read it there in
`car_rmsnorm_default_on`, so the gate and the level that justifies it come from
one resolution of the contract instead of a raw attribute read. Family and
level now share a single `resolve_optimization_contract` call, replacing the
separate `infer_car_rmsnorm_model_family` lookup.

The field defaults to `None`, not to `O2`: an absent level means "no vLLM
config was supplied", which stays distinct from a real `O0`. No provider reads
it, and a parametrized test pins that every level resolves to the same family
and the same feature sets for Qwen3.5, Qwen3.5-MoE, DeepSeek V4, GLM and an
unknown architecture.

Also add `tools/probe_optimization_level.py`, which builds real `VllmConfig`
objects and prints the resolved pass value, so the ordering claim above can be
re-measured rather than re-argued.

Evidence: 140 passed / 0 failed across the seven contract and CAR-RMSNorm test
files on S5000 (driver 5.2.0, MPX 30).
Review of the previous commit against its own goal. The rule is simpler to
keep in one place if it is also written in one place:

- `car_rmsnorm_default_on` loses most of its docstring and keeps its lazy
  resolver import; the explanation that matters lives in the tests.
- the platform hook logged `family=`, which re-resolved the whole contract
  immediately after `car_rmsnorm_default_on` had already resolved it. Drop the
  field rather than resolve twice to format one log line.
- `test_config_default_only_writes_a_still_none_field` asserted a substring of
  upstream source; fold it into the ordering test that needs the same fact.
- `test_the_signature_field_defaults_to_none_not_to_o2` restated a dataclass
  default that the neutrality test already depends on.
- `tools/probe_optimization_level.py` was a diagnostic for building this
  change, not product code. Move it to the ticket evidence path.

No behaviour change: same gate, same predicate, same resolved pass value.
A scan of the diff for repeated blocks turned up two accessors written more
than once:

- `_current_compile_range` in the Inductor pass and
  `_fused_add_rmsnorm_compile_range` in the kernel dispatch were the same
  function under two names, byte-identical but for the docstring.
- the "read the current VllmConfig, then derive family and quantization
  state" block appeared once in the kernel dispatch and again in the
  communicator, differing only in the arity of the `None` they return.

Both now live in the contract as `current_car_rmsnorm_compile_range` and
`current_car_rmsnorm_metadata`. The metadata helper returns `None` for "no
active config", which is deliberately not the same as "not quantized", so each
caller keeps its own fail-closed direction instead of inheriting one.

Also collapse the six byte-identical
`extra_check=lambda match: _can_fuse_allreduce_rmsnorm_match(...)` closures in
the Inductor pass into `_extra_check_for(self)`. Adding a fifth predicate
argument previously meant editing six places.

The communicator test stub moves from the communicator module to the contract
module, which is where the family is resolved now.

No behaviour change: same predicate, same arguments, same fail-closed paths.
… patch

Two review findings on PR MooreThreads#199.

The fused_add_rms_norm provider selector consulted the CAR contract through
``current_car_rmsnorm_metadata()``, which returns None whenever no VllmConfig is
current. Inductor lowers this IR op from the lowering pass via
``fx.map_arg(node.args, lambda arg: arg.meta["val"])``, and every function that
reaches it -- ``compile_or_warm_up_model``, ``_dummy_run``, ``capture_model``,
``execute_model`` -- runs outside ``set_current_vllm_config``. The metadata was
therefore always None, the selector always returned True, and the declared
native-row routing never reached provider selection. Remove that dead gate and
its two now-unused helpers.

The shape guard it also carried is kept, because it is not part of the contract:
a symbolic hidden dimension has no truthful answer for the weight-numel and
multiple-of-8 comparisons in the provider predicates, so rejecting it first is
load-bearing independently of the contract. ``weight is None`` and ``x.dim() !=
2`` are dropped as duplicates of checks both provider predicates already make.

The new patch took the ``0109-`` prefix already owned by
``0109-fix-avoid-CUDA-FA2-import-on-MUSA.patch``, so ``check-series`` reported
``duplicate-number`` and ``sorted()`` decided apply order by filename. Renumber
it to ``0189``, the first free number above both this tree's 0180 and the 0188
in v0.28.0-dev. A test now asserts the series carries no duplicate prefix.

Assisted-by: DeepSeek Harness
@Elon-yf
Elon-yf force-pushed the codex/musa60030-default-on-qwen36-v028-20260825 branch from 42fa928 to a247a53 Compare October 13, 2026 06:43

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge verdict: 3 blocking findings — not ready to merge.

Two of the repo's own gate tests fail at a247a53, and the renamed 0189- entry collides with the 0189- the base added after this head was cut.

Findings: 3 blocking · 6 nit
Earlier: duplicate-0109 P1 fixed at a247a53 · provider-gate P1 deleted at a247a53 (round 1 had refuted its premise)

nit location problem fix
nit vllm_musa/_inductor/musa_allreduce_rms_fusion.py:53 import reachable only through globals().get at :583, so ruff reports F401 here call it directly and drop the globals().get
nit vllm_musa/model_executor/layers/layernorm.py:139 contract re-resolved on every Gemma residual forward when the cached flag is false cache the false result as well
nit vllm_musa/kernels/musa_ops.py:57 docstring repeats the "no config while lowering" premise round 1 refuted; the guard is shape-only state the symbolic-shape reason only
What changed · what I could not verify

Head and history. Reviewed a247a535bcd2 (draft). The branch was rebased since the last review: the SHAs the earlier rounds anchored (3c5c5ad47303, 1a1dcf4b72f2, 9c616c83cb3f, 4bbf1d25a5a5, 42fa9288ba1) no longer exist on codex/musa60030-default-on-qwen36-v028-20260825; it now holds 8a23c1b07598 → 87147a3a53a1 → 539e398f8946 → 22c6452d3369 → a651948ef855 → a247a535bcd2, and compare/v0.28.0-dev...a247a535 reports ahead_by 6, behind_by 1. a247a535 drops the CAR gate from musa_ops.py and renames the patch.

Earlier findings. The duplicate-0109 P1 is fixed: the series is 0001..0189, 189 entries, no duplicate, no gap. The provider-gate P1 is gone: vllm_musa/kernels/musa_ops.py mentions the contract only in the new docstring, and _select_musa_fused_add_rms_norm_impl (line 197) keeps only the shape/compile-range checks. The author's two inline replies (2026-10-13T06:44Z) contain only the file references @/tmp/reply-patch.md and @/tmp/reply-gate.md, which do not resolve in this session and carry no content to weigh, so both earlier findings were judged from the code at this head. gh pr checks 199 says, verbatim: no checks reported on the 'codex/musa60030-default-on-qwen36-v028-20260825' branch.

P0 — non-canonical patch author. tests/test_musa_sync.py:130 (test_series_uses_documented_prefixes_and_canonical_metadata) asserts {lines[1] for lines in headers} == {b"From: musa <musa@local>"} over series/*.patch. Line 2 of this new entry is From: Elon Gao <elon.gao@mthreads.com>; every other entry I sampled (0001, 0109, 0188) uses the synthetic identity, so the set has two elements and the assertion fails. series/README.md:11-13 documents that normalization and musa_sync._normalize_patch_author re-applies it. I did not execute pytest (no checkout at this head; this session's filesystem is read-only), so this is the assertion's inputs reproduced from the head tree.

P0 — stale README patch count. series/README.md:22 says Currently **188 patches**, plus **3 upstream entries**; the directory holds 189 *.patch (upstream count 3 still matches). tests/test_musa_sync.py:109 (test_series_readme_count_matches_directory) asserts f"Currently **{patch_count} patches**" in readme, so it fails at this head. docs/mdm-developer-guide.md step 4 requires the bump for a new MUSA entry and notes "the tests check both". Write 189 here, or 190 once the numbering finding's rebase lands.

P1 — the new number collides with the base. The one base-only commit is 9539b3ba370a (2026-10-13T06:47Z, PR #266), which adds vllm_musa/patches/series/0189-MUSA-hook-PaddleOCR-VL-rotary-fast-path.patch; this PR adds 0189-MUSA-keep-compile-warmup-outside-CUDAGraph.patch (authored 06:31Z, sixteen minutes earlier). The merge therefore holds two 0189- entries: tools/musa_sync.py:_series_numbering_rows emits duplicate-number, cmd_check_series returns 1, and this PR's own tests/test_compile_warmup_cudagraph_source.py:11-20 fails with duplicate patch numbers: ['0189']. Rename to 0190- on the rebase and update the PATCH constant. _series_numbering_rows's own docstring describes exactly this race.

Verified good. CUDAGraphMode is imported at vllm/v1/worker/gpu_worker.py:20 of the pin (VLLM_COMMIT=2cf0a6915ce544dc493a0990f2ea38d81601128a) and _dummy_run accepts cudagraph_runtime_mode (gpu_model_runner.py:5943), so the patch targets a real parameter; its context sits at pin line 720, not 678, which git apply --recount -p1 tolerates (the build-path apply was not executed; check-series --replay needs a checkout at the pin). compile_ranges_endpoints defaults to None and the pin's get_compile_ranges ends the last range at max_num_batched_tokens, so writing [3,4,15,16,63] yields the partition the PR body documents.

Not verified. No CI, no pytest, no hardware run, no make format-patches. The PR body itself records zero fused rewrites and ON/OFF deltas within ±0.5% (single-cell outliers to ±3%), so the default-on arm's benefit is unproven by that evidence — a claim to follow up, not a finding here.

Remaining nits: vllm_musa/optimization_contract/types.py:128 says "as a plain int" while resolver._int_attr returns the OptimizationLevel member unchanged; tests/test_default_on_dispatch_parity.py:221 ("now lives" / "former copy") and tests/test_default_on_env_contract.py:73 ("no longer reads the switch") narrate history in shipped comments.

auto-review round 2/3 · verdict: blockers

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Elon Gao <elon.gao@mthreads.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 — Restore the canonical patch author header

tests/test_musa_sync.py:130 requires every series/*.patch to carry From: musa <musa@local> on line 2; this header makes that set two elements, failing it.
series/README.md and musa_sync._normalize_patch_author both pin the synthetic identity, so regen would rewrite this line anyway.
Fix: write the canonical header, or regenerate the entry.

Suggested change
From: Elon Gao <elon.gao@mthreads.com>
From: musa <musa@local>

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 — Bump the series patch count in the README

tests/test_musa_sync.py:109 asserts Currently **{patch_count} patches** against the 189 entries this directory now holds, while series/README.md:22 still says 188.
This entry is what moves the count, and docs/mdm-developer-guide.md step 4 requires the README bump with it.
Fix: write 189 in series/README.md:22, or 190 once you rebase for the 0189 collision.


ROOT = Path(__file__).resolve().parents[1]
SERIES = ROOT / "vllm_musa/patches/series"
PATCH = SERIES / "0189-MUSA-keep-compile-warmup-outside-CUDAGraph.patch"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 — Renumber the patch after rebasing onto v0.28.0-dev

The base took 0189 for 0189-MUSA-hook-PaddleOCR-VL-rotary-fast-path.patch in 9539b3ba370a, and this head is one commit behind that.
Merging leaves two 0189- entries, so check-series reports duplicate-number and line 20 of this test fails as well.
Fix: rename the patch file to 0190- and update this constant.

Suggested change
PATCH = SERIES / "0189-MUSA-keep-compile-warmup-outside-CUDAGraph.patch"
PATCH = SERIES / "0190-MUSA-keep-compile-warmup-outside-CUDAGraph.patch"

This branch has not been deployed

No deployments
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.

2 participants