nemo_automodel.components.loggers.mlflow_utils#
Module Contents#
Classes#
MLflow logger for experiment tracking and model management. |
Functions#
Build MLflow logger from configuration. |
Data#
API#
- nemo_automodel.components.loggers.mlflow_utils.logger#
βgetLogger(β¦)β
- class nemo_automodel.components.loggers.mlflow_utils.MLflowLogger(
- experiment_name: str,
- run_name: Optional[str] = None,
- tracking_uri: Optional[str] = None,
- tags: Optional[Dict[str, str]] = None,
- artifact_location: Optional[str] = None,
- **kwargs,
MLflow logger for experiment tracking and model management.
Initialization
Initialize MLflow logger.
- Parameters:
experiment_name β Name of the MLflow experiment
run_name β Name of the current run (optional)
tracking_uri β MLflow tracking server URI (optional)
tags β Dictionary of tags to add to the run
artifact_location β Location to store artifacts (optional)
**kwargs β Additional arguments passed to mlflow.start_run()
- log_params(params: Dict[str, Any]) None#
Log parameters to MLflow.
- Parameters:
params β Dictionary of parameters to log
- log_metrics(
- metrics: Dict[str, float],
- step: Optional[int] = None,
Log metrics to MLflow.
- Parameters:
metrics β Dictionary of metrics to log
step β Step number for the metrics (optional)
- log_artifacts(
- local_dir: str,
- artifact_path: Optional[str] = None,
Log artifacts to MLflow.
- Parameters:
local_dir β Local directory containing artifacts
artifact_path β Path within the runβs artifact directory (optional)
- log_artifact(
- local_path: str,
- artifact_path: Optional[str] = None,
Log a single artifact to MLflow.
- Parameters:
local_path β Local path to the artifact
artifact_path β Path within the runβs artifact directory (optional)
- log_model(
- model: torch.nn.Module,
- artifact_path: str = 'model',
- registered_model_name: Optional[str] = None,
- **kwargs,
Log a PyTorch model to MLflow.
- Parameters:
model β PyTorch model to log
artifact_path β Path within the runβs artifact directory
registered_model_name β Name for model registry (optional)
**kwargs β Additional arguments for mlflow.pytorch.log_model()
- __enter__()#
- __exit__(exc_type, exc_val, exc_tb)#
- nemo_automodel.components.loggers.mlflow_utils.build_mlflow(
- cfg,
Build MLflow logger from configuration.
- Parameters:
cfg β Configuration object containing MLflow settings
- Returns:
MLflowLogger instance