Skip to content

DOC clarify that n_jobs argument uses threading in pairwise_distances and pairwise_kernels #29693

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 2 commits into from
Aug 23, 2024

Conversation

stepan-srsen
Copy link
Contributor

Reference Issues/PRs

Fixes #29587

What does this implement/fix? Explain your changes.

Improves the documentation of pairwise_distances and pairwise_kernels so that it is clear that they use threading when the n_jobs argument is used. One could expect the functions to be truly parallel using multiprocessing otherwise, which is not the case and that has a serial performance impact for user-defined metric functions (see #29587).

Copy link

github-actions bot commented Aug 20, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: dfcd469. Link to the linter CI: here

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stepan-srsen Thank you for the PR!

I have a minor nit, but other wise LGTM.

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
@lesteve lesteve changed the title clarification of the documentation for the n_jobs argument in pairwise_distances and pairwise_kernels DOC clarify that n_jobs argument uses threading in pairwise_distances and pairwise_kernels Aug 23, 2024
@lesteve
Copy link
Member

lesteve commented Aug 23, 2024

Merging this one thanks @stepan-srsen!

@lesteve lesteve merged commit ede02b4 into scikit-learn:main Aug 23, 2024
32 checks passed
@stepan-srsen stepan-srsen deleted the pairwise_metric branch August 23, 2024 13:21
MarcBresson pushed a commit to MarcBresson/scikit-learn that referenced this pull request Sep 2, 2024
… and pairwise_kernels (scikit-learn#29693)

Co-authored-by: Stepan Srsen <srsen@manganese.itc.univie.ac.at>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 9, 2024
… and pairwise_kernels (scikit-learn#29693)

Co-authored-by: Stepan Srsen <srsen@manganese.itc.univie.ac.at>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
glemaitre pushed a commit that referenced this pull request Sep 11, 2024
… and pairwise_kernels (#29693)

Co-authored-by: Stepan Srsen <srsen@manganese.itc.univie.ac.at>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Truly parallel execution of pairwise_kernels and pairwise_distances
3 participants