From 00d7d2723e9e1244657fde46b5ad43c7c2be45ff Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 10 Aug 2026 17:22:11 -0700 Subject: [PATCH 1/4] 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 bbfba61e14..5d860e1076 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"<1.0" cmake ninja versioneer[toml]==0.29 + pip install cython setuptools"<80" scikit-build"<1.0" 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 c1ff6fabaf..2a59da40d5 100644 --- a/conda-recipe/conda_build_config.yaml +++ b/conda-recipe/conda_build_config.yaml @@ -7,8 +7,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 0a4459221f..c911d9b5cc 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 run: diff --git a/docs/doc_sources/contributor_guides/building.rst b/docs/doc_sources/contributor_guides/building.rst index 2a184c6bf6..0bfb57c0d3 100644 --- a/docs/doc_sources/contributor_guides/building.rst +++ b/docs/doc_sources/contributor_guides/building.rst @@ -89,11 +89,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 4ba314f5b4..f095742514 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}\"") @@ -138,7 +136,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 fe06e30da9..bc68e21852 100644 --- a/examples/cython/sycl_buffer/CMakeLists.txt +++ b/examples/cython/sycl_buffer/CMakeLists.txt @@ -22,7 +22,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) @@ -36,7 +36,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 2b489802d9..b09648c1dc 100644 --- a/examples/cython/use_dpctl_sycl/CMakeLists.txt +++ b/examples/cython/use_dpctl_sycl/CMakeLists.txt @@ -22,7 +22,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) @@ -36,7 +36,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 da57f8c966..8428144dd5 100644 --- a/examples/pybind11/external_usm_allocation/CMakeLists.txt +++ b/examples/pybind11/external_usm_allocation/CMakeLists.txt @@ -27,7 +27,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 65e1a2c49b..b9f248212b 100644 --- a/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt +++ b/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt @@ -27,7 +27,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 ec0a02283c..167f40855e 100644 --- a/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt +++ b/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt @@ -27,7 +27,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 d5f9f0af32..2f16cecbe7 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 fc229ea13478e07d74a109df242c14f64fd6c322 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 2 Dec 2026 13:14:50 -0800 Subject: [PATCH 2/4] add gh-2436 to the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f69d1459d9..91a5d08423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * 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) * Pickled `dpctl.memory.MemoryUSMShared`, `MemoryUSMDevice`, and `MemoryUSMHost` objects keep their queue instead of being restored on the default device. Pickling memory whose queue can not be pickled raises `pickle.PicklingError` [gh-2406](https://github.com/IntelPython/dpctl/pull/2406) +* 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 6c8db42fe89bf0b16704301049ff6366c5515ee6 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 2 Dec 2026 14:06:34 -0800 Subject: [PATCH 3/4] 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 bc68e21852..cb3354ed41 100644 --- a/examples/cython/sycl_buffer/CMakeLists.txt +++ b/examples/cython/sycl_buffer/CMakeLists.txt @@ -22,7 +22,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 b09648c1dc..b085f3d60c 100644 --- a/examples/cython/use_dpctl_sycl/CMakeLists.txt +++ b/examples/cython/use_dpctl_sycl/CMakeLists.txt @@ -22,7 +22,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 8428144dd5..17c0e75b13 100644 --- a/examples/pybind11/external_usm_allocation/CMakeLists.txt +++ b/examples/pybind11/external_usm_allocation/CMakeLists.txt @@ -27,7 +27,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 b9f248212b..6cf37f15ad 100644 --- a/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt +++ b/examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt @@ -27,7 +27,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 167f40855e..8fabdb3768 100644 --- a/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt +++ b/examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt @@ -27,7 +27,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) From bfa944a9b7e179e393153d426d99b234c1116057 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Thu, 3 Dec 2026 11:27:20 -0800 Subject: [PATCH 4/4] pin numpy in conda recipe run requirements match the numpy>=2.0.0 runtime requirement in pyproject.toml, since numpy's run_exports no longer apply --- conda-recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index c911d9b5cc..77baead8ab 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -45,7 +45,7 @@ requirements: - python - {{ pin_compatible('intel-sycl-rt', min_pin='x.x', max_pin='x') }} - {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }} - - numpy + - numpy >=2.0.0 test: requires: