Repository navigation
Conversation
e69cf29 to
c7532bc
Compare
c7532bc to
3c5c5ad
Compare
yeahdongcn
left a comment
There was a problem hiding this comment.
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
yeahdongcn
left a comment
There was a problem hiding this comment.
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.pygainscar_rmsnorm_default_on()/resolve_car_rmsnorm_enabled()as the single default-on rule;platform.apply_config_platform_defaultsandlayernorm._car_rmsnorm_ir_fusion_enablednow consume it.vllm_musa/tuning.pyreturns 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/orvllm_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 oftests/test_default_on_dispatch_parity.py(including their round-2 rewrites) all hold against the head sources. musa_sync check-serieswas not executed (it needs a checkout of the pin); theduplicate-numberrow and exit-1 path were read fromtools/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
yeahdongcn
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
yeahdongcn
left a comment
There was a problem hiding this comment.
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
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
42fa928 to
a247a53
Compare
yeahdongcn
left a comment
There was a problem hiding this comment.
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> | |||
There was a problem hiding this comment.
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.
| From: Elon Gao <elon.gao@mthreads.com> | |
| From: musa <musa@local> |
| @@ -0,0 +1,27 @@ | |||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | |||
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
| PATCH = SERIES / "0189-MUSA-keep-compile-warmup-outside-CUDAGraph.patch" | |
| PATCH = SERIES / "0190-MUSA-keep-compile-warmup-outside-CUDAGraph.patch" |
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 servecommand 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 theexisting
-cc.modeand-cc.cudagraph_modearguments.pass_config.fuse_allreduce_rmsunspecified (auto/default)-cc.pass_config.fuse_allreduce_rms=Falsepass_config.fuse_allreduce_rmsunspecified (auto/default)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
range.
the native path.
control:
-cc.pass_config.fuse_allreduce_rms=False.Supported routing matrix
TP2 contract
[16][3,4,15,16,63][[1,3],[4,4],[5,15],[17,63],[64,8192]]; Native[[16,16]][4,16][3,4,15,16,63][[1,3],[5,15],[17,63],[64,8192]]; Native[[4,4],[16,16]]TP4 contract
[16,64][15,16,63,64][[1,15]]; Native[[16,16],[17,63],[64,64],[65,8192]][64][15,16,63,64][[1,15],[16,16],[17,63],[65,8192]]; Native[[64,64]]Other / unsupported
[][][[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, or64); set--num-promptsand--max-concurrencyto that same BS, with--request-rate inf. The command below shows the 4096/1024 form; use the sameBS mapping for the 2500/1500 rows by changing the two random-length arguments.
The serve command below is the default-ON arm:
For the matched OFF arm, append this argument to the same serve command:
Validation
The existing
FULL_DECODE_ONLYreport is copied without re-aggregation:n=10repeated data;25 cells retain the report's unavailable sample count.
are not attributed to fused execution.
FULL_DECODE_ONLYmeasures the decode graph path; mixed execution is outsidethis report.
Complete results
Qwen3.5-35B-A3B-BF16 · 4096/1024 · TP4 · BF16
Qwen3.5-35B-A3B-BF16 · 2500/1500 · TP4 · BF16
Qwen3.5-27B-BF16 · 4096/1024 · TP2 · BF16
Qwen3.5-27B-BF16 · 2500/1500 · TP2 · BF16
Qwen3.5-27B-FP8 · 4096/1024 · TP2 · FP8
Qwen3.5-27B-FP8 · 2500/1500 · TP2 · FP8
Qwen3.5-35B-A3B-FP8 · 4096/1024 · TP4 · FP8
Qwen3.5-35B-A3B-FP8 · 2500/1500 · TP4 · FP8
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:
For the matched OFF arm, append this argument to the same serve command:
Gain is relative to SGLang. Positive values are better; throughput uses
higher-is-better, while TTFT and TPOT use lower-is-better.
Limitations
RMSNorm; ordinary custom all-reduce transport is unchanged.
n=10measurements.they do not establish fused-operator performance benefit.