Add Python bindings for SYCL IPC memory via dpctl#2331
Merged
Conversation
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
83bb9b4 to
b2c490f
Compare
Collaborator
a626c94 to
7f907d0
Compare
2b2a3ec to
0a67e67
Compare
zxue2
commented
Jul 6, 2026
antonwolfy
reviewed
Jul 6, 2026
Contributor
Author
|
also add fix about "Remove unnecessary context parameters" |
Collaborator
|
@zxue2 |
ndgrigorian
previously approved these changes
Jul 7, 2026
ndgrigorian
left a comment
Collaborator
There was a problem hiding this comment.
aside from above changes LGTM
Contributor
Author
Please kindly check "public IPC class and update the docs" |
ndgrigorian
previously approved these changes
Jul 8, 2026
ndgrigorian
left a comment
Collaborator
There was a problem hiding this comment.
LGTM if no more comments from @antonwolfy
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>
add has_aspect_ext_oneapi_ipc_memory checks in __init__ and open() Signed-off-by: Zhan Xue <zhan.xue@intel.com>
Signed-off-by: Zhan Xue <zhan.xue@intel.com>
create_ipc_from_usm_pointer_size_qref(): Wrap the MemoryIPCDevice construction in try/except. On failure, null base._memory_ptr to signal that __dealloc__ already closed the handle. On success, null base._memory_ptr to prevent base's own dealloc from touching it. Also null _memory_ptr in the SyclQueueCreationError path so the caller knows it still owns the handle. IPCMemoryHandle.open(): Split the single try/except into two: - SyclQueue creation failure: handle not yet transferred, close it. - create_ipc_from_usm_pointer_size_qref raises ValueError: failed before construction (queue copy), handle not closed, close it. - Any other exception from construction: __dealloc__ already closed the handle, do NOT close again. Signed-off-by: Zhan Xue <zhan.xue@intel.com>
Signed-off-by: Zhan Xue <zhan.xue@intel.com>
Signed-off-by: Zhan Xue <zhan.xue@intel.com>
antonwolfy
reviewed
Jul 8, 2026
antonwolfy
approved these changes
Jul 8, 2026
antonwolfy
left a comment
Collaborator
There was a problem hiding this comment.
Thank you @zxue2, no more comments from me
ndgrigorian
approved these changes
Jul 8, 2026
Signed-off-by: Zhan Xue <zhan.xue@intel.com>
Signed-off-by: Zhan Xue <zhan.xue@intel.com>
Signed-off-by: Zhan Xue <zhan.xue@intel.com>
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).
C API (libsyclinterface):
Cython declarations:
Python subpackage (dpctl.ipc):
Test In Docker (oneAPI 2026.0 installed):