-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[air] Remove ray.train.checkpoint
namespace
#37991
Conversation
Signed-off-by: Justin Yu <justinvyu@anyscale.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.
Thanks!
python/ray/train/checkpoint.py
Outdated
from pathlib import Path | ||
import tempfile | ||
|
||
from ray.train.checkpoint import Checkpoint |
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.
Please don't do this, see #37925 (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'm currently forced to do this, since 2 "Checkpoint" classes exist at the moment:
from ray.air import Checkpoint # old one, used in current examples, currently being phased out
from ray.train._checkpoint import Checkpoint # new checkpoint interface
__all__ = ["Checkpoint"] # These 2 checkpoints are colliding -- I can't expose both the same way.
By 2.7, I will definitely make the switch for ray.train.Checkpoint
to point to ray.train._checkpoint.Checkpoint
.
But, we're not 100% ready to make the switch just yet (it will involve a bunch of tests to change, and the new Checkpoint is not fully supported yet by other internal components).
For now, I can add a TODO in this docstring to update it to ray.train.Checkpoint
when the switch has happened. How does that sound?
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'm also happy to pre-emptively rename this to _checkpoint.py
so that the ray.train.checkpoint
namespace is no longer a thing.
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.
Sounds good, why don't you rename this to _checkpoint
while this is still brewing to avoid confusion? :)
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.
Done! PTAL
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
ray.train.checkpoint
code example to testcoderay.train.checkpoint
namespace
* Convert code example to testcode Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Rename ray.train.checkpoint -> ray.train._checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix checkpoint -> _checkpoint for imports Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix train.get_context().get_checkpoint -> train.get_checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com>
* Convert code example to testcode Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Rename ray.train.checkpoint -> ray.train._checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix checkpoint -> _checkpoint for imports Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix train.get_context().get_checkpoint -> train.get_checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: NripeshN <nn2012@hw.ac.uk>
* Convert code example to testcode Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Rename ray.train.checkpoint -> ray.train._checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix checkpoint -> _checkpoint for imports Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix train.get_context().get_checkpoint -> train.get_checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: harborn <gangsheng.wu@intel.com>
* Convert code example to testcode Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Rename ray.train.checkpoint -> ray.train._checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix checkpoint -> _checkpoint for imports Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix train.get_context().get_checkpoint -> train.get_checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com>
* Convert code example to testcode Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Rename ray.train.checkpoint -> ray.train._checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix checkpoint -> _checkpoint for imports Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix train.get_context().get_checkpoint -> train.get_checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
* Convert code example to testcode Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Rename ray.train.checkpoint -> ray.train._checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix checkpoint -> _checkpoint for imports Signed-off-by: Justin Yu <justinvyu@anyscale.com> * Fix train.get_context().get_checkpoint -> train.get_checkpoint Signed-off-by: Justin Yu <justinvyu@anyscale.com> --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Victor <vctr.y.m@example.com>
Why are these changes needed?
This PR makes a few fixes:
ray.train.checkpoint
->ray.train._checkpoint
to remove the confusingray.train.checkpoint
namespace. The aliasray.train.Checkpoint
needs to be assigned toray.train._checkpoint.Checkpoint
by the time of 2.7 release.code-block
that should be atestcode
.train.get_checkpoint
usage in a test that changed from a recent PR.Related issue number
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.