From e4409ffeec621e6ccdf9ac14f8bfcade17b27885 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 10 Aug 2026 17:22:11 -0700 Subject: [PATCH 1/3] remove NumPy as build dependency --- .github/workflows/coverity.yml | 2 +- conda-recipe/conda_build_config.yaml | 2 -- conda-recipe/meta.yaml | 1 - docs/doc_sources/contributor_guides/building.rst | 2 +- dpctl/CMakeLists.txt | 3 --- examples/cython/sycl_buffer/CMakeLists.txt | 3 +-- examples/cython/use_dpctl_sycl/CMakeLists.txt | 3 +-- examples/pybind11/external_usm_allocation/CMakeLists.txt | 2 +- examples/pybind11/onemkl_gemv/CMakeLists.txt | 2 +- examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt | 2 +- examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt | 2 +- pyproject.toml | 1 - requirements.txt | 1 - 13 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index d1aeda61cf..a8e401a43b 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -57,7 +57,7 @@ jobs: - name: Install dpctl dependencies run: | - pip install numpy cython setuptools"<80" scikit-build cmake ninja versioneer[toml]==0.29 + pip install cython setuptools"<80" scikit-build cmake ninja versioneer[toml]==0.29 - name: Report compiler version run: | diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml index b9b33386e1..58d529f89f 100644 --- a/conda-recipe/conda_build_config.yaml +++ b/conda-recipe/conda_build_config.yaml @@ -8,8 +8,6 @@ python: - "3.14.* *_cp314t" - "3.15.* *_cp315" - "3.15.* *_cp315t" -numpy: - - '2' c_compiler: # [linux] - gcc # [linux] cxx_compiler: # [linux] diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index dc1095d3d1..43ac0a59d1 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -39,7 +39,6 @@ requirements: - scikit-build >=0.17.0,<1.0 - cython >=3.1.0 # [py>=313] - cython >=3.0.10 # [py<313] - - numpy # WARNING: check with doc how to upgrade - versioneer ==0.29 # versioneer dependency diff --git a/docs/doc_sources/contributor_guides/building.rst b/docs/doc_sources/contributor_guides/building.rst index c9f3036d0f..4a7625a401 100644 --- a/docs/doc_sources/contributor_guides/building.rst +++ b/docs/doc_sources/contributor_guides/building.rst @@ -88,11 +88,11 @@ Build and Install with scikit-build To build using Python ``setuptools`` and ``scikit-build``, install the following Python packages: - ``cython`` -- ``numpy`` - ``cmake`` - ``scikit-build`` - ``ninja`` - ``versioneer`` +- ``numpy`` (runtime dependency) - ``gtest`` (optional to run C API tests) - ``gmock`` (optional to run C API tests) - ``pytest`` (optional to run Python API tests) diff --git a/dpctl/CMakeLists.txt b/dpctl/CMakeLists.txt index 069e75d11c..bd2f3dcf93 100644 --- a/dpctl/CMakeLists.txt +++ b/dpctl/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(Python REQUIRED COMPONENTS NumPy) - # -t is to only Cythonize sources with timestamps newer than existing CXX files (if present) # -w is to set working directory (and correctly set __pyx_f[] array of filenames) set(CYTHON_FLAGS "-t -w \"${CMAKE_SOURCE_DIR}\"") @@ -135,7 +133,6 @@ function(build_dpctl_ext _trgt _src _dest) ) endif() endif() - target_link_libraries(${_trgt} PRIVATE Python::NumPy) if (DPCTL_GENERATE_COVERAGE) target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1) if (BUILD_DPCTL_EXT_SYCL) diff --git a/examples/cython/sycl_buffer/CMakeLists.txt b/examples/cython/sycl_buffer/CMakeLists.txt index a30fbb2f35..1f0b2db910 100644 --- a/examples/cython/sycl_buffer/CMakeLists.txt +++ b/examples/cython/sycl_buffer/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) # Define CMAKE_INSTALL_xxx: LIBDIR, INCLUDEDIR include(GNUInstallDirs) -find_package(Python REQUIRED COMPONENTS Development.Module NumPy) +find_package(Python REQUIRED COMPONENTS Development.Module) find_package(Dpctl REQUIRED) # -w is to set working directory (and correctly set __pyx_f[] array of filenames) @@ -29,7 +29,6 @@ add_cython_target(${py_module_name} ${_cy_source} CXX OUTPUT_VAR _generated_cy_s Python_add_library(${py_module_name} MODULE WITH_SOABI ${_generated_cy_src}) add_sycl_to_target(TARGET ${py_module_name} SOURCES ${_generated_cy_src}) target_include_directories(${py_module_name} PUBLIC src ${Dpctl_INCLUDE_DIRS}) -target_link_libraries(${py_module_name} PRIVATE Python::NumPy) install(TARGETS ${py_module_name} DESTINATION syclbuffer) diff --git a/examples/cython/use_dpctl_sycl/CMakeLists.txt b/examples/cython/use_dpctl_sycl/CMakeLists.txt index 9445ae08f3..f23a1017e0 100644 --- a/examples/cython/use_dpctl_sycl/CMakeLists.txt +++ b/examples/cython/use_dpctl_sycl/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) # Define CMAKE_INSTALL_xxx: LIBDIR, INCLUDEDIR include(GNUInstallDirs) -find_package(Python REQUIRED COMPONENTS Development.Module NumPy) +find_package(Python REQUIRED COMPONENTS Development.Module) find_package(Dpctl REQUIRED) # -w is to set working directory (and correctly set __pyx_f[] array of filenames) @@ -29,7 +29,6 @@ add_cython_target(${py_module_name} ${_cy_source} CXX OUTPUT_VAR _generated_cy_s Python_add_library(${py_module_name} MODULE WITH_SOABI ${_generated_cy_src}) add_sycl_to_target(TARGET ${py_module_name} SOURCES ${_generated_cy_src}) target_include_directories(${py_module_name} PUBLIC include ${Dpctl_INCLUDE_DIRS}) -target_link_libraries(${py_module_name} PRIVATE Python::NumPy) install(TARGETS ${py_module_name} DESTINATION use_dpctl_sycl) diff --git a/examples/pybind11/external_usm_allocation/CMakeLists.txt b/examples/pybind11/external_usm_allocation/CMakeLists.txt index e3ef19d199..9065ab7568 100644 --- a/examples/pybind11/external_usm_allocation/CMakeLists.txt +++ b/examples/pybind11/external_usm_allocation/CMakeLists.txt @@ -20,7 +20,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(pybind11) -find_package(Python REQUIRED COMPONENTS Development.Module NumPy) +find_package(Python REQUIRED COMPONENTS Development.Module) find_package(Dpctl REQUIRED) set(py_module_name _external_usm_alloc) diff --git a/examples/pybind11/onemkl_gemv/CMakeLists.txt b/examples/pybind11/onemkl_gemv/CMakeLists.txt index 5a41b021b2..d70767b802 100644 --- a/examples/pybind11/onemkl_gemv/CMakeLists.txt +++ b/examples/pybind11/onemkl_gemv/CMakeLists.txt @@ -24,7 +24,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(pybind11) -find_package(Python REQUIRED COMPONENTS Development.Module NumPy) +find_package(Python REQUIRED COMPONENTS Development.Module) find_package(Dpctl REQUIRED) find_package(TBB REQUIRED) diff --git a/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt b/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt index 77b26749fc..cd10de3973 100644 --- a/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt +++ b/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt @@ -20,7 +20,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(pybind11) -find_package(Python REQUIRED COMPONENTS Development.Module NumPy) +find_package(Python REQUIRED COMPONENTS Development.Module) find_package(Dpctl REQUIRED) set(py_module_name _use_kernel) diff --git a/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt b/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt index b3a16c6f62..92a8b36e56 100644 --- a/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt +++ b/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt @@ -20,7 +20,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(pybind11) -find_package(Python REQUIRED COMPONENTS Development.Module NumPy) +find_package(Python REQUIRED COMPONENTS Development.Module) find_package(Dpctl REQUIRED) set(py_module_name _use_queue_device) diff --git a/pyproject.toml b/pyproject.toml index 8b1ad79d77..15ecd23bb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ requires = [ "ninja>=1.11.1; platform_system!='Windows'", "cmake>=3.29.0", "cython>=3.1.0", - "numpy >=1.26.0", # WARNING: check with doc how to upgrade "versioneer[toml]==0.29" ] diff --git a/requirements.txt b/requirements.txt index d95e5a8ffd..0ab06b070b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ setuptools cython -numpy wheel From f98b9cf14f620960b6c707082d83303f673efeb0 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 2 Dec 2026 13:14:50 -0800 Subject: [PATCH 2/3] add gh-2436 to the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36469b7c3f..4b3d93b198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `import_dpctl()` now returns 0 on success and -1 with a Python exception set on failure, and `dpctl4pybind11.hpp` raises that exception rather than failing on the first C-API call [gh-2359](https://github.com/IntelPython/dpctl/pull/2359) * The event returned by `dpctl.SyclQueue.keep_args_alive`, `dpctl::utils::keep_args_alive` and `dpctl.SyclQueue._submit_keep_args_alive` is now for an empty kernel that gates the deferred release rather than for a `host_task` that performs it, so its completion means that the objects are no longer in use rather than that they have been released [gh-2359](https://github.com/IntelPython/dpctl/pull/2359) * `dpctl.utils.SequentialOrderManager[q].submitted_events` includes the queue's last event for in-order queues when `sycl_ext_oneapi_in_order_queue_events` is available, and `wait()` waits for all work on an in-order queue [gh-2299](https://github.com/IntelPython/dpctl/pull/2299) +* NumPy is no longer a build dependency of `dpctl`, only a run-time dependency [gh-2436](https://github.com/IntelPython/dpctl/pull/2436) ### Deprecated * Deprecated `dpctl.SyclQueue._submit_keep_args_alive` in favor of `dpctl.SyclQueue.keep_args_alive`, which it now calls and which behaves identically [gh-2359](https://github.com/IntelPython/dpctl/pull/2359) From ef2dbe0f86574cf41f32c0acf1c74be24bff98d2 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 2 Dec 2026 14:06:34 -0800 Subject: [PATCH 3/3] find the Python interpreter in examples The NumPy component brought in Interpreter implicitly; without it FindPython does not detect the free-threaded ABI and fails on 3.15t. --- examples/cython/sycl_buffer/CMakeLists.txt | 2 +- examples/cython/use_dpctl_sycl/CMakeLists.txt | 2 +- examples/pybind11/external_usm_allocation/CMakeLists.txt | 2 +- examples/pybind11/onemkl_gemv/CMakeLists.txt | 2 +- examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt | 2 +- examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/cython/sycl_buffer/CMakeLists.txt b/examples/cython/sycl_buffer/CMakeLists.txt index 1f0b2db910..2c0af86d71 100644 --- a/examples/cython/sycl_buffer/CMakeLists.txt +++ b/examples/cython/sycl_buffer/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) # Define CMAKE_INSTALL_xxx: LIBDIR, INCLUDEDIR include(GNUInstallDirs) -find_package(Python REQUIRED COMPONENTS Development.Module) +find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) find_package(Dpctl REQUIRED) # -w is to set working directory (and correctly set __pyx_f[] array of filenames) diff --git a/examples/cython/use_dpctl_sycl/CMakeLists.txt b/examples/cython/use_dpctl_sycl/CMakeLists.txt index f23a1017e0..2f36dfeedf 100644 --- a/examples/cython/use_dpctl_sycl/CMakeLists.txt +++ b/examples/cython/use_dpctl_sycl/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) # Define CMAKE_INSTALL_xxx: LIBDIR, INCLUDEDIR include(GNUInstallDirs) -find_package(Python REQUIRED COMPONENTS Development.Module) +find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) find_package(Dpctl REQUIRED) # -w is to set working directory (and correctly set __pyx_f[] array of filenames) diff --git a/examples/pybind11/external_usm_allocation/CMakeLists.txt b/examples/pybind11/external_usm_allocation/CMakeLists.txt index 9065ab7568..9249caa7b1 100644 --- a/examples/pybind11/external_usm_allocation/CMakeLists.txt +++ b/examples/pybind11/external_usm_allocation/CMakeLists.txt @@ -20,7 +20,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(pybind11) -find_package(Python REQUIRED COMPONENTS Development.Module) +find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) find_package(Dpctl REQUIRED) set(py_module_name _external_usm_alloc) diff --git a/examples/pybind11/onemkl_gemv/CMakeLists.txt b/examples/pybind11/onemkl_gemv/CMakeLists.txt index d70767b802..2fc8161a64 100644 --- a/examples/pybind11/onemkl_gemv/CMakeLists.txt +++ b/examples/pybind11/onemkl_gemv/CMakeLists.txt @@ -24,7 +24,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(pybind11) -find_package(Python REQUIRED COMPONENTS Development.Module) +find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) find_package(Dpctl REQUIRED) find_package(TBB REQUIRED) diff --git a/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt b/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt index cd10de3973..85136e6385 100644 --- a/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt +++ b/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt @@ -20,7 +20,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(pybind11) -find_package(Python REQUIRED COMPONENTS Development.Module) +find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) find_package(Dpctl REQUIRED) set(py_module_name _use_kernel) diff --git a/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt b/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt index 92a8b36e56..5052a69c8b 100644 --- a/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt +++ b/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt @@ -20,7 +20,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(pybind11) -find_package(Python REQUIRED COMPONENTS Development.Module) +find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) find_package(Dpctl REQUIRED) set(py_module_name _use_queue_device)