Python SYCL bindings and SYCL-based Python Array API library
Repo IntelPython/dpctl, read from GitHub 29 min ago. IntelPython has not joined Take My Repo.
This release extends the SYCL interface exposed by dpctl in several directions: dpctl.compiler.SyclKernelBundle objects can now be built from SYCL source strings via the DPC++ kernel_compiler extension, SPIR-V specialization constants are supported, USM-device allocations can be shared between processes using the SYCL IPC memory extension, and dpctl.SyclQueue gained copy, memset, and fill methods along with their asynchronous counterparts. The package can now be used with free-threaded builds of CPython 3.14 and supports Python 3.15. The dpctl.program submodule is deprecated in favor of dpctl.compiler, which better describes its purpose.
NOTE: This release contains breaking changes:
dpctl.SyclDevice.sub_group_sizes, return a tuple instead of a list gh-2322dpctl.SyclDevice.sub_group_independent_forward_progress property and DPCTLDevice_GetSubGroupIndependentForwardProgress C-API function were removed gh-2353DPCTLKernelBundle_CreateFromSpirv C-API function changed gh-2304DPCTLPartitionAffinityDomainType enumerators shifted, as DPCTL_PARTITION_AFFINITY_DOMAIN_UNKNOWN was added as the zero value gh-2324SyclProgram names in the dpctl Python C-API and dpctl4pybind11.hpp were renamed to SyclKernelBundle ones (e.g. PySyclProgramObject to PySyclKernelBundleObject, SyclProgram_Make to SyclKernelBundle_Make) without keeping aliases, while the Python names remain available as deprecated aliases gh-2291dpctl.program submodule was removed gh-2317dpctl.compiler.create_kernel_bundle_from_sycl_source, dpctl.compiler.is_sycl_source_compilation_available, and dpctl.SyclDevice.can_compile for creating dpctl.compiler.SyclKernelBundle objects from SYCL source strings via the DPC++ kernel_compiler extension, as well as corresponding C-API functions gh-2206dpctl.SyclQueue.copy and dpctl.SyclQueue.copy_async methods gh-2273DPCTLQueue_CopyData and DPCTLQueue_CopyDataWithEvents C-API functions to support dpctl.SyclQueue.copy and dpctl.SyclQueue.copy_async gh-2273dpctl.compiler.SpecializationConstant and the specializations keyword of dpctl.compiler.create_kernel_bundle_from_spirv, as well as dpctl.compiler.utils submodule for inspecting them gh-2304sycl::device info queries to dpctl.SyclDevice gh-2324dpctl.memory.MemoryIPCDevice and dpctl.memory.IPCMemoryHandle, along with SyclIPCGetMemHandle, SyclIPCOpenMemHandle, and SyclIPCCloseMemHandle functions, for sharing USM-device allocations between processes, as well as supporting C-API functions and the dpctl.SyclDevice.has_aspect_ext_oneapi_ipc_memory aspect query gh-2331sycl::info::context queries sycl_platform, atomic_memory_order_capabilities, atomic_fence_order_capabilities, atomic_memory_scope_capabilities, and atomic_fence_scope_capabilities to dpctl.SyclContext gh-2354dpctl.SyclQueue.memset and dpctl.SyclQueue.memset_async methods gh-2361DPCTLQueue_MemsetWithEvents C-API function to support dpctl.SyclQueue.memset_async gh-2361dpctl.SyclQueue.fill and dpctl.SyclQueue.fill_async methods gh-2365DPCTLQueue_Fill8/16/32/64/128WithEvents C-API functions to support dpctl.SyclQueue.fill_async gh-2365dpctl.program.SyclProgram to dpctl.compiler.SyclKernelBundle, SyclProgramCompilationError to SyclKernelBundleCompilationError, and create_program_from_source/create_program_from_spirv to create_kernel_bundle_from_source/create_kernel_bundle_from_spirv, with corresponding renaming in the dpctl Python C-API (e.g. PySyclKernelBundleObject, SyclKernelBundle_Make) and dpctl4pybind11.hpp gh-2291, gh-2317dpctl.SyclPlatform.get_devices now queries automatic and custom device types instead of returning no devices, as the work-around for the DPC++ bug is no longer needed gh-2303DPCTLKernelBundle_CreateFromSpirv C-API function now also takes an array of DPCTLSpecConst specialization constants gh-2304dpctl.get_devices and dpctl.SyclPlatform.get_devices, as well as dpctl.SyclDevice.sub_group_sizes, now return a tuple instead of a list gh-2322DPCTL_PARTITION_AFFINITY_DOMAIN_UNKNOWN as the first enumerator (= 0) of DPCTLPartitionAffinityDomainType, used when the SYCL runtime reports an unrecognized partition affinity domain; this shifts the values of the existing enumerators gh-2324dpctl.program.SyclProgram and dpctl.program.SyclProgramCompilationError in favor of dpctl.compiler.SyclKernelBundle and dpctl.compiler.SyclKernelBundleCompilationError; the old names are kept as aliases that emit a DeprecationWarning gh-2291, gh-2317dpctl.program.create_program_from_source and dpctl.program.create_program_from_spirv in favor of dpctl.compiler.create_kernel_bundle_from_source and dpctl.compiler.create_kernel_bundle_from_spirv; the old functions are kept as aliases that emit a DeprecationWarning gh-2291, gh-2317dpctl.program submodule in favor of dpctl.compiler, which provides a better description of the purpose of the submodule in exposing DPC++ compilation-related functionality gh-2317DPCTL_ENABLE_L0_PROGRAM_CREATION CMake option in favor of DPCTL_ENABLE_L0_KERNEL_BUNDLE_CREATION gh-2317platform_typeid_lookup from dpctl4pybind11.hpp gh-2286dpctl.program submodule, as the submodule is now deprecated, with functionality migrated to dpctl.compiler gh-2317dpctl.SyclDevice.sub_group_independent_forward_progress property and the corresponding DPCTLDevice_GetSubGroupIndependentForwardProgress C-API function gh-2353dpctl.SyclDevice.create_sub_devices gh-2285TypeError messages raised by dpctl.WorkGroupMemory and dpctl.RawKernelArg constructors, as well as of error messages raised by dpctl.SyclQueue methods gh-2290GetLevelZeroHeaders.cmake gh-2366dpctl.memory.MemoryUSMShared.memset call in the "Heterogeneous Systems and Programming Concepts" user guide gh-2368dpctl.compiler.SyclKernelBundle.get_sycl_kernel now raises ValueError instead of returning a kernel wrapping a null reference, which deferred the failure to the submission of the kernel; dpctl.SyclQueue.submit and dpctl.SyclQueue.submit_async now raise ValueError when the number of arguments does not match the number of kernel arguments, instead of appearing to succeed; and submitting an invalid kernel now raises dpctl.SyclKernelSubmitError gh-2382dpctl.utils.SequentialOrderManager gh-2250str.format with f-strings gh-2282, and constructors of empty Python containers with literals gh-2289pre-commit hooks, including codespell, shellcheck, gitleaks, and actionlint gh-2285IntelSYCLConfig.cmake and dpctl targets to suppress deprecation warnings coming from compiler headers on Windows gh-2334opencl-headers as a Windows host requirement of the conda recipe gh-2349dpctl and examples gh-2357conda-recipe-cf recipe and a workflow for building and testing dpctl with conda-forge packages only gh-2367, gh-2383asv benchmark suite for dpctl, along with a benchmark optional dependency group in pyproject.toml gh-2378Coverity Scan workflow that builds dpctl with the DPC++ compiler under cov-build and submits the results to Coverity Scan gh-2379This is a bug-fix release which fixes a memory leak in dpctl.RawKernelArg gh-2294.
The highlight of this release is the full migration of dpctl.tensor submodule to sister project dpnp, shrinking the size of the package tremendously, by between 93% and 96%. The __sycl_usm_array_interface__ is still supported, with dpctl serving as curator of the protocol.
Additionally, dpctl build scripts were updated, removing use of python setup.py develop and python setup.py install, and dpctl documentation page now supports a version dropdown.
NOTE: Changes below which reference tensor were added to the tensor submodule prior to release, and therefore are included in the migrated tensor submodule in dpnp. They are included here for transparency and continuity of the submodule's history in the changelog.
dpctl.tensor submodule, with all tensor functionality migrated to dpnp gh-2245--clean). Options can be seen by calling --help, for example, python scripts/build_locally.py --help from the repository root gh-2172dpctl using a custom drop-down for version selection and a --multiversion option for documentation build helper script gh-2276tensor.astype for boolean arrays gh-2158tensor DLPack version to v1.2 gh-2193, gh-2219tensor.usm_ndarray per Python Array API specification gh-2223, gh-2229DPCTLSyclInterface.dll when building dpctl Conda package on Windows gh-2167SyclContextCreationError and SyclDeviceCreationError exception text gh-2169tensor.roll test gh-2220tensor.cumulative_logsumexp to return incorrect results gh-2275dpctl in-place gh-2160python setup.py develop and python setup.py install throughout the project, as they were deprecated and are no longer supported gh-2172, gh-2227dpctl.tensor, opting to simplify the examples and rely on dpctl.memory objects which wrap USM allocations. Examples which could not be reasonably rewritten were removed gh-2245This release is identical to 0.21.0 in terms of features.
This release adjusts conda recipes and metadata to release dpctl for Python 3.14, and deprecates dpctl.tensor. In the future, all tensor functionality will be moved to dpnp. For now, a DeprecationWarning is shown when importing dpctl.tensor or from dpctl.tensor.
python-gil to package metadata, as free-threaded Python is not yet supported gh-2173dpctl.tensor module pending move to dpnp gh-2191This release features the addition of new function tensor.isin, indexing of tensor.usm_ndarray with numpy.ndarray, and support for building dpctl for specific CUDA architectures.
Improvements were also made to the build time and binary size of the project, and to the build driver script, making it more convenient when building for CUDA or AMD devices.
tensor.isin per future Python Array API specification version gh-2098numpy.ndarrays are now permitted when indexing on tensor.usm_ndarray gh-2128DPCTL_TARGET_CUDA and DPCTL_TARGET_HIP now permit specifying the CUDA or HIP architectures gh-2096, gh-2099build_locally.py build driver script to permit --target-cuda and --target-hip options, which match the behavior of DPCTL_TARGET_CUDA and DPCTL_TARGET_HIP gh-2109tensor.asnumpy and tensor.to_numpy for size-0 arrays gh-2120tensor.usm_ndarray to arbitrary dtype via tensor.usm_ndarray constructor's buffer keyword (i.e., using the original memory as the buffer for the new size-0 array's underlying memory) gh-2123tensor.asarray failing when given device keyword with an input array of a dtype not supported by device gh-2097tensor.sort and tensor.argsort on size-1 arrays, or along a size-1 axis gh-2106dpt.astype on tensor.usm_ndarray constructed from a boolean view into a numpy.ndarray gh-2122dpctl imported in virtual environment on Windows failing to see devices or find DLLs gh-2130dpctl Cython API extensions with an editable install gh-2147tensor.DLDeviceType documentation from __dlpack_device__ docstring gh-2127This release is identical to 0.20.1 in terms of features
This release adds metadata and conda recipe changes intended for releasing the dpctl package with Python 3.13