Skip to content

Fix sort for size 1 axes #2106

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ndgrigorian
Copy link
Collaborator

Some sorting algorithms used (in particular radix_sort) assert that elements to be sorted must be greater than 1, and this can cause failures in debug builds, like coverage

This PR proposes a fix: copy in sort and memset to 0 in argsort when sort_nelems is 1

  • 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

Copy link

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_16 ran successfully.
Passed: 1114
Failed: 7
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Jun 18, 2025

Coverage Status

coverage: 84.984% (-0.005%) from 84.989%
when pulling 1838afa on fix-sorting-size-1-axes
into 35a8c26 on master.

@ndgrigorian ndgrigorian force-pushed the fix-sorting-size-1-axes branch from 6344d94 to 1838afa Compare June 18, 2025 20:04
@ndgrigorian ndgrigorian marked this pull request as ready for review June 18, 2025 20:19
Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_21 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@antonwolfy antonwolfy mentioned this pull request Jun 23, 2025
8 tasks
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.

Thank you @ndgrigorian for catching and resolving that

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.

3 participants