-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
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
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.
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 <olivier.grisel@ensta.org>
…ed attributes (scikit-learn#24882) Co-authored-by: Julien Jerphanion <git@jjerphan.xyz> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
…atch (scikit-learn#25297) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
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 <olivier.grisel@ensta.org>
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. |
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 https://github.com/scikit-learn/scikit-learn/actions/runs/3951111594/jobs/6764541521#step:3:2324 Maybe we could instead do a simple docstring for |
Green! @thomasjpfan any final comment? |
I swear it was green before :) |
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.
@@ -105,6 +115,10 @@ Changelog | |||
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 <olivier.grisel@ensta.org>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
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
_delayed
is not really possible since we would warn our user or developer to use a private function.This PR proposes to overload
Parallel
and propagate theconfig
using the thread that callsParallel
. It only requires changing the import without changing theParallel
ordelayed
calls.