-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
Add num_threads in the prange loop of init_bounds in KMeans #22773
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
Conversation
Can this be tested? 😁 |
I don't see how to do that easily. We don't do it for the other pranges. It should mainly be noticeable when running in e.g a docker container with quota on cpu ressources on a machine with many cores. |
At a high level, we already test that the results are the same with different scikit-learn/sklearn/cluster/tests/test_k_means.py Lines 932 to 934 in f9d7423
|
This PR is not about parallelizing a some part of the code. This function is already parallel, it's just that we don't control the number of threads the way we do for other pranges, i.e. with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry for being unclear. I was trying to say that we already test for different As long as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. LGTM!
Fixes #20483