Add Python bindings for SYCL IPC memory via dpctl#2331
Open
zxue2 wants to merge 5 commits into
Open
Conversation
Add inter-process communication (IPC) support for SYCL USM memory, enabling
zero-copy GPU memory sharing across processes. It wraps
sycl::ext::oneapi::experimental::ipc::memory (get/open/close/put).
C API (libsyclinterface):
- dpctl_sycl_ipc_memory_interface.h: declares DPCTLIPCMem_GetHandle,
DPCTLIPCMem_OpenHandle, DPCTLIPCMem_CloseHandle, DPCTLIPCMem_FreeHandleData
- dpctl_sycl_ipc_memory_interface.cpp: implements the C API by calling the
SYCL experimental ipc::memory functions; auto-discovered by CMake.
Cython declarations:
- _backend.pxd: extern block for the 4 new C functions
Python subpackage (dpctl.ipc):
- IPCMemoryHandle: Cython extension class wrapping IPC memory export/import
__init__(usm_memory): calls get() + put(), stores handle as bytes
to_bytes(): serializable payload for cross-process transport
open(handle_bytes, device, nbytes): returns MemoryUSMDevice
close_mapping(usm_memory): explicitly closes an IPC mapping
Signed-off-by: Zhan Xue <zhan.xue@intel.com>
ndgrigorian
reviewed
Jun 30, 2026
ndgrigorian
reviewed
Jun 30, 2026
ndgrigorian
reviewed
Jun 30, 2026
ndgrigorian
reviewed
Jun 30, 2026
ndgrigorian
reviewed
Jun 30, 2026
add has_aspect_ext_oneapi_ipc_memory checks in __init__ and open() Signed-off-by: Zhan Xue <zhan.xue@intel.com>
Collaborator
a626c94 to
7f907d0
Compare
Signed-off-by: Zhan Xue <zhan.xue@intel.com>
ce669ed to
2b2a3ec
Compare
2b2a3ec to
0a67e67
Compare
zxue2
commented
Jul 6, 2026
|
|
||
| Parameters | ||
| ---------- | ||
| usm_memory : MemoryUSMDevice |
Author
There was a problem hiding this comment.
Is it better to use the new MemoryIPCDevice based on MemoryUSMDevice?
One more thing, I am fine with current implementation which can satisfy current demand. But restricting MemoryIPCDevice to base MemoryUSMDevice may lack extension for zeMemGetIpcHandleWithProperties that is with device or host memory allocation in future. May have a separate jira there for improvement in future.
Collaborator
There was a problem hiding this comment.
I figured we can extend to add additional classes later for host/shared allocations, so yes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add inter-process communication (IPC) support for SYCL USM memory, enabling zero-copy GPU memory sharing across processes. It wraps sycl::ext::oneapi::experimental::ipc::memory (get/open/close/put).
C API (libsyclinterface):
Cython declarations:
Python subpackage (dpctl.ipc):
Test In Docker (oneAPI 2026.0 installed):