Skip to content

UCP/RNDV: Use local memory info for unsupported remote memory types - #12111

Merged
tvegas1 merged 6 commits into
openucx:masterfrom
intel-staging:fix/proto-remote-mem-type-estimation
Nov 2, 2026
Merged

tvegas1 merged 6 commits into
openucx:masterfrom
intel-staging:fix/proto-remote-mem-type-estimation

Conversation

@yafshar

@yafshar yafshar commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What?

When the memory type of a remote key is not supported by the local context, estimate the remote side of rndv/rtr protocols as if the remote buffer had the local buffer's memory info (memory type, system device and flags). This is what is already done when there is no remote key. The remote datatype stays contiguous with a single segment, as for any remote key.

Why?

Between nodes with GPUs of different vendors, for example CUDA on one side and Level Zero on the other, ucp_get of 1 to 64 bytes between GPU buffers fails:

proto_reconfig.c:104  UCX  ERROR cannot find remote protocol for: ucp_context_0 inter-node cfg#2 | get into ze-device memory from cuda/dev[0]

Gets smaller than the get_zcopy minimal size (one more than the inline CQE capacity for get responses; 65 bytes in the tested RC setup) rely on get/rndv, where the remote side writes the data. The local worker estimates that remote side with its own resources. No local MD can register the peer's memory type, and no local memtype endpoint can copy it, so the rndv/rtr variant has no lanes and get/rndv has no variant. None of the other get protocols covers that range for a GPU destination.

The remote estimate is used only to select the local protocol and for UCX_PROTO_INFO output. At runtime the peer selects its own protocols from its real buffer, so only the reading side needs this change.

Until this is merged, setting UCX_IB_TX_INLINE_RESP=0 on the reading side works around the failure, since get/zcopy then also covers the affected 1 to 64 byte gets in that setup.

How?

  • ucp_proto_rndv_remote_select_param_init: treat a remote key whose memory type is not in context->supported_mem_type_mask like a missing remote key when filling the memory info, and keep the contiguous datatype used for remote keys.
  • New test test_ucp_rma_foreign_mem_type.get_blocking in test_ucp_rma.cc: the reading context has no GPU transports, so the memory type of the peer's GPU buffer is not in its supported_mem_type_mask, and it reads from that buffer with data checks from 1 byte to 1 MB. UCX_IB_GPU_DIRECT_RDMA=n makes get/rndv the only protocol for the GPU buffer.

Testing

  • On an NVIDIA H200 node with mlx5, the new test fails without the change for cuda and cuda-managed (cannot find remote protocol ... get into host memory from cuda) and passes with it. On Intel GPU nodes its ZE variants skip, because the GPU-aware instantiation loads only cuda_copy and rocm_copy.
  • test_ucp_proto_mock, test_ucp_rma_rndv, test_ucp_rma_gpu_nic and test_ucp_rma_dmabuf gtests: no new failures, on the H200 node and on an Intel Arc Pro B70 node. On the B70 node the run also had the change from UCT/ZE/COPY: Log the device count limit at diag level #12110, which this branch predates: without it, the ze_copy device-count warning fails every gtest when two GPUs are visible.
  • Two-node ucp_get over RC with data checks, from 1 to 4096 bytes, into ze-device memory from CUDA and into CUDA memory from ze-device. Gets of 1 to 64 bytes failed before the change and pass with it; the peer ran without the change.

When the remote key memory type is not supported by the local context,
such as GPU memory of another vendor, the remote side of rndv/rtr
could not be estimated: no local MD registers that memory type and no
local memtype endpoint copies it. get/rndv then had no variant,
leaving gets smaller than the get_zcopy minimal size without any
protocol. Estimate the remote side as if its buffer had the local
buffer properties, as is already done when there is no remote key.

Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread src/ucp/rndv/proto_rndv.c Resolved
Comment thread src/ucp/rndv/proto_rndv.c Resolved
Comment thread test/gtest/ucp/test_ucp_proto_mock.cc Resolved
Comment thread test/gtest/ucp/test_ucp_proto_mock.cc Resolved
Comment thread test/gtest/ucp/test_ucp_proto_mock.cc Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread src/ucp/rndv/proto_rndv.c Resolved
Comment thread test/gtest/ucp/test_ucp_proto_mock.cc Resolved
Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
Co-authored-by: Thomas Vegas <125344591+tvegas1@users.noreply.github.com>
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread test/gtest/ucp/test_ucp_rma.cc Resolved
Comment thread test/gtest/ucp/test_ucp_rma.cc Resolved
tvegas1
tvegas1 previously approved these changes Oct 29, 2026
Comment thread test/gtest/ucp/test_ucp_rma.cc Resolved
Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@yafshar
yafshar requested a review from tvegas1 October 29, 2026 18:07
@tvegas1
tvegas1 enabled auto-merge (squash) October 29, 2026 18:07
Comment thread test/gtest/ucp/test_ucp_rma.cc Resolved
Comment thread test/gtest/ucp/test_ucp_rma.cc Resolved
Comment thread src/ucp/rndv/proto_rndv.c Resolved
@svc-ucx

svc-ucx commented Oct 29, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (AddressSanitizer roce on worker 0) · commit 04af746e

TL;DR: The ASan roce gtest shard didn't crash on an assertion — it hung: the very first test (dc_no_ud_ud_x/test_ucp_sockaddr_check_lanes.check_rndv_lanes/1 <dc_mlx5,mm/tag,mt>) issued an 8-byte tag send that never completed during the full 675 s request deadline, and the 900 s gtest watchdog then SIGTERM/aborted the process. Nothing in this PR's diff (rendezvous remote-memory-type estimation) can affect an 8-byte eager/wireup send, so this is a wireup/data-path hang in the dc_mlx5,mm (no ud/ud_x) CM configuration, not a regression from commit 04af746.

Full analysis

Summary: make -C test/gtest test aborted (core dumped) because test_ucp_sockaddr_check_lanes.check_rndv_lanes/1 <dc_mlx5,mm/tag,mt> hung for the entire watchdog period; exit code 2 from contrib/test_jenkins.sh.

Root cause: Timeline from the log:

  • 19:30:43.976 — test starts, server listening on 1.1.1.1:58642 (CM connection to the server EP succeeded, otherwise the test would have skipped in wait_for_server_ep).
  • 11 m 16 s of silence (progress loop running, no errors, no completion).
  • 19:42:00.312 — ucp_test.cc:310 UCX ERROR request 0x62e000016420 did not complete on time, then test_ucp_sockaddr.cc:594 Expected equality of these values: send_data ... recv_data Which is: 0.
  • 19:45:43.421 — test_helpers.cc:57 Failed / Connection timed out - abort testing, Caught signal 6, backtrace shows the main thread in __sched_yield inside the gtest progress loop.

The 676 s gap exactly matches ucs::get_deadline() = min(watchdog 900 × 0.75, 180 × 20 [ASan multiplier]) = 675 s, and the abort at 19:45:43 is exactly 900 s after test start (watchdog_timeout, test/gtest/common/test_helpers.cc:31). So the process was polling continuously but the 8-byte ucp_tag_send_nbx request never completed and no endpoint error was ever reported — even though this test sets RC_TIMEOUT=100us, RC_RETRY_COUNT=3 and KEEPALIVE_INTERVAL=5s, which would have produced an ENDPOINT_TIMEOUT had anything been posted to the wire. That signature means the request stayed parked in the wireup pending queue: the WIREUP_MSG/ACK exchange on the dc_mlx5,mm (CONNECT_TO_IFACE, no ud/ud_x fallback) endpoint never completed.

This is independent of the PR under test: the hung operation is an 8-byte eager send, while 04af746 / f4c79c0 only change rendezvous protocol estimation (ucp_proto_rndv_remote_select_param_init, ucp_proto_rndv_rkey_mem_flags_estimate in src/ucp/rndv/proto_rndv.c), which is reached only for RNDV-sized messages and ran to completion here (the send request was successfully created and returned).

Implicated commit: Not this PR. No single commit can be pinned from this log; the most plausible suspects in the wireup path merged shortly before this run are fb88400f (Evgeny Leksikov, "UCP/WIREUP: Add a token trailer and an ACK message to the lane address exchange", #11843), 40d8c4a6 (same author, #12048) and b904de40 (Zhenlong Ma, "UCP/WIREUP: fix worker flush hang from recovery wireup ep", #11988).

File: test/gtest/ucp/test_ucp_sockaddr.cc:594 (failure point) / test/gtest/ucp/ucp_test.cc:300 (deadline report); hang originates in the UCP wireup path, src/ucp/wireup/wireup.c.

Suggested fix: Re-trigger the AddressSanitizer roce job to confirm this is the known-flaky dc_no_ud_ud_x variant rather than a code change — do not raise the timeout, the process was hung, not slow. If it reproduces (on this PR or on master), run just that variant with GTEST_FILTER='dc_no_ud_ud_x/test_ucp_sockaddr_check_lanes.*' UCX_LOG_LEVEL=debug and inspect whether the client EP still holds a wireup_ep with a pending request (i.e. WIREUP_MSG / lane-address ACK never completed) on the dc_mlx5,mm config that has no ud/ud_x aux transport; that is where the fix belongs. Also worth verifying the RoCE device health on worker swx-rain03 (address 1.1.1.1), since the DC lane produced neither completion nor error.

Related: PR under test: #12111 (UCP/RNDV: Use local memory info for unsupported remote memory types) — diff not implicated. Candidate wireup changes: #11843, #12048, #11988.

@tvegas1

tvegas1 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

/azp run UCX PR

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@svc-ucx

svc-ucx commented Oct 30, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (AddressSanitizer roce on worker 1) · commit 04af746e

TL;DR: The ASan/RoCE gtest job failed on a single UCT atomic test — dc_mlx5/uct_atomic_key_reg_rdma_mem_type.fadd64/0 (an atomic fetch-add-64 correctness check on RDMA-mem-type registered memory) — which is a pure UCT-layer test and cannot be affected by this PR's UCP rendezvous change; treat it as an unrelated/flaky failure, re-run CI and file a separate issue if it reproduces.

Full analysis

Summary: make test in the "AddressSanitizer roce on worker 1" job exited non-zero because 1 of 8893 gtest cases failed: dc_mlx5/uct_atomic_key_reg_rdma_mem_type.fadd64/0, where GetParam() = dc_mlx5/mlx5_0:1.

Root cause: From the fetched Azure log, the run completed normally (continuous output, no gaps — not a hang or timeout; [==========] 8893 tests ... [ PASSED ] 8892 tests, [ FAILED ] 1 test, then make: *** [Makefile:4971: test] Error 1). The one failure is a UCT-level atomic-operation correctness test: it registers a buffer of UCS_MEMORY_TYPE_RDMA and runs concurrent 64-bit fetch-and-add over dc_mlx5, then validates that every reply appears exactly once and the final value matches the expected accumulated value (uct_amo_test::validate_replies / EXPECT_EQ(value, *(T*)recvbuf.ptr())). This path involves only UCT MD registration (atomic/indirect mkey for RDMA-type memory) and the DC mlx5 transport. PR #12111 ("UCP/RNDV: Use local memory info for unsupported remote memory types") changes only the UCP rendezvous protocol-selection/estimation layer (src/ucp/proto/*), which is not exercised by UCT gtests at all — so the failure is not a regression from this commit. The most likely real cause is a pre-existing bug/flakiness in the atomic-key (indirect atomic MR / KSM) registration for UCS_MEMORY_TYPE_RDMA buffers on dc_mlx5, which yields a wrong accumulated value; the detailed assertion text sits earlier in the ~2757 s log than the retrievable tail, so the exact mismatch message could not be captured.

Implicated commit: unknown — nothing in the log ties the failure to 04af746e (PR #12111); no UCT/IB commit in recent history (test/gtest/uct, src/uct/ib/mlx5) is identifiable as the trigger from the available log.

File: test/gtest/uct/test_amo.cc:106 (validate_replies → UCS_TEST_ABORT) and test/gtest/uct/test_amo_fadd_fxor.cc:39/48 (fadd64 final-value EXPECT_EQ) — the uct_atomic_key_reg_rdma_mem_type fixture reuses this fetch-add validation logic.

Suggested fix:

  1. Do not block PR UCP/RNDV: Use local memory info for unsupported remote memory types #12111 on this: re-trigger the "AddressSanitizer roce on worker 1" job. The change is confined to UCP rendezvous memory-type estimation and cannot alter UCT atomic results.
  2. To get the actual assertion, re-run just the failing case with the full log preserved, e.g. GTEST_FILTER='dc_mlx5/uct_atomic_key_reg_rdma_mem_type.fadd64/0' ./gtest --gtest_also_run_disabled_tests with UCX_LOG_LEVEL=debug, so the "Reply … appeared N times" / expected-vs-actual value is visible.
  3. If it reproduces on master, open a UCT/IB issue and inspect the atomic-rkey path for UCS_MEMORY_TYPE_RDMA registrations on dc_mlx5 (indirect atomic MR / KSM selection in uct_ib_mlx5 devx MD, cf. has_atomic_ksm() / uct_ib_md_atomic_rkey() logic in test/gtest/uct/ib/test_ib_md.cc:227,323) — a missing atomic mkey there produces exactly this kind of wrong fetch-add result.
  4. Meanwhile, if this suite is known-unstable under AddressSanitizer, gate it with a skip condition similar to rc/test_ucp_mmap_atomic.reuse_buffer ("Address sanitizer") rather than leaving the whole shard red.

Related: #12111 (the PR under test); no existing issue found for uct_atomic_key_reg_rdma_mem_type failures.

@yafshar

yafshar commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@tvegas1 CI is green now, including the dc_mlx5 job that failed before. Your approval was reset by a review re-request I sent right after it, could you approve again? I can merge it afterwards, or feel free to. Thanks

@tvegas1
tvegas1 disabled auto-merge November 2, 2026 17:01
@tvegas1
tvegas1 merged commit 14d79a2 into openucx:master Nov 2, 2026
167 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants