Skip to content

UCT/CUDA_IPC: Require the same IMEX channel for MNNVL reachability - #12339

Open
amastbaum wants to merge 14 commits into
openucx:masterfrom
amastbaum:cuda_ipc_reachability_check
Open

amastbaum wants to merge 14 commits into
openucx:masterfrom
amastbaum:cuda_ipc_reachability_check

Conversation

@amastbaum

@amastbaum amastbaum commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What?

Require fabric support on both peers for cross-node cuda_ipc reachability, and add the IMEX channel to the MNNVL device address so peers on different channels are not reachable.

Why?

Cross-node memory is shared only as fabric handles, which are imported over IMEX. Being in the same NVLink domain is not enough: a process without an IMEX channel, or with a different one (e.g. another Slurm job on the same rack), fails only at rkey unpack/import, after lanes were already selected.

How?

  • md: replace fabric_supported with imex_channel, the lowest accessible channelN (the one the driver uses), or UCT_CUDA_IPC_IMEX_CHANNEL_INVALID if fabric is not supported.
  • MNNVL device address: append imex_channel after nvlink_domain, which is already sent since v1.23 (UCT/CUDA_IPC: Restrict MNNVL reachability to the same NVLink domain - v1.23.x #12142). Each field is checked by the address length, so all released formats stay compatible:
    • v1.22 and older (9 bytes, no domain): legacy MNNVL reachability.
    • v1.23 (17 bytes): NVLink domain and FLAG_FABRIC are checked, IMEX channel is not.
    • This version (21 bytes): NVLink domain, FLAG_FABRIC and the IMEX channel are checked.
  • is_reachable: share the fabric check between the cross-node and cross-PID-namespace paths.

Tested on GB300 (2 nodes, same NVLink domain): with the IMEX channel hidden on one node, cuda_ipc is now unreachable and rc_gda is selected at wireup, instead of failing at mem list creation.

Memory is exported to other hosts only as fabric handles, which are imported
over IMEX, so being in the same NVLink domain is not enough. Require fabric
support on both peers for cross-node reachability, and add the IMEX channel to
the MNNVL device address, so that peers with different channels are not
reachable.
@amastbaum
amastbaum requested a review from a team as a code owner November 15, 2026 15:26
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.c Outdated

if (!imex_channel.found) {
ucs_debug("CUDA fabric IPC support on device %d is disabled: no "
"accessible IMEX channel", cu_device);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

when a process has access to several channels, is the lowest one always the one the driver exports on? otherwise peers with overlapping but different channel sets (local {0,5} vs remote {5}) will be reported unreachable.

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 lowest channel matches the driver: "When the GPU driver needs to find the channel associated with a user, it will find the lowest channel accessible by the user and use that for all operations" (https://docs.nvidia.com/multi-node-nvlink-systems/imex-guide/imexchannels.html). maybe mention it in the comment of uct_cuda_ipc_md_check_imex_channel_cb()?

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Outdated
return 0;
}

if ((mnnvl_addr != NULL) &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the IMEX channel is sent only when FLAG_MNNVL is set, so the cross-PID-namespace fabric check below (same host, different containers) still can't compare it. should the channel be part of the base device address whenever FLAG_FABRIC is set?

Also, the header comment /* Valid if FLAG_FABRIC is set */ reads as if the field is always present when fabric is supported, which is not the case.

@@ -155,13 +171,20 @@ static int uct_cuda_ipc_md_check_fabric_support(void)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
static const char channel_prefix[] = "channel";
uct_cuda_ipc_md_imex_channel_t *imex_channel = arg;

minor: pls keep consecutive assignments aligned (docs/CodeStyle.md).

* by editing the address of a local entity before passing it to the check.
* On systems without MNNVL, MNNVL support and the NVLink domain of the MD are
* emulated as well, so that the check runs on any CUDA system. */
* address, so a peer on another host, in another NVLink domain or with another

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

minor: the fixture now covers fabric/IMEX reachability too, maybe rename it to test_cuda_ipc_iface_reachability.

@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap: the new test emulates MNNVL/fabric by poking uct_cuda_ipc_md_t, so it validates only the reachability decision logic, not the real detection path. There is no coverage for uct_cuda_ipc_md_check_imex_channel_cb itself (prefix/number parsing, lowest-channel selection), which is the newly added parsing logic and is only exercised on hardware with /dev/nvidia-caps-imex-channels populated. Would a small unit test over a fake directory be practical, or does this rely on MNNVL hardware CI?

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.h Outdated
typedef struct {
uct_cuda_ipc_device_addr_t super;
uint64_t nvlink_domain;
uint32_t imex_channel; /* Valid if FLAG_FABRIC is set */

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.

pls check the NVLink domain when dev_addr_len >= ucs_offsetof(uct_cuda_ipc_mnnvl_device_addr_t, imex_channel), check the IMEX channel only when dev_addr_len >= sizeof(uct_cuda_ipc_mnnvl_device_addr_t), and add a test with the 17-byte address. This address format is already released in v1.23.2 (#12142), so with the current sizeof check uct_cuda_ipc_iface_mnnvl_dev_addr() returns NULL for a v1.23.2 peer and the NVLink domain check is skipped.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll handle it. I didn't take into account it's already part of a release.

@svc-ucx

svc-ucx commented Nov 16, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR · commit bb3e973e

Summary: Unable to fetch logs — cannot diagnose without them.
Root cause: Unknown — log access failed.
Implicated commit: unknown
File: unknown
Suggested fix: Provide a direct link to the failed build log in a follow-up comment.
Log fetch attempts:

  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145329'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 145329]
  • fetch_jenkins_stages({'job': 'UCX PR', 'build': 145329}) → [fetch_jenkins_stages ERROR] build URL names Jenkins controller 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145329', but this deployment is configured for 'https://nbuprod.blsm.nvidia.com/nb
  • fetch_jenkins_logs({'job': 'UCX PR', 'build': 145329}) → [fetch_jenkins_logs ERROR] build URL names Jenkins controller 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145329', but this deployment is configured for 'https://nbuprod.blsm.nvidia.com/nbu-
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/ucx/_build/results?buildId=145329'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 145329]
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145329&view=logs'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 145329]
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145329&view=logs&j=00000000-0000-0000-0000-000000000000', 'job_id': '00000000-0000-0000-0000-000000000000'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 145329]

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id b3e303f0-38ae-4aba-ac6a-3ca220ad5e4b in the triage console for the audit trail.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Outdated
remote_fabric_supported =
uct_cuda_ipc_iface_remote_fabric_supported(dev_addr,
dev_addr_len);
if (!local_fabric_supported || !remote_fabric_supported) {

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.

pls require FLAG_FABRIC from the peer only if it sent the NVLink domain, like the PID namespace check below does with pid_ns; v1.22 and older send a 9-byte address with only FLAG_MNNVL, so they become unreachable over MNNVL.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Outdated
mnnvl_addr = uct_cuda_ipc_iface_mnnvl_dev_addr(params->device_addr,
dev_addr_len);
if (mnnvl_addr == NULL) {
mnnvl_addr = (const uct_cuda_ipc_mnnvl_device_addr_t*)

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.

pls update the PR description: the NVLink domain address is already in v1.23 (#12142), so this PR appends the IMEX channel and checks each field by address length.

* the IMEX channel */
static void set_older_peer(std::string &dev_addr)
{
dev_addr.resize(sizeof(uct_cuda_ipc_device_addr_t));

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.

Suggested change
dev_addr.resize(sizeof(uct_cuda_ipc_device_addr_t));
dev_addr.resize(sizeof(uct_cuda_ipc_device_addr_t));
set_no_fabric(dev_addr);

older UCX never sets FLAG_FABRIC, so older_peer passes now only because the truncated address keeps it.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.h Outdated
Comment on lines +38 to +40
uint64_t nvlink_domain; /* Since v1.23.2 */
uint32_t imex_channel; /* Not sent by v1.23.2, valid
if FLAG_FABRIC is set */

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.

Suggested change
uint64_t nvlink_domain; /* Since v1.23.2 */
uint32_t imex_channel; /* Not sent by v1.23.2, valid
if FLAG_FABRIC is set */
uint64_t nvlink_domain; /* Since v1.23 */
uint32_t imex_channel; /* Not sent by v1.23, valid
if FLAG_FABRIC is set */

minor: v1.23.0-rc3 already sends the NVLink domain (#12142), maybe also rename the v1_23_2_peer test.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Outdated
Comment on lines +91 to +92
mnnvl_addr->imex_channel = md->fabric_supported ?
md->imex_channel : 0;

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.

Suggested change
mnnvl_addr->imex_channel = md->fabric_supported ?
md->imex_channel : 0;
mnnvl_addr->imex_channel = md->imex_channel;

minor: md is allocated with ucs_calloc() and imex_channel is set only when fabric is supported, so it is already 0 otherwise.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.h Outdated
Comment on lines +80 to +82
/** IMEX channel used to export and import fabric handles, valid if
* fabric_supported. Fabric handles can be imported only by a process
* which has access to the same IMEX channel. */

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.

Suggested change
/** IMEX channel used to export and import fabric handles, valid if
* fabric_supported. Fabric handles can be imported only by a process
* which has access to the same IMEX channel. */
/** IMEX channel used to export and import fabric handles, 0 if not
* fabric_supported. Fabric handles can be imported only by a process
* which has access to the same IMEX channel. */

minor: then the address packing can use it as is.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Outdated
Comment on lines +137 to +141
/* Whether the peer sent the given field of the MNNVL device address */
#define UCT_CUDA_IPC_MNNVL_ADDR_HAS_FIELD(_dev_addr_len, _field) \
((_dev_addr_len) >= \
(ucs_offsetof(uct_cuda_ipc_mnnvl_device_addr_t, _field) + \
ucs_field_sizeof(uct_cuda_ipc_mnnvl_device_addr_t, _field)))

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.

maybe keep the uct_cuda_ipc_iface_mnnvl_dev_addr() helper from master and add one struct level for the IMEX channel, like ucs_cma_iface_ext_device_addr_t does for pid_ns? each struct is then one address version, checked by sizeof, and the per-field macro is not needed:

typedef struct {
    uct_cuda_ipc_mnnvl_device_addr_t super;
    uint32_t                         imex_channel;
} UCS_S_PACKED uct_cuda_ipc_fabric_device_addr_t;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I considered this too but wasn’t sure how stable the address is going to stay across versions and wanted avoid adding too many levels to it. On the other hand it may be more safe and consistent with other structs..

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Outdated
Comment on lines +211 to +221
local_fabric_supported = md->fabric_supported;
remote_fabric_supported =
uct_cuda_ipc_iface_remote_fabric_supported(dev_addr,
dev_addr_len);
if (!local_fabric_supported || !remote_fabric_supported) {
uct_iface_fill_info_str_buf(
params,
"different machine and FABRIC support local=%d remote=%d",
local_fabric_supported, remote_fabric_supported);
return 0;
}

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.

pls move this check to a helper shared with the PID namespace check below, e.g. uct_cuda_ipc_iface_fabric_reachable(md, params, dev_addr, dev_addr_len, "different machine"); the two blocks differ only in the message, and local_fabric_supported is just md->fabric_supported.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.c Outdated

if (!imex_channel.found) {
ucs_debug("CUDA fabric IPC support on device %d is disabled: no "
"accessible IMEX channel", cu_device);

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 lowest channel matches the driver: "When the GPU driver needs to find the channel associated with a user, it will find the lowest channel accessible by the user and use that for all operations" (https://docs.nvidia.com/multi-node-nvlink-systems/imex-guide/imexchannels.html). maybe mention it in the comment of uct_cuda_ipc_md_check_imex_channel_cb()?

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.c Outdated
Comment on lines +991 to +992
md->fabric_supported = uct_cuda_ipc_md_check_fabric_support(
&md->imex_channel);

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.

Suggested change
md->fabric_supported = uct_cuda_ipc_md_check_fabric_support(
&md->imex_channel);
md->fabric_supported = uct_cuda_ipc_md_check_fabric_support(
&md->imex_channel);
ucs_debug("CUDA fabric IPC support is %s, IMEX channel %u",
md->fabric_supported ? "enabled" : "disabled", md->imex_channel);

minor: maybe log once here, like uct_cuda_ipc_md_check_fabric_info() does for MNNVL, and drop the two logs inside? then the #else build and the silent paths (no fabric support on the device, no /dev/nvidia-caps-imex-channels) are logged too.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.h Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Outdated
remote_fabric_supported =
uct_cuda_ipc_iface_remote_fabric_supported(dev_addr,
dev_addr_len);
if (!local_fabric_supported || !remote_fabric_supported) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wire compatibility: does a v1.23.2 peer set UCT_CUDA_IPC_DEVICE_ADDR_FLAG_FABRIC? It looks like the FABRIC flag came with the pid_ns iface address, i.e. after v1.23.2, while the new header comment states nvlink_domain ships "Since v1.23.2". Such a peer sends a 17-byte device address with flags = MNNVL and no FABRIC bit, so uct_cuda_ipc_iface_remote_fabric_supported() returns 0 and every cross-host MNNVL peer from v1.23.2 (or older) becomes unreachable. The rest of this function carefully preserves legacy behavior by length-gating new fields, but this check is not gated at all. Can we apply it only when the peer also sent the imex_channel, under UCT_CUDA_IPC_MNNVL_ADDR_HAS_FIELD(dev_addr_len, imex_channel)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

v1.23.2 sets FLAG_FABRIC when fabric is supported (since v1.23.0-rc1), so a 17-byte peer with fabric passes. Requiring fabric on both sides for cross-host peers is intended: memory is exported to other hosts only as fabric handles, so a pair without fabric on either side fails at import anyway. v1.22 and older send 9 bytes and skip the check.

* without the IMEX channel */
static void set_v1_23_2_peer(std::string &dev_addr)
{
dev_addr.resize(ucs_offsetof(uct_cuda_ipc_mnnvl_device_addr_t,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The new v1_23_2_peer test hides the wire-compatibility issue above: set_v1_23_2_peer() only truncates the address, and the emulated flags byte still has UCT_CUDA_IPC_DEVICE_ADDR_FLAG_FABRIC set because the local MD had fabric_supported emulated to 1 when the address was packed. A real v1.23.2 peer cannot set that bit, so the test asserts reachability for an address no v1.23.2 peer can produce and the regression is not covered. Please also clear UCT_CUDA_IPC_DEVICE_ADDR_FLAG_FABRIC here.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.c Outdated
if (access(path, R_OK | W_OK) == 0) {
*found = 1;
if ((access(path, R_OK | W_OK) == 0) &&
(!imex_channel->found || (channel < imex_channel->channel))) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"Lowest accessible channel" may not match between peers that do share a channel: the comparison assumes both sides derive the same number. If a process has access to more than one channel (e.g. a world-accessible channel0 plus a job channel), the two peers can pick different lowest values while still sharing a channel, and reachability is wrongly refused. It also assumes the driver exports through the lowest accessible channel, which is the premise the new imex_channel field documents in cuda_ipc_md.h — does the driver always export through the lowest accessible channel?

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.c Resolved
return 0;
}
(ipc_addr.pid_ns != ucs_sys_get_ns(UCS_SYS_NS_TYPE_PID)) &&
!uct_cuda_ipc_iface_fabric_reachable(md, params, dev_addr,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why not compare the IMEX channel here too? Cross-PID-namespace peers import fabric handles as well, so a channel mismatch fails the same way when MNNVL is on and the channel is part of the address.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.h Outdated
typedef struct {
uct_cuda_ipc_device_addr_t super;
uint64_t nvlink_domain;
uint64_t nvlink_domain; /* Since v1.23 */

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Was nvlink_domain really released in v1.23? master is 1.24.0, so if it is new in this cycle too, the imex_channel prefix handling and the v1_23_peer test are not needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, nvlink_domain is sent by v1.23.2 (#12142), so the prefix handling is needed.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.c Outdated
/* Find the lowest IMEX channel accessible by the process. The GPU driver uses
* the lowest accessible channel for all fabric handle operations. */
static ucs_status_t
uct_cuda_ipc_md_check_imex_channel_cb(const struct dirent *entry, void *arg)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor: pls rename to ..._find_imex_channel_cb, it no longer checks but selects the lowest channel for uct_cuda_ipc_md_get_imex_channel().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap (already reported in the earlier review, not repeated as a new thread): the IMEX channel discovery/parsing path in uct_cuda_ipc_md_check_imex_channel_cb is still only exercised on hardware with a populated /dev/nvidia-caps-imex-channels; the gtest emulates md->imex_channel and covers only the reachability decision.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@svc-nvidia-pr-review

Copy link
Copy Markdown

src/uct/cuda/cuda_ipc/cuda_ipc_iface.c

Wire compatibility — new FLAG_FABRIC requirement may break 1.23↔1.24 MNNVL interop. The code now rejects any cross-host peer that sends nvlink_domain but does not set UCT_CUDA_IPC_DEVICE_ADDR_FLAG_FABRIC, and the in-code comment justifies this with "older peers do not send the NVLink domain nor FLAG_FABRIC". The header annotates nvlink_domain as "Since v1.23", but FLAG_FABRIC and the whole md->fabric_supported / IMEX-channel detection live next to the pid_ns iface-address code, whose files are new in this (1.24) development cycle. If FLAG_FABRIC is newer than nvlink_domain, every v1.23 MNNVL peer sends a 17-byte address with the flag clear and becomes unreachable.

Impact: cross-host MNNVL stops working between 1.23 and 1.24 in the common case (both sides in the root PID namespace, where the pre-existing cross-namespace fabric check never ran). The new v1_23_peer test codifies this behavior, so it would not be caught.

At the uct_cuda_ipc_iface_fabric_reachable(md, params, dev_addr, dev_addr_len, "different machine") call: does v1.23 set FLAG_FABRIC in the device address? It does send nvlink_domain, and this now requires FLAG_FABRIC from any peer that sends the domain, so if the flag is newer than the domain all cross-host MNNVL peers running v1.23 become unreachable.

src/uct/cuda/cuda_ipc/cuda_ipc_iface.c

IMEX channel is not compared for same-host peers in different PID namespaces. The PR's premise is that fabric handles can only be imported by a process with access to the same IMEX channel. That constraint also applies to the same-host cross-PID-namespace path, which is exactly the path that already requires fabric handles, but there only FLAG_FABRIC is compared. Also, imex_channel is written only when md->enable_mnnvl, so for a non-MNNVL MD the device address is 9 bytes and the channel is not on the wire at all.

Impact: two containers on one host with access to different IMEX channels are still reported reachable, and the import fails later. At the new UCT_CUDA_IPC_MNNVL_ADDR_HAS_FIELD(dev_addr_len, imex_channel) check: can we compare the IMEX channel for same-host peers in different PID namespaces as well? They also exchange only fabric handles, but the channel is sent only when MNNVL is enabled, so two containers with different channels are still reported reachable.

src/uct/cuda/cuda_ipc/cuda_ipc_iface.c

minor — IMEX check depends on an implicit ordering. The HAS_FIELD(imex_channel) check sits after the if/else, but it can only trigger when the peer sent the domain, i.e. after uct_cuda_ipc_iface_fabric_reachable() already guaranteed both channels are valid. Keeping it outside the else hides that dependency — pls move this check into the else branch above, where it is clear that it runs after the FABRIC check validated both channels.

src/uct/cuda/cuda_ipc/cuda_ipc_iface.h

minor: at the imex_channel field comment — the field is sent only when FLAG_MNNVL is set (it is part of the MNNVL address), so "valid if FLAG_FABRIC is set" is confusing/misleading; pls mention both conditions.

Residual coverage gap (already reported earlier, not re-posted): the IMEX discovery/parsing in uct_cuda_ipc_md_find_imex_channel_cb (prefix/number parsing, lowest-channel selection) is still only exercised on hardware with a populated /dev/nvidia-caps-imex-channels; the gtest emulates md->imex_channel and covers only the reachability decision.

@ofirfarjun7

Copy link
Copy Markdown
Contributor

@tvegas1 @rakhmets with this PR do we still need to open the mem handle in uct_cuda_ipc_is_peer_accessible?

@svc-ucx

svc-ucx commented Nov 17, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (AddressSanitizer roce on worker 3) · commit 2a16a81e

TL;DR: The ASAN "roce on worker 3" job failed on a single, PR-unrelated test — dc_mlx5/uct_atomic_key_reg_rdma_mem_type.fadd64/0 — which allocates MLX5 device memory (MEMIC, UCS_MEMORY_TYPE_RDMA) and has a long history of resource-exhaustion flakiness; the PR's CUDA_IPC changes cannot affect it, so re-run the job and (if it recurs) make the test skip/retry harder on MEMIC allocation failure.

Full analysis

Summary: make test in build-test/test/gtest exited with error 1 because 1 of 9114 tests failed: dc_mlx5/uct_atomic_key_reg_rdma_mem_type.fadd64/0 (GetParam() = dc_mlx5/mlx5_0:1); the other 9113 passed and no sanitizer report appears in the log.

Root cause: Evidence in the log: continuous test activity up to the end (no hangs, no ASAN/LSAN report, no SIGSEGV/abort trace), only the final gtest summary line [ FAILED ] dc_mlx5/uct_atomic_key_reg_rdma_mem_type.fadd64/0. That test is the only gtest that allocates IB device memory via mapped_buffer(..., UCS_MEMORY_TYPE_RDMA, UCT_MD_MEM_ACCESS_ALL, 10) (test/gtest/uct/test_atomic_key_reg_rdma_mem_type.cc:33), which goes through uct_test::entity::mem_alloc() and hard-asserts after its retry loop (ASSERT_UCS_OK(status), test/gtest/uct/uct_test.cc:1050). MEMIC capacity on mlx5_0 is tiny and shared across the concurrently running gtest workers on this host, which is exactly why this test already accumulated three separate "fix the MEMIC allocation failure" commits (6c7715d → d7d57e1 → [REDACTED:Hex High Entropy String] → 69718f6, adding size limits, retries and random sleep). Nothing in PR #12339 (UCT/CUDA_IPC: Require the same IMEX channel for MNNVL reachability, commit 2a16a81) touches IB/DC, atomics or device-memory allocation, and the cuda_ipc paths are skipped on this node ("CUDA memory is not supported" appears throughout the log), so this is an environment/flakiness failure, not a regression from the PR. Caveat: the fetched Azure log is the truncated tail, so the exact assertion text for the failing test was not captured — the attribution above rests on the FAILED line plus the test's known-only failure mode.

Implicated commit: unknown — not the PR commit (2a16a81, Alma Mastbaum); the flaky test area was last touched by 69718f6 (Michal Shalev, retries + random sleep for MEMIC allocation)

File: test/gtest/uct/test_atomic_key_reg_rdma_mem_type.cc:33 (allocation) and test/gtest/uct/uct_test.cc:1050 (ASSERT_UCS_OK after the retry loop)

Suggested fix:

  1. Re-trigger the "AddressSanitizer roce" job — this failure is unrelated to the PR's cuda_ipc reachability change and should pass on retry.
  2. To stop the recurrence, harden the test rather than the timeout: in uct_test::entity::mem_alloc() convert the terminal UCS_ERR_NO_MEMORY case into a UCS_TEST_SKIP_R("no device memory available") when mem_type == UCS_MEMORY_TYPE_RDMA (or add that condition in uct_atomic_key_reg_rdma_mem_type::init()), so contention for MEMIC between parallel gtest workers yields a SKIP instead of a hard failure.
  3. Fetch the full (untruncated) job log for the failing test's own [ RUN ]/[ FAILED ] block to confirm the assertion text is the MEMIC No memory path before merging any test change.

Related: PR #12339 (the PR under test, unrelated area); prior fixes for this same test: #10475 ("Increase retries and add random sleep when MEMIC allocation fails")

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 7582013c-f189-446c-8e8a-07bb53653cde in the triage console for the audit trail.

@rakhmets

rakhmets commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

@tvegas1 @rakhmets with this PR do we still need to open the mem handle in uct_cuda_ipc_is_peer_accessible?

We need to open it at least for memory allocated by cuMemAlloc/cudaMalloc. However, I think we can cover this case as well. Originally, we open memory handle because devices can be invisible for the UCT as we used only driver API. Theoretically, we can get rid of it, as we can use NVML API nvmlDeviceGetP2PStatus. But I'm not sure how we will cover MLOPart case, because CUDA Driver and NVML count devices differently in this case.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Resolved
Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.c Resolved
Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.c Resolved
Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_md.h Resolved
@tvegas1

tvegas1 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@ofirfarjun7 related to this, #11979 already queries the NVML P2P status in uct_cuda_ipc_is_peer_accessible(), but it skips the open only when NVML reports no P2P; when NVML reports P2P or cannot tell, we still open the handle and keep the mapping for later put/get.

#12344 also changes this function and uses the open result to tell a NO_IPC buffer from missing P2P, so IMO if we remove the open, it should be a follow-up after #12344, not part of this PR.

tvegas1
tvegas1 previously approved these changes Nov 18, 2026
@svc-ucx

svc-ucx commented Nov 19, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (AddressSanitizer new on worker 3) · commit aa0ecc9a

TL;DR: The ASan gtest job failed on a single unrelated test, rc_mlx5/test_uct_peer_failure_sgl_zcopy.put_fail_middle/1 (9007/9008 passed) — a timing-sensitive assertion in the SGL-zcopy peer-failure test added by #12205, not anything touched by this cuda_ipc PR; re-run the job and fix/relax the status-matching assertion in that test.

Full analysis

Summary: make test in the AddressSanitizer worker-3 job exited 1 because exactly one gtest case failed: rc_mlx5/test_uct_peer_failure_sgl_zcopy.put_fail_middle/1 (GetParam() = rc_mlx5/mlx5_1:1).

Root cause: The build log shows [ FAILED ] 1 test ... rc_mlx5/test_uct_peer_failure_sgl_zcopy.put_fail_middle/1 out of 9008 tests, with make: *** [Makefile:5015: test] Error 1; everything else passed and there is no hang (log timestamps are continuous, no gap > ~15 s, which is the legitimate test_async_event_mt case). That test is test_sgl_zcopy_peer_failure(true, SGL_COUNT/2): it posts a 4-element uct_ep_put_sgl_zcopy whose middle element targets remote address 0, then asserts that the completion status equals the status reported to the EP error handler (ASSERT_EQ(1ul, m_failed_eps.count(ep0())) / EXPECT_EQ(m_failed_eps[ep0()], comp.uct.status), test_peer_failure.cc:1632-1635). This "complete the whole SGL chain with the EP error status" behaviour was introduced only ~10 days before this run by commit 15e2185 (#12205, dmitrygx) for RC/MLX5, and the comparison is inherently order-sensitive: if the QP flush cancels the remaining WQEs of the chain (UCS_ERR_CANCELED) before the error CQE for the failing middle element is attributed, or if the error handler has not yet recorded the EP status, the assertion trips. Under AddressSanitizer the extra latency makes this ordering race observable. PR #12339 only changes uct/cuda_ipc MNNVL/IMEX reachability and cannot affect an rc_mlx5/mlx5_1:1 RDMA put path, so this failure is not caused by the PR under test.

Note: the per-assertion failure text is in the part of the Azure task log that is older than the retrievable tail, so the exact failing EXPECT/ASSERT line could not be quoted; the attribution above is based on the failing test name plus the test source.

Implicated commit: 15e2185 — "UCT/IB/MLX5/RC: Complete SGL op with ep error status on peer failure (#12205)", dmitrygx (not the PR commit aa0ecc9)

File: test/gtest/uct/test_peer_failure.cc:1632 (assertions in test_uct_peer_failure_sgl_zcopy::test_sgl_zcopy_peer_failure, tests declared at :1868)

Suggested fix:

  1. Re-run the AddressSanitizer worker-3 job for PR UCT/CUDA_IPC: Require the same IMEX channel for MNNVL reachability #12339 — the failure is unrelated to the cuda_ipc reachability change and should not block the PR.
  2. Harden the test/implementation on the UCT/IB/MLX5/RC: Complete SGL op with ep error status on peer failure #12205 path: before comparing statuses, wait for the EP error handler (wait_for_flag-style on the error count) so m_failed_eps is populated, and accept UCS_ERR_CANCELED in addition to the EP error status for a chain that may be torn down by the QP flush (same relaxation already used in test_sgl_zcopy_after_failed_put_short, line 1696). Alternatively, make uct_rc_mlx5 deterministically stamp the EP error status on all WQEs of an SGL chain before the flush-cancel path runs.
  3. Loop put_fail_middle under ASan (e.g. --gtest_repeat) on rc_mlx5/mlx5_1:1 to confirm the flakiness and avoid re-breaking unrelated PRs.

Related: #12205 (introduced the test and the SGL error-status behaviour); PR under test: #12339

@rakhmets

Copy link
Copy Markdown
Contributor

@ofirfarjun7 related to this, #11979 already queries the NVML P2P status in uct_cuda_ipc_is_peer_accessible(), but it skips the open only when NVML reports no P2P; when NVML reports P2P or cannot tell, we still open the handle and keep the mapping for later put/get.

We don't need to open mem handle in this case. We did not open it always, only for the first access to the GPU. Thus, we cannot say that is done for later put/get.
We should think more carefully about the design of this part of the code. We should take into account several use cases. Memory allocated using cuMemAlloc/cudaMalloc and memory allocated using VMM API have slightly different things to check in reachability function. We also cannot drop the recently added support for the cases with two processes running in different containers on the same host.

It seems we need to review #11979 once again, as it's adds extra condition for the reachability check, but does not use the new information to its full potential.

@tvegas1

tvegas1 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

It seems we need to review #11979 once again, as it's adds extra condition for the reachability check, but does not use the new information to its full potential.

@rakhmets, can you please review and add suggestions to #12344, that is following up #11979?

@rakhmets

Copy link
Copy Markdown
Contributor

It seems we need to review #11979 once again, as it's adds extra condition for the reachability check, but does not use the new information to its full potential.

@rakhmets, can you please review and add suggestions to #12344, that is following up #11979?

Yes, sure.
I was confused a little by the comment. Because #11979 doesn't change reachability. It's only changes accessibility check during rkey unpack.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@svc-nvidia-pr-review

Copy link
Copy Markdown

src/uct/cuda/cuda_ipc/cuda_ipc_md.c

minor: pls skip the entry early when it cannot lower the result, to avoid a snprintf + access() syscall per channel (there may be thousands of them).

    channel_str = entry->d_name + sizeof(channel_prefix) - 1;
    channel     = strtoul(channel_str, &end, 10);
    if ((*channel_str == '\0') || (*end != '\0') ||
        (channel >= *lowest_channel)) {
        return UCS_OK;
    }

    ucs_snprintf_safe(path, sizeof(path), "%s/%s",
                      UCT_CUDA_IPC_IMEX_CHANNELS_PATH, entry->d_name);
    if (access(path, R_OK | W_OK) == 0) {
        *lowest_channel = channel;
    }

*lowest_channel starts at UCT_CUDA_IPC_IMEX_CHANNEL_INVALID, so this also keeps the strtoul overflow guard. access() and the snprintf currently run for every entry even when the channel cannot lower the result; /dev/nvidia-caps-imex-channels can hold thousands of entries, and the probe runs on every md_open (unlike MNNVL probing, which is cached in a static).

test/gtest/uct/cuda/test_cuda_ipc_iface.cc

minor: maybe pass the iface address into is_reachable() and edit it with a set_other_pid_ns() helper, like the device address helpers above? The file's pattern is "get the address, then mutate it with a set_* helper"; a bool parameter (bool other_pid_ns = false) which makes the checker corrupt the address it just built is less obvious than the existing set_* pattern.

Already-open item (existing thread): requiring FLAG_FABRIC from any cross-host peer that sends nvlink_domain (v1.23 interop question, still unanswered; the v1_23_peer test codifies the new behavior).

Already-open item (existing thread): imex_channel is only on the wire when md->enable_mnnvl, so same-host containers with fabric but different channels are still reported reachable, and the check is asymmetric between an MNNVL and a non-MNNVL peer.

Already-open item (existing thread): in v1_23_peer, set_other_imex_channel() writes bytes that set_v1_23_peer() immediately drops via resize(), so the call has no effect.

Already-open item (existing thread): uct_cuda_ipc_iface_fabric_reachable() reads params->device_addr while also taking dev_addr, which is the same buffer.

Residual coverage gap (unchanged): the IMEX discovery/parsing path (uct_cuda_ipc_md_lowest_imex_channel_cb — prefix match, strtoul validation, lowest-channel selection) is still only exercised on hardware with a populated /dev/nvidia-caps-imex-channels. The gtest emulates md->imex_channel and covers only the reachability decision.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@svc-nvidia-pr-review

Copy link
Copy Markdown

test/gtest/uct/cuda/test_cuda_ipc_iface.cc

In other_pid_ns_imex, at the /* The channel is not checked in the same PID namespace */ comment: can we also compare the IMEX channel for peers in the same PID namespace? VMM and mempool memory is exported as fabric handles there too (uct_cuda_ipc_mem_add_reg() picks CU_MEM_HANDLE_TYPE_FABRIC based on the allocation, not on the namespace), so two same-host processes with access to different channels are reported reachable and fail later in cuMemImportFromShareableHandle. If this is intentional because the import failure falls back gracefully via uct_cuda_ipc_is_peer_accessible() -> UCS_ERR_UNREACHABLE, that same argument weakens the cross-namespace check, so it would help to state the intent in the comment.

v1.23 interop: requiring FLAG_FABRIC from every cross-host peer that sends nvlink_domain (still unanswered; v1_23_peer codifies the new behavior).

imex_channel is only on the wire when md->enable_mnnvl, making the cross-namespace check asymmetric between an MNNVL and a non-MNNVL peer.

uct_cuda_ipc_md_lowest_imex_channel_cb() still does snprintf + access() for entries that cannot lower the result.

uct_cuda_ipc_iface_fabric_reachable() reads params->device_addr while also taking dev_addr (same buffer).

set_other_imex_channel() in v1_23_peer writes bytes that set_v1_23_peer() immediately drops in resize().

uct_cuda_ipc_imex_device_addr_t comment says the channel is "valid if FLAG_FABRIC is set", but it is only written when FLAG_MNNVL is set.

is_reachable(..., bool other_pid_ns) is used instead of a set_* helper on the iface address.

Residual coverage gap: IMEX discovery/parsing (prefix match, strtoul validation, lowest-channel selection, access() filtering) is still only exercised on hardware with a populated /dev/nvidia-caps-imex-channels; the gtest pokes md->imex_channel and covers only the reachability decision. The cross-host and cross-namespace paths are emulated by editing address bytes, so no test covers a real fabric-handle import failing/succeeding on a channel mismatch.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@@ -30,13 +30,24 @@ typedef struct {
} UCS_S_PACKED uct_cuda_ipc_device_addr_t;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe add a short convention line to src/uct/cuda/AGENTS.md? This is the third generation of the cuda_ipc device address (uuid → mnnvl → imex), and the rule it relies on ("only append fields, never reorder, and length-check before reading an appended field"; same for the folded nvlink_domain value) is easy to break and is not documented anywhere in the guides.

@svc-nvidia-pr-review

Copy link
Copy Markdown

Reply in the existing thread about imex_channel being on the wire only when md->enable_mnnvl: can we pack the channel in the iface address instead, next to pid/pid_ns, which are also per-process properties? It is sent regardless of MNNVL, so the cross-PID-namespace check would also work for fabric-only peers, and uct_cuda_ipc_iface_address_length() can depend on fabric support the same way uct_cuda_ipc_iface_device_addr_length() depends on enable_mnnvl.

Reply in the existing coverage-gap thread: for the discovery path, maybe add a test next to mnnvl_detection in test_cuda_ipc_md.cc which scans /dev/nvidia-caps-imex-channels itself and compares the lowest accessible channel with md->imex_channel? That would cover the prefix/strtoul parsing and the lowest-channel selection on the MNNVL CI machines, in the same style as the existing MNNVL detection test.

Still open (add +1 to the existing thread, do not repost): v1.23 interop — requiring FLAG_FABRIC from every cross-host peer that sends nvlink_domain (also now requiring local fabric support for cross-host peers); unanswered, and v1_23_peer codifies the new behavior.

Still open (add +1 to the existing thread, do not repost): imex_channel is only on the wire with enable_mnnvl, so same-host containers with fabric but different channels are still reported reachable.

Still open (add +1 to the existing thread, do not repost): the channel is not compared for peers in the same PID namespace, although VMM/mempool memory is exported as fabric handles there too.

Still open (add +1 to the existing thread, do not repost): uct_cuda_ipc_iface_fabric_reachable() reads params->device_addr while also taking dev_addr (same buffer).

Still open (add +1 to the existing thread, do not repost): residual coverage gap — no test exercises real IMEX discovery or a real fabric import failing on a channel mismatch.

Comment thread src/uct/cuda/cuda_ipc/cuda_ipc_iface.c Outdated
Comment on lines +156 to +157
int local_fabric_supported = uct_cuda_ipc_md_fabric_supported(md);
int remote_fabric_supported =

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.

please add const

tvegas1
tvegas1 previously approved these changes Nov 20, 2026
@svc-ucx

svc-ucx commented Nov 21, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR · commit 6c302939

Summary: Unable to fetch logs — cannot diagnose without them.
Root cause: Unknown — log access failed.
Implicated commit: unknown
File: unknown
Suggested fix: Provide a direct link to the failed build log in a follow-up comment.
Log fetch attempts:

  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=146380'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 146380]
  • fetch_jenkins_stages({'job': 'UCX PR', 'build': 146380}) → [fetch_jenkins_stages ERROR] build URL names Jenkins controller 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=146380', but this deployment is configured for 'https://nbuprod.blsm.nvidia.com/nb
  • fetch_jenkins_logs({'job': 'UCX PR', 'build': 146380}) → [fetch_jenkins_logs ERROR] build URL names Jenkins controller 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=146380', but this deployment is configured for 'https://nbuprod.blsm.nvidia.com/nbu-
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/ucx/_build/results?buildId=146380'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 146380]
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=146380&view=logs'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 146380]
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_apis/build/builds/146380'}) → [fetch_azure_logs ERROR: not an Azure DevOps URL: 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-4b2350e02c88/_apis/build/builds/146380']
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=146380', 'job_id': '0b36e3f0-8ab9-4a48-b68b-4b2350e02c88'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 146380]

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 89a92b55-710c-4b6d-9ad2-55f9a5b2b2ed in the triage console for the audit trail.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@svc-nvidia-pr-review

Copy link
Copy Markdown

test/gtest/uct/cuda/test_cuda_ipc_iface.cc

minor: at EXPECT_EQ(17u, dev_addr.size()); — maybe pin the wire sizes with UCS_STATIC_ASSERT(sizeof(uct_cuda_ipc_mnnvl_device_addr_t) == 17) (and 21 for uct_cuda_ipc_imex_device_addr_t) next to the structs, like uct_cuda_ipc_vmm_multi_check_layout() does, and drop this runtime check? It would then protect the production layout on every build, not only when this gtest runs on a CUDA machine.

+1 on the already-open thread about v1.23 interop: requiring FLAG_FABRIC (and local fabric support) from every cross-host peer that sends nvlink_domain is still unanswered, and v1_23_peer codifies the new behavior.

+1 on the already-open thread: imex_channel is only on the wire when enable_mnnvl, so same-host containers with fabric but different channels are still reported reachable, and the check is asymmetric between an MNNVL and a non-MNNVL peer (including the suggestion to move the channel into the iface address next to pid/pid_ns).

+1 on the already-open thread: the channel is not compared for peers in the same PID namespace, although VMM/mempool memory is exported as fabric handles there too.

src/uct/cuda/cuda_ipc/cuda_ipc_iface.c

+1 on the already-open thread: uct_cuda_ipc_iface_fabric_reachable() still reads params->device_addr while also taking dev_addr (same buffer); the suggested const void* signature was not applied.

Residual coverage gap (already reported): the IMEX discovery path (uct_cuda_ipc_md_lowest_imex_channel_cb: prefix match, strtoul validation, lowest-channel selection, access() filtering) is still only exercised on hardware with a populated /dev/nvidia-caps-imex-channels; the gtest pokes md->imex_channel and covers only the reachability decision, and no test covers a real fabric import failing on a channel mismatch.

@svc-ucx

svc-ucx commented Nov 22, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Tests roce on worker 1) · commit c199c1b4

TL;DR: Two gtest failures in the token-failover fault-tolerance suite (rcx/test_ucp_fault_tolerance_tf.target_failure/14 and .worker_flush_during_recovery/9) made make test exit non-zero; these rc_x UCX_FAILOVER_MODE=token tests are unrelated to this PR's CUDA-IPC change and point at the FT/token work merged into master one day before the run. Re-run / bisect against master rather than changing the PR.

Full analysis

Summary: ./contrib/test_jenkins.sh → gtest "roce on worker 1" ran 9296 tests; 9294 passed and 2 failed (make: *** [Makefile:5017: test] Error 1), both in rcx/test_ucp_fault_tolerance_tf (RC_X with FAILOVER_MODE=token): target_failure/14 (rc_x/PUT|AM|FLUSH) and worker_flush_during_recovery/9 (rc_x/AM|MSG_MEDIUM).

Root cause: The job log shows a clean run with no hang (continuous per-test output up to tear-down, largest gap ≈0.6 s) — the only failure signal is the two failed FT tests. Both failures are confined to the token-failover fixture test_ucp_fault_tolerance_tf (modify_config("FAILOVER_MODE", "token"), instantiated only for rc_x, test/gtest/ucp/test_ucp_fault_tolerance.cc:952-959, 1336). The expectations that can fail in those variants are:

  • target_failure/14 → test_put_am_flush_with_injected_failure(): PUT+AM+FLUSH after uct_ep_invalidate() must all complete with UCS_OK, no other lane marked UCP_LANE_TYPE_FAILED, and no error callback (lines 422, 429, 437), plus test_recovery() requiring ucp_ep_get_failed_lanes()==0 (line 603).
  • worker_flush_during_recovery/9 → either "could not catch an aux recovery probe in flight" (line 1242) or EXPECT_EQ(UCS_OK, flush_status) << "idle recovery wireup endpoint blocked worker flush" (line 1273).

The PR under test (#12339, "UCT/CUDA_IPC: Require the same IMEX channel for MNNVL reachability") only touches cuda_ipc reachability and cannot influence rc_x token-mode failover lanes, so this is a master-side regression/flake in the FT token path, whose most recent change is 427320ef (merged ~17 h before this 2026-11-22 run) which touched both src/ucp/core/ucp_ep.c and this exact test file.

Implicated commit: 427320ef — Evgeny Leksikov, "UCP/FT/AM: add token failover support for short and single/bcopy protocols (#12371)" (2026-11-21); related earlier FT/TF commits b3bf0e53 (#12184), 11ae0fca (#12274). Not the PR commit c199c1b4.

File: test/gtest/ucp/test_ucp_fault_tolerance.cc:1273 (worker_flush_during_recovery) and test/gtest/ucp/test_ucp_fault_tolerance.cc:422 / :603 (target_failure, PUT|AM|FLUSH); implementation side: src/ucp/core/ucp_ep.c (token-mode failover/recovery introduced by 427320e)

Suggested fix:

  1. Don't change PR UCT/CUDA_IPC: Require the same IMEX channel for MNNVL reachability #12339 — restart the "roce on worker 1" job to confirm it is not PR-related.
  2. Reproduce locally on an RC_X/RoCE node: ./build-test/test/gtest/gtest --gtest_filter='rcx/test_ucp_fault_tolerance_tf.target_failure/14:rcx/test_ucp_fault_tolerance_tf.worker_flush_during_recovery/9' with UCX_FAILOVER_MODE=token UCX_MAX_EAGER_LANES=8 UCX_RECOVERY_RETRIES=1000 UCX_KEEPALIVE_INTERVAL=0.1s to capture the exact EXPECT_* message (the Azure tail truncates it).
  3. Bisect master between 11ae0fca/b3bf0e53 and 427320ef; ping the FT owner (Evgeny Leksikov, UCP/FT/AM: add token failover support for short and single/bcopy protocols #12371) since token-mode short/single-bcopy AM failover plus ucp_ep_flush_nbx on a lane being recovered is the newly added path exercised by exactly these two variants. If confirmed as a known-unstable new path, temporarily restrict/skip the token variants (test_ucp_fault_tolerance_tf) for PUT|AM|FLUSH and worker_flush_during_recovery until fixed, so unrelated PRs aren't blocked.

Related: #12371, #12274, #11988, #12184, #12339

@amastbaum

Copy link
Copy Markdown
Contributor Author

@tvegas1 @rakhmets Actually why not put the IMEX channel in the iface instead of the device address if it's a per-process property?

@tvegas1

tvegas1 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Actually why not put the IMEX channel in the iface instead of the device address if it's a per-process property?

+1, like pid_ns; it is then sent also without MNNVL and the device address stays at the v1.23 layout. pls append it in a new struct after the v1.23 uct_cuda_ipc_iface_address_t (not inside it, unpack_pid_ns() checks its sizeof), and compare it only if iface_addr_len covers it.

This branch has not been deployed

No deployments
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.

6 participants