Skip to content

Lower the threshold to use sequential sort #1866

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 3 commits into from
Oct 16, 2024
Merged

Conversation

oleksandr-pavlyk
Copy link
Contributor

The threshold lowered from 64 elements to sort, to 16 elements. This recovers monotonicity of run-times curve.

When number of array elements along the axis we sort is less than the threshold, a quadratic complexity insertion sort is used. Too high a value of the threshold (64) made for the artifact, where sorting 63 elements took several times longer than sorting 65 elements.

Setting it to 16 recovers monotonicity (sorting 16 elements is not slower than sorting 17 elements).

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

The threshold lowered from 64 elements to sort, to 16 elements.
This recovers monotonicity of run-times curve.

When number of array elements along the axis we sort is less
than the threshold, a quadratic complexity insertion sort
is used. Too high a value of the threshold (64) made for the
artifact, where sorting 63 elements took several times longer
than sorting 65 elements.

Setting it to 16 recovers monotonicity (sorting 16 elements
is not slower than sorting 17 elements).
Copy link

github-actions bot commented Oct 15, 2024

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

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_134 ran successfully.
Passed: 895
Failed: 0
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_133 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Oct 15, 2024

Coverage Status

coverage: 87.669%. remained the same
when pulling a9edf94 on tune-merge-sort
into 2f327af on master.

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_135 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

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.

LGTM!

@oleksandr-pavlyk oleksandr-pavlyk merged commit 08605c4 into master Oct 16, 2024
49 of 51 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the tune-merge-sort branch October 16, 2024 17:33
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