Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT Do not propagate n_jobs as n_threads #22593

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

Conversation

jjerphan
Copy link
Member

Reference Issues/PRs

Follow-up for #22134.

What does this implement/fix? Explain your changes.

n_jobs is to be used for joblib tasks but not for the number of threads to use for OpenMP.

Any other comments?

As per our discussion, @ogrisel.

`n_jobs` is to be used for joblib tasks but not for
the number of threads to use for OpenMP.
jjerphan and others added 3 commits February 23, 2022 18:25
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.

+1 on not passing n_threads=self.n_jobs.

jjerphan and others added 2 commits February 24, 2022 10:25
This reverts commit fb19915.

Co-authored-by: Jérémie du Boisberranger <[email protected]>
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.

In the other parts of the codebase we usually call _openmp_effective_n_threads and pass it into Cython code through n_threads. In this case, the Cython code is calling _openmp_effective_n_threads itself. In the end, it's the same.

For this PR, I'm okay with removing n_threads.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM as well.

@ogrisel
Copy link
Member

ogrisel commented Feb 24, 2022

Before merging there is problem with a new warning raised in the sphinx doc.

@ogrisel ogrisel merged commit 1f491f3 into scikit-learn:main Feb 24, 2022
@jjerphan jjerphan deleted the do-not-propagate-n_jobs-for-n_threads branch February 24, 2022 20:39
jjerphan added a commit to jjerphan/scikit-learn that referenced this pull request Feb 24, 2022
Catching up with scikit-learn#22593.

Co-authored-by: Olivier Grisel <[email protected]>
thomasjpfan added a commit to thomasjpfan/scikit-learn that referenced this pull request Feb 26, 2022

Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
thomasjpfan added a commit to thomasjpfan/scikit-learn that referenced this pull request Mar 1, 2022

Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
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.

4 participants