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
[train] Hard-deprecate MosaicTrainer
and remove SklearnTrainer
#42814
[train] Hard-deprecate MosaicTrainer
and remove SklearnTrainer
#42814
Conversation
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
…ecate_sklearn_trainer
"`ray.train.mosaic.MosaicTrainer` is deprecated. " | ||
"Use `ray.train.torch.TorchTrainer` instead. " | ||
"See this issue for a migration example: " | ||
"https://github.com/ray-project/ray/issues/42257" |
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.
We won't be able to have a migration example because of the threading issue though, right?
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.
Yeah, I was planning to just keep it as "not possible for now", then update the issue later. Or should I just remove the migration link for Mosaic trainer?
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.
Oh yeah we can have a GH Issue that says it's not supported right now (the current one points to sklearn)
} | ||
estimator.set_params(**cpu_params) | ||
|
||
|
||
@PublicAPI(stability="alpha") | ||
class SklearnPredictor(Predictor): |
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.
Do we still need SklearnPredictor?
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.
We still have all the predictors around but not shown in docs. Maybe we can remove them all at some point at once?
Does the main thread refer to the driver and all Ray actors methods are child threads? Seems that the signal handling issue is unresolvable in current Ray Train design. |
@woshiyyya It refers to the main thread of a single worker actor that is processing the result queue from the training thread:
Yep this is unresolvable unless we get rid of this threading logic (which is an implementation detail for implementing "yielding" behavior, that can be done with Ray Generators in the future). |
…ecate_sklearn_trainer
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Got it. Signal handling is a missing feature that we need to support it in the future. User can save checkpoint on exception before the actors get killed.
|
"`ray.train.mosaic.MosaicTrainer` is deprecated. " | ||
"Use `ray.train.torch.TorchTrainer` instead. " | ||
"See this issue for a migration example: " | ||
"https://github.com/ray-project/ray/issues/42257" |
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.
Oh yeah we can have a GH Issue that says it's not supported right now (the current one points to sklearn)
…ecate_sklearn_trainer
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
…ay-project#42814) This PR removes some already deprecated APIs to reduce the library surface area and remove unused/unnecessary components. (`MosaicTrainer` can be folded into `TorchTrainer`, and `SklearnTrainer` doesn't provide any value over using Tune with your own training loop.) --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com>
…ay-project#42814) This PR removes some already deprecated APIs to reduce the library surface area and remove unused/unnecessary components. (`MosaicTrainer` can be folded into `TorchTrainer`, and `SklearnTrainer` doesn't provide any value over using Tune with your own training loop.) --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: tterrysun <terry@anyscale.com>
Why are these changes needed?
MosaicTrainer
is not needed, since it can be folded underTorchTrainer
, similar toLightningTrainer
andTransformersTrainer
SklearnTrainer
is also not needed, since it does not provide any extra utility over just callingTuner(sklearn_train_fn)
. The Ray Train version added an extra layer of abstraction that is not needed over calling the underlying sklearn methods. There was no multi-worker training happening.TODO
Notes
ray.train.report
.Related issue number
Closes #32732
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.