Skip to content

[Bugfix][NIXL] Release unreachable prefill peers on failed heartbeat - #60268

Open
ovidiusm wants to merge 2 commits into
vllm-project:mainfrom
ovidiusm:heartbeat
Open

ovidiusm wants to merge 2 commits into
vllm-project:mainfrom
ovidiusm:heartbeat

Conversation

@ovidiusm

@ovidiusm ovidiusm commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Overview

In pull mode, the decoder does not release a remote prefill's NIXL state on failed heartbeat (which is detectable from UCX disconnection error, but current code does not check it).

When a prefill node crashes, its rkeys stay loaded on the decode nodes it recently communicated with, which results in MNNVL stale mappings. When the prefill node attempts to restart, it is unable to remap memory.

The current implementation of heartbeat could detect this, but they are only sent by decoders when they need to extend KV leases for pending requests.

This patch adds periodic sending of heartbeats, with detection and cleanup of disconnected peers.

Addresses #58063

Claims

Validation

On a GB200 NVL72 system, we ran vLLM v0.31.0 with this patch and NIXL 1.5.0, with --enable-cumem-allocator, on every instance, serving with two prefill and two decode instances under continuous traffic. We killed one prefill instance six times and each time started a replacement on the same GPU, restarting one decode instance along the way. In every cycle the decode instances released the killed prefill within about 10 seconds (about 25 seconds with the two keepalive variables left at their defaults), its GPU memory dropped to zero, the replacement started with its full memory budget and served all requests from both decode instances, and the other prefill instance kept serving, with no errors on the decode side.

Caveat

Two workarounds are needed until upstream changes land; two more to shorten detection.

Status Variable Purpose Without it Obsoleted by
[x] merged UCX_CUDA_IPC_CACHE=n Workaround: the UCX CUDA IPC cache keeps imported fabric mappings after the rkey is destroyed, so the released prefill's GPU memory stays allocated Memory stayed pinned although the decode instances released the prefill openucx/ucx#11870, plus NIXL setting UCP_EP_PARAMS_FLAGS_RKEY_BOUND_LIFETIME
[ ] pending UCX_RC_GDA_EP_ALLOC_MODE=direct Workaround: the UCX rc_gda QP pool returns QPs still connected to the old peer, and the next connection fails INIT2RTR (syndrome 0x5d668c) The replacement served 0 of 16 requests reset pooled rc_gda QPs before reuse openucx/ucx#11968
not needed UCX_KEEPALIVE_INTERVAL=2s Optional tuning: shortens detection of a failed peer Detection takes about 25 s instead of about 10 s n/a
not needed UCX_UD_TIMEOUT=5s Optional tuning: shortens the UD keepalive timeout As above n/a

Details


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

In pull mode, the decoder does not release a remote prefill's NIXL state
on failed heartbeat (which is detectable from UCX disconnection error,
but current code does not check it).

When a prefill node crashes, its rkeys stay loaded on the decode nodes
it recently communicated with, which results in MNNVL stale mappings.
When the prefill node attempts to restart, it is unable to remap memory.

The current implementation of heartbeat could detect this, but they are only
sent by decoders when they need to extend KV leases for pending requests.

This patch adds periodic sending of heartbeats, with detection and cleanup
of disconnected peers.

Signed-off-by: Ovidiu Mara <ovidium@nvidia.com>
@mergify

mergify Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @ovidiusm.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 10, 2026
stu-cao pushed a commit to stu-cao/vllm that referenced this pull request Oct 10, 2026
In pull mode, the decoder does not release a remote prefill's NIXL state
on failed heartbeat (which is detectable from UCX disconnection error,
but current code does not check it).

When a prefill node crashes, its rkeys stay loaded on the decode nodes
it recently communicated with, which results in MNNVL stale mappings.
When the prefill node attempts to restart, it is unable to remap memory.

The current implementation of heartbeat could detect this, but they are only
sent by decoders when they need to extend KV leases for pending requests.

This patch adds periodic sending of heartbeats, with detection and cleanup
of disconnected peers.

(cherry picked from vllm-project#60268, commit e629145)
[prime: conflict in get_transfer_results resolved by keeping the fork's
_cleanup_replaced_remote_engines() call and adding
_release_unreachable_remote_engines() after it]

Signed-off-by: Ovidiu Mara <ovidium@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Stu Cao <stu@primeintellect.ai>
stu-cao added a commit to stu-cao/vllm that referenced this pull request Oct 10, 2026
…ct#60268

Three tests for the pull-mode heartbeat added by the previous commit:
a peer whose heartbeat raises a remote-disconnect error is released, it
is kept while a read from it is still in flight, and the per-engine
heartbeat is rate limited.

The connector fixtures that build workers with object.__new__ now set the
three attributes the new code reads in get_transfer_results(), with the
periodic heartbeat disabled; 14 tests failed with AttributeError without
this.

Test: NIXL unit suites on a B300 pod, before vs after the cherry-pick:
no new failures, and these 3 tests now pass. The other failures are the
pod's environment (no facebook/opt-125m) and fail identically before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Stu Cao <stu@primeintellect.ai>
@mergify mergify Bot added nixl NIXL KV connector / multi-tiered KV offloading (KVCR) and removed needs-rebase labels Oct 29, 2026
@ovidiusm
ovidiusm marked this pull request as ready for review November 4, 2026 19:31

@claude claude 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.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working kv-connector nixl NIXL KV connector / multi-tiered KV offloading (KVCR)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant