Skip to content

fix(data_plane): one RDMA rail finder, rails for a netdev-only UCX_NET_DEVICES - #5145

Merged
terrykong merged 6 commits into
mainfrom
zhiyul/fix/nixl-ucx-gb300-rails
Nov 18, 2026
Merged

terrykong merged 6 commits into
mainfrom
zhiyul/fix/nixl-ucx-gb300-rails

Conversation

@ZhiyuLi-Nvidia

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

On GB300 the image sets UCX_TLS=tcp UCX_NET_DEVICES=eth0. With data_plane.backend=nixl, the real single-controller entry fails at startup:

TransportPolicyError: UCX_NET_DEVICES=eth0 names network interfaces ['eth0']; use RDMA devices with a port, e.g. rdma_vf_rail0:1

Root cause

configure_engine_env (nixl) fixes UCX_TLS, but when UCX_NET_DEVICES names only netdevs it deletes the variable. init_ray() copies os.environ into the Ray runtime_env. A deleted key is not in that copy, so every Ray worker keeps the node's eth0 and NixlStorageUnit refuses to start. Earlier nixl runs passed only because their launchers exported the RDMA rails.

Fix

One device finder for every backend, transfer_queue_env.rdma_rails():

  • InfiniBand first, else RoCE, never mixed (the rule rdma_devices() already had).
  • Minus the RDMA function of the default-route interface (/proc/net/route + /sys/class/infiniband/<dev>/device/net). On GB300 that is mlx5_8, the RoCE port of eth0. Kept only if it is the sole RDMA device.
  • mooncake's rdma_devices() calls it (keeps the MC_MOONCAKE_DEVICE override and the uverbs gate).
  • nixl: keep the RDMA devices the job named; if it named only netdevs, set UCX_NET_DEVICES to the rails (<dev>:1). Never delete it, never fall back to all. No rail at all raises TransportPolicyError.
Platform Inventory rdma_rails()
H100 (pool0) 8 IB mlx5_* + 1 RoCE port 8 IB rails (unchanged)
GB200 CI 4 RoCE mlx5_0..3 all 4 (unchanged)
GB300 mlx5_8 (eth0) + rdma_vf_rail0..3 rdma_vf_rail0..3 (mlx5_8 dropped, for mooncake too)

Tests

  • Unit: test_rdma_device_selection.py + nixl/test_transport_policy.py: 40 passed on the nightly-gym.2026-11-05 image. New: GB300 inventory for mooncake and nixl, management port kept when it is the only device, host without rails raises.
  • On a GB300 node: default route eth0, rdma_rails() == ['rdma_vf_rail0', 'rdma_vf_rail1', 'rdma_vf_rail2', 'rdma_vf_rail3'].
  • End-to-end on GB300, real run_grpo_single_controller.py recipe, 2 nodes, no UCX variables in the launcher:
Run Result
main, nixl TransportPolicyError at NixlStorageUnit start
this PR, nixl 3 steps, exit 0; all 9 nixl endpoints: UCX_TLS=rc,cuda_copy,cuda_ipc,self,sm UCX_NET_DEVICES=rdma_vf_rail0:1,rdma_vf_rail1:1,rdma_vf_rail2:1,rdma_vf_rail3:1
this PR, mooncake_cpu 3 steps, exit 0; mooncake device_name=rdma_vf_rail0,rdma_vf_rail1,rdma_vf_rail2,rdma_vf_rail3

Also: HPC-X's UCX hijacks NIXL's UCX (UCX_MODULES=^fuse)

On GB200 with the nightly.2026-11-12 image, backend=nixl failed in every trainer worker (MegatronPolicyWorker.setup_data_plane -> NIXL_ERR_BACKEND, "transports 'rc','cuda_copy','cuda_ipc' are not available"), with or without any UCX setting, on this PR and on its base.

Root cause: NCCL's default net plugin (/opt/hpcx/nccl_rdma_sharp_plugin/lib/libnccl-net.so) loads HPC-X's UCX 1.20 next to the UCX 1.21 the nixl wheel bundles. HPC-X's libucs loads its fuse module RTLD_GLOBAL (UCX debug log: loading module 'fuse' with mode 0x101), so it becomes process-global. NIXL's UCX then resolves its ucs_* calls into it (LD_DEBUG: 983 bindings), never loads its own IB/CUDA modules, and agent creation fails.

Fix: configure_engine_env (nixl branch) defaults UCX_MODULES=^fuse before anything loads UCX; a launcher's value wins. NCCL keeps its plugin. This replaces the doc's NCCL_NET_PLUGIN=none workaround (dropped from grpo_dp_nixl_tq_recovery.sh).

GB200, 2 nodes x 4 GPUs before UCX_MODULES=^fuse
NIXL agent after NCCL NIXL_ERR_BACKEND OK
NIXL ucs_* bindings into HPC-X libucs 983 0
NCCL network NCCL RDMA Plugin v11 NCCL RDMA Plugin v11
process exit (8 ranks) segfault (rc=139) clean
NCCL all_reduce / all_gather / reduce_scatter, 32 MiB-1 GiB, MNNVL on baseline within 1%
grpo_dp_single_controller + grpo_async_gym_single_controller, nixl, no launcher UCX/NCCL vars fail pass (7/7, 2/2 checks)

With MNNVL off, a few small/mid-size points moved by more than 2x the run-to-run noise in a single ordered run (e.g. all_reduce 32 B-2 KiB +10 us); not yet re-measured interleaved.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia changed the title fix(data_plane): name the RDMA rails when UCX_NET_DEVICES names only netdevs fix(data_plane): one RDMA rail finder; name the rails when UCX_NET_DEVICES is only netdevs Nov 10, 2026
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/fix/nixl-ucx-gb300-rails branch from dc44ee1 to 205c25c Compare November 10, 2026 05:44
@ZhiyuLi-Nvidia ZhiyuLi-Nvidia changed the title fix(data_plane): one RDMA rail finder; name the rails when UCX_NET_DEVICES is only netdevs fix(data_plane): one RDMA rail finder, rails for a netdev-only UCX_NET_DEVICES Nov 10, 2026
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 205c25c

zyzhou5
zyzhou5 previously approved these changes Nov 13, 2026

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

LGTM.

ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 14, 2026
…rror

Review nit on #5145: configure_engine_env raises TransportPolicyError
when UCX_NET_DEVICES names only netdevs and the host has no active RDMA
rail, which is a launcher or host condition, not only the internal
RDMA-only invariant the docstring described.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 14, 2026
…none

Cleanup review of #5145. The rails list is built only when UCX_NET_DEVICES
names no RDMA device, with the reason `all` is not used stated next to
it; the management-port filter drops a guard that was a no-op when there
is no default route; the docstring points to the design doc instead of
repeating it; the test fixture no longer pretends each RDMA device owns a
netdev of its own name.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/fix/nixl-ucx-gb300-rails branch from e178c54 to ffe39c9 Compare November 14, 2026 01:48
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test ffe39c9

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia added the CI:L1 Run doctests, unit tests, and functional tests label Nov 14, 2026
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test ffe39c9

ZhiyuLi-Nvidia and others added 4 commits November 16, 2026 14:18
…VICES is only netdevs

GB300 jobs get UCX_TLS=tcp UCX_NET_DEVICES=eth0 from the image. For the
nixl backend, configure_engine_env dropped eth0 and deleted
UCX_NET_DEVICES. init_ray() copies os.environ into the Ray runtime_env,
and a deleted key is not in that copy, so every Ray worker kept eth0 and
NixlStorageUnit raised TransportPolicyError at startup.

Add transfer_queue_env.rdma_rails(), the one device finder for every
backend: InfiniBand first, else RoCE, never mixed, minus the RDMA
function of the default-route interface (eth0 -> mlx5_8 on GB300), kept
only if it is the sole RDMA device. mooncake's rdma_devices() now calls
it. The nixl path keeps the RDMA devices the job named, or, when it named
only netdevs, sets the rails; it never deletes the variable and never
falls back to "all".

H100: 8 IB mlx5_* (unchanged). GB200 CI: 4 RoCE mlx5_* (unchanged).
GB300: rdma_vf_rail0..3 for both mooncake_cpu and nixl.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
On images that ship HPC-X, NCCL's default net plugin
(/opt/hpcx/nccl_rdma_sharp_plugin/lib/libnccl-net.so) loads HPC-X's UCX
1.20 into every NCCL process, next to the UCX 1.21 that the nixl wheel
bundles. HPC-X's libucs loads its fuse module RTLD_GLOBAL, which makes
that libucs process-global; NIXL's bundled UCX then resolves its ucs_*
calls into it (LD_DEBUG: 983 bindings), never loads its own IB/CUDA
modules, and agent creation in the trainer workers fails with
NIXL_ERR_BACKEND ("rc, cuda_copy, cuda_ipc not available").

configure_engine_env's nixl branch now defaults UCX_MODULES=^fuse (a
launcher's value wins). It runs on the driver before init_ray and any
UCX load, and Ray hands it to every worker. NCCL keeps its plugin; only
UCX's monitoring filesystem is off. This replaces the documented
NCCL_NET_PLUGIN=none workaround, which swapped NCCL's network.

Verified on GB200, image nightly.2026-11-12, 2 nodes x 4 GPUs: NIXL
works after NCCL (0 bindings into HPC-X), NCCL still uses "NCCL RDMA
Plugin v11", processes exit cleanly (they segfaulted at exit before),
both single-controller functional tests pass with backend=nixl and no
launcher UCX/NCCL settings, and NCCL collectives at 32 MiB-1 GiB stay
within 1% with MNNVL on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
…rror

Review nit on #5145: configure_engine_env raises TransportPolicyError
when UCX_NET_DEVICES names only netdevs and the host has no active RDMA
rail, which is a launcher or host condition, not only the internal
RDMA-only invariant the docstring described.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
…none

Cleanup review of #5145. The rails list is built only when UCX_NET_DEVICES
names no RDMA device, with the reason `all` is not used stated next to
it; the management-port filter drops a guard that was a no-op when there
is no default route; the docstring points to the design doc instead of
repeating it; the test fixture no longer pretends each RDMA device owns a
netdev of its own name.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the zhiyul/fix/nixl-ucx-gb300-rails branch from ffe39c9 to 013620c Compare November 16, 2026 22:51
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 013620c

@copy-pr-bot

copy-pr-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

/ok to test 013620c

@ZhiyuLi-Nvidia, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 013620c

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this fix. backend: nixl failed at startup on GB300, and this branch makes it start (main fails, this branch passes, in the 2-node runs in the description). Making rdma_rails() the one device finder for both backends is a good change, and splitting out the sysfs and procfs reads lets the tests run on CPU.

All five comments are about lines this PR adds or changes:

  1. (C1) The design doc still says the driver drops netdevs from UCX_NET_DEVICES. Update it to say the driver now sets the rails, or stops with an error.
  2. (C2) Tell users who set UCX_MODULES themselves to keep ^fuse in it.
  3. (C3) Add a test that parses a real /proc/net/route text.
  4. (C4) Test the "never all" rule with UCX_NET_DEVICES=all,eth0.
  5. (C5) Shorten two 3-line comments in configure_engine_env to one line each.

CI: the only CI job that runs with UCX_MODULES=^fuse in place of the removed NCCL_NET_PLUGIN=none is the GB200 L1 run of L1_Functional_Tests_SingleController_3.sh. The PR already has the CI:L1 label.

The earlier approval from zyzhou5 was dismissed by a later push.

Generated by Claude Code

Comment thread docs/design-docs/nixl-data-plane.md Resolved
… doc the rail fallback

Review follow-ups on the RDMA rail finder:

- design doc: the driver no longer only drops netdevs from
  UCX_NET_DEVICES; when the job named only netdevs it sets the host's
  RDMA rails (without the management port) or stops with an error.
- design doc: a launcher that sets UCX_MODULES itself must keep ^fuse.
- test: parse a real /proc/net/route text (default route after a
  non-default row whose Gateway is 00000000) so a wrong-column read
  fails; also cover no default route and no procfs.
- test: run the netdevs-only GB300 case for UCX_NET_DEVICES=all,eth0 too,
  so a filter that kept `all` fails.
- configure_engine_env: shorten two 3-line comment blocks; the old-bug
  story lives in the commit history.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test f2a7109

@terrykong
terrykong enabled auto-merge (squash) November 17, 2026 23:07
@terrykong

Copy link
Copy Markdown
Collaborator

/ok to test 4070f91

ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 18, 2026
…rror

Review nit on #5145: configure_engine_env raises TransportPolicyError
when UCX_NET_DEVICES names only netdevs and the host has no active RDMA
rail, which is a launcher or host condition, not only the internal
RDMA-only invariant the docstring described.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
ZhiyuLi-Nvidia added a commit that referenced this pull request Nov 18, 2026
…none

Cleanup review of #5145. The rails list is built only when UCX_NET_DEVICES
names no RDMA device, with the reason `all` is not used stated next to
it; the management-port filter drops a guard that was a no-op when there
is no default route; the docstring points to the design doc instead of
repeating it; the test fixture no longer pretends each RDMA device owns a
netdev of its own name.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
@terrykong
terrykong merged commit e6449ae into main Nov 18, 2026
214 of 216 checks passed
@terrykong
terrykong deleted the zhiyul/fix/nixl-ucx-gb300-rails branch November 18, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants