Skip to content

Commit 8e76666

Browse files
committed
update string quote; added process=0 check
1 parent fd85ceb commit 8e76666

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/MaxText/pyconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _prepare_for_pydantic(raw_keys: dict[str, Any]) -> dict[str, Any]:
120120
for key, value in raw_keys.items():
121121
if key not in valid_fields:
122122
logger.warning("Ignoring invalid/unsupported field from YAML/CLI: %s", repr(key))
123-
raise ValueError(f"{key!r} not in {', '.join(map(repr, valid_fields))}.")
123+
raise ValueError(f"{key!r} not in {", ".join(map(repr, valid_fields))}.")
124124

125125
new_value = value
126126
if isinstance(new_value, str) and new_value.lower() == "none":

src/maxtext/common/metric_logger.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ def __init__(self, config, learning_rate_schedule):
104104
if self.config.managed_mldiagnostics:
105105
ManagedMLDiagnostics(config) # Initialize the MLRun instance.
106106

107-
self.enable_wandb = self.config.enable_wandb and jax.process_index() == 0
108-
if self.enable_wandb:
107+
if self.config.enable_wandb and jax.process_index() == 0:
109108
wandb.init(
110109
project=config.wandb_project_name,
111110
name=config.wandb_run_name,
@@ -133,7 +132,7 @@ def write_metrics(self, metrics, step, is_training=True):
133132
if self.config.managed_mldiagnostics:
134133
self.write_metrics_to_managed_mldiagnostics(metrics, step)
135134

136-
if self.enable_wandb:
135+
if self.config.enable_wandb and jax.process_index() == 0:
137136
self.write_metrics_to_wandb(metrics, step)
138137

139138
def log_metrics(self, metrics, step, is_training):

0 commit comments

Comments
 (0)