maxent_grpo.training.runtime.logging

Logging utilities (primarily W&B) for the training stack.

Functions

_ensure_wandb_installed()

Best-effort runtime install of wandb when it's missing.

_env_rank_zero()

Return True when common environment hints describe the primary node.

_git_sha()

Return the short git SHA for the current repo if available.

_is_primary_wandb_process(accelerator)

Return True when the current process should initialize a W&B run.

_log_wandb(run, metrics, step)

Safely log metrics to a W&B run.

_maybe_init_wandb_run(accelerator, ...)

Initialize a W&B run when report_to includes wandb.

_report_to_contains(report_to, target)

Case-insensitive membership check for TrainingArguments.report_to.

_torch_rank_zero()

Return True when a torch distributed rank 0 process is running.

_wandb_error_types()

Return exception types that should be suppressed during W&B logging.

log_run_header([training_args])

Log a consistent run header with recipe and resolved method identity.

resolve_run_metadata([training_args])

Return run-level metadata for logging consistency.

maxent_grpo.training.runtime.logging.log_run_header(training_args=None)[source]

Log a consistent run header with recipe and resolved method identity.

Parameters:

training_args (Any | None) – Optional training config used to resolve metadata.

Returns:

Metadata dictionary emitted to the logs.

Return type:

dict[str, str]

maxent_grpo.training.runtime.logging.resolve_run_metadata(training_args=None)[source]

Return run-level metadata for logging consistency.

Parameters:

training_args (Any | None) – Optional training config used to read recipe/method fields.

Returns:

Mapping with git SHA, recipe path, and resolved method identity.

Return type:

dict[str, str]