PLUGINS/UCX: Single UCX connection per handle - #2040
Conversation
|
👋 Hi iyastreb! Thank you for contributing to ai-dynamo/nixl. Your PR reviewers will review your contribution then trigger the CI to test your changes. 🚀 |
d85016c to
343758b
Compare
📝 WalkthroughWalkthroughThe UCX backend now tracks one connection per request handle. Standard range transfers use one endpoint, release superseded or failed requests, and flush the selected endpoint once. ChangesUCX connection and transfer handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant nixlUcxEngine
participant RemoteDescriptor
participant UCXEndpoint
nixlUcxEngine->>RemoteDescriptor: Read endpoint from first descriptor
nixlUcxEngine->>RemoteDescriptor: Validate endpoint for each descriptor
nixlUcxEngine->>UCXEndpoint: Post requests through selected endpoint
nixlUcxEngine->>UCXEndpoint: Flush selected endpoint once
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/plugins/ucx/ucx_backend.cpp`:
- Around line 1240-1251: Update the request handling around pending_req so every
NIXL_IN_PROG UCX request is retained rather than freeing or overwriting the
previous request. Before the failure path exits, cancel or drain all tracked UCX
requests and only then release them, ensuring UCX no longer accesses transfer
buffers before returning the error.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: a1146478-0bdd-4d10-b9fc-99ed1641dfe4
📒 Files selected for processing (2)
src/plugins/ucx/ucx_backend.cppsrc/plugins/ucx/ucx_backend.h
💤 Files with no reviewable changes (1)
- src/plugins/ucx/ucx_backend.h
|
/build |
|
🤖 CI Triage Agent — TL;DR: The container builds failed because Full analysisSummary: Multiple "Build image" stages (nixl/x86_64 node 156, nixlbench/x86_64 node 233, and other arches) failed with Root cause: Loss of network connectivity to the Ubuntu package mirrors during the image build. In node 233, Implicated commit: unknown — not code-related; environmental network failure on the Jenkins build agents. File: Suggested fix:
Related: none (no matching code issue/PR found). |
What?
Keep just a single connection pointer per handle, not set of them
Why?
A transfer handle targets exactly one remote agent, since createXferReq/prepXferReq take a single remote_agent and resolve the remote descriptors only against that agent's section. The engine keeps at most one connection per agent in remoteConnMap, and each nixlUcxPublicMetadata::conn is a const shared_ptr copied from that entry, so one agent means one nixlUcxConnection. The handle is also pinned to one worker, and a connection owns one endpoint per worker, so the whole descriptor list resolves to a single nixlUcxEp.
Testing
BW and post latency improves by 1% on low dimensions
This also improves sglang performance by 1-2%
Summary by CodeRabbit