Skip to content

refactor(vllm): use native IPC engine for colocated weight sync#332

Closed
miracle0517 wants to merge 1 commit into
vllm-project:ascendfrom
miracle0517:fix/ascend_colocate
Closed

refactor(vllm): use native IPC engine for colocated weight sync#332
miracle0517 wants to merge 1 commit into
vllm-project:ascendfrom
miracle0517:fix/ascend_colocate

Conversation

@miracle0517

@miracle0517 miracle0517 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace VIME's custom colocated IPC weight-sync implementation with the native weight transfer engines provided by vLLM and vLLM-Ascend.

This removes the manual IPC handle gathering, serialization, and worker-side chunk loading path while aligning colocated weight updates with vLLM's native /update_weights lifecycle.

What changed

  • Use NPUIPCWeightTransferEngine on Ascend to send colocated weights.
  • Route native update_info payloads through VLLMEngine.update_weights and vLLM's /update_weights endpoint.
  • Initialize the native weight transfer engine once when colocated rollout engines are connected.
  • Use the native start_weight_update / finish_weight_update state machine with checkpoint-format loading.
  • Remove the custom:
    • trainer-rank IPC gather groups
    • IPC handle merging and serialization helpers
    • update_weights_from_tensor / update_weights_chunk RPC path
    • colocated worker-side tensor reconstruction logic
  • Retain the Ascend worker compatibility patches for MoE expert weight loaders and rotary embeddings.
  • Update unit tests to cover the native CUDA/NPU IPC transfer flow and isolate optional dependency stubs between test modules.

Why

The previous implementation duplicated functionality already supported by vLLM's native IPC transfer engines and required VIME to maintain custom GPU-slot gathering, IPC handle reconstruction, and worker RPC code.

Using the native transfer path reduces VIME-specific integration code and keeps colocated weight synchronization aligned with upstream vLLM and vLLM-Ascend behavior.

Testing

  • pytest tests/unit/backends/megatron_utils/update_weight/test_update_weight_from_tensor.py -q
  • pytest tests/unit/backends/vllm_utils/test_vllm_engine.py -q
  • Pre-commit formatting and lint checks
  • End-to-end Qwen3-4B colocated training on Ascend NPU

@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 refactors the colocated vLLM weight synchronization mechanism to leverage native IPC transfer engines (such as NPUIPCWeightTransferEngine and IPCWeightTransferEngine) instead of custom IPC gathering and serialization logic. The custom update_weights_from_tensor and update_weights_chunk methods have been replaced by a single update_weights method that posts native vLLM payloads, and serialization has been switched from cloudpickle to standard pickle. Unit tests, scripts, and Docker patches have been updated to align with these native APIs. No review comments were provided, so there is no additional feedback to address.

Replace the custom colocated IPC handle gathering and worker chunk RPC path
with vLLM/vLLM-Ascend native IPC weight transfer engines.

Route generated update_info through VLLMEngine.update_weights and vLLM's
/update_weights endpoint, initialize colocated transfer engines once during
connection, and update unit tests for the native colocated transfer flow.

Signed-off-by: wuxiang <498160096@qq.com>
@miracle0517
miracle0517 force-pushed the fix/ascend_colocate branch from 01d77cd to 38f431a Compare July 13, 2026 02:47
@miracle0517
miracle0517 marked this pull request as ready for review July 13, 2026 03:08
@miracle0517

Copy link
Copy Markdown
Contributor Author

The content of this PR has been merged into another PR. #345

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