Skip to content

feat(ascend): add HCCL PD transport - #209

Open
O1range wants to merge 1 commit into
InferMatrixLab:mainfrom
O1range:feat/ascend-pd-kv-transfer
Open

O1range wants to merge 1 commit into
InferMatrixLab:mainfrom
O1range:feat/ascend-pd-kv-transfer

Conversation

@O1range

@O1range O1range commented Nov 23, 2026 •

Copy link
Copy Markdown

Required human contributor answers

The human contributor must answer all four questions before PR submission.
An explicit answer already recorded elsewhere may be referenced with a precise,
accessible source; a bare link without an identifiable answer is insufficient.
Agents must not invent or fill in the human's answers. Blank, placeholder, or
unresolved answers do not complete this gate. See the
contributor-intent gate
and contributing guide.

Required human contributor answers

1. What outcome are you trying to achieve?

Add an Ascend HCCL-only transport for same-host PD execution so Ouro-1.4B can run BF16, fixed four-loop, greedy, full-prefill 2P2D inference on four Ascend 910B3 devices.

The PR should provide output-equivalent Prefill/Decode execution, KV and hidden-state transfer accounting, and reliable cancellation, timeout, duplicate-generation, worker-failure, and resource-release behavior. The previous SOCKET transport is removed from the Ascend implementation.

2. What is the highest-leverage variable for that outcome?

The highest-leverage variable is the correctness of asynchronous device-to-device transfer ordering and ownership.

Every send must match the intended receive geometry and operation order, and every request generation must keep its KV, hidden buffer, worker, and HCCL resources alive until the lifecycle protocol proves they are safe to release.

3. How will this work move that variable rather than create busywork?

The implementation connects HCCL directly to the existing PD coordinator and connector lifecycle instead of adding a parallel request protocol.

It adds HCCL process-group initialization, pair communication warmup, fixed P/D pair mapping, lazy receive registration, full-prefill KV/hidden geometry matching, transfer accounting, timeout handling, and fail-closed cleanup. The behavior is validated with CPU protocol tests, NPU lifecycle tests, and a real 4×910B3 Ouro-1.4B 2P2D run compared with single-stage output.

4. Who is the customer or user, and what do they actually need?

The users are maintainers and Ascend users who need to deploy Ouro PD inference on a same-host 910B3 machine.

They need a reproducible HCCL transport that works with NPU memory, preserves output correctness, exposes transfer accounting, and releases resources safely. They do not need a SOCKET fallback in the Ascend path.

PR necessity and bugfix evidence

A PR is needed because this change adds a new runtime transport, changes worker process-group lifecycle, changes Ascend PD configuration and connector behavior, removes the SOCKET implementation, and adds tests and documentation. These changes cannot be delivered through configuration alone.

During local bring-up, the original implementation reproduced the following failures:

  • HCCL receive registration before the matching send left all requests in reserving until timeout.
  • Rank/world-size fields in the shared model fingerprint caused false P/D configuration mismatches.
  • Multiple tids with different chunk geometry caused HCCL inconsistent-count errors.
  • Missing process-group warmup caused hcclCommInitRootInfoConfig rank-table failures.

These failures were reproduced locally and fixed in this PR. The original task is tracked in issue #172, and the implementation is based on the merged Ascend work from PR #168.

Purpose

Add an Ascend HCCL-only same-host 2P2D PD transport for Ouro-1.4B.

The supported scope is BF16, fixed four-loop, greedy decoding, full prefill, equal-size Prefill/Decode pools, and last_exited KV. CUDA deployments continue using NIXL.

The HCCL path serializes active tids because Ascend HCCL requires deterministic rank-pair operation ordering. This PR qualifies correctness, accounting, lifecycle behavior, and resource cleanup rather than throughput scaling.

Test Plan

vllm-rlt Version / Commit: 8d2dbb9

source /data/disk/lh/conda_env.sh
conda activate rlt

pre-commit run --all-files

python -m pytest -q \
  tests/test_hccl_transport.py \
  tests/test_pd.py \
  tests/test_transfer_connector.py

ASCEND_RT_VISIBLE_DEVICES=0,1,3,4 \
HCCL_IF_IP=192.168.0.130 \
HCCL_SOCKET_IFNAME=enp67s0f5 \
python -m pytest -q tests/test_ascend_pd.py --run-npu

The real 2P2D benchmark was run with four Ascend 910B3 devices:

ASCEND_RT_VISIBLE_DEVICES=0,1,2,3 \
HCCL_IF_IP=192.168.0.130 \
HCCL_SOCKET_IFNAME=enp67s0f5 \
python benchmarks/ascend_pd_2p2d.py \
  --model /data/disk/lh/models/Ouro-1.4B \
  --prefill-devices 0 1 \
  --decode-devices 2 3 \
  --num-blocks 128 \
  --prefill-tokens 128 \
  --max-tokens 4

## Test Result

- CPU/HCCL regression tests: 41 passed, 27 skipped.
- Ascend PD lifecycle tests: 2 passed.
- Real 4×910B3 2P2D run completed successfully.
- 2P2D token IDs, exit depths, and finish reasons matched single-stage execution.
- P-side submitted/completed bytes matched.
- D-side received/ready bytes matched.
- All workers reported used_blocks=0 after shutdown.
- Cancellation, tid reuse, worker failure, and resource-release paths passed in the NPU regression tests.
- pre-commit run --all-files: run this command before final submission and record its result here.

## Required human contributor answers

The human contributor must answer all four questions before PR submission.
An explicit answer already recorded elsewhere may be referenced with a precise,
accessible source; a bare link without an identifiable answer is insufficient.
Agents must not invent or fill in the human's answers. Blank, placeholder, or
unresolved answers do not complete this gate. See the
contributor-intent gate (../.agents/skills/vllm-rlt-review-pr/SKILL.md#human-contributor-intent-gate)
and contributing guide (../CONTRIBUTING.md).

### 1. What outcome are you trying to achieve?

### 2. What is the highest-leverage variable for that outcome?

### 3. How will this work move that variable rather than create busywork?

### 4. Who is the customer or user, and what do they actually need?

### PR necessity and bugfix evidence

After answering the four questions, explicitly state whether a PR is needed
at all and why. Reuse a traceable human decision if already recorded; otherwise
wait for the human to decide. For a bugfix, link the actual observed failure
(reproducer, failing test output, logs, or issue/report with expected versus
actual behavior); state whether it was reproduced locally.

## Purpose

## Test Plan

**vllm-rlt Version / Commit:**

## Test Result

<!-- BEFORE SUBMITTING: read the contributing guide at https://github.com/InferMatrixLab/vllm-rlt#contributing and run `pre-commit run --all-files` from the repository root (Ruff lint, Ruff format, and the CPU regression test suite). -->

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