Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tune] Fix resuming from cloud storage (+ test) #32504

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions python/ray/tune/execution/experiment_state.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections import Counter
from dataclasses import dataclass
from typing import Dict, Optional, Union, Callable
from typing import Callable, Dict, Optional, Tuple, Union

import click
import logging
Expand Down Expand Up @@ -28,7 +28,7 @@ class _ResumeConfig:
restart_errored: bool = False


def _resume_str_to_config(resume_str: str) -> _ResumeConfig:
def _resume_str_to_config(resume_str: str) -> Tuple[str, _ResumeConfig]:
if resume_str is True:
resume_str = "LOCAL"
elif resume_str == "ERRORED_ONLY":
Expand Down Expand Up @@ -61,7 +61,7 @@ def _resume_str_to_config(resume_str: str) -> _ResumeConfig:
assert resume_str in VALID_RESUME_TYPES, "resume={} is not one of {}".format(
resume_str, VALID_RESUME_TYPES
)
return resume_config
return resume_str, resume_config


def _experiment_checkpoint_exists(experiment_dir: str) -> bool:
Expand Down Expand Up @@ -406,7 +406,7 @@ def resume(self, resume_type: Union[str, bool]) -> Optional[_ResumeConfig]:
if not resume_type:
return None

resume_config = _resume_str_to_config(resume_type)
resume_type, resume_config = _resume_str_to_config(resume_type)

# Not clear if we need this assertion, since we should always have a
# local checkpoint dir.
Expand Down