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

fix: Fix bug in benchmarking where default values were int instead of… #670

Merged
merged 1 commit into from
May 16, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions benchmarking/commons/hpo_main_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
ExtraArgsType = List[DictStrKey]


def str2bool(v):
def str2bool(v: Any) -> bool:
if isinstance(v, bool):
return v
if v.lower() in ("yes", "true", "t", "y", "1"):
Expand Down Expand Up @@ -83,7 +83,7 @@ class ConfigDict:
Parameter(
name="save_tuner",
type=str2bool,
default=0,
default=False,
help="Serialize Tuner object at the end of tuning?",
),
Parameter(
Expand Down Expand Up @@ -113,7 +113,7 @@ class ConfigDict:
Parameter(
name="scale_max_wallclock_time",
type=str2bool,
default=0,
default=False,
help=(
"If 1, benchmark.max_wallclock_time is multiplied by B / min(A, B),"
"where A = n_workers and B = benchmark.n_workers"
Expand Down
4 changes: 2 additions & 2 deletions benchmarking/commons/hpo_main_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
dict(
name="verbose",
type=str2bool,
default=0,
default=False,
help="Verbose log output?",
),
dict(
Expand All @@ -75,7 +75,7 @@
dict(
name="restrict_configurations",
type=str2bool,
default=0,
default=False,
help="If 1, scheduler only suggests configs contained in tabulated benchmark",
),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def __init__(
else:
self._debug_log = None
else:
assert isinstance(debug_log, DebugLogPrinter)
assert isinstance(
debug_log, DebugLogPrinter
), f"debug_log = {debug_log} must either be bool or DebugLogPrinter"
self._debug_log = debug_log

def configure_scheduler(self, scheduler):
Expand Down
Loading