Skip to content

UCM/ZE/TEST: Add ZE support to gtest mem_buffer and UCM hook tests - #11321

Merged
brminich merged 20 commits into
openucx:masterfrom
intel-staging:test/ze-mem-buffer-ucm-hooks
Aug 6, 2026
Merged

UCM/ZE/TEST: Add ZE support to gtest mem_buffer and UCM hook tests#11321
brminich merged 20 commits into
openucx:masterfrom
intel-staging:test/ze-mem-buffer-ucm-hooks

Conversation

@yafshar

@yafshar yafshar commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

What?

Add Level Zero (ZE) memory support to gtest mem_buffer and introduce UCM ZE hook tests.

This PR:

  • Extends mem_buffer to support ZE host, device, and managed memory types
  • Adds ZE copy and memset handling paths to mem_buffer utilities
  • Introduces UCM ZE hook tests to validate memory alloc/free callback behavior
  • Updates gtest build rules to compile and link ZE tests and dependencies

Why?

UCX gtests already cover GPU memory handling and UCM hook behavior for other backends, but ZE memory flows were not covered in this area.

Adding ZE support and tests improves confidence that:

  • ZE memory operations are handled correctly by shared test utilities
  • UCM memory-type events are emitted as expected for ZE alloc/free APIs

How?

The change adds ZE-gated code paths under HAVE_ZE in gtest mem_buffer:

A new UCM ZE hooks gtest suite allocates and frees ZE host, device, and managed memory and verifies that matching UCM alloc/free events are generated.
Build integration is updated in gtest/Makefile.am to include the new ZE test sources and ZE compiler/linker flags when ZE support is enabled.

- Extend gtest mem_buffer with ZE host, device, and managed
  allocators, including ZE copy and memset paths, and centralize
  ZE runtime initialization.
- Add UCM ZE hook tests to validate alloc and free callbacks.
- Update gtest Makefile.am to include ZE sources and linker flags.
@yafshar
yafshar marked this pull request as ready for review April 4, 2026 14:57
@yafshar

yafshar commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

Hi @yosefe, just pinging for visibility. It’s been open for a few weeks and I wanted to check if you had a chance to look, or if there’s anything I can do to help move it forward.

@yafshar

yafshar commented May 8, 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 force-pushed the test/ze-mem-buffer-ucm-hooks branch from 01288fb to 072a8d0 Compare May 12, 2026 18:46
@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!

@tvegas1 tvegas1 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.

only minor comments

Comment thread test/gtest/common/mem_buffer.cc Outdated
Comment thread test/gtest/common/mem_buffer.cc Outdated
Comment thread test/gtest/common/mem_buffer.cc Outdated
Remove the dead HAVE_ZE guard around ZE memset case labels because
the enum values are always defined. Use UCS_TEST_ABORT instead of
UCS_TEST_SKIP in ZE allocate() paths for consistency with memset and
copy_between handling. Also drop the duplicate -lze_loader from
gtest_LDADD since it is already included in ZE_LIBS.

Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
@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 merged commit 9f05e5c into openucx:master Aug 6, 2026
161 checks passed
@yafshar
yafshar deleted the test/ze-mem-buffer-ucm-hooks branch August 6, 2026 11:47
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.

3 participants