Skip to content

Fix for incorrect result in reduction over axis=0 #1392

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

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

oleksandr-pavlyk
Copy link
Contributor

Closes gh-1391

The specialized reduce_over_axis0 kernel should be called if both src/dst are F-contiguous, or when src is F-contig, and dst is C-contig but 1D (usually it is also F-contig in this case though).

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

The kernel is applicable if both inputs are F-contiguous, or
if the first input if F-contiguous and we are reducing to
1d C-contiguous array.

Closes gh-1391
@github-actions
Copy link

github-actions bot commented Sep 6, 2023

@ndgrigorian
Copy link
Collaborator

For me, building this branch gives a compiler warning

[84/89] Building CXX object dpctl/tensor/CMakeFiles/_tensor_impl.dir/libtensor/source/sum_reductions.cpp.o
/home/ngrigori/dpctl/dpctl/tensor/libtensor/source/sum_reductions.cpp:222:35: warning: '&&' within '||' [-Wlogical-op-parentheses]
                 (is_dst_c_contig && dst_nd == 1 || dst.is_f_contiguous()))

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

Array API standard conformance tests for dpctl=0.14.6dev4=py310ha25a700_49 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

Array API standard conformance tests for dpctl=0.14.6dev4=py310ha25a700_51 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@oleksandr-pavlyk
Copy link
Contributor Author

For me, building this branch gives a compiler warning

[84/89] Building CXX object dpctl/tensor/CMakeFiles/_tensor_impl.dir/libtensor/source/sum_reductions.cpp.o
/home/ngrigori/dpctl/dpctl/tensor/libtensor/source/sum_reductions.cpp:222:35: warning: '&&' within '||' [-Wlogical-op-parentheses]
                 (is_dst_c_contig && dst_nd == 1 || dst.is_f_contiguous()))

Thank you @ndgrigorian . I have added the parenthesis and the warning is gone for me.

Copy link
Collaborator

@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.

dpnp tests are passing now. Thank you @oleksandr-pavlyk !

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.

Compiler warning is gone and it resolves the issue

@oleksandr-pavlyk oleksandr-pavlyk merged commit a9064ee into master Sep 6, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-gh-1391 branch September 6, 2023 21:48
@github-actions
Copy link

github-actions bot commented Sep 6, 2023

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

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.

dpt.sum over axis for transposed input array
3 participants