Skip to content

tensordot and vecdot array API conformity changes - #1577

Merged
ndgrigorian merged 7 commits into
masterfrom
tensordot-vecdot-fixes
Mar 1, 2024
Merged

ndgrigorian merged 7 commits into
masterfrom
tensordot-vecdot-fixes

Conversation

@ndgrigorian

Copy link
Copy Markdown
Collaborator

Updates vecdot and tensordot to reflect changes to the array API specification

  • tensordot permits negative axis values when axes is a tuple, as there is no ambiguity, because they are specified separately
  • vecdot now only permits negative integers for its axis argument to prevent ambiguity

Additionally, this fixes a few cases where vecdot, tensordot, and matmul would produce incorrect results (e.g., fixes #1570 )

  • 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?

Per array API standard

Also fixes vecdot attempting to call `py_dot` with incorrect batching dims
Only negative values for `axis` are permitted to avoid ambiguity

Now separately checks that the `axis` parameter is valid for each array before broadcasting occurs
@github-actions

github-actions Bot commented Mar 1, 2024 •

Copy link
Copy Markdown

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@coveralls

coveralls commented Mar 1, 2024 •

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 87.449% (-0.002%) from 87.451%
when pulling 7649688 on tensordot-vecdot-fixes
into 1465451 on master.

@github-actions

github-actions Bot commented Mar 1, 2024

Copy link
Copy Markdown

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_54 ran successfully.
Passed: 906
Failed: 0
Skipped: 94

@ndgrigorian
ndgrigorian marked this pull request as ready for review March 1, 2024 22:45

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for tracking and fixing these, @ndgrigorian !

@github-actions

github-actions Bot commented Mar 1, 2024

Copy link
Copy Markdown

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_55 ran successfully.
Passed: 906
Failed: 0
Skipped: 94

@ndgrigorian
ndgrigorian merged commit 289ac65 into master Mar 1, 2024
@oleksandr-pavlyk
oleksandr-pavlyk deleted the tensordot-vecdot-fixes branch March 2, 2024 00:19
oleksandr-pavlyk added a commit that referenced this pull request Mar 27, 2024
Backport changes from gh-1577 to 0.16.x maintenance branch
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.

Incorrect result in dpctl.tensor.tensordot for axes=0

3 participants