[Train] Replace Checkpoint Manager pydantic v2 APIs with v1 APIs#57147
Merged
justinvyu merged 10 commits intoray-project:masterfrom Oct 7, 2025
Merged
Conversation
…ty funcs Signed-off-by: JasonLi1909 <jasli1909@gmail.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces compatibility utility functions to support both Pydantic v1 and v2 within Ray Train's CheckpointManager. The changes are well-isolated in ray._common.pydantic_compat and correctly applied in CheckpointManager. My review includes a minor suggestion to improve the type hinting for one of the new utility functions to enhance code clarity and correctness.
justinvyu
reviewed
Oct 3, 2025
python/ray/train/v2/_internal/execution/checkpoint/checkpoint_manager.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com>
Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com>
Signed-off-by: JasonLi1909 <jasli1909@gmail.com>
justinvyu
reviewed
Oct 3, 2025
Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com>
Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com>
Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com>
Signed-off-by: JasonLi1909 <jasli1909@gmail.com>
liulehui
pushed a commit
to liulehui/ray
that referenced
this pull request
Oct 9, 2025
…-project#57147) Replace `CheckpointManager`'s usage of pydantic v2 APIs with v1 APIs instead. --------- Signed-off-by: JasonLi1909 <jasli1909@gmail.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com>
joshkodi
pushed a commit
to joshkodi/ray
that referenced
this pull request
Oct 13, 2025
…-project#57147) Replace `CheckpointManager`'s usage of pydantic v2 APIs with v1 APIs instead. --------- Signed-off-by: JasonLi1909 <jasli1909@gmail.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Josh Kodi <joshkodi@gmail.com>
ArturNiederfahrenhorst
pushed a commit
to ArturNiederfahrenhorst/ray
that referenced
this pull request
Oct 13, 2025
…-project#57147) Replace `CheckpointManager`'s usage of pydantic v2 APIs with v1 APIs instead. --------- Signed-off-by: JasonLi1909 <jasli1909@gmail.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com>
justinyeh1995
pushed a commit
to justinyeh1995/ray
that referenced
this pull request
Oct 20, 2025
…-project#57147) Replace `CheckpointManager`'s usage of pydantic v2 APIs with v1 APIs instead. --------- Signed-off-by: JasonLi1909 <jasli1909@gmail.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com>
xinyuangui2
pushed a commit
to xinyuangui2/ray
that referenced
this pull request
Oct 22, 2025
…-project#57147) Replace `CheckpointManager`'s usage of pydantic v2 APIs with v1 APIs instead. --------- Signed-off-by: JasonLi1909 <jasli1909@gmail.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: xgui <xgui@anyscale.com>
landscapepainter
pushed a commit
to landscapepainter/ray
that referenced
this pull request
Nov 17, 2025
…-project#57147) Replace `CheckpointManager`'s usage of pydantic v2 APIs with v1 APIs instead. --------- Signed-off-by: JasonLi1909 <jasli1909@gmail.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com>
Aydin-ab
pushed a commit
to Aydin-ab/ray-aydin
that referenced
this pull request
Nov 19, 2025
…-project#57147) Replace `CheckpointManager`'s usage of pydantic v2 APIs with v1 APIs instead. --------- Signed-off-by: JasonLi1909 <jasli1909@gmail.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Aydin Abiar <aydin@anyscale.com>
Future-Outlier
pushed a commit
to Future-Outlier/ray
that referenced
this pull request
Dec 7, 2025
…-project#57147) Replace `CheckpointManager`'s usage of pydantic v2 APIs with v1 APIs instead. --------- Signed-off-by: JasonLi1909 <jasli1909@gmail.com> Signed-off-by: Jason Li <57246540+JasonLi1909@users.noreply.github.com> Co-authored-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Future-Outlier <eric901201@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: The Ray Train
CheckpointManagercurrently depends on pydantic v2, using v2 API's likemodel_dump_json,from_json, andmodel_validate. However, users might not have v2 installed.This PR:
CheckpointManager's usage of v2 APIs with v1 APIs instead