Skip to content

Conversation

@dagrayvid
Copy link
Contributor

@dagrayvid dagrayvid commented Oct 20, 2025

This PR adds the ability to configure the number of UCX threads used for the NIXL backend agents.

Example usage:
--kv-transfer-config '{"kv_connector": "NixlConnector", "kv_role": "kv_both", "kv_connector_extra_config": {"num_threads": 2}}'

Purpose

This PR fixes an issue with WideEP in RDMA environments where we ran out of UAR space while initializing nvshmem for multi-node DeepEP, when used in conjunction with P/D.

This issue would result in logs like

/tmp/nvshmem_src/src/modules/transport/ibgda/ibgda.cpp 2939 Creating 1 DCI QPs (shared: 1, exclusive: 0)
...
/tmp/nvshmem_src/src/modules/transport/ibgda/ibgda.cpp 2967 Creating 8 RC QPs
/tmp/nvshmem_src/src/modules/transport/ibgda/ibgda.cpp 2967 Creating 8 RC QPs
...
/tmp/nvshmem_src/src/modules/transport/ibgda/ibgda.cpp:1830: NULL value cannot allocate mlx5dv_devx_uar

/tmp/nvshmem_src/src/modules/transport/ibgda/ibgda.cpp:1951: non-zero status: 12 ibgda_alloc_and_map_qp_uar failed
...
/tmp/nvshmem_src/src/modules/transport/ibgda/ibgda.cpp:2978: non-zero status: 7 ibgda_create_dci failed on RC #157.
/tmp/nvshmem_src/src/host/transport/transport.cpp:420: non-zero status: 7 connect EPS failed

This issue is not seen prior to 8ce5d31 where num_threads=8 was introduced. Some investigation with bpftrace revealed that in vLLM versions since this change, there are more UAR allocations by NIXL (from ~550 to ~1640), which explains the resource shortage later on in the start-up process when nvshmem is being bootstrapped.

Test Plan

Tested VLLM_ALL2ALL_BACKEND=deepep_low_latency with this change on a 3x8xH100 node environment on IBM Cloud.

Test Result

The above error is resolved and the model (Qwen-235B-A22B) loaded successfully.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@mergify mergify bot added the kv-connector label Oct 20, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 addresses a critical issue where nvshmem initialization fails due to UAR space exhaustion in RDMA environments. The fix, which reduces the number of NIXL threads for the UCX backend from 8 to 4, is well-justified and directly targets the regression. I have provided one suggestion to make this thread count configurable, which would improve flexibility for different environments while maintaining a safe default to prevent the issue from recurring.

@dagrayvid dagrayvid force-pushed the nixl-uar-resources-fix branch 3 times, most recently from 1662707 to 71a3ec4 Compare October 20, 2025 15:29
@tlrmchlsmth tlrmchlsmth added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 20, 2025
@tlrmchlsmth tlrmchlsmth enabled auto-merge (squash) October 20, 2025 21:25
@markmc
Copy link
Member

markmc commented Oct 21, 2025

This is the failing tests:

FAILED v1/distributed/test_async_llm_dp.py::test_load[True-ray-RequestOutputKind.DELTA] - ValueError: Currently, async scheduling only supports `mp` or `uni` distributed executor backend, but you choose `ray`.
[2025-10-20T13:11:22Z] !!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!

Fixed by #27195

You can rebase to pick up the fix or a committer can force merge 👍

This fixes an issue in RDMA environments where we ran out of UAR space
while initializing nvshmem for DeepEP, when used in conjunction with
P/D.

Signed-off-by: David Whyte-Gray <[email protected]>
auto-merge was automatically disabled October 21, 2025 14:37

Head branch was pushed to by a user without write access

@dagrayvid dagrayvid force-pushed the nixl-uar-resources-fix branch from b2bf90c to 483f9ff Compare October 21, 2025 14:37
@dagrayvid
Copy link
Contributor Author

Rebased on main

@tlrmchlsmth tlrmchlsmth merged commit ddeec11 into vllm-project:main Oct 21, 2025
51 checks passed
baonudesifeizhai pushed a commit to baonudesifeizhai/vllm that referenced this pull request Oct 21, 2025
sstamenk pushed a commit to sstamenk/vllm that referenced this pull request Oct 23, 2025
usberkeley pushed a commit to usberkeley/vllm that referenced this pull request Oct 23, 2025
albertoperdomo2 pushed a commit to albertoperdomo2/vllm that referenced this pull request Oct 23, 2025
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Chenyaaang pushed a commit to Chenyaaang/vllm that referenced this pull request Oct 28, 2025
ilmarkov pushed a commit to neuralmagic/vllm that referenced this pull request Nov 7, 2025
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kv-connector ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants