Skip to content

UCT/UD: Calibrate and configure UD interface overhead - #12297

Open
shasson5 wants to merge 10 commits into
openucx:masterfrom
shasson5:ud-fixed-overhead-50ns
Open

shasson5 wants to merge 10 commits into
openucx:masterfrom
shasson5:ud-fixed-overhead-50ns

Conversation

@shasson5

@shasson5 shasson5 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What?

Keep the 50 ns increase to UD software-overhead defaults and make the interface/receive estimate configurable. Defaults remain 155 ns for verbs and 130 ns for mlx5.

Why?

The previous costs could select UD over DC when UD completed collectives more slowly. The 50 ns increase is an empirical transport-selection calibration. A configurable estimate allows tuning for different hardware, process counts, and communication patterns.

How?

Add UCX_UD_VERBS_IFACE_OVERHEAD and UCX_UD_MLX5_IFACE_OVERHEAD, with UCX_UD_IFACE_OVERHEAD as a shared override. Cache the configured value during interface initialization and use it in interface queries.

Keep configuration help descriptive and explain the calibration beside the default constants. Existing SEND_OVERHEAD defaults and overrides remain independent.

Related: Redmine #5346165. Alternative to #12287.

@shasson5
shasson5 requested a review from a team as a code owner November 10, 2026 17:26
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/uct/ib/ud/base/ud_iface.h Resolved
Comment thread test/gtest/uct/ib/test_ud.cc Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

The new test only runs on IB hardware (UCT_INSTANTIATE_UD_TEST_CASE), so the invariant is unverified in non-IB CI jobs.

The test implicitly depends on the default UCX_IB_SEND_OVERHEAD=...,wqe_post:<tl overhead>; it will fail if that variable is set in the environment. Passing an explicit IB_SEND_OVERHEAD=wqe_post:... test parameter would make it independent of defaults, but that is optional.

@shasson5 shasson5 added the WIP-DNM Work in progress / Do not review label Nov 10, 2026
@shasson5 shasson5 changed the title UCT/UD: Add fixed 50 ns interface overhead UCT/UD: Increase default software overhead estimates by 50 ns Nov 10, 2026
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@shasson5

Copy link
Copy Markdown
Contributor Author

Regarding #12297 (comment): The gap test was removed because the existing constants now feed both interface/receive estimates and the default WQE posting estimate. The final diff changes only the two transport constants and leaves the existing master tests unchanged.

Comment thread src/uct/ib/mlx5/ud/ud_mlx5.c Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap: this is a pure retuning change, so there is nothing to unit-test; validation has to come from UD latency/overhead measurements on real IB HW (the mock harness in contrib/ibmock/ cannot validate the value), which CI does not assert.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@shasson5 shasson5 changed the title UCT/UD: Increase default software overhead estimates by 50 ns UCT/UD: Calibrate and configure UD interface overhead Nov 10, 2026
@shasson5

Copy link
Copy Markdown
Contributor Author

Regarding #12297 (comment): Agreed that CI does not establish a universally optimal 50 ns value. It is an empirical transport-selection calibration for the motivating collective workload, not an isolated UD processing measurement. The new IFACE_OVERHEAD settings allow tuning for other scales, hardware and communication patterns; existing SEND_OVERHEAD settings control send-side estimates. The hardware-dependent performance coverage gap remains.

Comment thread src/uct/ib/mlx5/ud/ud_mlx5.c Resolved
Comment thread src/uct/ib/ud/verbs/ud_verbs.c Resolved
Comment thread src/uct/ib/ud/base/ud_iface.c Resolved
Comment thread src/uct/ib/ud/base/ud_iface.c Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap: the knob itself is only exercised through iface_attr->overhead on real IB HW; nothing in CI asserts that UCX_UD_IFACE_OVERHEAD reaches uct_iface_query()/perf_attr->recv_overhead, and the new 130/155ns values can only be validated by UD latency/overhead measurements on hardware.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@shasson5

Copy link
Copy Markdown
Contributor Author

Regarding #12297 (comment): Configuration propagation was checked on Funk with defaults, shared and per-backend overrides, ucx.conf, environment precedence, and independent send settings. Those checks are not part of CI. This text-only revision does not close that CI coverage gap or establish a universally optimal calibration.

Comment thread src/uct/ib/mlx5/ud/ud_mlx5.c Resolved
Comment thread src/uct/ib/mlx5/ud/ud_mlx5.c Resolved
Comment thread src/uct/ib/ud/base/ud_iface.c Resolved
@svc-ucx

svc-ucx commented Nov 10, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (WireCompat Test wire compatibility gpu ucx_1_17) · commit d8b9e873

TL;DR: The wire‑compat job's "compare tls performance characteristics" step diffs ucx_info -d output between the UCX v1.17.x build and the PR build and requires exact equality; this PR deliberately raises the UD iface overhead by 50 ns (ud_verbs 105→155 ns, ud_mlx5 80→130 ns), so the comparison fails. Either keep the advertised overhead value unchanged (apply the 50 ns calibration only where it's needed, not to the published iface/send overhead) or update the wire‑compat comparison baseline/exception list for ud_*/overhead.

Full analysis

Summary: Azure job "Test wire compatibility gpu ucx_1_17", step compare tls performance characteristics, exited 1 with four errors of the form Fail: (mlx5_0:1/ud_verbs/overhead) 105 nsec != 155 nsec and (mlx5_0:1/ud_mlx5/overhead) 80 nsec != 130 nsec (both devices, checked in both directions). The subsequent client_server steps were then skipped/marked failed by SucceededNode().

Root cause: Not a hang or flake — a hard perf-attribute equality gate. The legacy UCX 1.17 library reports UD overhead = 105 ns (ud_verbs) / 80 ns (ud_mlx5); the PR build reports 155 ns / 130 ns. This comes directly from the PR's change of the UD overhead constants (branch ud-fixed-overhead-50ns), which add a "50 ns calibration for UD/DC selection in hybrid Alltoallv":

  • src/uct/ib/ud/verbs/ud_verbs.c:35 #define UCT_UD_VERBS_IFACE_OVERHEAD 155e-9 (was 105e-9)
  • src/uct/ib/mlx5/ud/ud_mlx5.c:38 #define UCT_UD_MLX5_IFACE_OVERHEAD 130e-9 (was 80e-9)

These constants feed both the new UD_IFACE_OVERHEAD config default (reported as iface_attr->overhead in uct_ud_verbs_iface_query/uct_ud_mlx5_iface_query, ud_verbs.c:607, ud_mlx5.c:637) and UCT_IB_SEND_OVERHEAD_DEFAULT(...) → send_overhead.wqe_post (ib_iface.h:34). So the +50 ns also inflates send_pre_overhead, which is very likely unintended since the calibration was only meant to bias UD-vs-DC selection.

Implicated commit: PR #12297 commit chain by Shachar Hasson: c1bd5b29 ("UCT/UD: Add fixed 50 ns interface overhead"), 464cab14 ("Fold overhead correction into existing constants"), 4ff6e825 ("Make interface overhead configurable"), d8b9e873 (doc tweak).

File: src/uct/ib/ud/verbs/ud_verbs.c:35 and src/uct/ib/mlx5/ud/ud_mlx5.c:38 (consumers: src/uct/ib/ud/base/ud_iface.c:679 IFACE_OVERHEAD config entry, src/uct/ib/base/ib_iface.h:34 UCT_IB_SEND_OVERHEAD_VALUE)

Suggested fix: Pick one of:

  1. Don't change the publicly advertised numbers: revert the constants to 105e-9 / 80e-9 for UCT_IB_SEND_OVERHEAD_DEFAULT(...) and IFACE_OVERHEAD, and apply the 50 ns bias only inside the UD/DC selection logic (or ship it as a non-default UCX_UD_*_UD_IFACE_OVERHEAD setting). This keeps wire-compat perf characteristics identical and avoids silently inflating wqe_post/send_pre_overhead.
  2. If the new values are intended to be the defaults, update the wire-compat compare tls performance characteristics step in buildlib/ (the script invoked before buildlib/tools/test_wire_compat.sh) to tolerate/except ud_verbs/overhead and ud_mlx5/overhead, or to compare with a tolerance instead of exact equality, and call this out in the PR as an intentional perf-attribute change.

At minimum, decouple send_overhead.wqe_post from the UD iface overhead constant so the calibration doesn't leak into the send-path estimate.

Related: PR #12297 (this change); prior similar perf-attribute tuning: commit 0818bf80 "UCT/DC: Adjust DC FHS latency (#11498)" — worth checking how that PR handled the wire-compat perf comparison.

@shasson5 shasson5 removed the WIP-DNM Work in progress / Do not review label Nov 10, 2026
@shasson5
shasson5 requested a review from gleon99 November 10, 2026 19:28
@shasson5

Copy link
Copy Markdown
Contributor Author

CI failure

fixed

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/uct/ib/ud/verbs/ud_verbs.c Resolved
Comment thread src/uct/ib/ud/verbs/ud_verbs.c Resolved
Comment thread buildlib/tools/check_tls_perf_caps.sh Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap: both the 130/155 ns values and the new knob reaching perf_attr->recv_overhead can only be validated on real IB HW; nothing in CI asserts them, and contrib/ibmock/ cannot. The only CI signal is the perf-caps comparison, which this PR explicitly suppresses for UD.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/uct/ib/ud/base/ud_iface.c Resolved
Comment thread src/uct/ib/ud/base/ud_iface.c Resolved
Comment thread buildlib/tools/check_tls_perf_caps.sh Resolved
@svc-ucx

svc-ucx commented Nov 12, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Tests new on worker 0) · commit ce06e1b0

TL;DR: The gtest run failed on a single unrelated test, tcp/test_ucp_rma.put_nonblocking/1 <tcp,cuda_copy,rocm_copy/flush_ep>, while PR #12297 only changes UD interface overhead (no UD lane exists in that TCP-only variant) — this is a pre-existing/flaky flush_ep data-validation failure, so re-run the job rather than changing the PR.

Full analysis

Summary: make test in the "Tests new on worker 0" job exited with code 1 because 1 of 8986 gtests failed: tcp/test_ucp_rma.put_nonblocking/1, GetParam() = tcp,cuda_copy,rocm_copy/flush_ep.

Root cause: The log tail shows the whole suite passed except that one case ([ PASSED ] 8985, [ FAILED ] 1), and the run then failed via make: *** [Makefile:5014: test] Error 1. The failing variant restricts transports to tcp,cuda_copy,rocm_copy, i.e. no UD/IB lane is instantiated, so the PR's change (configurable/fixed UD interface overhead, commits c1bd5b29, 464cab14, 4ff6e825 by Shachar Hasson, all confined to src/uct/ib/ud/base/ud_iface.{c,h}) cannot influence protocol selection or data path in that test. The failing case is the flush_ep variant of a non-blocking put: test_xfer() issues put_nbi in a loop and then only calls flush_ep(sender()) before mem_buffer::compare(), so any lane left unflushed (e.g. a lane whose operations were queued as pending) surfaces as "data validation failed". That matches the known open issue being fixed by PR #12266 ("UCP/FLUSH: Flush the other lanes after the pending lane"). Note the per-assertion text is before the fetched tail of this log, so the exact failure line could not be read; the evidence above is from the summary section of the log.

Implicated commit: unknown (not caused by ce06e1b0/this PR; the PR's own commits only touch UD: c1bd5b29, 464cab14, 4ff6e825 — Shachar Hasson)

File: test/gtest/ucp/test_ucp_memheap.cc:103-116 (ep-flush-then-verify path exercised by test/gtest/ucp/test_ucp_rma.cc:283 put_nonblocking, flush_ep variant at test_ucp_rma.cc:32)

Suggested fix: Re-trigger the Azure job for PR #12297 — no change to the UD overhead code is warranted for a TCP-only RMA test. If it reproduces, it is the endpoint-flush completeness bug: take/rebase onto PR #12266 ("UCP/FLUSH: Flush the other lanes after the pending lane") so ucp_ep_flush also flushes lanes other than the pending one, which would otherwise leave the last put_nbi unflushed and fail mem_buffer::compare() in test_ucp_memheap::test_xfer(). For faster triage next time, publish the gtest output as a build artifact (or grep the full job log around the [ FAILED ] line) so the assertion message and message size are visible.

Related: #12266 (ep flush vs. pending lane), #12297 (this PR), #12287 (predecessor UD overhead PR)

@shasson5

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).

@svc-ucx

svc-ucx commented Nov 12, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Tests roce on worker 0) · commit ce06e1b0

TL;DR: The roce on worker 0 job failed because a single gtest case, ib/test_md.alloc/1 (device mlx5_1), failed while 9100 other tests passed; this is a memory-domain allocation test that is unrelated to this PR's UD-overhead change and points to a transient allocation/registration failure on the shared CI agent. Re-run the job; if it reproduces, investigate the IB MD uct_mem_alloc path, not the PR.

Full analysis

Summary: make test in the gtest stage returned error 1 because exactly one test failed: [ FAILED ] ib/test_md.alloc/1, where GetParam() = mlx5_1.

Root cause: From the log, the run completed normally (9101 tests from 1322 test suites ran, 9100 PASSED, no timeout, no crash, no sanitizer report) and make exited only due to the single failing case. test_md.alloc repeatedly calls uct_mem_alloc() on the IB memory domain 300 times per memory type and only tolerates UCS_ERR_NO_MEMORY (counted, with a 50% ceiling enforced by EXPECT_LT(... , 0.5) << "Too many OUT_OF_RESOURCE failures" at test_md.cc:559); any other status trips ASSERT_UCS_OK(status) at test_md.cc:541, and the subsequent uct_md_mkey_pack_v2() with INVALIDATE_RMA|INVALIDATE_AMO is also asserted. This is a host/HCA-resource-sensitive test running on a shared agent ([REDACTED:Base64 High Entropy String], i.e. multiple concurrent workspaces/workers on one machine), and it failed on only the second device (mlx5_1).

Critically, the PR under test (#12297, branch ud-fixed-overhead-50ns) only changes the UD interface overhead attribute — commits 4ff6e825 "UCT/UD: Make interface overhead configurable" and d8b9e873 "UCT/UD: Keep overhead documentation concise" in src/uct/ib/ud/base/ud_iface.c. That value feeds transport performance estimation / lane selection; it is not on any code path reached by uct_md_open/uct_mem_alloc/uct_md_mkey_pack_v2 for the ib component. There is therefore no causal link between the change and the failing assertion.

Caveat: the exact assertion text for ib/test_md.alloc/1 scrolled out of the retrievable log window (Azure returns only the tail, and the failure occurred ~54 minutes earlier in the 3257 s run), so the precise failing line within the test could not be confirmed from the log — only the final failure summary.

Implicated commit: none for the failure itself. PR commits present but not causal: 4ff6e825 and d8b9e873 (Shachar Hasson, src/uct/ib/ud/base/ud_iface.c); HEAD under test [REDACTED:Hex High Entropy String].

File: test/gtest/uct/test_md.cc:479-561 (failing test body; assertions at :541 and :559)

Suggested fix: Treat this as an unrelated/flaky failure and re-run the roce on worker 0 job. To get a conclusive diagnosis if it recurs, capture the full gtest output (the [ RUN ] ib/test_md.alloc/1 block with the [ FAILED ] assertion message) rather than the log tail — e.g. publish build-test/test/gtest output as a build artifact. If it is reproducible, the test should be hardened rather than the PR changed: in test_md.cc:531, also tolerate/retry transient non-fatal statuses (not just UCS_ERR_NO_MEMORY) from uct_mem_alloc() on IB MDs, and log the actual ucs_status_string(status) plus the requested size so resource exhaustion is distinguishable from a real registration bug. Do not raise any timeout — there is no hang here (test cadence is continuous to the end of the run).

Related: PR #12297 (this PR, "UCT/UD: Calibrate and configure UD interface overhead"); predecessor #12287 ("UCT/UD: Add configurable extra interface overhead", closed). No existing issue found for ib/test_md.alloc flakiness.

🛡️ This comment had 2 potential secret(s) redacted (Base64 High Entropy String, Hex High Entropy String). See request_id bdb97b55-d083-445a-a034-31ca8cee8d94 in the triage console for the audit trail.

@shasson5

Copy link
Copy Markdown
Contributor Author

@gleon99 can review?

Comment thread buildlib/tools/check_tls_perf_caps.sh Outdated
Comment on lines +47 to +54

# Update UCX v1.15.x-v1.18.x UD baselines for the 50 ns calibration.
# Remove this remap when those versions leave the wire-compat matrix.
case "${tl_name}/${cap}/${old_cap}" in
"ud_verbs/overhead/105 nsec") old_cap="155 nsec" ;;
"ud_mlx5/overhead/80 nsec") old_cap="130 nsec" ;;
esac

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.

@brminich is this overhead compatibility check actually needed? maybe we can remove it?

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, we need to check if CI passes

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.

you mean if CI pass after we remove it? I don't see why not because it's only guarding the ud case in this specific wire compat test

@shasson5 shasson5 Nov 23, 2026 •

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.

@brminich CI passed as expected. are you OK with removing this test?

shasson5 and others added 2 commits November 18, 2026 20:04
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread buildlib/tools/check_tls_perf_caps.sh Outdated
old_caps=$(echo "$old_tl_caps" | grep -A 7 "Device: $device" || true)
new_caps=$(echo "$new_tl_caps" | grep -A 7 "Device: $device" || true)
for cap in bandwidth overhead
for cap in bandwidth

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this drops the overhead comparison for every transport, not only UD, and since the script compares against frozen releases the coverage is gone for good; can we skip it just for UD?

Suggested change
for cap in bandwidth
caps="bandwidth overhead"
if [[ "$tl_name" == ud* ]]
then
# UD overhead values were intentionally re-tuned
caps="bandwidth"
fi
for cap in $caps

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.

Can we keep the overhead comparison for non-UD transports?

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.

fixed

Comment thread src/uct/ib/mlx5/ud/ud_mlx5.c Resolved
Comment thread src/uct/ib/ud/base/ud_iface.c Outdated
UCS_CONFIG_TYPE_TABLE(uct_ud_iface_common_config_table)},

{"IFACE_OVERHEAD", "0",
"Estimated software overhead per operation for the interface and receive\n"

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
"Estimated software overhead per operation for the interface and receive\n"
"Estimated software overhead of processing a single received operation,\n"
"used for performance estimation.",

minor: the current sentence is hard to parse, and since the value only feeds perf_attr->recv_overhead, maybe name the knob RECV_OVERHEAD as in mm_iface.c.

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.

fixed

Comment thread src/uct/ib/ud/verbs/ud_verbs.c Resolved
@svc-ucx

svc-ucx commented Nov 19, 2026

Copy link
Copy Markdown

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

TL;DR: The gtest suite passed in full; the job failed in the run_ucx_perftest_fault_tolerance step, where after the drop tool blocked SL 10 / TC 40 on mlx5_0 the running ucx_perftest never printed a second protocol configuration (perftest self cfg#1), so the script aborted with "Failed to find protocol configuration count 1". This is a RoCE-specific/racy CI test issue unrelated to PR #12297 (which only changes UD interface overhead, while this test forces UCX_TLS=rc_x).

Full analysis

Summary: contrib/test_jenkins.sh::run_ucx_perftest_fault_tolerance failed on the "roce on worker 1" agent (swx-rain03): no failover/reconfiguration (cfg#1) appeared in ucx_perftest.stdout within the 10 s settle window → Bash exited with code '1'.

Root cause: From the log, the baseline check passed (cfg#0 = 50% on rc_mlx5/mlx5_0:1 and 50% on rc_mlx5/mlx5_1:1). After ucx_drop_tool -d mlx5_0 -s 10 -t 40 started, the perftest output contains only steady [thread 0] ... 81.9 usec / ~11.7 GB/s report lines, no transport-error or failover log lines and no second proto-info table — i.e. UCX never observed a transport error, so no protocol reconfiguration was emitted. Two concrete contributors visible in the sources:

  • The script derives sl=$((EXECUTOR_NUMBER + 1)) → UCX_IB_SL=10 here. Per src/uct/ib/base/ib_iface.c:176-179 the SL knob on RoCEv2 is the Ethernet priority (valid 0–7), so a drop rule matching "service level 10" can never match RoCE traffic on this executor; the test then depends entirely on the TC/DSCP rule taking effect.
  • The verification is single-shot: one sleep 10 followed by one parse of ucx_perftest.stdout (contrib/test_jenkins.sh:566-581), with no polling/retry and no tolerance for stdio block buffering of the redirected stdout — so a slightly slower error detection/reconfiguration (RC timeout + UCX_RC_MLX5_RETRY_COUNT=2) or a buffered flush fails the job.

No evidence links this to commit d7608d2: the PR touches the UD send-overhead default (UCT_IB_SEND_OVERHEAD_VALUE, src/uct/ib/base/ib_iface.h:34-41), while this test runs with UCX_TLS=rc_x only and the whole 9197-test gtest run passed.

Implicated commit: Not the PR commit. Test logic comes from [REDACTED:Hex High Entropy String] — "CI/FT: Adds fault tolerance CI test (#11570)", william-gallagher-nv.

File: contrib/test_jenkins.sh:514 (SL derivation) and contrib/test_jenkins.sh:557-581 (single-shot verification); parser at contrib/test_jenkins.sh:430-463.

Suggested fix:

  1. Make the check resilient: replace the fixed sleep ${settle_seconds} + single verify_active_devices with a poll loop (e.g. retry every 1 s for 30–60 s until cfg#${config_cnt} appears), and cat ucx_perftest.stdout on failure so the failure can be diagnosed.
  2. Make the drop rule valid on RoCE: clamp the service level to the Ethernet-priority range on RoCE ports (sl=$(( (EXECUTOR_NUMBER + 1) % 8 ))) or drive the test by traffic class only when the port link layer is Ethernet.
  3. Re-run the PR pipeline; treat this job as infrastructure flakiness for UCT/UD: Calibrate and configure UD interface overhead #12297 (no UD transport is exercised by this test).

Related: PR #12297 (commit under test), PR #11570 (test that is failing), and PR #12362 / #12180 which show the same Failed to find protocol configuration count signature on unrelated branches — further evidence of a flaky fault-tolerance check.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 106d30e0-7c00-474a-befc-32215c20dc29 in the triage console for the audit trail.

@shasson5

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).

@shasson5

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).

@svc-ucx

svc-ucx commented Nov 20, 2026

Copy link
Copy Markdown

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

TL;DR: rc/test_ucp_mmap_export.reg_export_and_reimport/2 failed because the UMR (memory-export) self-loopback QP on mlx5_1 never completed its registration WQE — ibv_poll_cq(UMR CQ, registration ...) timed out after 30 s — and the resulting ASSERT_UCS_OK abort leaked a ucp_rcache region, turning the test failure into a core dump. This is unrelated to the UD-overhead change in PR #12297.

Full analysis

Summary: gtest task "roce on worker 1" aborted in rc/test_ucp_mmap_export.reg_export_and_reimport/2 <rc_v,cuda_copy,rocm_copy/proto_v1>: UMR mkey registration on mlx5_1 timed out, then ucs_mem_region_destroy_internal() asserted region->refcount == 0 during ucp_cleanup().

Root cause: Two distinct problems, in sequence:

  1. Primary: at 08:09:50 the test entered ucp_memh_pack(..., UCP_MEMH_PACK_FLAG_EXPORT), which lazily creates the UMR QP/CQ for mlx5_1 (uct_ib_mlx5_devx_umr_init_export) and posts a synchronous UMR WQE. The completion never arrived: exactly 30 s of silence (08:09:50 → 08:10:20) ends with ib_mlx5dv_md.c:1439 mlx5_1: ibv_poll_cq(UMR CQ, registration, UMR mkey ... index 0x3caa) timed out, i.e. a hang on the loopback WQE, not slowness. The immediately following invalidation then failed with ibv_post_send(... ) returned 12 because the send queue is still occupied by the stuck WQE. The UMR QP is wired to itself in uct_ib_mlx5_devx_umr_modify_qp() using is_global=1, dlid = port_attr->lid and only the default GID index, while grh.hop_limit, grh.sgid_index and traffic_class are left zero — valid for an IB port, but on an Ethernet/RoCE port (this is the roce worker, and mlx5_1 is the RoCE device here, lid == 0, hop_limit == 0) the self-addressed packet is not deliverable, so the WQE never completes. That explains why the same code path works on mlx5_0 (md[0] registered fine) and stalls only on mlx5_1.
  2. Secondary (why it core-dumped instead of just failing): import_memh() aborts via ASSERT_UCS_OK(status) at test_ucp_mmap.cc:668 (throws UCS_TEST_ABORT). test_rereg() only unmaps memh in the catch (ucs::test_skip_exception&) handler, so on an abort exception ucp_mem_unmap(sender, memh) is skipped; the region survives with ref 1, producing rcache.c:679 destroying inuse region ... ref 1 md[0]=mlx5_0 md[1]=mlx5_1 and the fatal assert at rcache.c:403.

Implicated commit: unknown — not the PR head commit [REDACTED:Hex High Entropy String] (UD fixed overhead), which touches no IB/UMR or rcache code. The UMR export path in ib_mlx5dv_md.c predates the recent commits listed for that file (latest: e4d1e59, dmitrygx).

File: src/uct/ib/mlx5/dv/ib_mlx5dv_md.c:1436 (timeout loop), src/uct/ib/mlx5/dv/ib_mlx5dv_md.c:1213-1222 (UMR QP ah_attr missing RoCE fields), test/gtest/ucp/test_ucp_mmap.cc:742-750 (leaked memh on abort)

Suggested fix:

  1. Fill the UMR QP address vector correctly for Ethernet/RoCE ports: set ah_attr.grh.hop_limit (e.g. 64), ah_attr.grh.sgid_index, traffic_class, and select the GID via the device's configured RoCE GID index (reuse the existing uct_ib_iface_fill_ah_attr*/uct_ib_device_select_gid logic) instead of hardcoding UCT_IB_DEVICE_DEFAULT_GID_INDEX with dlid = port_attr->lid; keep is_global = 1 only when link layer is Ethernet.
  2. Harden uct_ib_mlx5_devx_umr_post_sync(): on UCS_ERR_TIMED_OUT do not post further WQEs to the stalled QP — mark the md's UMR context as broken (so export reports UCS_ERR_UNSUPPORTED/IO_ERROR immediately) and tear down/recreate the QP/CQ instead of logging a cascading ibv_post_send error.
  3. Test hygiene: in test_rereg() free memh/buf on any exception (catch-all or UCS_TEST_SCOPE_EXIT), so a registration failure reports a clean gtest failure rather than aborting the whole binary on the rcache in-use assert.

Related: none found for this signature (searches for the UMR CQ timeout and the rcache refcount == 0 assert returned no matching issue; #11742 and #12324 are unrelated).

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 8493dae5-91c8-49ef-9ca9-b5724784e95e in the triage console for the audit trail.

Comment thread buildlib/tools/check_tls_perf_caps.sh Outdated
# Remove this remap when those versions leave the wire-compat matrix.
case "${tl_name}/${cap}/${old_cap}" in
"ud_verbs/overhead/105 nsec") old_cap="155 nsec" ;;
"ud_mlx5/overhead/80 nsec") old_cap="130 nsec" ;;

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.

As discussed f2f, plz check.

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.

The hard-coded remap for the legacy UD overhead values was already removed in d7608d226.


#define UCT_UD_VERBS_IFACE_OVERHEAD 105e-9
/* Includes 50 ns calibration for UD/DC selection in hybrid Alltoallv. */
#define UCT_UD_VERBS_IFACE_OVERHEAD 155e-9

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.

as discussed, plz remove the comment

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.

The Alltoallv calibration comment was already removed from both the verbs and mlx5 implementations in cbc595b7a.

Comment thread buildlib/tools/check_tls_perf_caps.sh Outdated
old_caps=$(echo "$old_tl_caps" | grep -A 7 "Device: $device" || true)
new_caps=$(echo "$new_tl_caps" | grep -A 7 "Device: $device" || true)
for cap in bandwidth overhead
for cap in bandwidth

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.

Can we keep the overhead comparison for non-UD transports?

@github-actions

Copy link
Copy Markdown

CLA check failed

See items 1 and 2 of CONTRIBUTING.md for how
to sign the CLA and your commits. Once your email is on the CLA
list, push a new commit or ask for a re-run of this check.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — CLA · commit 70053119

TL;DR: The CLA workflow failed as a policy gate, not a code bug: 8 of the 9 commits in PR #12297 (d7608d226a, cbc595b7a5, ce06e1b029, [REDACTED:Hex High Entropy String], d8b9e873e0, [REDACTED:Hex High Entropy String], 464cab1495, [REDACTED:Hex High Entropy String]) have no verified GPG/SSH signature, so buildlib/tools/cla_check.sh exited 1. The author must sign (or re-sign) those commits with a key registered on GitHub and ensure their commit email is on the CLA list.

Full analysis

Summary: GitHub Actions job CLA (run 45231233105) failed with ##[error]CLA check failed, see the job summary / exit code 1 while running ./buildlib/tools/cla_check.sh --repo openucx/ucx --pr 12297 --head-sha 70053119eb....

Root cause: Not a build, test, or infrastructure failure — there are no compile errors, no timeouts, and no hangs (total job runtime ~8 s with continuous output). The script fetched the PR commit list (Checking 9 new commits) and reported:

### CLA check failed
- Commits without a verified signature: d7608d226a (unsigned), cbc595b7a5 (unsigned), ce06e1b029 (unsigned), [REDACTED:Hex High Entropy String] (unsigned), d8b9e873e0 (unsigned), [REDACTED:Hex High Entropy String] (unsigned), 464cab1495 (unsigned), [REDACTED:Hex High Entropy String] (unsigned).

Every one is flagged (unsigned) — i.e. GitHub's commit verification status is unsigned, meaning the commits carry no GPG/SSH signature at all (as opposed to unverified, which would indicate a signature present but not matching a registered key). The repository's CLA gate requires each new commit on the branch to carry a verified signature whose signer email is on the CLA individuals/entities allowlist (the CLA_INDIVIDUALS / CLA_ENTITIES secrets passed to the step). Since 8 of 9 commits on branch ud-fixed-overhead-50ns were created without signing configured locally, the gate correctly refuses the PR. Note the head commit 70053119eb is not in the failure list, so signing appears to have been enabled only for the most recent commit — consistent with the author turning on commit.gpgsign partway through the branch's history.

Implicated commit: The unsigned commits on PR #12297 themselves — d7608d226a, cbc595b7a5, ce06e1b029, [REDACTED:Hex High Entropy String], d8b9e873e0, [REDACTED:Hex High Entropy String], 464cab1495, [REDACTED:Hex High Entropy String] (all authored by the PR submitter on branch ud-fixed-overhead-50ns). No upstream/master commit is at fault; cla_check.sh and .github/workflows/cla.yml are not present in this PR's checked-out tree and were not modified here.

File: buildlib/tools/cla_check.sh (invoked from .github/workflows/cla.yml, job CLA) — the check behaved as designed; the defect is in the PR's commit metadata, not in this script.

Suggested fix: The PR author should re-sign the branch's commits and ensure CLA enrollment:

  1. Confirm a signing key is registered on GitHub (Settings → SSH and GPG keys) and configure git:
    git config user.signingkey <key-id>      # or ssh key path with gpg.format=ssh
    git config commit.gpgsign true
    
  2. Re-sign all commits on the branch, then force-push:
    git rebase --exec "git commit --amend --no-edit -n -S" origin/master
    git push --force-with-lease
    
    Alternatively, squash the branch into a single signed commit. (CONTRIBUTING.md item 6 normally discourages force-push mid-review, but it is unavoidable here since commit signatures cannot be added without rewriting the commits — mention this in a PR comment so reviewers know why history changed.)
  3. Verify the commit author email matches the address signed onto the UCX contributors agreement at http://www.openucx.org/license; if it is not yet on the CLA list, sign the CLA first, then push a new commit or ask a maintainer to re-run the CLA check.

No credentials need attention: the tokens in the log (GH_TOKEN, CLA_INDIVIDUALS, CLA_ENTITIES, and the git AUTHORIZATION: basic header) were all masked by Actions and none were exposed.

Related: PR #12297 (the failing PR). Searches for prior CLA-signature failures returned only unrelated open PRs (#12438, #12439, #12422, #12410, #12394) with no matching tracking issue — none

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id e156fb1b-505c-44c8-873e-b7712f234c7a in the triage console for the audit trail.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Review complete — no issues found.

@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

🤖 Review complete — no issues found.

@svc-ucx

svc-ucx commented Nov 23, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — CLA · commit 057985b6

TL;DR: This is not a product/test failure — the CLA gate rejected PR #12297 because 8 of its 10 commits carry no GitHub-verified cryptographic signature; the contributor needs to re-sign those commits (and have their email on the CLA list) and force-push.

Full analysis

Summary: The CLA GitHub Actions job failed at the buildlib/tools/cla_check.sh step with exit code 1, reporting commits without a verified signature.

Root cause: A contributor-compliance gate, not a code defect. cla_check.sh --repo openucx/ucx --pr 12297 --head-sha [REDACTED:Hex High Entropy String] examined the 10 new commits on branch ud-fixed-overhead-50ns and found 8 of them unsigned:

Checking 10 new commits
### CLA check failed
- Commits without a verified signature: d7608d226a (unsigned), cbc595b7a5 (unsigned),
  ce06e1b029 (unsigned), [REDACTED:Hex High Entropy String] (unsigned), d8b9e873e0 (unsigned),
  [REDACTED:Hex High Entropy String] (unsigned), 464cab1495 (unsigned), [REDACTED:Hex High Entropy String] (unsigned).
##[error]CLA check failed, see the job summary
##[error]Process completed with exit code 1.

The script requires every new commit in the PR to have a GPG/SSH signature that GitHub reports as verified (i.e. git commit -S, with the signing key registered on the author's GitHub account), and the signing identity's email to be present in the CLA_INDIVIDUALS/CLA_ENTITIES lists supplied as repository secrets. The job ran correctly and fast (total runtime ~7 s, no gaps, no timeouts), the checkout succeeded, and the script itself did not error — it deliberately exited 1 on policy violation. Note the workflow checked out cla_check.sh from master ([REDACTED:Hex High Entropy String]), so the PR's own content could not have broken the checker.

Implicated commit: No CI-breaking commit. The offending unsigned commits on the PR branch are d7608d226a, cbc595b7a5, ce06e1b029, [REDACTED:Hex High Entropy String], d8b9e873e0, [REDACTED:Hex High Entropy String], 464cab1495, [REDACTED:Hex High Entropy String] (author not disclosed in the job log).

File: buildlib/tools/cla_check.sh (invoked from .github/workflows/cla.yml) — the script is the gate, not the fault; neither file is readable at the repo snapshot available to me, so no line number.

Suggested fix: Action is on the PR author, not on CI:

  1. Configure commit signing and register the public key in GitHub Settings → SSH and GPG keys:
    git config user.signingkey <key> and git config commit.gpgsign true (for SSH signing also set git config gpg.format ssh).
  2. Re-sign the existing history and force-push, e.g. rebase the 10 commits onto master with signing enabled:
    git rebase --exec 'git commit --amend --no-edit -S' origin/master then git push --force-with-lease.
  3. Verify the commit author/committer email matches the email registered on the CLA list; if it is not yet on the list, sign the CLA per items 1 and 2 of .github/CONTRIBUTING.md, then push a new commit or request a re-run of the check.
  4. Confirm success by checking that GitHub shows a green "Verified" badge next to each commit in the PR's Commits tab.

Do not retry/re-run the job without re-signing — the result will be identical and deterministic, since the check is a property of the commit objects themselves.

Related: none found — a search for this error signature returned only unrelated open PRs (#12438, #12439, #12422, #12410, #12394) with no matching CLA-signature discussion.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id a1e6ff68-73ca-40d3-b5eb-6fb051135b24 in the triage console for the audit trail.

@svc-ucx

svc-ucx commented Nov 24, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Tests roce on worker 0) · commit 057985b6

TL;DR: The roce on worker 0 job was killed while ucx_info -epw -u t had been hung with zero output for 6m17s (it and both greps had to be reaped as orphans); the hang is in UCP protocol/threshold selection, which is exactly the code path affected by this PR's new UD interface-overhead constants — so the UD overhead calibration (UD_IFACE_OVERHEAD, IB_SEND_OVERHEAD wqe_post) needs to be reproduced/fixed, not the job time limit.

Full analysis

Summary: contrib/test_jenkins.sh → test_unused_env_var never completed: UCX_IB_PORTS=mlx5_0:1 ./src/tools/info/ucx_info -epw -u t | grep unused | grep -q -E UCX_IB_PORTS produced no output for >6 minutes until the Azure agent shut down and terminated the orphaned ucx_info (pid 196375) and two grep processes.

Root cause: Evidence from the log: the last application line is 01:49:01.667 + grep unused, then a single 6m17s gap to 01:55:18.512 ##[error]The agent has received a shutdown signal, followed by Terminate orphan process: pid (196375) (ucx_info). ucx_info -epw normally finishes in well under a second, so the process was hung, not slow (the agent shutdown/cancel is the symptom that ended the job, not the cause). -epw -u t creates a UCP worker + self endpoint and builds the whole protocol-selection table; that walk is the do { ... msg_length = max_length + 1; } while (max_length < SIZE_MAX); loop in ucp_proto_select_elem_init_thresh() (src/ucp/proto/proto_select.c:430-469), which is driven entirely by the transport perf model (iface_attr->overhead, IB_SEND_OVERHEAD). If a transport reports a degenerate overhead the per-protocol ranges collapse to ~1-byte intervals and that loop effectively never terminates (it advances one byte at a time toward SIZE_MAX) — a silent, CPU-spinning hang with no log output, matching the observed signature. The only functional change on this branch is precisely that input: UD now reports iface_attr->overhead = iface->config.iface_overhead from a new UD_IFACE_OVERHEAD knob (src/uct/ib/ud/verbs/ud_verbs.c:607, src/uct/ib/mlx5/ud/ud_mlx5.c:637), whose base-table default is "0" (src/uct/ib/ud/base/ud_iface.c:679-682) and whose per-TL defaults are stringified C double literals (UCS_PP_MAKE_STRING(155e-9) / 130e-9) that are also injected into IB_SEND_OVERHEAD's wqe_post field. A zero (or unparsed/misparsed) overhead yields a zero-cost transport in the perf model.

Implicated commit: 057985b (HEAD under test) — functional changes in 4ff6e82 "UCT/UD: Make interface overhead configurable", c1bd5b2 "UCT/UD: Add fixed 50 ns interface overhead", 464cab1 — all by Shachar Hasson (PR #12297)

File: src/uct/ib/ud/base/ud_iface.c:679 (IFACE_OVERHEAD default "0"), src/uct/ib/ud/verbs/ud_verbs.c:34-47 and :607; hang loop at src/ucp/proto/proto_select.c:430-469

Suggested fix:

  1. Reproduce directly: UCX_IB_PORTS=mlx5_0:1 timeout 30 ucx_info -epw -u t on a RoCE node, and take a gdb -p backtrace / UCX_LOG_LEVEL=trace dump; expect the stack in ucp_proto_select_elem_init_thresh → ucp_proto_thresholds_next_range / ucp_proto_perf_envelope_make.
  2. Give UD_IFACE_OVERHEAD a real default instead of "0" in uct_ud_iface_config_table and validate it in UCS_CLASS_INIT_FUNC(uct_ud_iface_t) (reject <= 0, as is already done for timer_tick/event_timer_tick), so no UD-derived iface can ever report overhead == 0.
  3. Express the defaults as explicit time strings ("155ns", "130ns") rather than UCS_PP_MAKE_STRING(155e-9); the stringified exponent literal is fragile for UCS_CONFIG_TYPE_TIME/IB_SEND_OVERHEAD key-value parsing and hides errors.
  4. Independently harden the selection loop: add ucs_assertv_always(max_length > msg_length || max_length == SIZE_MAX, ...) (or a bail-out + warning) in ucp_proto_select_elem_init_thresh so a degenerate perf model fails loudly instead of hanging CI for hours.

Related: PR #12297 (this change), PR #12287 "UCT/UD: Add configurable extra interface overhead" (closed predecessor)

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.

5 participants