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

Fixed dpctl.tensor.result_type function for scalars #1473

Merged
merged 4 commits into from
Jan 18, 2024

Conversation

npolina4
Copy link
Collaborator

@npolina4 npolina4 commented Nov 13, 2023

Added support for weak scalars data 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?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

@coveralls
Copy link
Collaborator

coveralls commented Nov 13, 2023

Coverage Status

coverage: 90.187% (+0.2%) from 89.993%
when pulling 01e9d9c on fix_result_type
into 700079f on master.

Copy link

Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310ha25a700_2 ran successfully.
Passed: 1022
Failed: 51
Skipped: 60

Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310ha25a700_3 ran successfully.
Passed: 1022
Failed: 51
Skipped: 60

It handles scalars consistently with the way elementwise
operations do, following NEP-0050.

Some definitions were migrated from _elementwise_common
to _type_utils.
Copy link

Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_3 ran successfully.
Passed: 896
Failed: 13
Skipped: 86

Copy link

Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_4 ran successfully.
Passed: 894
Failed: 15
Skipped: 86

Copy link

Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_5 ran successfully.
Passed: 890
Failed: 19
Skipped: 86

Copy link

Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_5 ran successfully.
Passed: 892
Failed: 17
Skipped: 86

Copy link

Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_5 ran successfully.
Passed: 893
Failed: 16
Skipped: 86

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

Behavior for Numpy scalars seems worth noting
(the device does not support fp64)

In [9]: dpt.result_type(dpt.empty(0, dtype="f4"), np.float64(2))
Out[9]: dtype('float32')

But we usually treat them as Python scalars anyway, so I don't see a reason to change anything here.

Overall LGTM!

@oleksandr-pavlyk oleksandr-pavlyk merged commit fbe0081 into master Jan 18, 2024
39 of 47 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix_result_type branch January 18, 2024 04:27
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.

4 participants