ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Concept · Builds on AIF-C01

Experiment tracking: managed MLflow

Log parameters, metrics and artifacts for every training run, compare the runs, and repeat the best one.

You know from AI Practitioner

  • SageMaker AI runs MLflow as a managed service to track experiments and compare training runs.
  • Model Registry keeps a catalog of model versions with an approval status.
Read the AI Practitioner lesson
Training job
MLflow tracking server
S3 artifact store
Compare runs
Model Registry
  1. 1Training code logs parameters and metrics.
  2. 2Artifacts such as the model go to your S3 bucket.
  3. 3Open the MLflow UI and compare runs.
  4. 4Register the best model.
Each run logs to the tracking server, and the best run goes to the registry.
  • Random seed

    A parameter
  • Data version

    S3 URI and version ID
  • Code

    Git commit as a tag
  • Container

    Image URI as a tag
  • Settings

    Every hyperparameter
Log these five things and a run can be repeated.

What it is

Training is many runs, each with other data, settings or code. MLflow groups runs into an experiment. Each run logs parameters (settings), metrics (results, often per step) and artifacts (files such as the model and plots). You compare runs side by side in the MLflow UI and pick the best.

What it is

Managed MLflow has three parts. Compute and the metadata store (run IDs, parameters, metrics) live in the SageMaker AI service account and are managed for you. The artifact store is an S3 bucket in your account, and the server needs an IAM role that can reach it. Your code installs MLflow and the sagemaker-mlflow plugin and calls set_tracking_uri with the server ARN. The plugin signs each call with your IAM credentials. MLflow API calls are IAM actions under the sagemaker-mlflow prefix, so one team can log and another only read.

What it is

A tracking server comes in Small (the default, up to 25 users), Medium (up to 50) and Large (up to 100). Pick by users, data logged and call rate. It runs in a single Availability Zone. AWS also offers MLflow Apps, the newer managed form, which AWS prefers: they start faster and can be shared across accounts. Register the best model in the MLflow Model Registry and then in SageMaker Model Registry.

What it is

The older SageMaker Experiments SDK works only in Studio Classic. AWS recommends MLflow, and old code must be rewritten with the MLflow SDK. A run is reproducible only if you log the random seed, data version, code commit, container image and every hyperparameter. An audit can then trace a deployed model to its run.

Remember

  • Run: one attempt. Experiment: a group of runs.
  • Artifacts: your S3 bucket. Run metadata: the service account.
  • Sizes: Small 25 users, Medium 50, Large 100.

On the exam

  • “Track and compare many training runs, then register the best model” points to managed MLflow on SageMaker AI.
  • “Repeat a past training run exactly” points to logging seed, data version, code commit and container image with the run.
  • “A tracking server for 40 concurrent users” points to the Medium size.