Skip to content

UCM: Don't call ucs_status_string() from UCM modules - v1.23.x - #12301

Merged
tvegas1 merged 1 commit into
openucx:v1.23.xfrom
tvegas1:ucm_status_string_v1.23.x
Nov 13, 2026
Merged

tvegas1 merged 1 commit into
openucx:v1.23.xfrom
tvegas1:ucm_status_string_v1.23.x

Conversation

@tvegas1

@tvegas1 tvegas1 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

backport #12228

@tvegas1 tvegas1 changed the title UCM: Don't call ucs_status_string() from UCM modules (#12228) UCM: Don't call ucs_status_string() from UCM modules - v1.23.x Nov 10, 2026
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread buildlib/az-helpers.sh
exit 1
fi

if nm -D --undefined-only ${ucm_modules} | grep -E '\bU ucs_'; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nm failure is swallowed by the pipe; grep exit status is all the if sees, so a missing or failing nm makes the guard pass silently. Non-blocking but defeats the purpose of a CI check.

Suggestion:

Suggested change
if nm -D --undefined-only ${ucm_modules} | grep -E '\bU ucs_'; then
undefined_syms=$(nm -D --undefined-only ${ucm_modules})
if echo "${undefined_syms}" | grep -E '\bU ucs_'; then
azure_log_error "UCM modules have undefined libucs symbols"
exit 1
fi

Right now a failing or missing nm is hidden by the pipe, and the check passes silently.

Comment thread src/ucm/cuda/cudamem.c
out_unlock:
if (status != UCS_OK) {
ucm_diag("failed to install cuda hooks: %s", ucs_status_string(status));
ucm_diag("failed to install cuda hooks: status %d", status);

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: raw ucs_status_t numbers in user-visible logs are hard to interpret — status %d is hard to read for users. Maybe we can add a header-only status-name helper in ucs/type/status.h so ucm logs stay readable? Same for the two messages in rocmmem.c.

Comment thread src/ucm/rocm/rocmmem.c
ucm_warn("rocm hooks installed with one mechanism only (bistro: %s, "
"reloc: %s)", ucs_status_string(bistro_status),
ucs_status_string(reloc_status));
ucm_warn("rocm hooks installed with one mechanism only (bistro: %d, "

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: raw ucs_status_t number in this user-visible log is hard to interpret; consider a header-only status-name helper so ucm logs stay readable.

Comment thread src/ucm/rocm/rocmmem.c
ucm_info("rocm hooks are ready");
}
} else {
status = (bistro_status != UCS_OK) ? bistro_status : reloc_status;

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: raw ucs_status_t number in this user-visible log is hard to interpret; consider a header-only status-name helper so ucm logs stay readable.

Comment thread src/AGENTS.md
- `ucm`: memory allocation/event interception and memory hook logic. Be careful
with initialization order, async-signal-safety assumptions, and interactions
with external allocators.
with external allocators. UCM modules (`libucm_cuda`, `libucm_rocm`, ...)

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 new rule is ucm-specific; src/ucm/AGENTS.md has a Conventions section where ucm rules live. Can we also put this in src/ucm/AGENTS.md under Conventions?

@tvegas1
tvegas1 enabled auto-merge (squash) November 11, 2026 08:04
@svc-ucx

svc-ucx commented Nov 11, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (AddressSanitizer BlueField on worker 0) · commit 76de5644

TL;DR: The ASAN BlueField gtest run failed on the single test rcx/test_ucp_proto_mock_rcx_speed_change.rma_put/0, whose hard-coded expected rkey/EP-config counts in test_port_speed() are stale on the v1.23.x branch; the fix already exists upstream (PR #12293, "UCP/GTEST: Fix expected rkey config count in port speed change test") and needs to be backported to v1.23.x — it is unrelated to PR #12301.

Full analysis

Summary: make test exited with code 2 because 1 of 8736 gtests failed: [ FAILED ] rcx/test_ucp_proto_mock_rcx_speed_change.rma_put/0, where GetParam() = rc_x (all other 8735 tests passed; no sanitizer report, no crash, no timeout — the run completed normally and ASAN only reported a benign bfd_map_over_sections suppression).

Root cause: test_ucp_proto_mock_rcx_speed_change is compiled only where HAVE_DECL_IBV_EVENT_DEVICE_SPEED_CHANGE is defined (i.e. essentially only on this BlueField agent), and test_port_speed() asserts an exact sequence of worker configuration counts and rkey config indices after each simulated IBV_EVENT_DEVICE_SPEED_CHANGE:

  • EXPECT_EQ(ucs_array_length(&worker->rkey_config), 1/2/3/4) and EXPECT_EQ(worker->ep_config.length, 1/2/3)
  • plus EXPECT_EQ(send_recv_rma(...), rkey_cfg_index) with literal indices 1, 2, 3 and check_rkey_config(..., key, 1|2|3).

These literals encode an exact number of EP/rkey configurations created by protocol re-selection. On this branch the rkey/EP configuration machinery was recently reworked by the v1.23.x backports (332d30cd "UCP/RKEY: Keep configurations at stable addresses - v1.23.x (#12043)", b2a4d27d "UCP/PROTO: Initialize short thresholds from protocol selection - v1.23.x (#12035)", 579d935c "#12083"), so the produced count no longer matches the expectation — which is exactly what upstream PR #12293 ("Fix expected rkey config count in port speed change test") corrects. The last commit touching test/gtest/ucp/test_ucp_proto_mock.cc on this branch is [REDACTED:Hex High Entropy String] (2026-10-08), i.e. the #12293 correction is not present here. The rma_get sibling passing while rma_put fails is consistent with a per-operation config-count/index mismatch rather than with a functional regression. PR #12301 (ucm_status_string_v1.23.x) touches only UCM status-string code and cannot influence UCP protocol selection, so this is a pre-existing branch failure, not a regression from the PR.

Note: the Azure log is only retrievable as the tail of the step, which contains the gtest summary but not the per-assertion EXPECT_EQ diff printed earlier in the 2546-second run, so the exact failing line number is inferred from the test structure and the matching upstream fix rather than quoted.

Implicated commit: Not a single bad commit; the mismatch was introduced by the rkey/EP-config backports, most likely 332d30cd — Guy Ealey Morag, "UCP/RKEY: Keep configurations at stable addresses - v1.23.x (#12043)" (with the missing test-side fix being PR #12293).

File: test/gtest/ucp/test_ucp_proto_mock.cc:3972-4045 (test_port_speed() count assertions at lines 3977-3988, 4001-4009, 4019-4031; rma_put test body at line 4038)

Suggested fix:

  1. Backport PR UCP/GTEST: Fix expected rkey config count in port speed change test #12293 ("UCP/GTEST: Fix expected rkey config count in port speed change test") to the v1.23.x branch and rebase PR UCM: Don't call ucs_status_string() from UCM modules - v1.23.x #12301 on top — this unblocks the PR without touching unrelated code.
  2. Longer term, adopt PR TEST/UCP: Make test_port_speed more robust #11901's approach ("TEST/UCP: Make test_port_speed more robust"): stop asserting absolute ucs_array_length(&worker->rkey_config) / worker->ep_config.length values and literal rkey config indices. Instead capture the counts/index returned before each set_port_speed() and assert deltas (e.g. "a new rkey config and a new EP config were created" vs. "none were created" for the quantization-stable 14.5e9 step), and pass the index returned by send_recv_rma() into check_rkey_config() rather than a hard-coded 1/2/3.
  3. Since this test only compiles on hosts with IBV_EVENT_DEVICE_SPEED_CHANGE, it is exercised solely by this BlueField job — consider running it in a broader job so expectation drift is caught before it reaches a release branch.

Related: #12293 (the fix, not yet on v1.23.x), #11901 (make test_port_speed robust), #12043 (rkey configurations at stable addresses, v1.23.x backport 332d30cd)

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id f7364a67-8cbc-47a5-a509-1bec9f390982 in the triage console for the audit trail.

@tvegas1
tvegas1 merged commit 74e60d4 into openucx:v1.23.x Nov 13, 2026
162 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