-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
ENH: Vectorize argsort and argselect with AVX2 #25610
Conversation
Thank you @r-devulap! |
There was a new failure in scikit-learn when testing against numpy dev because of this change, see scikit-learn/scikit-learn#28326 for more details. The The scikit-learn tests pass in 0a4b2b8 (previous merge commit in main) and fail in 221427b (the merge commit for this PR). I could not find any mention of this change in the changelog, but maybe I missed it? I think this would be worth to adding a changelog entry about this change to indicate that np.argsort and np.argselect results may change in numpy 2.0. |
I verified that this is indeed common when sorting integers. >>> import hashlib
>>> import numpy as np
>>> rng = np.random.RandomState(seed=123098) # minor: reproducers across versions should use RandomState
>>> x = rng.randint(100, size=10_000)
>>> hashlib.sha256(np.argsort(x).tobytes()).hexdigest() I'll include this note in my next release notes PR:
|
As asked for in numpygh-25610 [skip actions] [skip azp] [skip cirrus]
As asked for in numpygh-25610 [skip actions] [skip azp] [skip cirrus]
Add AVX2 version of argsort and argselect. Benchmark numbers: