Repository navigation
[RLlib] Cleanup examples folder #14: Add example script for how to resume a tune.Tuner.fit() experiment from a checkpoint. - #45681
Merged
sven1977 merged 7 commits intoJun 3, 2024
Conversation
Signed-off-by: sven1977 <[email protected]>
…nup_examples_folder_14_continue_training_from_checkpoint
Signed-off-by: sven1977 <[email protected]>
sven1977
requested review from
ArturNiederfahrenhorst and
simonsays1980
as code owners
June 3, 2024 08:52
Signed-off-by: sven1977 <[email protected]>
simonsays1980
approved these changes
Jun 3, 2024
simonsays1980
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Invaluable example for users!
| tuner = tune.Tuner( | ||
| trainable=config.algo_class, | ||
| param_space=config, | ||
| run_config=air.RunConfig( |
Contributor
There was a problem hiding this comment.
In regard to the future deprecation of air: Can we use ray.train.RunConfig here instead?
| param_space=config, | ||
| run_config=air.RunConfig( | ||
| callbacks=tune_callbacks, | ||
| checkpoint_config=air.CheckpointConfig( |
Contributor
There was a problem hiding this comment.
Same here: can we use ray.train.CheckpointConfig?
| results = tuner.fit() | ||
| experiment_name = Path(results.experiment_path).name | ||
|
|
||
| # Extract the latest checkpoint from the results and confirm it's the right one. |
Contributor
There was a problem hiding this comment.
Let's state this comment differently. The get_best_result gets us only in this specific setup and only with a checkpoint frequency of 1 the latest checkpoint, otherwise we get the one with the highest episode_return_mean from whenever this happened.
Contributor
Author
There was a problem hiding this comment.
Ah, good catch! Yes, in this example, we should probably just use the last checkpoint, not necessarily the best. ...
| # TODO (simon): Change to -800 once the metrics are fixed. Currently | ||
| # the combined return is not correctly computed. | ||
| f"{ENV_RUNNER_RESULTS}/episode_return_mean": -400, | ||
| f"{ENV_RUNNER_RESULTS}/{EPISODE_RETURN_MEAN}": -800, |
Signed-off-by: sven1977 <[email protected]>
…nup_examples_folder_14_continue_training_from_checkpoint
sven1977
enabled auto-merge (squash)
June 3, 2024 10:08
sven1977
enabled auto-merge (squash)
June 3, 2024 10:18
Signed-off-by: sven1977 <[email protected]>
sven1977
enabled auto-merge (squash)
June 3, 2024 13:28
sven1977
deleted the
cleanup_examples_folder_14_continue_training_from_checkpoint
branch
June 3, 2024 14:44
richardsliu
pushed a commit
to richardsliu/ray
that referenced
this pull request
Jun 12, 2024
…r how to resume a tune.Tuner.fit() experiment from a checkpoint. (ray-project#45681) Signed-off-by: Richard Liu <[email protected]>
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.
Cleanup examples folder #14: Add example script for how to resume a tune.Tuner.fit() experiment from a checkpoint.
MetricsLogger.peek()(keyinstead of*keyto unify signature with all the other methods ofMetricsLogger).Why are these changes needed?
Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.