Skip to content

Commit

Permalink
[tune] Fix BOHB example for new storage (ray-project#38983)
Browse files Browse the repository at this point in the history
The new storage path does not create "empty" checkpoints per default anymore. Previously, when no checkpoint is saved, PAUSEing a trial would create a dummy checkpoint that only contains trial metadata (such as the iteration number). This is not the case anymore.

Examples now have to implement checkpointing to properly restore previous state. This was also true previously - but some of our simple examples (e.g. the one in this PR) didn't implement it and still "worked".

I think it's fine to keep the functionality as is and require our examples to show checkpointing implementations. This will ensure that users don't shoot their feet trying to use e.g. BOHB.

Separately, BOHB was malfunctioning as trials were repeatedly PAUSED and restarted as they've never been removed from `bracket.trials_to_unpause`. @justinvyu mentioned this in the review where it was introduced and I believed at the time it wasn't necessary - turns out it is, as we can end up in a situation where a bracket is never finished because trials are constantly running. This was not caught by any tests. We should add one in a follow-up - for now we can proceed with this PR to pick onto Ray 2.7.

Signed-off-by: Kai Fricke <kai@anyscale.com>
  • Loading branch information
krfricke authored Aug 29, 2023
1 parent 945bf95 commit 2c5d354
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 67 deletions.
2 changes: 0 additions & 2 deletions doc/source/tune/examples/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ py_test_run_all_notebooks(
size = "medium",
include = ["*.ipynb"],
exclude = [
# TODO(krfricke): Enable this test for new persistence path.
"bohb_example.ipynb",
"pbt_ppo_example.ipynb",
"tune-xgboost.ipynb",
"pbt_transformers.ipynb", # Transformers uses legacy Tune APIs.
Expand Down
Loading

0 comments on commit 2c5d354

Please sign in to comment.