neural_lam.utils.logging#
Setup and configuration of training loggers (WandB / MLFlow).
Functions#
|
Configure validation metric aggregation for the active training logger. |
|
Log a message only on rank zero using loguru logger. |
|
Set up the training logger (WandB or MLFlow). |
Module Contents#
- neural_lam.utils.logging.init_training_logger_metrics(training_logger: Any, val_steps: list[int]) None[source]#
Configure validation metric aggregation for the active training logger.
- neural_lam.utils.logging.log_on_rank_zero(msg: str, level: str = 'info', *args: Any, **kwargs: Any) None[source]#
Log a message only on rank zero using loguru logger.
- neural_lam.utils.logging.setup_training_logger(datastore: neural_lam.datastore.base.BaseDatastore, args: argparse.Namespace, run_name: str, run_dir: str) pytorch_lightning.loggers.Logger[source]#
Set up the training logger (WandB or MLFlow).
- Parameters:
datastore (BaseDatastore) – Datastore providing metadata for logging configuration.
args (argparse.Namespace) – Parsed training arguments controlling the logger backend.
run_name (str) – Name of the run.
run_dir (str) – Directory under which all artifacts for this run are written (logger
save_dir, checkpoints, Lightningdefault_root_dir). Typicallyruns/<run_name>.
- Returns:
The initialized logger object.
- Return type:
pl.loggers.Logger
- Raises:
ValueError – If
args.loggeris not'wandb'or'mlflow'.
Notes
When
--wandb_idis given,resume="allow"is set automatically: W&B resumes the run if it exists, or creates it with that ID otherwise. This allows the same job script to be safely resubmitted on HPC systems. The run name is set toNonewhen resuming to preserve the existing name.