8000 ENH: Vectorize np.partition and np.argpartition using AVX-512 by r-devulap · Pull Request #24201 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Vectorize np.partition and np.argpartition using AVX-512 #24201

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 23 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dddc046
Update submodule to latest
Jul 13, 2023
489acbb
Add benchmarks for np.partition
Jun 29, 2023
4a9ac25
ENH: Use avx512_qselect for np.partition
Jul 13, 2023
12ae67d
TST: Add tests for np.partition
Jul 15, 2023
234754d
BENCH: Add benchmarks for argpartition
Jul 24, 2023
f3ac24b
Update x86-simd-sort submodule to latest
Jul 24, 2023
d8643a4
get_partition_func does not need an extra argument
Jul 24, 2023
0c86047
ENH: Use avx512_argselect for np.argpartition
Jul 24, 2023
1a3caed
TST: 8000 add tests for np.argpartition
Jul 24, 2023
8e58998
Enable AVX-512 partition and argpartition on Windows
Jul 25, 2023
1999828
Move PyArray_PartitionFunc and PyArray_ArgPartitionFunc out of ndarra…
Jul 26, 2023
c0bdd18
MAINT: Prevent re-definition of quickselect dispatch on ARM 32-bit
Aug 1, 2023
ae33785
Avoid using template specializations for quickselect and argquicksele…
Aug 2, 2023
cd9df94
Update submodule to latest
Aug 8, 2023
25a2efb
Update x86-simd-sort submodule to latest
Sep 5, 2023
29a9267
Update x86-simd-sort submodule to latest
Sep 6, 2023
f3f6111
ifdef remove avx512 instantiations for CYGWIN
Sep 7, 2023
fc5b215
Enable quicksort on WIN32
Sep 8, 2023
9d986f7
BUG: Fix compile error for avx512_qselect
Sep 8, 2023
fcb6249
BUG: Fix qselect function declaration argument
Sep 8, 2023
6c1b8c7
Disable avx512_qselect on 32-bit systems
Sep 8, 2023
cb176c1
Add may vary to output of np.partition and np.argpartition in docs
Sep 8, 2023
6cd06c0
Use np::Half instead of np_tag::npy_half::type
Sep 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
get_partition_func does not need an extra argument
  • Loading branch information
Raghuveer Devulapalli committed Sep 18, 2023
commit d8643a4041b8c254d68ac39678a98a1ba2c3cd1b
2 changes: 1 addition & 1 deletion numpy/core/src/common/npy_partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern "C" {
#endif

NPY_NO_EXPORT PyArray_PartitionFunc *
get_partition_func(int type, NPY_SELECTKIND which, npy_intp kthsize);
get_partition_func(int type, NPY_SELECTKIND which);

NPY_NO_EXPORT PyArray_ArgPartitionFunc *
get_argpartition_func(int type, NPY_SELECTKIND which);
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/item_selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ PyArray_Partition(PyArrayObject *op, PyArrayObject * ktharray, int axis,
PyErr_SetString(PyExc_ValueError, "not a valid partition kind");
return -1;
}
part = get_partition_func(PyArray_TYPE(op), which, PyArray_SIZE(ktharray));
part = get_partition_func(PyArray_TYPE(op), which);
if (part == NULL) {
/* Use sorting, slower but equivalent */
if (PyArray_DESCR(op)->f->compare) {
Expand Down
6 changes: 3 additions & 3 deletions numpy/core/src/npysort/selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ struct partition_t {
constexpr std::array<arg_map, partition_t::taglist::size> partition_t::map;

static inline PyArray_PartitionFunc *
_get_partition_func(int type, NPY_SELECTKIND which, npy_intp kthsize)
_get_partition_func(int type, NPY_SELECTKIND which)
{
npy_intp i;
npy_intp ntypes = partition_t::map.size();
Expand Down Expand Up @@ -536,9 +536,9 @@ _get_argpartition_func(int type, NPY_SELECTKIND which)
*/
extern "C" {
NPY_NO_EXPORT PyArray_PartitionFunc *
get_partition_func(int type, NPY_SELECTKIND which, npy_intp kthsize)
get_partition_func(int type, NPY_SELECTKIND which)
{
return _get_partition_func(type, which, kthsize);
return _get_partition_func(type, which);
}
NPY_NO_EXPORT PyArray_ArgPartitionFunc *
get_argpartition_func(int type, NPY_SELECTKIND which)
Expand Down
0