Skip to content

Conversation

@justinvyu
Copy link
Contributor

@justinvyu justinvyu commented Oct 22, 2025

Description

Deprecate CheckpointConfig(checkpoint_at_end, checkpoint_frequency) and mark the resume_from_checkpoint, metadata Trainer constructor arguments as deprecated in the docstrings.

Drive-by changes

Update the "inspecting results" user guide doc code to show how to catch and inspect errors raised by trainer.fit(). The previous recommendation to check result.error is unusable because we always raise the error which prevents the user from accessing the result object.

Related issues

#49454

@justinvyu justinvyu requested a review from a team as a code owner October 22, 2025 22:23
Copy link
Contributor

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

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 effectively deprecates checkpoint_at_end and checkpoint_frequency in CheckpointConfig, and resume_from_checkpoint and metadata in various Trainer constructors. The implementation for deprecation is solid, raising DeprecationWarning upon usage. The changes are consistent across the affected modules.

My main feedback is to improve the docstrings for the deprecated parameters. While the deprecation warnings at runtime are informative, updating the docstrings to include the reason for deprecation and the recommended alternative would greatly improve the developer experience for users browsing the API documentation. I've left specific suggestions on the relevant files.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@JasonLi1909 JasonLi1909 left a comment

Choose a reason for hiding this comment

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

Nice!

@ray-gardener ray-gardener bot added the train Ray Train Related Issue label Oct 23, 2025
@justinvyu justinvyu enabled auto-merge (squash) October 23, 2025 21:14
@github-actions github-actions bot disabled auto-merge October 23, 2025 21:14
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Oct 23, 2025
@justinvyu justinvyu requested a review from a team as a code owner October 27, 2025 21:34
@justinvyu justinvyu enabled auto-merge (squash) October 27, 2025 21:36
@justinvyu justinvyu merged commit 092550b into ray-project:master Oct 27, 2025
7 checks passed
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
…y-project#58022)

Deprecate `CheckpointConfig(checkpoint_at_end, checkpoint_frequency)`
and mark the `resume_from_checkpoint, metadata` Trainer constructor
arguments as deprecated in the docstrings.

Update the "inspecting results" user guide doc code to show how to catch
and inspect errors raised by trainer.fit(). The previous recommendation
to check result.error is unusable because we always raise the error
which prevents the user from accessing the result object.

---------

Signed-off-by: Justin Yu <[email protected]>
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
…y-project#58022)

Deprecate `CheckpointConfig(checkpoint_at_end, checkpoint_frequency)`
and mark the `resume_from_checkpoint, metadata` Trainer constructor
arguments as deprecated in the docstrings.

Update the "inspecting results" user guide doc code to show how to catch
and inspect errors raised by trainer.fit(). The previous recommendation
to check result.error is unusable because we always raise the error
which prevents the user from accessing the result object.

---------

Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Aydin Abiar <[email protected]>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants