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

Fix axis0 calls in reduction Python binding #1459

Merged
merged 3 commits into from
Oct 27, 2023
Merged

Conversation

ndgrigorian
Copy link
Collaborator

Closes #1455

This PR fixes typos in reductions/reduction_over_axis.hpp which caused the axis1 implementation to be called where axis0 was determined to be correct.

Now, the correct table is used to retrieve the function pointer.

Additionally, this PR sneaks in a fix for another typo in reduction_atomic_support.hpp which caused MinAtomicSupportFactory and MaxAtomicSupportFactory to inherit from ArithmeticAtomicSupportFactory rather than MinMaxAtomicSupportFactory. This meant atomics were unused for min and max for floating-point types.

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

These functions were using ArithmeticAtomicSupportFactory, which disables atomics for floating point types
This issue was caused by a typo where when the `axis0` kernels
for tree and atomic reductions would be called, the `axis1` kernel
would be called instead
@github-actions
Copy link

@coveralls
Copy link
Collaborator

coveralls commented Oct 27, 2023

Coverage Status

coverage: 85.748%. remained the same when pulling 891161f on resolve-gh-1455 into d82f3a9 on master.

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.1dev0=py310ha25a700_74 ran successfully.
Passed: 935
Failed: 65
Skipped: 119

Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Choose a reason for hiding this comment

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

LGTM! I also ran tests locally on different devices.

@ndgrigorian ndgrigorian merged commit 02e7714 into master Oct 27, 2023
26 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the resolve-gh-1455 branch October 27, 2023 22:59
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.1dev0=py310ha25a700_74 ran successfully.
Passed: 935
Failed: 65
Skipped: 119

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.

dpctl.tensor.max returns incorrect result when reducing over axis=0
3 participants