-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
FIX propagate configuration to workers in parallel #25363
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
FIX propagate configuration to workers in parallel #25363
Conversation
ogrisel
left a comment
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.
I like this approach the best. Here is a first pass of feedback on phrasing.
thomasjpfan
left a comment
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.
Thank you for the PR! I do like this option a bit more than the other ones.
Co-authored-by: Olivier Grisel <[email protected]>
…ed attributes (scikit-learn#24882) Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Guillaume Lemaitre <[email protected]>
…atch (scikit-learn#25297) Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]> Co-authored-by: Christian Lorentzen <[email protected]> Co-authored-by: Guillaume Lemaitre <[email protected]> Co-authored-by: Chiara Marmo <[email protected]>
ogrisel
left a comment
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.
Reading the generated API doc for the sklearn.fixes module I see that we also expose utils.parallel_backend and utils.register_parallel_backend.
I believe that we should also deprecated those and move them to sklearn.utils.parallel for consistency.
We should also probably included versionchanged or versionchanged info in the docstring of sklearn.utils.parallel.delayed and versionadded for .Parallel.
|
Other than the comments above, LGTM by the way. Thanks very much for this work @glemaitre! |
Does the following comment still apply? scikit-learn/sklearn/utils/__init__.py Lines 44 to 50 in f1340c7
I do not think we need to provide |
Co-authored-by: Olivier Grisel <[email protected]>
Good catch, I should have checked that. I would be in favor of deprecating those two in favor of the matching functions from joblib. |
I can do that in a subsequent PR since it is independent of this PR. |
|
I think that I addressed the last comments. I will now open a PR for the deprecation of the joblib helper functions. |
ogrisel
left a comment
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! +1 when CI is green.
|
Hum, sphinx chokes in the Maybe we could instead do a simple docstring for |
|
Green! @thomasjpfan any final comment? |
|
I swear it was green before :) |
thomasjpfan
left a comment
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.
Minor comment about the changelog, otherwise LGTM.
| boolean. The type is maintained, instead of converting to `float64.` | ||
| :pr:`25147` by :user:`Tim Head <betatim>`. | ||
|
|
||
| - |API| :func:`utils.fixes.delayed` is deprecated in 1.2.1 and will be removed |
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.
I think we need a changelog entry to introduce utils.parallel.Parallel as well.
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.
Rather than a new entry I think we can just expand this entry as suggested below to keep related changes together:
Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Thomas J. Fan <[email protected]>
closes #25242
closes #25239
closes #25290
This is an alternative to #25290. The issue in #25290 is that we change the public API for 1.2.1. Making the change in a private
_delayedis not really possible since we would warn our user or developer to use a private function.This PR proposes to overload
Paralleland propagate theconfigusing the thread that callsParallel. It only requires changing the import without changing theParallelordelayedcalls.