Implement machine learning model lifecycle and operations Study Guide — AI-300

29% of the exam · domain 2 of 5 · Microsoft Machine Learning Operations Engineer Associate · Free Implement machine learning model lifecycle and operations practice questions

0 of 39 topics covered
What the exam asks here — tap to tick off0 / 8 covered
Domain 2 of 5

Implement ML Model Lifecycle and Operations

This domain accounts for 29% of the AI-300 exam — the single largest domain. It tests your ability to orchestrate the full machine learning lifecycle inside Azure Machine Learning (Azure ML): from experiment tracking and pipeline authoring, through model registration and responsible AI checks, to deployment, monitoring, drift detection, and automated retraining. Expect scenario-based questions where you must choose the right SDK v2 construct, CLI v2 command, or Azure ML Studio feature for a given operational requirement.


MLflow Experiment Tracking, Automated ML, and Notebooks

MLflow in Azure ML

MLflow is the open-source tracking library natively integrated into Azure ML. Every Azure ML workspace exposes a tracking URI so MLflow calls are automatically associated with workspace experiments.

Key facts the exam tests:

  • mlflow.set_experiment("name") creates or reuses an experiment by name.
  • mlflow.start_run() opens a run context; all mlflow.log_param(), mlflow.log_metric(), and mlflow.log_artifact() calls inside it write to Azure ML.
  • Autologging (mlflow.autolog()) captures params, metrics, and model artifacts without explicit calls. Supported frameworks: scikit-learn, PyTorch, TensorFlow/Keras, XGBoost, LightGBM, Spark MLlib.
  • Azure ML stores the MLflow model format under the run's outputs/mlflow-model/ path, making it directly deployable without conversion.
  • The tracking URI is retrieved with mlflow.set_tracking_uri(ws.get_mlflow_tracking_uri()) in SDK v1, or is set automatically when a job script runs inside an Azure ML compute context.

Automated ML (AutoML)

AutoML automates algorithm selection and hyperparameter search for classification, regression, time-series forecasting, NLP (text classification, NER), and computer vision tasks.

AutoML TaskTypical primary metricNotes
Classificationaccuracy, AUC_weightedDefault: AUC_weighted
Regressionnormalized_RMSE, r2_scoreDefault: normalized_RMSE
Forecastingnormalized_RMSERequires time_column_name
NLP ClassificationaccuracyRequires GPU compute
Object Detectionmean_average_precisionRequires GPU compute

Key AutoML limits:

  • experiment_timeout_hours: max wall-clock time; default 6 hours.
  • max_concurrent_iterations: must not exceed the number of nodes in the compute cluster.
  • enable_early_stopping: stops a child run if metric improvement stalls; enabled by default.
  • featurization: "auto" (default), "off", or a FeaturizationConfig object.

Notebooks

Azure ML Studio provides managed Jupyter notebooks and JupyterLab on compute instances. Notebooks are stored in the workspace file share (/home/azureuser/cloudfiles/code). The exam distinguishes:

  • Compute instance: single-node, always-on or scheduled, for interactive development.
  • Compute cluster: multi-node, scales to zero, for training jobs — not for interactive notebooks.

Common traps:

  • Assuming MLflow autolog captures every framework — Spark MLlib is supported but requires mlflow.pyspark.ml.autolog() explicitly.
  • Confusing mlflow.log_model() (logs a model artifact within a run) with mlflow.register_model() (registers to the model registry).
  • Believing AutoML requires a labeled dataset for forecasting — it also requires a time_column_name and a defined forecast_horizon.
  • Setting max_concurrent_iterations higher than cluster node count — this silently clamps or causes failures.

Hyperparameter Tuning Automation and Distributed Training

Hyperparameter Tuning with Azure ML Sweep Jobs

A sweep job (SDK v2) / HyperDriveConfig (SDK v1) automates hyperparameter search. The exam uses SDK v2 terminology.

Sampling StrategyBehaviorWhen to use
RandomParameterSamplingRandom draws; supports early terminationLarge search spaces, limited budget
GridParameterSamplingExhaustive grid; no early termination supportSmall discrete spaces
BayesianParameterSamplingUses past results to guide next trialMedium spaces, maximize metric efficiency
QUniform, QLog distributionsQuantized continuous valuesInteger hyperparameters

Early termination policies stop unpromising runs early:

PolicyKey parameterBehavior
BanditPolicyslack_factor or slack_amountCancels runs whose metric is outside slack of best run
MedianStoppingPolicyevaluation_intervalCancels if metric worse than median of completed runs
TruncationSelectionPolicytruncation_percentageCancels lowest X% of runs at each interval
NoTerminationPolicy—All runs complete (default for Grid sampling)

BanditPolicy with slack_factor=0.1 is the most exam-tested policy. It cancels a run if its primary metric is not within 10% of the best run's metric at that evaluation interval.

Distributed Training

FrameworkAzure ML distributed backendNotes
PyTorch DDPPyTorch distribution typeUses NCCL for GPU, Gloo for CPU
HorovodMpi distribution typeFramework-agnostic; requires horovod package
TensorFlow tf.distributeTensorFlow distribution typeMultiWorkerMirroredStrategy
Ray on SparkCustom setup on Spark clusterLess common in exam

In SDK v2, set distribution = MpiDistribution(process_count_per_instance=N) or TorchDistribution(process_count_per_instance=N). The instance_count in ResourceConfiguration sets the number of nodes.

Common traps:

  • Using GridParameterSampling with BanditPolicy — Grid sampling does not support early termination; the exam may present this as a valid combo.
  • Confusing max_total_trials (total runs) with max_concurrent_trials (parallel runs).
  • Believing Bayesian sampling supports early termination — it does not (runs must complete to inform the surrogate model).
  • Setting process_count_per_instance equal to the number of GPUs per node (correct) versus the total GPU count (wrong).

Worked scenario: A team has a 4-node GPU cluster (4 GPUs each) and wants to maximize metric efficiency with minimal runs. → Use BayesianParameterSampling, no early termination policy, instance_count=4, process_count_per_instance=4.


Unlock with a paid plan

9 more sections (about 2,422 words) continue below. Every paid plan unlocks all AI-300 study guides, the full question bank and mock exams, from $4.97/month.