Skip to content

Move _tensor_impl extensions and use it for dpnp#2755

Open
vlad-perevezentsev wants to merge 18 commits intoinclude-dpctl-tensorfrom
move_tensor_impl_ext
Open

Move _tensor_impl extensions and use it for dpnp#2755
vlad-perevezentsev wants to merge 18 commits intoinclude-dpctl-tensorfrom
move_tensor_impl_ext

Conversation

@vlad-perevezentsev
Copy link
Contributor

@vlad-perevezentsev vlad-perevezentsev commented Feb 5, 2026

This PR proposes introducing dpctl_ext as a new internal extension module (temporarily renamed from dpctl to avoid conflicts), adding CMake/packaging support for building _tensor_impl via pybind11 and switching dpnp to use dpctl_ext.tensor. _tensor_impl

The migrated _tensor_impl currently supports the following functions:

'_array_overlap',
'_as_c_contig',
'_as_f_contig',
'_contract_iter',
'_contract_iter2',
'_contract_iter3',
'_contract_iter4',
'_copy_usm_ndarray_into_usm_ndarray',
'_ravel_multi_index',
'_same_logical_tensors',
'_unravel_index',
'default_device_bool_type',
'default_device_complex_type',
'default_device_fp_type',
'default_device_index_type',
'default_device_int_type',
'default_device_uint_type'

Files in dpnp that explicitly import dpctl.tensor._tensor_impl
Green items are handled in this PR
Red items will be handled in the next PR (#2758 )
123

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@vlad-perevezentsev vlad-perevezentsev self-assigned this Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

View rendered docs @ https://intelpython.github.io/dpnp/pull/2755/index.html

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Array API standard conformance tests for dpnp=0.20.0dev2=py313h509198e_26 ran successfully.
Passed: 1353
Failed: 4
Skipped: 7

import dpctl.tensor._tensor_impl as dti

# pylint: disable=no-name-in-module
import dpctl_ext.tensor._tensor_impl as dti
Copy link
Contributor

Choose a reason for hiding this comment

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

Missed to update:

  • dpnp/tests/test_array_api_info.py
  • dpnp/linalg/dpnp_utils_linalg.py
  • dpnp/fft/dpnp_utils_fft.py
  • dpnp/dpnp_algo/dpnp_fill.py
  • dpnp/dpnp_iface_indexing.py

If intended, it has to be clearly stated with explicit TODO comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated dpnp/tests/test_array_api_info.py
The other files have been updated to #2758

# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
# *****************************************************************************
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it empty? It leads to

import dpctl_ext.tensor as dpe

dir(dpe)
# Out[6]:
# ['__builtins__',
#  '__cached__',
#  '__doc__',
#  '__file__',
#  '__loader__',
#  '__name__',
#  '__package__',
#  '__path__',
#  '__spec__']

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this PR does not add public functions to dpctl_ext.tensor
_init_.py will be expanded in the following PRs
For example in #2758 https://github.com/IntelPython/dpnp/pull/2758/changes#diff-83d3837f45456ab786416e3e3fa6c6111e65c03b2404af195fb7d16dfb58b00b

Copy link
Contributor

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

Please find the comments above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants