NPU Async Connector: tests and docs - #236
Draft
ShwStone wants to merge 3 commits into
Draft
Conversation
Repair 28 NPU unit tests that failed on real hardware while CPU CI silently skipped them. All failures were test-side. - Stale v0.26 fixtures: use_v2_model_runner, afd_config/model_config, _ffn_loop_error, tensor-typed dp_metadata, read-only use_dcp -> dcp_size, required initialize_attn_backend kv_cache_config. - Cross-file pollution: pre-import the real module before the fake sys.modules swap so teardown has an original to restore. - Fake-torch leak: replace the string-typed fake torch with _FakeIntVector. Co-Authored-By: Claude <noreply@anthropic.com>
…ect#232) Add the async-cam-eager E2E case for CAMAsyncAFDConnector using the refactored tests/e2e framework. - Configure the connector through the shared runner (connector=CAMAsyncAFDConnector, async=true, compute_gate_on_attention=true, eager execution). - Make Attention/FFN topology explicit and configurable via AFD_E2E_ATTENTION_DEVICES / AFD_E2E_FFN_DEVICES (no fixed 2A1F). - Relax validate_topology for configurable topology; extract build_launch_order so async launches Attention before FFN. - Add CPU-safe unit coverage for commands, connector flags, launch order, and topology validation; update README, design doc, and run-e2e skill. Co-Authored-By: Claude <noreply@anthropic.com>
Restore the circular-import workaround that was dropped when the old conftest.py (with now-obsolete E2E fixtures) was deleted on main. Without it, pytest collection trips vllm_ascend's device_op -> ops -> experts_selector cycle (ImportError: cannot import name 'DeviceOperator'). Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates the NPU async CAM connector's test coverage and documentation on top of the v0.26 port (#203). It bundles three things:
async-cam-eagerE2E case forCAMAsyncAFDConnectorwith configurable topology.1. v0.26 unit-test fixes
The v0.26 upgrade left 28 NPU unit tests failing on real hardware while CPU CI silently skipped them (
pytest.importorskip). Every failure was test-side. After the fixes,tests/unit -m "not gpu and not vllm_runtime"is green (~450 passed).tests/conftest.pywith avllm_ascend.opspreimport to break thedevice_op → ops → experts_selectorcycle; without it, collection fails withImportError: cannot import name 'DeviceOperator'.use_v2_model_runner,afd_config/model_config,_ffn_loop_error, tensor-typeddp_metadata(was a plainlist), read-onlyuse_dcp→dcp_size, and the now-requiredinitialize_attn_backend(kv_cache_config).test_npu_mla_graph.pyswaps a fake module intosys.modules; when the real module had never been imported, teardown had no original to restore and the fake leaked into later tests. Fixed by pre-importing the real module..to(dtype)call (Invalid device string: 'int64'); replaced with_FakeIntVector.Details:
docs/npu/NPU_UNIT_TEST_FIX_2026-08-12.zh-CN.md.2. #232 —
async-cam-eagerE2EAdds
async-cam-eagerto the refactoredtests/e2e/framework:CAMAsyncAFDConnectorwithasync=true,compute_gate_on_attention=true, eager execution (the async connector has no graph path).AFD_E2E_ATTENTION_DEVICES/AFD_E2E_FFN_DEVICESinstead of the fixed 2A1F split.validate_topologyrelaxed for configurable topology;build_launch_orderextracted so the async connector launches Attention before FFN.The case is NPU-only and not yet run on hardware (see TODO).
3. Async connector features & runtime gotchas
Features
compute_gate_on_attention— the gate is evaluated on the Attention side.Runtime gotchas
EI0006) — same root cause on single and dual node; bisect confirmed the plugin code is innocent. Mitigation: send-ready immediately +HCCL_CONNECT_TIMEOUT=3600+GPU_MEM_UTIL=0.8.layer_input/attn_output/final_hidden.68bb799.attn_metadataduring dump crashes the FFN.VLLMWorker_DPlinger afterkill vllmand hold HBM; clean withnpu-smi info+kill -9.ifconfig.GPU_MEM_UTIL0.8 vs 0.9 — 0.9 leaves too little room for theHCCL_BUFFSIZE=4096communication pool (~8.6 GB); 0.8 is safe.AFD_CAM_OP_IO_LOG=1+ASCEND_LAUNCH_BLOCKING=1to trace send/recv.DP1TP8+EP8; CAM vendor env must be set.TODO (before undrafting)
async-cam-eageron real Ascend NPU and attach accuracy/topology/version evidence.tests/unit/test_e2e_runner.pyand the fixed NPU unit tests in an environment withpytest.async-cam-eagercase (pytest node ID vs@pytest.mark.npu).🤖 Generated with Claude Code