Repository navigation
[CI] Add the platform import-boundary test from RFC #6691 - #8029
armaanamatya wants to merge 9 commits into
Conversation
|
Self-review:
Not included: the behaviour freezes step 1 also lists (fallback, patch timing, packed metadata, unsupported cases) need NPU/ROCm hardware and belong with each migration item's owner. @hsliuustc0106 (proposal owner) @gcanlin @tjtanaa @xuechendi (platforms) @yenuo26 (CI) @princepride (connectors, most of the allowlist) @Isotr0py @david6666666 (diffusion, the |
|
This PR appears to belong to: docs/design/module/execution_platforms.md. Module owners: @gcanlin @tjtanaa @xuechendi Routing: @gcanlin via semantic router; @tjtanaa via semantic router; @xuechendi via semantic router @armaanamatya, please review your own changes and leave a short self-review comment describing what you checked. PRs without author self-review may not be assigned a reviewer. Please take a look when you have a chance. If you would like an automated review, mention @vllm-omni-review-bot in a comment. |
|
@gcanlin @tjtanaa @xuechendi could one of you review this? It adds the import-boundary test from #6691: it fails when code outside |
|
Re-validated against current main ( @gcanlin @tjtanaa @xuechendi could one of you review and add @vllm-omni-review-bot please review. |
Omni ReviewBot routing recordAssigned Strict on zcode (GLM-5.3-Flash) under experiment |
6f116b9 to
c9e0c04
Compare
|
Rebased onto main ( @gcanlin @tjtanaa @xuechendi could one of you review and add @vllm-omni-review-bot please review. |
Omni ReviewBot attempt recordReview attempt ended as failed (step 'review' (agent.review_diff): unhandled error: RuntimeError: zcode exited 1 without a result event: statusCode: undefined } Error: Turn execution failed (traceId: eaf9929d-33c1-489e-8919-11d6b6bff035) — check |
Omni ReviewBot attempt recordReview attempt ended as failed (step 'review' (agent.review_diff): unhandled error: RuntimeError: zcode exited 1 without a result event: statusCode: undefined } Error: Turn execution failed (traceId: 3d538586-8ad6-4bbe-b1fc-b65932da9f54) — check |
Omni ReviewBot attempt recordReview attempt ended as failed (step 'review' (agent.review_diff): unhandled error: RuntimeError: zcode exited 1 without a result event: statusCode: undefined } Error: Turn execution failed (traceId: 45b5fca0-69ee-4a61-9d31-8cc9b50b82ea) — check |
vllm-omni-review-bot
left a comment
There was a problem hiding this comment.
Omni ReviewBot review
0 actionable finding(s).
CI at
c9e0c04e8d4e(2026-10-10T04:55:02.039483+00:00): required check(s) blocking:buildkite/vllm-omni(missing).
Note: The assigned review arm
strict/zcode/GLM-5.3-Flashcould not complete this review, so it was produced by the fallback armdirect/cursor/auto. It is excluded from the routing experiment.
Full review analysis
PR description
This change adds a CPU import-boundary test and a short enforcement note under PLATFORM-INV-002. The test parses vllm_omni with ast and fails when neutral modules import a concrete vllm_omni.platforms.<backend> module, or when importing a backend package and its platform module eagerly reaches model, layer, quantization, attention-backend, or connector bodies. Eight existing neutral imports stay on a named allowlist that also fails if an entry no longer exists; the eager-import allowlist is empty. A subprocess imports the detector, the platform interface, the attention-backend registry, and distributed.omni_connectors with optional hardware SDKs blocked in sys.modules. No production runtime path changes.
Change flow
flowchart LR
tree["[EXISTING] vllm_omni import graph"]:::existing
test["[NEW] tests/platforms/test_platform_import_boundary.py"]:::new
debt["[NEW] Eight-entry neutral allowlist"]:::new
docs["[CHANGED] PLATFORM-INV-002 enforcement note"]:::changed
ci["[EXISTING] Simple Other Test core_model and cpu"]:::existing
tree --> test
debt --> test
test --> docs
test --> ci
classDef existing fill:#e5e7eb,stroke:#6b7280,color:#111827
classDef changed fill:#fef3c7,stroke:#d97706,color:#451a03,stroke-width:2px
classDef new fill:#dcfce7,stroke:#16a34a,color:#052e16,stroke-width:2px
classDef removed fill:#fee2e2,stroke:#dc2626,color:#450a0a,stroke-width:2px
No actionable findings.
🤖 This review was generated by InferMatrix Copilot, an open-source repo-maintenance agent for PR review, CI debugging and issue triage. Try it on your own repo, and ⭐ star it if it helped!
Neutral modules may not import a concrete vllm_omni.platforms.<backend> module, and importing a backend's platform class may not eagerly load model, layer, quantization or connector implementation bodies. Both rules are checked statically over the source tree; the eight existing neutral violations are recorded as an exact, named allowlist that fails the test when it goes stale, so it can only shrink. A subprocess test imports the detector and the neutral connector code with every optional hardware SDK blocked. Rollout step 1 of vllm-project#6691. Signed-off-by: Armaan Amatya <armaanamatya2014@gmail.com>
…raph_tools vllm-project#8515 added function-level imports of vllm_omni.platforms.npu.graph_tools to the MiniCPM-o 4.5 encoder graphs, which the neutral-import rule rejects. Add the two (module, target) pairs to NEUTRAL_IMPORT_ALLOWLIST under NPU group 1, the RFC item that moves the MiniCPM-o graph helper to its consumer package. Signed-off-by: Armaan Amatya <armaanamatya2014@gmail.com>
c9e0c04 to
3730728
Compare
|
Rebased onto main ( @gcanlin @tjtanaa @xuechendi @hsliuustc0106 could one of you review and add @vllm-omni-review-bot please review. |
…ms.npu.models.step_audio2_token2wav Main's vllm-project#8735 added a function-level import of the StepAudio2 token2wav NPU SDPA context to minicpmo_4_5/cuda_graph_wrapper.py, which the neutral rule catches. It is the same NPU group 1 debt as the existing batched_token2wav entry. Signed-off-by: Armaan Amatya <armaanamatya2014@gmail.com>
|
Merged main ( |
…d CFM DiT modules Main's vllm-project#8908 added function-level imports of vllm_omni.platforms.npu.models.cosyvoice2_dit_attn and vllm_omni.platforms.npu.models.minicpmo_fused to minicpmo_4_5/batched_token2wav.py. List both under NPU group 1. Signed-off-by: Armaan Amatya <armaanamatya2014@gmail.com>
|
Merged main ( @hsliuustc0106 @yenuo26 @NickCao @Gaohan123 @david6666666 could one of you review and add @vllm-omni-review-bot please review. |
Omni ReviewBot: no human activity for 7 days@armaanamatya this pull request has had no human commit, comment or review since 2026-10-21. Please confirm the current plan and next step. The author or a maintainer decides whether to change the PR state. To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline. |
Signed-off-by: Armaan Amatya <armaanamatya2014@gmail.com>
|
Plan: the PR is complete and waiting for a review from the platform/CI owners; there is no open blocker on my side. Merged main @yenuo26 @NickCao @hsliuustc0106 @Gaohan123 @david6666666 could one of you review? The allowlist drifts with every new NPU import on main, so it is easiest to land soon. @vllm-omni-review-bot please review. |
yenuo26
left a comment
There was a problem hiding this comment.
Reviewed tip b02913c47 (personal PTAL / requested review).
Looks good for landing. The static AST walk correctly covers nested/control-flow imports, skips TYPE_CHECKING, resolves relative/from pkg import name against on-disk modules, and the shrink-only allowlists (unexpected + stale) match the RFC #6691 debt model. Empty PLATFORM_EAGER_IMPORT_ALLOWLIST is the right bar for R4 today. The SDK-isolation subprocess probe (blocked optional hardware modules + detector/neutral probes + no non-detected platform class load) is a useful runtime complement to the static rules. Docs enforcement note under PLATFORM-INV-002 points at the right test.
CI selection: no Buildkite YAML change needed — tests/platforms/test_platform_import_boundary.py is marked core_model + cpu and is covered by READY’s catch-all pytest -sv tests/ -m 'core_model and cpu' (with the usual diffusion/model_executor/entrypoints ignores). No redundant tee/upload or one-off _surviving_labels selection tests.
Author evidence is solid (9 passed locally incl. subprocess; grepped allowlist; negative probes reverted). Soft non-blocking notes:
- The neutral allowlist has grown with main drift (#8515/#8735/#8908/#9106). That is the intended ratchet, but please keep landing the matching RFC migration items so the list shrinks rather than becoming a permanent catalog.
- Soft residual: Buildkite READY still needs the
readylabel to run; once green this is fine to merge from my side.
No blockers from me.
Purpose
Rollout step 1 of #6691: land the import-boundary tests before any platform-tree code moves, so the boundary is enforced while the debt is paid down one consumer domain at a time.
tests/platforms/test_platform_import_boundary.pychecks two rules statically overvllm_omni/:vllm_omni.platforms.<backend>module (R2), at any nesting depth, including lazy imports inside functions. Everything outsidevllm_omni/platforms/<backend>/counts as neutral, including the detector invllm_omni/platforms/__init__.py.TYPE_CHECKINGblocks are skipped; relative imports andfrom pkg import submoduleare resolved against the tree.vllm_omni.platforms.<backend>and.platform, module-level imports are followed transitively through othervllm_omni.platformsmodules (thin hooks are platform-owned) and rejected when they reachplatforms/<any>/{models,layers,quant,omni_connectors}or a consumer implementation subsystem (model_executor.models,model_executor.layers,diffusion.models,diffusion.layers,diffusion.attention.backendsexcept the registry,quantization,diffusion.quantization,distributed.omni_connectors). Function-level imports in hooks are allowed, which is what R4 asks for.Existing violations are an exact, named allowlist. The test fails on a new violation and also on an entry whose import no longer exists, so the list can only shrink. Each entry names the RFC migration item that retires it:
diffusion/attention/backends/flash_attn.pyplatforms.npu.quant.kv_quant_npudistributed/omni_connectors/__init__.pyplatforms.npu.omni_connectors.yuanrong_transfer_engine_connectordistributed/omni_connectors/connectors/yuanrong_transfer_engine_connector.pydistributed/omni_connectors/factory.pyplatforms.npu.omni_connectorsmodel_executor/models/fish_omni/fish_omni_model.pyplatforms.npu.models.fish_omnimodel_executor/models/fish_omni/model_state.pyplatforms.npu.models.fish_omni_model_statemodel_executor/models/fish_omni/quantization.pyplatforms.npu.quant.fish_omnimodel_executor/models/minicpmo_4_5/batched_token2wav.pyplatforms.npu.models.step_audio2_token2wavmodel_executor/models/minicpmo_4_5/batched_token2wav.pyplatforms.npu.models.cosyvoice2_dit_attnmodel_executor/models/minicpmo_4_5/batched_token2wav.pyplatforms.npu.models.minicpmo_fusedmodel_executor/models/minicpmo_4_5/cuda_graph_wrapper.pyplatforms.npu.models.step_audio2_token2wavmodel_executor/models/minicpmo_4_5/encoder_graph.pyplatforms.npu.graph_toolsmodel_executor/models/minicpmo_4_5/flow_encoder_graph.pyplatforms.npu.graph_toolsmodel_executor/models/moss_tts/modeling_moss_tts_codec.pyplatforms.npu.models.moss_tts_streaming_decode_wrappermodel_executor/models/step_audio2/step_audio2_token2wav.pyplatforms.npu.models.step_audio2_token2wavplatforms/__init__.py(detector)platforms.xpudist_backendis set during detectionThe eager-import allowlist is empty: every backend's platform class is already clean.
rocm/platform.pyandxpu/platform.pyimport theirpatchhooks at module level, but those hooks only import the patch bodies insideapply_patches(), which runs from the platform constructor.A subprocess test covers the runtime side of the same contract from the RFC's enforcement section: with
torch_npu,vllm_ascend,aiter,yr,torchada,vllm_musaandamdsmiblocked insys.modules, the detector,platforms.interface, the attention backend registry anddistributed.omni_connectors(+factory) import, detection resolves, no blocked SDK gets populated, and no platform class other than the detected one is loaded.docs/design/module/execution_platforms.mdgets an enforcement pointer under PLATFORM-INV-002. No production code changes.Not in this PR: the behavior freezes step 1 also lists (fallback, patch timing, packed metadata, unsupported-case behavior). Those need NPU/ROCm hardware to pin and belong with the owners of each migration item.
Test Coverage
pytest tests/platforms/test_platform_import_boundary.py -m "core_model and cpu"at head b02913c (main d6bd0fd merged in, vLLM 0.32.0): 9 passed (1 discovery, 2 neutral-rule, 5 per-backend eager-rule, 1 SDK-isolation subprocess).from vllm_omni.platforms.npu import platformfails the neutral rule naming the module and line; appendingfrom vllm_omni.platforms.npu import omni_connectorstocuda/platform.pyfails the CUDA eager rule; rewriting one allowlisted import fails with the "remove this stale entry" message.tools/pre_commit/check_test_marks.py, ruff 0.14.10 check/format, markdownlint: clean.Validation
L1 only (CPU).
tests/platforms/is already collected by thecore_model and cpustep, andtests/helpers/is not touched, so no Buildkite change.