Skip to content

[Bugfix] Handle P2P NIXL submission failures - #55553

Closed
Etelis wants to merge 2 commits into
vllm-project:mainfrom
Etelis:fix/p2p-nixl-submit-errors
Closed

Etelis wants to merge 2 commits into
vllm-project:mainfrom
Etelis:fix/p2p-nixl-submit-errors

Conversation

@Etelis

@Etelis Etelis commented Sep 6, 2026

Copy link
Copy Markdown
Member

Addresses #55181.

NIXL submission exceptions leave the decoder waiting and can trigger
double-finalization. Report failed submissions through the existing failure
path, release created handles when possible, and finalize each round once.

Polling exceptions remain covered separately by #49632.

Tests

Validated on 2× NVIDIA H100 80GB:

  • .venv/bin/python -m pytest tests/v1/kv_offload/tiering/p2p/ -v:
    219 passed; five regression failures reproduced before the fix.
  • With [Bugfix] NIXL: mark transfer failed when check_xfer_state raises in poll() #49632: 220 passed.
  • Real NIXL/UCX transfer succeeded after an injected submission failure.
  • Qwen3-0.6B: eight normal and eight faulted requests matched local-prefill
    output. Failures were injected after handle creation.
  • Changed-file pre-commit hooks passed.

Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: cfac2b01-9ca8-46b8-a121-e72b2980cbd6

📥 Commits

Reviewing files that changed from the base of the PR and between a1541f5 and 989dab8.

📒 Files selected for processing (4)
  • tests/v1/kv_offload/tiering/p2p/test_data_transport.py
  • tests/v1/kv_offload/tiering/p2p/test_sessions.py
  • vllm/v1/kv_offload/tiering/p2p/data/nixl.py
  • vllm/v1/kv_offload/tiering/p2p/session/server.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • vllm/v1/kv_offload/tiering/p2p/session/server.py
  • tests/v1/kv_offload/tiering/p2p/test_data_transport.py
  • vllm/v1/kv_offload/tiering/p2p/data/nixl.py
  • tests/v1/kv_offload/tiering/p2p/test_sessions.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when block transfer submission encounters an error.
    • Failed transfers now clean up correctly and report failure without leaving stale state.
    • Prevented duplicate or delayed failure results during polling.
    • Improved handling of transfer completion during fetch operations.
    • Transfer failures are now reported consistently across different operation orderings, including failures during cleanup.
  • Tests
    • Added coverage for transfer submission failures, cleanup errors, polling behavior, and different fetch/store completion orderings.

Walkthrough

The change makes NixlTransport.write_blocks convert submission exceptions into a failed, cleared state. Session handling avoids duplicate finalization after matched transfers. Tests cover cleanup and multiple operation orderings.

Changes

P2P transfer failure handling

Layer / File(s) Summary
Transport submission failure handling
vllm/v1/kv_offload/tiering/p2p/data/nixl.py, tests/v1/kv_offload/tiering/p2p/test_data_transport.py
write_blocks catches transfer setup and submission exceptions, releases partial handles, returns None, and clears observable inflight state. Tests cover cleanup and polling results.
Session failure finalization
vllm/v1/kv_offload/tiering/p2p/session/server.py, tests/v1/kv_offload/tiering/p2p/test_sessions.py
on_fetch exits after matched transfer submission. Tests cover fetch-first, store-first, and finish-before-fetch orderings and verify one failure result without duplicate messages.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 989da

P2P NIXL submission failures now follow the existing failure path, release created handles when possible, and finalize each request round once. No unresolved merge-readiness risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: fixing P2P NIXL submission failures.
Description check ✅ Passed The description directly explains the submission-failure fix, handle release, finalization behavior, and validation results.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot added bug Something isn't working kv-connector labels Sep 6, 2026
@Etelis
Etelis marked this pull request as ready for review September 6, 2026 07:39

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

@nilig

nilig commented Sep 9, 2026

Copy link
Copy Markdown

The submission-failure cleanup and the on_fetch() early return address the two failure paths here: an exception bypassing terminal failure handling, and a failed submission reaching finalization twice in the store-before-fetch case.

Keeping polling exceptions in #49632 makes sense. We should keep #55181 open until both fixes land, since submission failures and check_xfer_state() failures both occur in the reported issue.

@liranschour liranschour left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fix works and looks good. One change is requested in nixl.py - treat an error return code also as an exception.

remote_dlist,
np.asarray(remote_idxs, dtype=np.int32),
)
self._agent.transfer(handle)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

transfer() doesn't raise on submission failure — it returns "ERR".
this path isn't covered by the new try/except.
Suggested:

status = self._agent.transfer(handle)
if status == "ERR":
raise RuntimeError(f"NIXL post failed: {status}") # or duplicate the warn + release + return None

self._agent_name,
peer_id,
exc,
exc_info=True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

exc_info=True on a warning plus exc interpolated in the message is doubly redundant; every other failure log in this file (poll, _release_handles, cancel) logs without a traceback. Either logger.exception or drop exc_info.

@mergify

mergify Bot commented Sep 30, 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, @Etelis.

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 Sep 30, 2026
@Etelis

Etelis commented Oct 7, 2026 •

Copy link
Copy Markdown
Member Author

Closed in favour of a smaller fix required,
@liranschour will have this.

@Etelis Etelis closed this Oct 7, 2026
liranschour added a commit to liranschour/vllm that referenced this pull request Oct 7, 2026
…hing peer

A NIXL error raised while submitting a fetch's WRITE escaped
`NixlTransport.write_blocks` into `P2PSession._on_message`, which only
logs. The round was never finalized, so the requesting peer learned
nothing and only gave up at its load timeout (30 s) before falling back
to recompute — against ~6 s to recompute a 113K-token prefix directly.
The handle from `make_prepped_xfer` also leaked when `transfer` raised.

Three changes:

- `NixlTransport.write_blocks` catches submission errors, releases a
  created handle, logs, and returns None. This is what
  `DataTransport.write_blocks` already documents ("None if the peer is
  not registered or submission failed") and reuses the existing
  fail-fast path in `ServerRole._submit_transfer`.
- `ServerRole._submit_transfer` treats a raise from `write_blocks` as a
  failed submission, so a transport that violates the contract cannot
  wedge a round until the peer's timeout either.
- `ServerRole.on_fetch` returns after submitting. When the submission
  failed with nothing else inflight, `_submit_transfer` already
  finalized the round and pruned the request, and falling through to
  the prefiller-first `finishing` check finalized it a second time —
  `KeyError` on the popped request, which the dispatcher then counted
  toward its consecutive-error disconnect.

Carries forward the transport catch and the `on_fetch` early return from
vllm-project#55553, which was closed in favour of this, and adds the
`_submit_transfer` guard plus its regression test.

Fixes vllm-project#60204. Addresses the submission half of vllm-project#55181; the
`check_xfer_state()` path there is covered separately by vllm-project#49632 and
vllm-project#60279.

Co-Authored-By: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Signed-off-by: Liran Schour <lirans@il.ibm.com>
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 needs-rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants