Skip to content

[train][V2] Implement Result::from_path in v2#58216

Merged
matthewdeng merged 19 commits into
ray-project:masterfrom
xinyuangui2:v2_test_result
Nov 1, 2025
Merged

[train][V2] Implement Result::from_path in v2#58216
matthewdeng merged 19 commits into
ray-project:masterfrom
xinyuangui2:v2_test_result

Conversation

@xinyuangui2

Copy link
Copy Markdown
Contributor

Description

In this function, Result::from_path is implemented in ray train v2, which reconstructs a Result object from the checkpoints. This implementation leverages CheckpointManager and refers to https://github.com/ray-project/ray/blob/master/python/ray/train/v2/_internal/execution/controller/controller.py#L512-L540

Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: xgui <xgui@anyscale.com>
This reverts commit f309643f4649f5f5f7ef7676c04fa99bfbca05e8.

Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: xgui <xgui@anyscale.com>
cursor[bot]

This comment was marked as outdated.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the Result::from_path method in Ray Train v2, which is a valuable feature for reconstructing results from stored checkpoints. The implementation is well-structured, leveraging the existing CheckpointManager to restore state, and is accompanied by a comprehensive set of tests covering local and remote storage, different path types, and error conditions.

I have one suggestion to improve the user-friendliness of an error message. Additionally, I noticed that the new _from_checkpoint_manager method duplicates logic from TrainController._build_result. A follow-up refactoring to consolidate this logic would be beneficial for maintainability.

Comment thread python/ray/train/v2/api/result.py
Signed-off-by: xgui <xgui@anyscale.com>
cursor[bot]

This comment was marked as outdated.

@ray-gardener ray-gardener Bot added the train Ray Train Related Issue label Oct 27, 2025

@justinvyu justinvyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread python/ray/train/v2/api/result.py Outdated
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
@justinvyu justinvyu enabled auto-merge (squash) October 27, 2025 20:39
@github-actions github-actions Bot added the go add ONLY when ready to merge, run all tests label Oct 27, 2025
@github-actions github-actions Bot disabled auto-merge October 27, 2025 21:02
cursor[bot]

This comment was marked as outdated.

Signed-off-by: xgui <xgui@anyscale.com>
@matthewdeng matthewdeng merged commit eebb513 into ray-project:master Nov 1, 2025
6 checks passed
YoussefEssDS pushed a commit to YoussefEssDS/ray that referenced this pull request Nov 8, 2025
## Description

In this function, `Result::from_path` is implemented in ray train v2,
which reconstructs a `Result` object from the checkpoints. This
implementation leverages `CheckpointManager` and refers to
https://github.com/ray-project/ray/blob/master/python/ray/train/v2/_internal/execution/controller/controller.py#L512-L540

---------

Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Co-authored-by: Justin Yu <justinvyu@anyscale.com>
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
## Description

In this function, `Result::from_path` is implemented in ray train v2,
which reconstructs a `Result` object from the checkpoints. This
implementation leverages `CheckpointManager` and refers to
https://github.com/ray-project/ray/blob/master/python/ray/train/v2/_internal/execution/controller/controller.py#L512-L540

---------

Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Co-authored-by: Justin Yu <justinvyu@anyscale.com>
SheldonTsen pushed a commit to SheldonTsen/ray that referenced this pull request Dec 1, 2025
## Description

In this function, `Result::from_path` is implemented in ray train v2,
which reconstructs a `Result` object from the checkpoints. This
implementation leverages `CheckpointManager` and refers to
https://github.com/ray-project/ray/blob/master/python/ray/train/v2/_internal/execution/controller/controller.py#L512-L540

---------

Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Co-authored-by: Justin Yu <justinvyu@anyscale.com>
Future-Outlier pushed a commit to Future-Outlier/ray that referenced this pull request Dec 7, 2025
## Description

In this function, `Result::from_path` is implemented in ray train v2,
which reconstructs a `Result` object from the checkpoints. This
implementation leverages `CheckpointManager` and refers to
https://github.com/ray-project/ray/blob/master/python/ray/train/v2/_internal/execution/controller/controller.py#L512-L540

---------

Signed-off-by: xgui <xgui@anyscale.com>
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Co-authored-by: Justin Yu <justinvyu@anyscale.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
justinvyu pushed a commit that referenced this pull request Apr 24, 2026
This PR uncomment documentation about `Result.from_path` due to being at
the time unsupported by Train v2 API. Now that it has been implemented
#58216, we can uncomment this
documentation for users.

---------

Signed-off-by: Mark Towers <mark@anyscale.com>
Co-authored-by: Mark Towers <mark@anyscale.com>
Lucas61000 pushed a commit to Lucas61000/ray that referenced this pull request May 15, 2026
This PR uncomment documentation about `Result.from_path` due to being at
the time unsupported by Train v2 API. Now that it has been implemented
ray-project#58216, we can uncomment this
documentation for users.

---------

Signed-off-by: Mark Towers <mark@anyscale.com>
Co-authored-by: Mark Towers <mark@anyscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests train Ray Train Related Issue

3 participants