Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a41175a
Add new header file `dpnp4pybind11.hpp` (#2734)
antonwolfy Jan 26, 2026
b69ffb3
Merge master into include-dpctl-tensor
vlad-perevezentsev Feb 18, 2026
464ddc1
Merge pull request #2776 from IntelPython/update_tensor_branch
vlad-perevezentsev Feb 19, 2026
1a1a099
Move `_tensor_impl` extensions and use it for dpnp (#2755)
vlad-perevezentsev Feb 19, 2026
b00d064
Extend `._tensor_impl` with remaining functions used by dpnp (#2758)
vlad-perevezentsev Feb 24, 2026
195b893
Extend `._tensor_impl` with copy functions (#2774)
vlad-perevezentsev Mar 3, 2026
192bd93
Extend `._tensor_impl` with advanced indexing functions (#2777)
vlad-perevezentsev Mar 3, 2026
ecd4991
Clean up dpctl.tensor code (#2797)
antonwolfy Mar 5, 2026
0edd3b1
Extend `._tensor_impl` with where(), clip() and type utils functions …
vlad-perevezentsev Mar 5, 2026
585f2e5
Extend `._tensor_impl` with linear sequences functions (#2782)
vlad-perevezentsev Mar 5, 2026
e96405c
Move `_tensor_accumulation_impl `extension and use it for dpnp (#2791)
vlad-perevezentsev Mar 9, 2026
dd62b6e
Move `_tensor_sorting_impl` extension and use it for dpnp (#2793)
vlad-perevezentsev Mar 9, 2026
6cc6b6c
Move `_tensor_reductions_impl` extension and use it for dpnp (#2794)
vlad-perevezentsev Mar 10, 2026
0f6d63e
Add missing includes (#2810)
antonwolfy Mar 10, 2026
2ef9a94
Move `_tensor_elementwise_impl` (unary) extension and use it for dpnp…
vlad-perevezentsev Mar 16, 2026
ce5f54e
Extend `_tensor_elementwise_impl` (unary) part 2 (#2796)
vlad-perevezentsev Mar 17, 2026
3a0c2ff
Extend `_tensor_elementwise_impl` (unary) part 3 (#2801)
vlad-perevezentsev Mar 18, 2026
b0647db
add tensor linalg extension (#2799)
ndgrigorian Mar 18, 2026
5dcdd27
Extend `_tensor_elementwise_impl` with binary functions and use it fo…
vlad-perevezentsev Mar 18, 2026
1bfa011
Extend `_tensor_elementwise_impl` with binary functions part 2 (#2804)
vlad-perevezentsev Mar 18, 2026
aa816fd
Extend `_tensor_elementwise_impl` with binary functions part 3 (#2805)
vlad-perevezentsev Mar 19, 2026
8d1c75b
Extend `dpctl_ext.tensor` with the remaining functions (#2806)
vlad-perevezentsev Mar 19, 2026
851628b
Move `usm_ndarray` into `dpctl_ext.tensor` (#2807)
vlad-perevezentsev Mar 31, 2026
a31ab47
Remove dpctl_ext.tensor C-API (#2830)
vlad-perevezentsev Apr 7, 2026
ed3476f
Move dpctl_ext.tensor to dpnp.tensor (#2829)
vlad-perevezentsev Apr 8, 2026
e1aad07
Move tensor tests from dpctl (#2817)
vlad-perevezentsev Apr 10, 2026
cf2a286
Move compute follows data utils (#2840)
vlad-perevezentsev Apr 10, 2026
d30c357
Merge master into include-dpctl-tensor
vlad-perevezentsev Apr 10, 2026
d835f96
Use ExecutionPlacementError from dpnp.exceptions in dpnp
vlad-perevezentsev Apr 10, 2026
56a0af4
Apply clang-format
vlad-perevezentsev Apr 10, 2026
fbc4f43
add __main__.py
ndgrigorian Apr 8, 2026
1679951
add test for new CLI options
ndgrigorian Apr 10, 2026
761573c
Merge pull request #2836 from IntelPython/add-main-py
ndgrigorian Apr 10, 2026
8fb303d
add __main__.py
ndgrigorian Apr 8, 2026
cf313c8
add test for new CLI options
ndgrigorian Apr 10, 2026
c83f72b
Remove the unnecessary inludes after the merge
vlad-perevezentsev Apr 12, 2026
e89e3d6
Enable muted tests for dpnp.cumlogsumexp (#2842)
antonwolfy Apr 10, 2026
cd1f5ca
Bump actions/upload-artifact from 7.0.0 to 7.0.1 (#2847)
dependabot[bot] Apr 12, 2026
eb94817
Bump peter-evans/create-pull-request from 8.1.0 to 8.1.1 (#2846)
dependabot[bot] Apr 12, 2026
3a1db6f
Remove redundant Dpctl_TENSOR_INCLUDE_DIR from backend extension CMak…
vlad-perevezentsev Apr 13, 2026
6857a9f
Update copyright year in __main__.py
vlad-perevezentsev Apr 13, 2026
cb1044d
Remove redundant include directories from lapack extension
vlad-perevezentsev Apr 13, 2026
cf94242
Merge master into update-include-dpctl-tensor
vlad-perevezentsev Apr 13, 2026
23da515
Merge branch 'include-dpctl-tensor' into update-include-dpctl-tensor
vlad-perevezentsev Apr 13, 2026
728ae42
Merge pull request #2843 from IntelPython/update-include-dpctl-tensor
vlad-perevezentsev Apr 13, 2026
4b163bf
Add cross-reference fallback for dpnp.tensor to dpctl 0.21.1 docs (#2…
vlad-perevezentsev Apr 14, 2026
549e940
Add device-aware output dtype for `dpt.round()` with boolean input (#…
vlad-perevezentsev Apr 15, 2026
125c913
Fix test warnings in dpnp.tensor tests (#2852)
vlad-perevezentsev Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: Build and Deploy Docs

runs-on: ubuntu-22.04
timeout-minutes: 60
timeout-minutes: 90

permissions:
# Needed to cancel any previous runs that are not completed for a given workflow
Expand Down
54 changes: 53 additions & 1 deletion .github/workflows/check-onemath.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
os: [ubuntu-22.04] # windows-2022 - no DFT support for Windows in oneMKL

runs-on: ${{ matrix.os }}
timeout-minutes: 60
timeout-minutes: 120

defaults:
run:
Expand Down Expand Up @@ -133,6 +133,14 @@ jobs:
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests
env:
SKIP_TENSOR_TESTS: 1
SYCL_CACHE_PERSISTENT: 1

- name: Run tensor tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1

Expand All @@ -150,6 +158,24 @@ jobs:
mamba activate ${{ env.test-env-name }}

python -m pytest -ra --pyargs dpnp.tests
env:
SKIP_TENSOR_TESTS: 1
SYCL_CACHE_PERSISTENT: 1

- name: ReRun tensor tests on Linux
if: env.rerun-tests-on-failure == 'true'
id: run_tensor_tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-tests-max-attempts }}
retry_on: any
command: |
. $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/mamba.sh
mamba activate ${{ env.test-env-name }}

python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1

Expand Down Expand Up @@ -239,6 +265,14 @@ jobs:
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests
env:
SKIP_TENSOR_TESTS: 1
SYCL_CACHE_PERSISTENT: 1

- name: Run tensor tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1

Expand All @@ -256,5 +290,23 @@ jobs:
mamba activate ${{ env.test-env-name }}

python -m pytest -ra --pyargs dpnp.tests
env:
SKIP_TENSOR_TESTS: 1
SYCL_CACHE_PERSISTENT: 1

- name: ReRun tensor tests on Linux
if: env.rerun-tests-on-failure == 'true'
id: run_tensor_tests_branch
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-tests-max-attempts }}
retry_on: any
command: |
. $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/mamba.sh
mamba activate ${{ env.test-env-name }}

python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1
44 changes: 43 additions & 1 deletion .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
actions: write

runs-on: ${{ matrix.os }}
timeout-minutes: 60
timeout-minutes: 90

defaults:
run:
Expand Down Expand Up @@ -220,6 +220,7 @@ jobs:
- name: Run tests
if: env.rerun-tests-on-failure != 'true'
run: |
export SKIP_TENSOR_TESTS=1
if [[ "${{ matrix.python }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
export DPNP_TEST_ALL_INT_TYPES=1
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
Expand All @@ -239,6 +240,7 @@ jobs:
. $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/mamba.sh
mamba activate ${{ env.test-env-name }}
export SKIP_TENSOR_TESTS=1

if [[ "${{ matrix.python }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
export DPNP_TEST_ALL_INT_TYPES=1
Expand All @@ -247,6 +249,26 @@ jobs:
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
fi

- name: Run tensor tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -n auto -ra --pyargs dpnp.tests.tensor

- name: Run tensor tests
if: env.rerun-tests-on-failure == 'true'
id: run_tests_tensor_linux
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-tests-max-attempts }}
retry_on: any
command: |
. $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/mamba.sh
mamba activate ${{ env.test-env-name }}

python -m pytest -n auto -ra --pyargs dpnp.tests.tensor

test_windows:
name: Test

Expand Down Expand Up @@ -382,6 +404,7 @@ jobs:
if: env.rerun-tests-on-failure != 'true'
shell: pwsh
run: |
$env:SKIP_TENSOR_TESTS=1
if (${{ matrix.python }} -eq ${{ env.python-ver-test-all-dtypes }}) {
$env:DPNP_TEST_ALL_INT_TYPES=1
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
Expand All @@ -399,13 +422,32 @@ jobs:
retry_on: any
shell: pwsh
command: |
$env:SKIP_TENSOR_TESTS=1
if ( ${{ matrix.python }} -eq ${{ env.python-ver-test-all-dtypes }} ) {
$env:DPNP_TEST_ALL_INT_TYPES=1
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
} else {
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
}

- name: Run tensor tests
if: env.rerun-tests-on-failure != 'true'
shell: pwsh
run: |
python -m pytest -n auto -ra --pyargs dpnp.tests.tensor

- name: Run tensor tests
if: env.rerun-tests-on-failure == 'true'
id: run_tests_tensor_win
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-tests-max-attempts }}
retry_on: any
shell: pwsh
command: |
python -m pytest -n auto -ra --pyargs dpnp.tests.tensor

upload:
name: Upload

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/generate_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Generate coverage and push to Coveralls.io

runs-on: ubuntu-latest
timeout-minutes: 120
timeout-minutes: 150

permissions:
# Needed to cancel any previous runs that are not completed for a given workflow
Expand Down Expand Up @@ -122,14 +122,15 @@ jobs:
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
shell: bash
timeout_minutes: 60
timeout_minutes: 120
max_attempts: 5
retry_on: error
command: |
. $CONDA/etc/profile.d/conda.sh
conda activate coverage
[ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh
git clean -fxd
export SKIP_TENSOR_TESTS=1
python scripts/gen_coverage.py

- name: Total number of coverage attempts
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dpnp_pytest.*
example3

*dpnp_backend*
dpnp/include/dpnp/tensor/*.h
dpnp/**/*.cpython*.so
dpnp/**/*.pyd
*~
Expand Down
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,23 @@ project(
)

option(DPNP_GENERATE_COVERAGE "Enable build DPNP with coverage instrumentation" OFF)
option(
DPNP_TENSOR_GENERATE_COVERAGE_FOR_PYBIND11_EXTENSIONS
"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"
OFF
)
option(
DPNP_TENSOR_OFFLOAD_COMPRESS
"Build dpnp tensor using offload section compression feature of DPC++ to reduce \
size of shared object with offloading sections"
OFF
)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
Expand Down Expand Up @@ -106,7 +117,6 @@ find_package(Cython REQUIRED)

find_package(Dpctl REQUIRED)
message(STATUS "Dpctl_INCLUDE_DIR=" ${Dpctl_INCLUDE_DIR})
message(STATUS "Dpctl_TENSOR_INCLUDE_DIR=" ${Dpctl_TENSOR_INCLUDE_DIR})

option(DPNP_USE_ONEMATH "Build DPNP with oneMath" OFF)
set(DPNP_TARGET_CUDA
Expand Down
66 changes: 66 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# http://www.sphinx-doc.org/en/master/config

from datetime import datetime
from urllib.parse import urljoin

from sphinx.ext.autodoc import FunctionDocumenter
from sphinx.ext.napoleon import NumpyDocstring, docstring
Expand Down Expand Up @@ -231,6 +232,9 @@ def _can_document_member(member, *args, **kwargs):

autosummary_generate = True

_DPCTL_021_BASE = "https://intelpython.github.io/dpctl/0.21.1/"
_DPCTL_021_INV = urljoin(_DPCTL_021_BASE, "objects.inv")

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
Expand Down Expand Up @@ -302,3 +306,65 @@ def _parse_returns_section_patched(self, section: str) -> list[str]:


NumpyDocstring._parse_returns_section = _parse_returns_section_patched


# TODO: Remove once dpnp.tensor docs are generated in dpnp
def _load_dpctl_tensor_inventory(app):
"""Load dpctl 0.21.1 inventory for dpnp.tensor fallback only."""
from sphinx.ext.intersphinx import fetch_inventory
from sphinx.util import logging

logger = logging.getLogger(__name__)

try:
inv = fetch_inventory(app, _DPCTL_021_BASE, _DPCTL_021_INV)
except Exception as exc:
logger.warning(
"Failed to load dpctl 0.21.1 inventory from %s: %s",
_DPCTL_021_INV,
exc,
)
inv = {}

app.builder.env._dpctl_tensor_021_inventory = inv


# TODO: Remove once dpnp.tensor docs are generated in dpnp
def _resolve_dpnp_tensor_refs(app, env, node, contnode):
"""Resolve dpnp.tensor.* references to dpctl 0.21.1 documentation.

This temporary workaround is needed because dpnp.tensor documentation
is not generated yet, while the corresponding API is still documented
in dpctl 0.21.1.
"""
from docutils import nodes as docutils_nodes

target = node.get("reftarget", "")
if not target.startswith("dpnp.tensor"):
return None

dpctl_target = target.replace("dpnp.tensor", "dpctl.tensor", 1)
dpctl_tensor_inv = getattr(env, "_dpctl_tensor_021_inventory", {})

for _objtype, objects in dpctl_tensor_inv.items():
if dpctl_target not in objects:
continue

item = objects[dpctl_target]
location = item.uri
if location.endswith("$"):
location = location[:-1] + dpctl_target

refuri = urljoin(_DPCTL_021_BASE, location)
newnode = docutils_nodes.reference(
"", "", internal=False, refuri=refuri
)
newnode += contnode.deepcopy()
return newnode

return None


def setup(app):
app.connect("builder-inited", _load_dpctl_tensor_inventory, priority=400)
app.connect("missing-reference", _resolve_dpnp_tensor_refs, priority=400)
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Data Parallel Extension for NumPy*
overview
quick_start_guide
reference/index
tensor

.. toctree::
:maxdepth: 1
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Exceptions
.. exception:: DLPackCreationError

Given when constructing DLPack capsule from either :class:`dpnp.ndarray` or
:class:`dpctl.tensor.usm_ndarray` based on a USM allocation
:class:`dpnp.tensor.usm_ndarray` based on a USM allocation
on a partitioned SYCL device.

.. rubric:: Examples
Expand Down
Loading
Loading