You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dpnp aims to be a drop-in replacement for NumPy and is already compatible with the 2024.12 version of the array api standard. As such it should be a relatively simple addition.
I'm mainly asking as I'd like the inspection helper functions array_api_compat.is_dpnp_array and array_api_compat.is_dpnp_namespace to be included.
To double-check: it looks that from the -compat perspective, dpnp is similar to jax: the Array API support lives in the package itself, and array-api-compat only has the two helper functions:
Meanwhile ndonnx is similar but -compat does not have matching is_ndonnx_* functions. Thus I wonder why we need to special-case some array providers and not others. A main question I suppose is how is -compat layer useful to dpnp if it's already fully compatible @Nin17 ?
OTOH there's no problem adding these two functions to -compat if it's anyhow useful.
Meanwhile ndonnx is similar but -compat does not have matching is_ndonnx_* functions. Thus I wonder why we need to special-case some array providers and not others. A main question I suppose is how is -compat layer useful to dpnp if it's already fully compatible @Nin17 ?
OTOH there's no problem adding these two functions to -compat if it's anyhow useful.
I think the main two reasons are:
a downstream library wants to run library X through their test-suite
a downstream library wants to write to the standard whilst also having special-cases for library X in production code
I guess neither of those have happened yet for ndonnx (or people have been happy to roll their own).
A main question I suppose is how is -compat layer useful to dpnp if it's already fully compatible @Nin17 ?
a downstream library wants to write to the standard whilst also having special-cases for library X in production code
Essentially that, I have an array api standard compliant implementation, but for performance reasons for libraries that support as_strided/sliding_window_view I want to use an alternative implementation. I could just implement my own check, but thought seeing as you already include similar functions for jax, ndonnx and pydata/sparse it may as well be included here.
Essentially that, I have an array api standard compliant implementation, but for performance reasons for libraries that support as_strided/sliding_window_view I want to use an alternative implementation. I could just implement my own check, but thought seeing as you already include similar functions for jax, ndonnx and pydata/sparse it may as well be included here.
With dpnp version 0.20.0 tested against the 2024.12 version of the standard I get this output:
========================================== short test summary info ==========================================
FAILED array_api_tests/test_dlpack.py::test_dunder_dlpack - BufferError: array cannot be placed on the requested device without a copy
FAILED array_api_tests/test_dlpack.py::test_from_dlpack - assert Device(opencl:cpu:0) == <dpctl.SyclDevice [backend_type.opencl, device_type.cpu, Intel(R) Core(T...
FAILED array_api_tests/test_linalg.py::test_trace - AssertionError: The input arrays have different values (array(0, dtype=uint8) != array(254, dtype=uint8)...
FAILED array_api_tests/test_special_cases.py::test_unary[acosh(real(x_i) is +0 and imag(x_i) is NaN) -> NaN \xb1 \u03c0j/2] - AssertionError: out=(nan+nanj), but should be NaN ± πj/2 [acosh()]
FAILED array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +infinity and isfinite(imag(x_i)) and imag(x_i) > 0) -> 1 + 0j] - AssertionError: out=(1-0j), but should be 1 + 0j [tanh()]
================== 5 failed, 1359 passed, 14 skipped, 183284 warnings in 242.08s (0:04:02) ==================
With dpnp version 0.21.0dev5+5.ge654d623031 tested against the 2025.12 version of the standard I get this output:
========================================== short test summary info ==========================================
FAILED array_api_tests/test_dlpack.py::test_dunder_dlpack - BufferError: array cannot be placed on the requested device without a copy
==================== 1 failed, 1376 passed, 5 skipped, 48 warnings in 231.91s (0:03:51) =====================
I skipped the test_device_to_device test in the above PR but that issue seems to be fixed in 0.21.0dev5+5.ge654d623031. So I'd just need to add "2024.12" to the skipped array-api-versions in test_array_namespace and then as far as I can tell, all the tests would be passing apart from test_dunder_dlpack.
Though none of this is tested in CI, I'm not sure how is best to do that.
The array-api-test tests are run by dpnp but the array-api-compat tests aren't run in CI with dpnp. So the tests in tests/test_array_namespace.py aren't being run with dpnp in CI. They seem to be being skipped with JAX etc as well.
Related I also haven't added dpnp to the dev dependency group in pyproject.toml
Helpers for is_dpnp_* have been added in #467;
The CI side of testing is blocked on the lack of readily available hardware, in #471
I'll close this issue as completed: we do not require that everything is tested in CI anyway.
Activity
lucascolley commentedon Jun 29, 2026
cc @antonwolfy @vlad-perevezentsev
would someone be interested in contributing this?
ev-br commentedon Jun 29, 2026
To double-check: it looks that from the -compat perspective,
dpnpis similar tojax: the Array API support lives in the package itself, andarray-api-compatonly has the two helper functions:array-api-compat/src/array_api_compat/common/_helpers.py
Line 431 in 2865123
and
array-api-compat/src/array_api_compat/common/_helpers.py
Line 217 in 2865123
Meanwhile
ndonnxis similar but-compatdoes not have matchingis_ndonnx_*functions. Thus I wonder why we need to special-case some array providers and not others. A main question I suppose is how is-compatlayer useful todpnpif it's already fully compatible @Nin17 ?OTOH there's no problem adding these two functions to
-compatif it's anyhow useful.lucascolley commentedon Jun 29, 2026
I think the main two reasons are:
I guess neither of those have happened yet for
ndonnx(or people have been happy to roll their own).Nin17 commentedon Jun 30, 2026
Those functions are included:
array-api-compat/array_api_compat/common/_helpers.py
Line 174 in 52e01be
array-api-compat/array_api_compat/common/_helpers.py
Line 376 in 52e01be
Essentially that, I have an array api standard compliant implementation, but for performance reasons for libraries that support
as_strided/sliding_window_viewI want to use an alternative implementation. I could just implement my own check, but thought seeing as you already include similar functions for jax, ndonnx and pydata/sparse it may as well be included here.ev-br commentedon Jun 30, 2026
Ah, thanks, don't know how I missed these two.
PR welcome!
Nin17 commentedon Aug 23, 2026
I've run
array-api-testsagainstdpnplocally.With
dpnpversion0.20.0tested against the 2024.12 version of the standard I get this output:With
dpnpversion0.21.0dev5+5.ge654d623031tested against the 2025.12 version of the standard I get this output:I skipped the
test_device_to_devicetest in the above PR but that issue seems to be fixed in0.21.0dev5+5.ge654d623031. So I'd just need to add"2024.12"to the skipped array-api-versions intest_array_namespaceand then as far as I can tell, all the tests would be passing apart fromtest_dunder_dlpack.Though none of this is tested in CI, I'm not sure how is best to do that.
antonwolfy commentedon Aug 24, 2026
test_dunder_dlpackis failing due to array-api-tests#456ev-br commentedon Aug 24, 2026
Am probably being dense: what is the problem with CI?
Nin17 commentedon Aug 24, 2026
Essentially this comment from copilot: #467 (comment)
The
array-api-testtests are run bydpnpbut thearray-api-compattests aren't run in CI withdpnp. So the tests intests/test_array_namespace.pyaren't being run withdpnpin CI. They seem to be being skipped with JAX etc as well.Related I also haven't added
dpnpto the dev dependency group in pyproject.tomlThis is the output of the latest run:
Shouldn't the 2024.12 and None cases not be skipped and the others xfailed based on the tests?
ev-br commentedon Aug 24, 2026
Ah yes, this is the -compat-specific CI is run:
https://github.com/data-apis/array-api-compat/blob/main/.github/workflows/tests.yml
I suppose it can install dpnp similar to Jax,sparse and ndonnx.
Note however that this all is CPU-only, as we do not currently have any non-CPU CI.
ev-br commentedon Sep 6, 2026
Helpers for
is_dpnp_*have been added in #467;The CI side of testing is blocked on the lack of readily available hardware, in #471
I'll close this issue as completed: we do not require that everything is tested in CI anyway.