Skip to content

test(npu): run the two CAMP2P extra-info cases against the real class - #584

Closed
Pingzii wants to merge 1 commit into
vllm-project:mainfrom
Pingzii:test/real-camp2p-extra-info
Closed

Pingzii wants to merge 1 commit into
vllm-project:mainfrom
Pingzii:test/real-camp2p-extra-info

Conversation

@Pingzii

@Pingzii Pingzii commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Makes the two connector-contract cases from #503 run on a bare CPU host.

test_sync_gate_feature_validation_cpu.py had 9 cases running everywhere and 2 behind pytest.importorskip("vllm"): the connector-local compute_gate_on_attention compatibility flag and the unknown-quant-mode rejection. They do not need vLLM at call time -- camp2p only pulls vllm.forward_context (and a few siblings) at module scope -- so the skip hid exactly the contract that tripped #581.

_real_extra_info() now installs the handful of runtime modules the import needs, restores sys.modules afterwards, and returns the real CAMP2PExtraInfo: parsing and validation stay production code, only the unavailable imports are stood in. On a host with vLLM installed the import simply succeeds and nothing is stubbed.

Local Windows CPU run: the file goes from 9 passed, 2 skipped to 11 passed; full tests/unit is 922 passed, 90 skipped, 0 failed.

Follow-up, not done here: test_sync_attention_gate_proxy.py also needs vLLM-Ascend and test_camp2p_connector.py needs torch_npu, so those stay CI-only and their per-file execution/skip record is the thing to read, not the suite total.

The connector-local compatibility flag and the unknown-quant-mode case sat behind
``pytest.importorskip(vllm)`` although they only need the module to import:
``camp2p`` pulls ``vllm.forward_context`` at module scope, nothing at call time
touches vLLM. They were therefore the two cases a bare CPU host never ran, and
the connector-level contract they pin is exactly what vllm-project#581 tripped over.

The helper now stubs the handful of runtime modules the import needs, restores
``sys.modules`` afterwards, and returns the real ``CAMP2PExtraInfo``; parsing and
validation stay real. Local run: 11 passed (previously 9 passed, 2 skipped).

Signed-off-by: 宋元盟 <songyuanmeng2@huawei.com>
@Pingzii

Pingzii commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #583 as the third commit (d6f5d89); closing to keep one review thread.

@Pingzii Pingzii closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ascend Ascend NPU platform and related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant