Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling sycl_queue for USMNdArray in dpnp overloads #1007

Conversation

chudur-budur
Copy link
Contributor

@chudur-budur chudur-budur commented Apr 18, 2023

  • This is PR enables dpctl.SyclQueue for USMNdArray in dpnp overloads.

  • This PR does not pass SYCL queue to the functions in numba_depx/core/runtime/_dpexrt_python.c (yet).

  • Since this PR, we won't have "unknown" as a default device string anymore, we will use None instead, when there is no need to specify the device type.

    • 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?
    • If this PR is a work in progress, are you filing the PR as a draft?

@chudur-budur chudur-budur force-pushed the fix/usmndarray-enable-sycl-queue branch 3 times, most recently from 0f037ea to 9c0900a Compare April 22, 2023 03:35
@chudur-budur chudur-budur marked this pull request as ready for review April 22, 2023 03:37
)

if queue is not None:
if queue and not isinstance(queue, types.misc.Omitted):
Copy link
Contributor

Choose a reason for hiding this comment

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

If we have a non-None queue argument can it be anything but a dpctl.SyclQueue? Where can we end up with the queue being a types.misc.Omitted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we have a non-None queue argument can it be anything but a dpctl.SyclQueue?

Then we fail on these tests numba_dpex/tests/dpjit_tests/parfors/test_builtin_ops.py::test_built_in_operators2

Where can we end up with the queue being a types.misc.Omitted?

The type of queue becomes types.misc.Omitted when dpnp.epmty() is being called by dpnp functions internally.


Returns:
DpnpNdArray: The Numba type to represent an dpnp.ndarray.
The type has the same structure as USMNdArray used to
represent dpctl.tensor.usm_ndarray.
"""
if queue and not isinstance(queue, types.misc.Omitted):

if sycl_queue and not isinstance(sycl_queue, types.misc.Omitted) and device:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be removed as the check is already inside the UsmNdArray constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can be removed as the check is already inside the UsmNdArray constructor.

We can actually remove these checks in all ol_dpnp_<functions>() too, we are doing this same check on three levels, which we shouldn't do.

@chudur-budur chudur-budur force-pushed the fix/usmndarray-enable-sycl-queue branch from dadf286 to f5d155e Compare April 24, 2023 16:48
@diptorupd diptorupd force-pushed the fix/usmndarray-enable-sycl-queue branch from f5d155e to 1802d7c Compare April 25, 2023 14:43
@diptorupd diptorupd self-requested a review April 26, 2023 18:35
@chudur-budur chudur-budur force-pushed the fix/usmndarray-enable-sycl-queue branch from 1802d7c to 4ac7a87 Compare May 1, 2023 00:00
@chudur-budur
Copy link
Contributor Author

Superceded by #1022

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