Skip to content

Commit 755d632

Browse files
committed
some misc
1 parent 0635c9a commit 755d632

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/forge/observability/metrics.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ async def log_samples(self, samples: Dict[str, List[dict]], step: int) -> None:
10541054
columns = list(table_rows[0].keys())
10551055
table = wandb.Table(columns=columns, log_mode="INCREMENTAL")
10561056
self._tables[table_name] = table
1057-
logger.info(
1057+
logger.debug(
10581058
f"WandbBackend: Created new incremental table: {table_name}"
10591059
)
10601060
else:
@@ -1066,10 +1066,10 @@ async def log_samples(self, samples: Dict[str, List[dict]], step: int) -> None:
10661066
table.add_data(*values)
10671067

10681068
# Log the same table object (INCREMENTAL update)
1069+
# table_name has to end with _table to be recognized by wandb
1070+
if not table_name.endswith("_table"):
1071+
table_name += "_table"
10691072
self.run.log({f"{table_name}": table})
1070-
logger.info(
1071-
f"WandbBackend: Appended {len(table_rows)} rows to incremental table '{table_name}' at step {step}"
1072-
)
10731073

10741074
def get_metadata_for_secondary_ranks(self) -> dict[str, Any]:
10751075
if self.run and self.per_rank_share_run:
@@ -1080,15 +1080,19 @@ async def finish(self) -> None:
10801080
import wandb
10811081

10821082
if self.run:
1083-
# Convert each incremental table to immutable before finishing
1083+
"""
1084+
Convert each incremental table to immutable before finishing
1085+
as recommended by wandb:
1086+
https://docs.wandb.ai/models/tables/log_tables#incremental-mode
1087+
"""
10841088
for table_name, incr_table in self._tables.items():
10851089
final_table = wandb.Table(
10861090
columns=incr_table.columns,
10871091
data=incr_table.data,
10881092
log_mode="IMMUTABLE",
10891093
)
10901094
self.run.log({table_name: final_table})
1091-
logger.info(f"WandbBackend: Finalized table {table_name}")
1095+
logger.debug(f"WandbBackend: Finalized table {table_name}")
10921096

10931097
self.run.finish()
10941098
logger.info(f"WandbBackend {self.process_name}: Finished run")

0 commit comments

Comments
 (0)