Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MAINT Adapt scheduling of PairwiseDistancesRadiusNeighborhood #22829

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
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions 5 sklearn/metrics/_pairwise_distances_reduction.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1570,8 +1570,7 @@ cdef class PairwiseDistancesRadiusNeighborhood(PairwiseDistancesReduction):
# This is done in parallel sample-wise (no need for locks)
# using dynamic scheduling because we might not have
# the same number of neighbors for each query vector.
# TODO: compare 'dynamic' vs 'static' vs 'guided'
for idx in prange(self.n_samples_X, schedule='dynamic'):
for idx in prange(self.n_samples_X, schedule='static'):
self._merge_vectors(idx, self.chunks_n_threads)

# The content of the vector have been std::moved.
Expand All @@ -1595,7 +1594,7 @@ cdef class PairwiseDistancesRadiusNeighborhood(PairwiseDistancesReduction):
cdef:
ITYPE_t i, j

for i in prange(self.n_samples_X, nogil=True, schedule='dynamic',
for i in prange(self.n_samples_X, nogil=True, schedule='static',
num_threads=self.effective_n_threads):
for j in range(deref(self.neigh_indices)[i].size()):
deref(self.neigh_distances)[i][j] = (
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.