Draft
Conversation
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.
Summary
This is a draft PR for an initial in-tree
ishmem4pyimplementation. If Python bindings are enabled with-DBUILD_PYTHON_BINDINGS=ON, it will build a small shared object shim layer. The built Python package can then be installed from the build directory.This draft currently only has basic functionality
shmem_malloc/shmem_freeputmem/getmemArchitecture
The binding layer is built around a small in-tree runtime shim,
_ishmem4py_runtime.so, rather than trying to bind directly to a stock Intel SHMEM install. If Intel SHMEM later adds a shared library build, we would likely use that directly.The shim:
ishmemCMake buildishmem-staticextern "C"ABI for PythonOn the Python side,
ishmem4pyis currently a thinctypeswrapper over that shim. For standard installs, the built runtime.sois bundled into the Python package; for editable/dev installs, the runtime can be overridden withISHMEM4PY_RUNTIME_LIBRARY.Building the bindings
The build should be performed as described in
README.md, with the-DBUILD_PYTHON_BINDINGS=ONadded. On my Ubuntu 24.04 system, I also needed-DENABLE_AOT_COMPILATION=OFFdue to an outdatedintel-oclocpackage.Then, it's usually easiest to install the Python package inside a conda environment. I also show the torch+xpu package install below. This is not strictly necessary, but the bindings will likely integrate with torch in the future.