Skip to content

UCT/ZE/TEST: expand ZE RMA coverage and fix ze_copy rkey_compare path - #11331

Open
yafshar wants to merge 27 commits into
openucx:masterfrom
intel-staging:test/ze-uct-rma
Open

UCT/ZE/TEST: expand ZE RMA coverage and fix ze_copy rkey_compare path#11331
yafshar wants to merge 27 commits into
openucx:masterfrom
intel-staging:test/ze-uct-rma

Conversation

@yafshar

@yafshar yafshar commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

What?

This PR expands ZE test coverage in UCT gtests and fixes a ZE MD callback issue
that caused a crash in existing tests.

  • Expand ZE RMA test coverage for the ze_copy transport in test_ze.cc
  • Extend ZE-related MD test coverage and expectations in test_md.cc
  • Register ZE gtest sources in Makefile.am
  • Update ZE test helpers in test_p2p_rma.cc and uct_test.h
  • Fix ze_copy component rkey compare callback and mem_dereg parameter handling
    in ze_copy_md.c
  • Fix ze_copy_md.c aligned with UCX style guidelines

Why?

ZE paths lacked sufficient automated coverage for ze_copy transport and MD
behavior, and an existing ZE MD test exposed a real failure:

  • The ze_copy MD test path crashed during rkey comparison due to missing component callback wiring.
  • Additional coverage is required to consistently validate ZE host, device, and managed memory cases across RMA and MD operations.

yafshar added 3 commits April 6, 2026 14:07
- Add UCT RMA tests for ze_copy covering put/get zcopy operations
  on ZE device and managed memory.
- Enable runtime skip logic based on ZE memory type availability
  instead of compile-time gtest filtering.
- Include ze_copy in p2p_rma source memory-type selection alongside
  cuda_ipc and rocm_copy.
- Introduce UCT_INSTANTIATE_ZE_TEST_CASE macro in uct_test.h to
  standardize ZE test instantiation.
- Update gtest Makefile.am to build ZE transport tests.
- Wire ze_copy component rkey_compare to uct_base_rkey_compare to
  prevent crashes in ze_copy/test_md.rkey_compare.
- Validate ze_copy mem_dereg parameters (memh and invalidate flag)
  to match MD bad-argument behavior when parameter checking is enabled.
- Fix the style
- Add ZE host, device, and managed memory RMA tests for ze_copy
  transport in test_ze.cc.
- Extend MD tests to cover ZE mem_query behavior and add ZE dmabuf
  query tests in test_md.cc.
@yafshar
yafshar marked this pull request as ready for review April 7, 2026 21:36
Comment thread test/gtest/uct/test_md.cc Outdated
yafshar added 2 commits April 13, 2026 11:05
Run dmabuf mem_query tests via the generic MD fixture (test_md_dmabuf)
instead of a ZE-only fixture, validating the generic dmabuf interface
across MDs.
@yafshar
yafshar requested a review from yosefe April 29, 2026 14:57
@yafshar

yafshar commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

Clarification: this PR is not blocked on #11321, but without it the ZE md_buffer test path will be skipped due to missing ZE support in gtest mem_buffer/UCM hooks.

@openucx openucx deleted a comment from svc-nixl May 4, 2026
@yafshar

yafshar commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

Hi @yosefe, just a gentle follow‑up in case this slipped through.
Happy to address any questions or make changes if needed.
Thanks!

@yafshar

yafshar commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @yosefe @tvegas1 just a gentle follow‑up in case this slipped through.
Happy to address any questions or make changes if needed.
Thanks!

Comment thread src/uct/ze/copy/ze_copy_md.c Outdated
Comment thread src/uct/ze/copy/ze_copy_md.c
Comment thread src/uct/ze/copy/ze_copy_md.c
Comment thread src/uct/ze/copy/ze_copy_md.c Outdated
Comment thread src/uct/ze/copy/ze_copy_md.c Outdated
Comment thread test/gtest/uct/test_md.cc Outdated
Comment thread test/gtest/uct/ze/test_ze.cc Outdated
Comment thread test/gtest/uct/ze/test_ze.cc Outdated
Comment thread test/gtest/uct/ze/test_ze.cc Outdated
Comment thread test/gtest/uct/ze/test_ze.cc Outdated
Keep ze_copy_md.c focused on functional changes by adding parameter
validation to uct_ze_copy_mem_dereg() and wiring rkey_compare to
uct_base_rkey_compare().

Refactor the ze_copy RMA tests by consolidating duplicated logic into
memory-type-parameterized run_single() and run_range() helpers. Switch
the tests to UCS_TEST_SKIP_COND_P() and rely on the common RMA transfer
path, ensuring ZE-local buffers are exercised as both source and
destination.

Update the dmabuf query test to accept UCS_OK when queried with an
invalid dmabuf file descriptor, matching the MD API contract. Also use
ucs_get_page_size() to determine the query buffer size instead of a
hard-coded value.

Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
@yafshar

yafshar commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@tvegas1 thanks for the review. All comments addressed and validated on Intel GPU (ze_copy): focused ze_cpy MD tests pass, ze_caps_and_mem_types passes, and ze_copy RMA transfer cases are enumerated but skip pending gtest mem_buffer ZE allocation support (#11321).

Comment thread test/gtest/uct/ze/test_ze.cc Outdated
Comment thread test/gtest/uct/test_md.cc Outdated
- Drop redundant GET_ZCOPY/PUT_ZCOPY checks in ze_caps_and_mem_types;
  they are already guaranteed by UCS_TEST_SKIP_COND_P.
- Merge mem_query_dmabuf_offset into mem_query_dmabuf by looping over
  offsets {0, 128}, preserving negative and error-path coverage.

Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
tvegas1
tvegas1 previously approved these changes Jul 9, 2026
@yafshar

yafshar commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@tvegas1 can we merge this PR?

@yafshar

yafshar commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Hi @yosefe @tvegas1 just a gentle follow‑up. Can we merge this PR?

@brminich brminich left a comment

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 all affected files with Intel copyright

Comment thread test/gtest/uct/test_md.cc
@yafshar

yafshar commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

pls update all affected files with Intel copyright

@brminich thanks — Intel copyright added to all files touched by this PR.

Also resolved a conflict merging master.

One update on my earlier note: now that #11321 is merged, gtest mem_buffer
supports ZE allocation, so the ze_copy RMA transfer cases actually execute
instead of skipping. Re-verified on Intel GPU — ZE RMA transfer cases,
ze_caps_and_mem_types, and the ze_copy MD tests all pass.

Ready to merge from my side.

@yafshar
yafshar requested a review from brminich August 7, 2026 16:46
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