Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ extend-ignore =

per-file-ignores =
__init__.py: E402, F401
dpnp/dpnp_algo/__init__.py: F401
dpnp/fft/__init__.py: F401
dpnp/linalg/__init__.py: F401
dpnp/random/__init__.py: F401
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,6 @@ jobs:
make html
working-directory: doc

- name: Set a project number to current release
run: |
PROJECT_NUMBER=$(git describe --tags --abbrev=0)
export PROJECT_NUMBER

echo "PROJECT_NUMBER=${PROJECT_NUMBER}"
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_ENV"

- name: Build backend docs
uses: mattnotmitt/doxygen-action@b84fe17600245bb5db3d6c247cc274ea98c15a3b # v1.12
with:
working-directory: 'dpnp/backend/doc'

- name: Copy backend docs
run: cp -r dpnp/backend/doc/html ${{ env.PUBLISH_DIR }}/backend_doc

# Detect if this is a fork PR
- name: Check if fork PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: With these steps gone, backend_doc/ is no longer built, but publishing to . keeps the files already on gh-pages. So https://intelpython.github.io/dpnp/backend_doc/ will keep serving the docs of the removed backend, with nothing linking to it. Could it be deleted from gh-pages once this is merged?

id: check_fork
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/os-llvm-sycl-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
python scripts/build_locally.py --c-compiler=clang --cxx-compiler=clang++ \
--compiler-root="${SYCL_BUNDLE_FOLDER}/dpcpp_compiler/bin" \
--onemath \
--cmake-opts="-DIntelSYCL_DIR=${GITHUB_WORKSPACE}/dpnp/backend/cmake/Modules" || exit 1
--cmake-opts="-DIntelSYCL_DIR=${GITHUB_WORKSPACE}/cmake/Modules" || exit 1

- name: Smoke test
run: |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ example3
# moved cmake scripts
dpnp/resources/cmake

*dpnp_backend*
dpnp/include/dpnp/tensor/*.h
dpnp/**/*.pyd
*~
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ repos:
rev: 0.29.2
hooks:
- id: gersemi
exclude: "dpnp/backend/cmake/Modules/"
exclude: "cmake/Modules/"
args: ["-i", "-l", "88", "--no-warn-about-unknown-commands"]
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.22.1
Expand Down
1 change: 0 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ Read the `AGENTS.md` nearest the files you change. When editing these files, eve
- [dpnp/AGENTS.md](dpnp/AGENTS.md): Python layer, adding a function, docstrings
- [dpnp/tests/AGENTS.md](dpnp/tests/AGENTS.md): test helpers, fp64, CuPy tests, running the suite
- [dpnp/libtensor/AGENTS.md](dpnp/libtensor/AGENTS.md): libtensor kernels, pybind11 SYCL modules and extensions, C++ rules, build options
- [dpnp/backend/AGENTS.md](dpnp/backend/AGENTS.md): legacy `dpnp_backend_c`
- [dpnp/tensor/AGENTS.md](dpnp/tensor/AGENTS.md): `dpnp.tensor`
- [doc/AGENTS.md](doc/AGENTS.md): Sphinx docs
- [benchmarks/AGENTS.md](benchmarks/AGENTS.md): ASV benchmarks
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ This release drops support for Python 3.10, making Python 3.11 the minimum requi
* Changed `dpnp.median`, `dpnp.nanmedian` and `dpnp.partition` with a single `kth` to use a radix select instead of a full sort for all but complex data types and, on a GPU, `dpnp.partition` of rows of 65 to 128 elements of 8-byte integers [#3138](https://github.com/IntelPython/dpnp/pull/3138)
* Improved performance of `dpnp.top_k` and `dpnp.tensor.top_k` on a GPU for batches of rows of 65536 to about 10^6 elements that occupy it with a work-group per row [#3138](https://github.com/IntelPython/dpnp/pull/3138)
* Reimplemented `dpnp.random.RandomState` and the `dpnp.random` functions on device kernels, drawing on the queue of the generator. `device`, `usm_type` and `sycl_queue` are now keyword-only, `usm_type` defaults to the USM type of the array parameters, `randint(dtype=int)` returns `int64` and `shuffle` requires a `dpnp.ndarray` or `usm_ndarray` [#3162](https://github.com/IntelPython/dpnp/pull/3162)
* Moved the vendored CMake modules of `IntelSYCL`, `MKL`, `TBB` and `oneDPL` from `dpnp/backend/cmake/Modules` to `cmake/Modules` [#3163](https://github.com/IntelPython/dpnp/pull/3163)

### Deprecated

Expand All @@ -52,6 +53,10 @@ This release drops support for Python 3.10, making Python 3.11 the minimum requi
* Dropped support for Python 3.10 [#3173](https://github.com/IntelPython/dpnp/pull/3173)
* Removed the `USE_GROUP_LOAD_STORE` macro from the libtensor header `utils/sycl_utils.hpp`, so `sub_group_load` and `sub_group_store` always use the `sycl_ext_oneapi_group_load_store` extension; the `sycl::sub_group` member load/store fallback it selected does not compile with DPC++ 2026.0, the minimum supported compiler [#3174](https://github.com/IntelPython/dpnp/pull/3174)
* Removed the legacy implementation of `dpnp.partition` from the backend [#3138](https://github.com/IntelPython/dpnp/pull/3138)
* Removed the legacy backend implementation of `dpnp.random`, which no longer needs `onemkl-sycl-rng` [#3163](https://github.com/IntelPython/dpnp/pull/3163)
* Removed the legacy `dpnp_backend_c` library with its GTest suite and the `DPNP_BACKEND_TESTS` CMake option, the Cython module `dpnp.dpnp_algo.dpnp_algo` built on it, and the NumPy fallback helper `call_origin` [#3163](https://github.com/IntelPython/dpnp/pull/3163)
* Removed `dpnp.get_dpnp_descriptor` and the `dpnp.config.__DPNP_ORIGIN__` setting, set by the `DPNP_ORIGIN` environment variable, which only it read [#3163](https://github.com/IntelPython/dpnp/pull/3163)
* Removed the `dpnp.config.__DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK__` setting, set by the `DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK` environment variable, which nothing reads since dpnp no longer falls back on NumPy [#3163](https://github.com/IntelPython/dpnp/pull/3163)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on #3163 (comment): 5671b36 now removes __DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK__ without the deprecation it had before, and __DPNP_ORIGIN__ goes the same way. Code that still sets them now fails instead of warning:

import pytest, dpnp

with pytest.MonkeyPatch.context() as mp:
    mp.setattr(dpnp.config, "__DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK__", 0)
# AttributeError: <module 'dpnp.config' ...> has no attribute '__DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK__'
# #3162 head: no error

Could both go into _DEPRECATED_SETTINGS for a release, as the earlier version of this commit did?


### Fixed

Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ option(
"Build dpnp tensor pybind11 offloading extensions with coverage instrumentation"
OFF
)
option(DPNP_BACKEND_TESTS "Enable building of DPNP backend test suite" OFF)
option(
DPNP_WITH_REDIST
"Build DPNP assuming DPC++ redistributable is installed into Python prefix"
Expand Down Expand Up @@ -70,7 +69,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
# 7. CMake variables defined in the Platform files for the current system (like in /usr/local for Linux)
# 8. Paths stored in the CMake System Package Registry
# 9. Paths specified by the PATHS option (assumed hard-coded guesses)
set(path_to_cmake_dir ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules)
set(path_to_cmake_dir ${CMAKE_SOURCE_DIR}/cmake/Modules)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Nothing links the oneDPL target after this PR: dpnp_backend_c was its only user. So ONEDPL_PAR_BACKEND and find_package(oneDPL REQUIRED ...) at lines 96-97 now only check that oneDPL is installed; gcd.hpp and lcm.hpp in libtensor get <oneapi/dpl/numeric> from the default include path. If the lines stay for that check, a short comment saying so would help.

# TODO: use the commented logic once the compiler resolves CMake issue CMPLRLLVM-73484
# find_package(IntelSYCL REQUIRED PATHS ${path_to_cmake_dir})
find_package(IntelSYCL QUIET)
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions conda-recipe-cf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ build:
- dpctl
- numpy
- python
# leaked from mkl-devel-dpcpp; drags in unused onemkl-sycl-{datafitting,rng,stats}
- mkl-dpcpp
Comment thread
ndgrigorian marked this conversation as resolved.
Resolved
# building with Intel DPC++ and do not import the MSVC runtime DLLs
- vc14_runtime # [win]
- ucrt # [win]
missing_dso_whitelist:
- '*DPCTLSyclInterface*'
- '*/dpnp_backend_c.dll' # [win]
skip: true # [osx or py<39]

requirements:
Expand Down Expand Up @@ -54,8 +55,8 @@ requirements:
- {{ pin_compatible('onemkl-sycl-blas', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-dft', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-lapack', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-rng', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-vm', min_pin='x.x', max_pin='x') }}
Comment thread
ndgrigorian marked this conversation as resolved.
Resolved
- {{ pin_compatible('onemkl-sycl-sparse', min_pin='x.x', max_pin='x') }}
- numpy
- ocl-icd-system # [linux]
- khronos-opencl-icd-loader # [win]
Expand Down
4 changes: 2 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ requirements:
- {{ pin_compatible('onemkl-sycl-blas', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-dft', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-lapack', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-rng', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-vm', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-sparse', min_pin='x.x', max_pin='x') }}
- numpy
Expand All @@ -88,12 +87,13 @@ build:
- dpctl
- numpy
- python
# leaked from mkl-devel-dpcpp; drags in unused onemkl-sycl-{datafitting,rng,stats}
- mkl-dpcpp
# building with Intel DPC++ and do not import the MSVC runtime DLLs
- vc14_runtime # [win]
- ucrt # [win]
missing_dso_whitelist:
- '*DPCTLSyclInterface*'
- '*/dpnp_backend_c.dll' # [win]

test:
requires:
Expand Down
5 changes: 1 addition & 4 deletions conda-recipe/rattler_recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ build:
dynamic_linking:
missing_dso_allowlist:
- "*DPCTLSyclInterface*"
- if: win
then: "*/dpnp_backend_c.dll"

requirements:
host:
Expand Down Expand Up @@ -67,7 +65,6 @@ requirements:
- ${{ pin_compatible('onemkl-sycl-blas', lower_bound='x.x', upper_bound='x') }}
- ${{ pin_compatible('onemkl-sycl-dft', lower_bound='x.x', upper_bound='x') }}
- ${{ pin_compatible('onemkl-sycl-lapack', lower_bound='x.x', upper_bound='x') }}
- ${{ pin_compatible('onemkl-sycl-rng', lower_bound='x.x', upper_bound='x') }}
- ${{ pin_compatible('onemkl-sycl-vm', lower_bound='x.x', upper_bound='x') }}
- ${{ pin_compatible('onemkl-sycl-sparse', lower_bound='x.x', upper_bound='x') }}
- numpy
Expand All @@ -80,7 +77,7 @@ requirements:
- dpctl
- numpy
- python
# leaked from mkl-devel-dpcpp; drags in unused onemkl-sycl-{datafitting,stats}
# leaked from mkl-devel-dpcpp; drags in unused onemkl-sycl-{datafitting,rng,stats}
- mkl-dpcpp
# building with Intel DPC++ and do not import the MSVC runtime DLLs
- if: win
Expand Down
7 changes: 0 additions & 7 deletions doc/dpnp_backend_api.rst

This file was deleted.

21 changes: 0 additions & 21 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ and numerical data types and provides implementations of selected

To the tensor documentation

.. grid-item-card:: Development information

C++ backend API reference and extension documentation for developers.

+++

.. button-ref:: dpnp_backend_api
:ref-type: doc
:expand:
:color: secondary
:click-parent:

To the backend API reference


.. toctree::
:maxdepth: 2
Expand All @@ -99,10 +85,3 @@ and numerical data types and provides implementations of selected
quick_start_guide
reference/index
tensor

.. toctree::
:maxdepth: 1
:hidden:
:caption: Development information

dpnp_backend_api
2 changes: 1 addition & 1 deletion dpnp/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- `dpnp_utils/`: shared helpers (`get_usm_allocations`, `map_dtype_to_device`, reduction wrappers)
- `linalg/`, `fft/`, `random/`, `scipy/`, `lib/`: subpackages, each exporting through its own `__init__.py`
- `random/`: `_bit_generator.py` (`BitGenerator`, `Philox4x3210`, `PCG64DXSM`, `MRG32k3a`; `SeedSequence` is NumPy's), `_generator.py` (`Generator`, which implements every distribution), `dpnp_random_state.py` (`RandomState`, the same samplers with NumPy's legacy checks) and `dpnp_iface_random.py` (module functions, one `RandomState` per queue). The kernels are in `dpnp.libtensor._rng_impl`.
- Legacy, don't extend: the Cython `dpnp_algo` path and `dpnp_backend_c` (still used by `dpnp.random`), and the NumPy fallback `call_origin`. New kernels go into `dpnp/libtensor` (see `dpnp/libtensor/AGENTS.md`).
- New kernels go into `dpnp/libtensor` (see `dpnp/libtensor/AGENTS.md`).

## Adding a Public Function
1. Implement it in the matching `dpnp_iface_*.py` or subpackage module. Iface modules have no `__all__`.
Expand Down
69 changes: 0 additions & 69 deletions dpnp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,65 +27,6 @@
# THE POSSIBILITY OF SUCH DAMAGE.
# *****************************************************************************

function(build_dpnp_cython_ext _trgt _src _dest)
add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
message(STATUS "Using ${_trgt}")

python_add_library(${_trgt} MODULE WITH_SOABI ${_generated_src})
set(_trgt_deps "${_trgt}_deps")
add_custom_target(${_trgt_deps} DEPENDS ${_src})
add_dependencies(${_trgt} ${_trgt_deps})

if(DPNP_GENERATE_COVERAGE)
# Pass CYTHON_USE_SYS_MONITORING=0 to force Cython's legacy (settrace-based)
# line tracing instead of the sys.monitoring path
target_compile_definitions(
${_trgt}
PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1 CYTHON_USE_SYS_MONITORING=0
)
target_compile_options(${_trgt} PRIVATE "-fno-sycl-use-footer")
endif()

# NumPy
target_compile_definitions(
${_trgt}
PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
)
target_link_libraries(${_trgt} PRIVATE Python::NumPy)

# Dpctl
target_include_directories(${_trgt} PRIVATE ${Dpctl_INCLUDE_DIR})
target_link_directories(${_trgt} PRIVATE ${Dpctl_INCLUDE_DIR}/..)
target_link_libraries(${_trgt} PRIVATE DPCTLSyclInterface)

set(_linker_options "LINKER:${DPNP_LDFLAGS}")
target_link_options(${_trgt} PRIVATE ${_linker_options})

if(DPNP_GENERATE_COVERAGE)
set(_copy_cxx_trgt "${_trgt}_copy_cxx")
add_custom_target(
${_copy_cxx_trgt}
ALL
COMMAND
${CMAKE_COMMAND} -DSOURCE_FILE=${_generated_src}
-DDEST=${CMAKE_CURRENT_SOURCE_DIR} -P
${CMAKE_SOURCE_DIR}/dpnp/cmake/copy_existing.cmake
DEPENDS ${_trgt}
VERBATIM
COMMENT
"Copying Cython-generated source for target ${_trgt} to dpnp source layout"
)
endif()

set(_rpath_value "$ORIGIN/..")
if(DPNP_WITH_REDIST)
set(_rpath_value "${_rpath_value}:$ORIGIN/../../../../")
endif()
set_target_properties(${_trgt} PROPERTIES INSTALL_RPATH ${_rpath_value})

install(TARGETS ${_trgt} LIBRARY DESTINATION ${_dest})
endfunction()

function(build_dpnp_tensor_ext _trgt _src _dest)
cmake_parse_arguments(BUILD_DPNP_TENSOR "" "RELATIVE_PATH" "" ${ARGN})
add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
Expand Down Expand Up @@ -146,11 +87,6 @@ function(build_dpnp_tensor_ext _trgt _src _dest)
endif()
endfunction()

function(build_dpnp_cython_ext_with_backend _trgt _src _dest)
build_dpnp_cython_ext(${_trgt} ${_src} ${_dest})
target_link_libraries(${_trgt} PRIVATE dpnp_backend_library)
endfunction()

# Builds a pybind11 extension of dpnp/libtensor/extensions with the options all
# of them share and installs it into dpnp/libtensor, next to the libtensor
# modules.
Expand Down Expand Up @@ -224,15 +160,10 @@ endfunction()

add_subdirectory(tensor)

add_subdirectory(backend)
add_subdirectory(libtensor/source)
add_subdirectory(libtensor/extensions/blas)
add_subdirectory(libtensor/extensions/fft)
add_subdirectory(libtensor/extensions/lapack)
add_subdirectory(libtensor/extensions/rng)
add_subdirectory(libtensor/extensions/vm)
add_subdirectory(libtensor/extensions/sparse)

add_subdirectory(dpnp_algo)
add_subdirectory(dpnp_utils)
add_subdirectory(random)
5 changes: 2 additions & 3 deletions dpnp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
dpctlpath = os.path.dirname(dpctl.__file__)

# For Windows OS with Python >= 3.7, it is required to explicitly define a path
# where to search for DLLs towards both DPNP backend and DPCTL Sycl interface,
# where to search for the DLLs of DPNP and of the DPCTL Sycl interface,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: After this PR nothing installs a DLL into dpnp/: the Windows package of this head has only .pyd modules, in dpnp/libtensor and dpnp/tensor. So os.add_dll_directory(mypath) and mypath in PATH below have no use now. Could they go, with this comment naming only the DPCTL interface library?

# otherwise DPNP import will be failing. This is because the libraries
# are not installed under any of default paths where Python is searching.

Expand All @@ -65,6 +65,7 @@
from .dpnp_array import dpnp_array as ndarray
from .dpnp_array_api_info import __array_namespace_info__
from ._version import get_versions
from . import config as config
from . import exceptions as exceptions
from . import fft as fft
from . import lib as lib
Expand Down Expand Up @@ -576,7 +577,6 @@
check_limitations,
check_supported_arrays_type,
default_float_type,
get_dpnp_descriptor,
get_normalized_queue_device,
get_result_array,
get_usm_ndarray,
Expand Down Expand Up @@ -1050,7 +1050,6 @@
"check_limitations",
"check_supported_arrays_type",
"default_float_type",
"get_dpnp_descriptor",
"get_normalized_queue_device",
"get_result_array",
"get_usm_ndarray",
Expand Down
7 changes: 0 additions & 7 deletions dpnp/backend/AGENTS.md

This file was deleted.

Loading
Loading