Skip to content

[Feature] Add NPU async DP framework and Async Cam connector - #64

Merged
jiangkuaixue123 merged 13 commits into
vllm-project:mainfrom
jiangkuaixue123:codex/async-rebase
Jul 6, 2026
Merged

jiangkuaixue123 merged 13 commits into
vllm-project:mainfrom
jiangkuaixue123:codex/async-rebase

Conversation

@jiangkuaixue123

Copy link
Copy Markdown
Collaborator

Summary

  • Add the NPU async DP framework plumbing, async CAM connector support, and related runtime/config integration.
  • Add async DP patch helpers, offline scheduling utilities, PCP debug helpers, and DeepSeek v2 async MoE support.
  • Expand unit coverage for async DP patches, connector metadata, offline schedules, config validation, and NPU worker/runtime behavior.

Impact

This enables the NPU async DP path to be exercised behind the AFD async configuration while keeping the changes isolated in the async connector/runtime flow.

Validation

  • Not run in this environment: local python is unavailable and python3 does not have pytest installed.
  • tests/unit/v1/worker/test_npu_runtime.py conflict was resolved and staged before the branch was finalized.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an asynchronous data-parallel (async-DP) connector (AFDAsyncConnector) along with compatibility patches, offline CSV scheduling, and NPU-specific model runner and worker updates for the Ascend NPU AFD plugin. The code review identified several critical runtime issues that must be addressed, including NameErrors due to missing imports or undefined functions (Mapping and _resolve_graph_pool), potential KeyErrors and TypeErrors during metadata sorting and cloning, negative slicing bugs when slicing token payloads, and a fallback issue where ffn_size is referenced instead of expert_rank_size.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread afd_plugin/v1/worker/ascend/ffn_model_runner.py Outdated
Comment thread afd_plugin/compat/ascend/runtime.py Outdated
Comment thread afd_plugin/v1/worker/ascend/ffn_model_runner.py Outdated
Comment thread afd_plugin/v1/worker/ascend/ffn_model_runner.py Outdated
Comment thread afd_plugin/v1/worker/ascend/ffn_model_runner.py Outdated
Comment thread afd_plugin/v1/worker/ascend/pcp_debug.py Outdated
Comment thread afd_plugin/compat/ascend/ops.py Outdated
Comment thread afd_plugin/compat/ascend/runtime.py Outdated
Comment thread afd_plugin/compat/ascend/runtime.py Outdated
Comment thread afd_plugin/connectors/npu/async_cam.py Outdated
return data


def _validate_topk_payload(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

这里的类型可以收窄成 Tensor / Tensor | None。调用点前面已经要求 topk_ids/topk_weights 存在,使用 object + getattr(shape) 的防御性写法有点重,直接访问 .shape 会更清楚。

Comment thread afd_plugin/connectors/npu/async_cam.py Outdated
Comment thread afd_plugin/model_executor/models/deepseek_v2.py Outdated
Comment thread afd_plugin/model_executor/models/deepseek_v2.py Outdated
Comment thread afd_plugin/v1/worker/ascend/ffn_model_runner.py Outdated
Comment thread afd_plugin/v1/worker/ascend/ffn_model_runner.py Outdated
Comment thread tests/unit/test_envs.py Outdated
Comment thread afd_plugin/model_executor/models/deepseek_v2.py Outdated
@jiangkuaixue123
jiangkuaixue123 force-pushed the codex/async-rebase branch 8 times, most recently from 019f8d4 to dd826be Compare July 5, 2026 12:23
Comment thread afd_plugin/connectors/npu/async_cam.py Outdated
Comment thread afd_plugin/connectors/npu/async_cam.py Outdated
Comment thread afd_plugin/connectors/npu/async_cam.py Outdated
Comment thread afd_plugin/model_executor/models/forward_context.py Outdated
Comment thread afd_plugin/v1/worker/ascend/attention_model_runner.py Outdated
Comment thread afd_plugin/v1/worker/ascend/attention_model_runner.py Outdated
Comment thread afd_plugin/v1/worker/ascend/attention_model_runner.py Outdated
Comment thread afd_plugin/v1/worker/ascend/attention_model_runner.py Outdated
Comment thread afd_plugin/model_executor/models/forward_context.py Outdated
Comment thread afd_plugin/config.py Outdated
Comment thread afd_plugin/v1/worker/ascend/ffn_worker.py Outdated
Comment thread afd_plugin/model_executor/models/forward_context.py
Comment thread afd_plugin/connectors/npu/async_cam.py Outdated
Comment thread afd_plugin/connectors/npu/async_cam.py Outdated
Comment thread afd_plugin/v1/worker/ascend/ffn_model_runner.py Outdated
@jiangkuaixue123
jiangkuaixue123 marked this pull request as ready for review July 6, 2026 08:16
@jiangkuaixue123 jiangkuaixue123 changed the title [codex] Add NPU async DP framework changes [Feature] Add NPU async DP framework and Async Cam connector Jul 6, 2026
@jiangkuaixue123
jiangkuaixue123 merged commit 912ee24 into vllm-project:main Jul 6, 2026
4 checks passed
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.

1 participant