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: