Skip to content

Commit

Permalink
Fix WandBLogger to allow resuming runs with updated config values (#1081
Browse files Browse the repository at this point in the history
)
  • Loading branch information
parthsarthi03 authored Jun 12, 2024
1 parent a1fa0fd commit 0e0aff0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion torchtune/utils/metric_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def __init__(
self._wandb.define_metric("global_step")
self._wandb.define_metric("*", step_metric="global_step", step_sync=True)

self.config_allow_val_change = kwargs.get("allow_val_change", False)

def log_config(self, config: DictConfig) -> None:
"""Saves the config locally and also logs the config to W&B. The config is
stored in the same directory as the checkpoint. You can
Expand All @@ -214,7 +216,9 @@ def log_config(self, config: DictConfig) -> None:
"""
if self._wandb.run:
resolved = OmegaConf.to_container(config, resolve=True)
self._wandb.config.update(resolved)
self._wandb.config.update(
resolved, allow_val_change=self.config_allow_val_change
)
try:
output_config_fname = Path(
os.path.join(
Expand Down

0 comments on commit 0e0aff0

Please sign in to comment.