Repository navigation
Conversation
A Level Zero device-memory allocation may need to be created for external DMA-BUF export before its handle can be used for RDMA. The ze_copy memory domain advertised ze-device in 'dmabuf_mem_types' and obtained a file descriptor through zeMemGetAllocProperties(), but allocated without an export descriptor. On the tested system, registering a DMA-BUF obtained that way completed successfully, but RDMA reads returned incorrect data while the transfer reported success. Request DMA-BUF exportability in uct_ze_copy_mem_alloc(), and only for the memory types advertised in 'dmabuf_mem_types', so that allocating a type without a DMA-BUF path cannot fail because of the descriptor. Add UCX_ZE_COPY_DMABUF, following the cuda_copy and rocm_copy pattern: query DMA-BUF export support once at md_open() using zeDeviceGetExternalMemoryProperties(), fail md_open() when 'y' is requested but unsupported, and advertise 'dmabuf_mem_types' and return a DMA-BUF descriptor only when it is effectively enabled. Memory allocated by an application without requesting external export cannot be repaired by UCX, so 'n' is available to disable DMA-BUF registration for it. The presence of the Intel Xe module alone does not prove that an IB memory domain can register Level Zero device memory directly. UCP routes DMA-BUF registration by combining a provider's 'dmabuf_mem_types' with an RDMA memory domain's UCT_MD_FLAG_REG_DMABUF. Remove the Intel Xe module heuristic from the IB memory domain. With UCX_ZE_COPY_DMABUF=n on the tested system, that heuristic made UCP attempt ordinary registration, which failed with EFAULT instead of staging through ze_copy. Removing ZE device memory from the IB MD's 'reg_mem_types' also disables the packet-tracer bound, so apply the bound whenever the IB memory domain supports DMA-BUF registration; otherwise tracing may dereference device memory from the CPU. Add test_ucp_mem_type_rndv_zcopy, which sends from memory allocated by ucp_mem_map(UCP_MEM_MAP_ALLOCATE) to a host buffer over a rendezvous zero-copy lane and verifies a non-zero pattern. It asserts that the source is registered on the memory domain used by the operation, so a staged transfer cannot make the test pass silently, and skips when that lane cannot register the memory type. Reverting only the export descriptor makes the ze-device variants fail the pattern check with zeros, in both the get_zcopy and put_zcopy directions. Tested on Intel Arc Pro B60 Graphics with rc_mlx5 over RoCE: 16 gtest variants pass, and ucx_perftest tag_lat with -V passes for ze-device, ze-host and ze-managed, including the DMABUF=n and DMABUF=y configurations. Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
|
The new test only exercises the default (DMABUF=try) path. Per the project test guidance, a new user-facing config that changes behavior should ideally cover both enable and disable paths. Since the whole point of this PR is that DMABUF=n must produce a correct transfer (data actually readable) while try uses the DMA-BUF handle, a variant with UCX_ZE_COPY_DMABUF=n would directly validate the regression this PR targets. Not a blocker, but worth considering.
In md_map_str(): for a remote (dst_md_index) map, the names are looked up in the local context->tl_mds[...], but dst_md_index is in the peer's MD index space, so the printed names can be wrong/misleading. It only affects the diagnostic UCS_TEST_MESSAGE, so it is cosmetic — could be clarified in the message or gated to the local case. |
Thanks for raising both points.
This also makes the assertion valid:
DMABUF=try : OK get lane mds: mlx5_1 | source memh mds: mlx5_1,ze_cpy
DMABUF=n : SKIP the rendezvous zero-copy lane cannot register ze-device memoryCovering the disable path requires a separate payload-only test without the lane-registration requirement, because it validates staging rather than direct DMA-BUF access. I verified manually that Focused staged-path coverage can be added separately. |
…ortable-allocation Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
…ortable-allocation Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
…ortable-allocation Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
Document the behavior of UCX_ZE_COPY_DMABUF=n and test transfers when the network rendezvous lane cannot register Level Zero memory: device memory must be staged through host fragments and CPU-accessible memory copied by the CPU. Check the selected protocol as well as the payload, since a forced zero-copy scheme can fall back to eager or to AM rendezvous when it cannot access the source. Cover memory allocated by UCP and by the application without an export descriptor, and instantiate the tests on rc_v as well, so that they run in builds without mlx5. Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
|
Residual coverage gap: |
|
🤖 CI Triage Agent — TL;DR: The new gtest Full analysisSummary: gtest run in the "AddressSanitizer gpu on worker 0" job ended with Root cause: For Implicated commit: [REDACTED:Hex High Entropy String] — "UCT/ZE/COPY: Test transfers with DMA-BUF disabled", Yaser Afshar (the PR head commit; the test file was previously touched only by 53c855b by the same author) File: test/gtest/ucp/test_ucp_mem_type.cc:426-449 (class/instantiation), with the failing assertion at test/gtest/ucp/test_ucp_mem_type.cc:340 and the faulty gate at :319-328 Suggested fix: Scope the new tests to Level Zero memory instead of inheriting the all-memtypes variant set. Concretely, in static void get_test_variants(std::vector<ucp_test_variant> &variants) {
add_variant_values(variants, get_test_variants_base,
UCS_MEMORY_TYPE_ZE_DEVICE, "ze-device");
add_variant_values(variants, get_test_variants_base,
UCS_MEMORY_TYPE_ZE_HOST, "ze-host");
}As a minimal alternative, add an early skip in Related: PR #11903 "UCT/ZE/COPY: Allocate DMA-BUF-exportable memory for RDMA" (#11903); no pre-existing issue found for this test name.
|
Also drop the IB comment which described removed code. Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
The application-allocated + DMA-BUF-enabled case was exercised manually: zero-copy is selected and the payload validates on the tested system. It is not added as a permanent test, since it would assert zero-copy on memory whose fd Level Zero does not guarantee; see the thread on ze_copy_md.c:39. The ZE instantiations skip without an Intel GPU, like the CUDA ones; a ZE runner is a separate effort. |
|
Residual coverage gap: there is no test for the Residual coverage gap: both ZE instantiations ( |
|
🤖 CI Triage Agent — TL;DR: The AddressSanitizer "roce on worker 0" job was not a test or compile failure — the Azure Pipelines agent itself was shut down mid-build ("The agent has received a shutdown signal"), cancelling the job while gtest sources were still compiling. Just re-run the pipeline; no code change is warranted. Full analysisSummary: Build 138647, job "roce on worker 0" ( Root cause: Infrastructure, not code. The log shows continuous, healthy progress with no stalls: object files are being emitted every 2–20 seconds from 22:10:21 through 22:22:37 (last compile:
Because the largest gap between consecutive log lines is well under a minute, this was not a hang and not a wall-clock timeout of the job's own work — the hosting agent/VM went away (agent service stop, pod eviction, or spot-node reclaim) while the ASan build was still ~2/3 of the way through compiling Nothing in the log implicates the PR's branch content ( Implicated commit: none — File: n/a (no source error). Cancellation point: Suggested fix: Re-run the failed job ("roce on worker 0") — this is a transient agent reclaim and should pass on retry. If this recurs on the ASan legs specifically, it's worth reducing the exposure window rather than chasing a code bug: (a) check the health/preemptibility of the agent pool backing the Related: none — searches for the agent-shutdown signature returned no matching tracked issue; the hits (#11932, #11842, #11970) are unrelated.
|
…ortable-allocation Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 CI Triage Agent — TL;DR: The gtest run failed on a single unrelated test, Full analysisSummary: Root cause: Implicated commit: unknown (pre-existing test fragility; the related hardening commit that missed this test is b82a920, Yossi Itigin — "UCT/TCP: Bound negative connect test timeout", #11415). The PR commits under test (ac618d1 / [REDACTED:Hex High Entropy String] / 53c855b, Yaser Afshar) touch only File: test/gtest/uct/test_sockaddr.cc:990-1004 (failing assertion at line 1003); timeout default at test/gtest/common/test.h:84; bounding config applied only at test/gtest/uct/test_sockaddr.cc:1140-1153 Suggested fix:
Related: #11415 (bounded negative connect timeout for the non-existent-IP variant only); PR under test: #11903
|
Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 CI Triage Agent — TL;DR: The Full analysisSummary: Root cause: The only failing case is a TCP RMA Implicated commit: none for this failure — PR head File: test/gtest/ucp/test_ucp_rma.cc:283 ( Suggested fix: Re-run the Related: #11903 (this PR); no existing issue found tracking
|
Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
…t probe Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
|
Can we add a
minor: Note (not blocking): ZE_HOST export is gated on a device-scoped Note (not blocking): app-allocated ZE memory with Note (not blocking): |
|
🤖 CI Triage Agent — TL;DR: The gtest shard didn't fail an assertion — it hung: Full analysisSummary: AddressSanitizer BlueField gtest shard 1/4 aborted because Root cause: A hang, not a slow test. Log timestamps show one single gap covering the entire failure: Nothing in the log points at the PR: the only transports probed are IB/mlx5 ( Implicated commit: none for the hang — branch commits ( File: Suggested fix:
Related: PR #11903 (the PR under test, ZE-only changes); candidate DC/zcopy completion areas: #11874 ("UCT/IB/MLX5: support put zcopy in purge outstanding"), #12066 ("UCT/IB/RC/VERBS: Support QPs without SRQ")
|
…test message Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
|
🤖 Starting review — findings will be posted here when done. |
|
Thanks.
Reworded in 346c123 to "memory handle registration on a DMA-BUF capable memory domain". For CUDA and ROCm with
Done in 346c123. The comment now says that the limit also applies to host-only runs on a DMA-BUF capable device.
ze-host export uses the same device query as |
|
Residual note: App-allocated ZE memory with Residual note: No test for a Residual note: The Residual note on coverage: the Residual note on size: ~480 added lines, under the 500 limit now; ~390 of them are tests. |
|
🤖 CI Triage Agent — TL;DR: The gtest binary aborted on an rcache assertion ( Full analysisSummary: Root cause: From the backtrace in the log: Implicated commit: unknown — not attributable to File: Suggested fix:
Related: PR under test: #11903 — no existing issue found for this assertion signature; worth filing one. |
|
/build |
|
🤖 CI Triage Agent — TL;DR: The Full analysisSummary: Root cause: Not a test or infra failure. The stage runs
Note the surrounding legacy code (e.g. Implicated commit: [REDACTED:Hex High Entropy String] — "UCT/ZE/COPY: Address review: clarify DMA-BUF comments, help text and test message" (Yaser Afshar); earlier branch commits 4a2d4f4 / 75f974d contribute the gtest hunks. File: src/uct/ze/copy/ze_copy_md.c:30 (also :96), test/gtest/ucp/test_ucp_mem_type.cc:208, test/gtest/uct/ib/test_ib_xfer.cc:292, test/gtest/uct/test_md.cc:271 Suggested fix: Locally run the same formatter over the branch and amend, e.g. Related: PR #11903 (this branch); no existing issue found for this formatter behavior (nearest hit: PR #11923).
|
|
🤖 CI Triage Agent — TL;DR: One of 40 parallel "Build" rows failed with Full analysisSummary: Build #47 failed in the Root cause: Evidence from the logs:
So this is a CI infrastructure/workspace problem on one agent pod: the per-branch source provisioning (checkout / stash-unstash / shared workspace volume) did not populate Secondary (non-fatal) noise seen in the same logs: Implicated commit: none in the product code — infrastructure. Closest CI-related changes: 9af60a8 (Alexey Rivkin, "CI: Add Fedora 44, Ubuntu 26.10, Azure Linux 4.0, UOS and openEuler 22.03 SP4 / 24.03 SP3", #11906) added new distro build rows, and the Jenkins pipeline itself is still being introduced (#12094 / #12166). The Jenkinsfile/pod templates are not in this repo, so the exact row cannot be pinned from the logs. File: Jenkins pipeline definition for Suggested fix:
Related: PR #12094 (CI: Jenkins integration testing), PR #12166 (Jenkins CI: Gate Jenkins jobs on a basic compile), commit 9af60a8 / PR #11906 (new distro CI rows)
|
|
🤖 CI Triage Agent — TL;DR: Three of the four GPU test shards hung in UCP RMA GET on host memory in the non-blocking memory-map variants ( Full analysisSummary: Root cause: A silent, permanent stall of large RDMA GET operations against non-blocking (ODP) memory registrations. The three independent hangs share one exact ingredient:
All three are the largest size class, all are GET, all use The PR is a red herring: its commits ( Implicated commit: unknown — not attributable to this branch; the hanging path is master's ODP/non-blocking registration advertisement (last touched by File: Suggested fix:
Related: PR #11903 (the branch under test, unrelated to the failure); #12176 "GTEST/UCT: Skip tests which assume GDR capable memory under MPS"; no existing issue found for this ODP/non-blocking RMA GET hang — worth filing one with these three stage logs attached. |
|
🤖 CI Triage Agent — TL;DR: All four GPU test shards of this job die on the same underlying problem — Full analysisSummary: Root cause: The common, reproducible error signature across shards is: emitted every time a test switches from
The triggering PR (#11903, Implicated commit: unknown (not PR #11903; its commits — 346c123 / 4a2d4f4, Yaser Afshar — only touch ZE code and test helpers). Node/driver configuration on the gb-nvl GB200 partition is the trigger. File: Suggested fix:
Related: #11903 (triggering PR), #12055 (non-GDR memory non-registrable without dmabuf), #12176 (skip tests assuming GDR-capable memory under MPS), #12263 (managed RNDV frag pool blocking registration), #11885 (moved this job to the GB200 partition) |
|
@tvegas1 Thanks for kicking off /build. ucx-codestyle-oss flags clang-format on the changed lines. I can push a format-only fix for the ternary and test hunks; the config table hunk would stay, since clang-format reflows the whole ucs_config_field_t initializer and I've kept it in the same layout as the other config tables. Would you like me to push that now (it restarts CI and needs a re-approval), or merge as is and I follow up with a format-only PR? The other failures look unrelated to this change: the rcache assert in tcp/test_ucp_rma.put_nonblocking (host memory over TCP), the BlueField 6 h timeout, and the *-oss build/GPU jobs, per the triage bot. If you prefer merging as is, the "Tests new on worker 1" job needs a rerun once build 143160 finishes. |
What?
Level Zero device memory may have to be allocated with external DMA-BUF export enabled. The ze_copy memory domain advertised
ze-hostandze-deviceindmabuf_mem_typesand returned a file descriptor fromzeMemGetAllocProperties(), but allocated without an export descriptor.uct_ze_copy_mem_alloc(), and only for the memory types advertised indmabuf_mem_types, so allocating a type without a DMA-BUF path cannot fail because of the descriptor.UCX_ZE_COPY_DMABUF, following thecuda_copyandrocm_copypattern: query export support once atmd_open()withzeDeviceGetExternalMemoryProperties(), failmd_open()whenyis requested but unsupported, and advertisedmabuf_mem_typesand return a DMA-BUF file descriptor only when effectively enabled.ibv_reg_mr()could registerze-devicememory.Why?
A DMA-BUF obtained without an export descriptor does not necessarily describe the requested range. Registration succeeds, the transfer completes, the completion is
UCS_OK, and the payload is wrong. Nothing reports an error atany layer:
ucx_perftest -t tag_lat -m ze-device -V -s 4194304 # UCX_TLS=rc,ze_copy ucp_tests.h:166 UCX ERROR data validation failed at offset 0: got 0x0 expected 0x1On the tested systems, writes into ze-device memory were unaffected; failures occurred only in flows where the RDMA device read from ze-device memory. Such transfers returned
UCS_OK, but the destination contained incorrect data.How?
UCP already routes DMA-BUF registration by combining a provider's
dmabuf_mem_typeswith an RDMA memory domain'sUCT_MD_FLAG_REG_DMABUF. Therefore, removing the Xe heuristic does not disable the DMA-BUF GPUDirect RDMA path when both capabilities are available. WithUCX_ZE_COPY_DMABUF=nthat heuristic made UCP attempt anordinary registration which failed with EFAULT instead of staging through
ze_copy. Removingze-devicememory from the IB MD'sreg_mem_typesalso disabled the packet-tracer bound, hence extending it to any DMA-BUF-capable IB memory domain; otherwise tracing may dereference device memory from the CPU.Memory allocated by an application without requesting external export cannot be repaired by UCX, so
UCX_ZE_COPY_DMABUF=nis available to disable DMA-BUF registration for it.With the default
try, UCX continues to use DMA-BUF for application allocations as on master, so RDMA reads from application-allocated Level Zero device memory for which DMA-BUF export was not requested can still return incorrect data; such applications should setUCX_ZE_COPY_DMABUF=n. Level Zero specifies fd export only when DMA-BUF export was requested at allocation time.UCX_ZE_COPY_DMABUF=ndisables thatpath; the tested
ze-devicerendezvous transfers then stage through host memory.UCX_ZE_COPY_DMABUF=ncan substantially increase latency for small ze-device messages because transfers stage through host memory.test_ucp_mem_type_rndv_zcopysends from memory allocated byucp_mem_map(UCP_MEM_MAP_ALLOCATE)to a host buffer using a forced rendezvous zero-copy lane and verifies a non-zero pattern. It asserts that the source memory handle is registered on a memory domain used by a rendezvous zero-copy lane and thatrndv/get/zcopyorrndv/put/zcopyran on the source memory, preventing a staged-only transfer from passing silently, and skips when that lane cannot register the memory type. It is parameterized over all memory types and instantiated forrc_x,rc_x,ze_copyandrc_v,ze_copy, so CUDA and ROCm are covered where present, ZE variants skip cleanly whereze_copyis unavailable, and the ZE cases also run in builds without mlx5.Both rendezvous suites check the protocols which moved the data as well as the payload: a forced zero-copy scheme can fall back to another transfer path (eager or AM rendezvous), so payload validation alone does not establish which protocol ran. They count protocol selections with
PROTO_INFO=usedon both workers around the transfer, because thetag/rndvdescription only estimates the rendezvous protocol which the peers then select. Their lane checks exclude memory-type-detection domains such asze_copy, which can register their own memory types without DMA-BUF.test_ucp_mem_type_rndv_stagedruns withUCX_ZE_COPY_DMABUF=n, pinsRNDV_FRAG_MEM_TYPES=host, and leaves rendezvous scheme selection to UCP. It is instantiated only forze-host,ze-deviceandze-managed, because UCX_ZE_COPY_DMABUF changes how only Level Zero memory is reached. Itsrc_x,ze_copyandrc_v,ze_copytransport lists carry no CUDA or ROCm copy transport, so CUDA memory which the IB lane cannot register has no staging path there and protocol selection falls back to thereconfigstub; this failed thecuda-managedvariant in CI before the suite was scoped. It still skips if a remaining RMA lane can register the source type. Otherwise it requires that no zero-copy rendezvous protocol ran on the source memory and, forze-device, that a protocol which ran reports "frag host". On the tested systems, all three memory types ranrndv/send/pplnthrough host fragments.The suite covers UCP-allocated and app-owned buffers. The latter use plain Level Zero allocations (including
zeMemAllocDevice()forze-device) and are sent without a UCP memory handle. Both suites haverc_x,ze_copyandrc_v,ze_copyinstantiations, so the ZE cases also run without mlx5.Tested on Intel Arc Pro B60 and B70,
rcover RoCE, server and client on different devices, and on an H200 NVL for CUDA. Test vehicle: this branch at 65561c7 (aff1b95, which merges 9b5c282 with master f21cfca, plus the test fixes on top), built both with and without mlx5 support on the Intel systems.test_ucp_mem_type_rndv_zcopypasses onrc_xandrc_v(ze-managed skips: not registrable on the tested rendezvous lanes).test_ucp_mem_type_rndv_stagedpasses forze-host,ze-deviceandze-managed, UCP-allocated and application-allocated, withrc_x,ze_copyandrc_v,ze_copy. On the H200 NVL,test_ucp_mem_type_rndv_zcopypasses forhostandcudaand skipscuda-managed, and the staged suite has no variants, as intended. Each suite ran 3 times. The neighbouringtest_ucp_mem_type, ze_copy, ze_ipc andtest_mdsuites also ran. 0 failures in all builds.ucx_perftesttag_bw/ucp_put_bw/ucp_getat 8 B, 64 KiB and 4 MiB, plus-Vpingpong validation (tag_lat,ucp_put_lat) at the same sizes: all pass withDMABUF=tryand withDMABUF=n, on both systems and in both builds. Protocols which ran (UCX_PROTO_INFO=used) for 64 KiB and 4 MiB tagged sends between ze-device buffers: withDMABUF=try, the receiver reads the source with zero-copy RDMA, directly into the destination on the B60 and on one of the two B70 systems (zero-copy read from remote), and through host fragments copied byze_copyon the other B70 system (read from remote, ze_copy, frag host); withDMABUF=n, the sender stages the source through host fragments withze_copyon both (ze_copy, fenced write to remote, frag host, pipelined above 512 KiB).flush(remote) is not supportedfromrc_verbswhen UCP issues a strong fence. Master logs the same forucp_put_bwanducp_get; withDMABUF=n,ucp_put_latalso reaches it. All affected cases exited 0; the-Vping-pong cases validated.DMABUF=nperftest matrix passed 0 of 15 cases. Aze-deviceallocation made before the memtype cache was initialized could be treated as host memory, causing theucp_mm.cmemory-type assertion or a segfault in the host eager-short path. With DMA-BUF enabled,uct_ze_copy_md_mem_query()populates the cache and masks this.Known limitation:
UCT-level
ucx_perftesthas no DMA-BUF registration path:uct_perf_md_mem_reg()does not supply a DMA-BUF fd. Before this change,-x rc_mlx5 -m ze-devicerelied on the Xe module heuristic and attemptedibv_reg_mr()on a device pointer; on the tested systems, this failed withEFAULT. After removing ze-device from the IB MD'sreg_mem_types,uct_perf_test_check_md_support()rejects this invocation up front instead:Unsupported memory type ze-device by rc_mlx5/...This does not imply that ordinary registration is unsupported on every platform; only that the presence of the Xe module is insufficient evidence of that capability. Adding DMA-BUF registration to UCT-level perftest is left for a separate change.
UCP-level
ucx_perftestis not subject to this UCT-level registration limitation. Its ZE allocator has no UCP-levelmem_alloccallback, so UCP allocates the buffer throughucp_mem_map(UCP_MEM_MAP_ALLOCATE)and uses UCP's DMA-BUF registration path when enabled.