nemo_automodel.components.loggers.wandb_utils

View as Markdown

Module Contents

Functions

NameDescription
init_wandb_runInitialize a W&B run from a config dict.
suppress_wandb_log_messagesPatches wandb logger to suppress upload messages.

API

nemo_automodel.components.loggers.wandb_utils.init_wandb_run(
wandb_cfg: dict,
full_config: dict,
default_name: str = ''
)

Initialize a W&B run from a config dict.

A recipe-agnostic counterpart to recipe-local build_wandb helpers: it takes the already-resolved wandb kwargs (project, entity, name, …) and the full run config to record, and falls back to default_name when no run name is given.

Parameters:

wandb_cfg
dict

Keyword args forwarded to wandb.init (e.g. project, entity, name).

full_config
dict

The full resolved config to store as the run’s config.

default_name
strDefaults to ''

Run name to use when wandb_cfg does not set one.

Returns:

The initialized wandb.Run.

nemo_automodel.components.loggers.wandb_utils.suppress_wandb_log_messages() -> None

Patches wandb logger to suppress upload messages.

These occur usually on KeyboardInterrupt or program crash.

To print the log url: run = wandb.init(…) print(run.url)