Databricks-ML-Pro Model Development Practice Question
An ML engineer is training a PyTorch model on a Databricks cluster and wants to automatically log training metrics, parameters, and the model artifact to MLflow without writing explicit mlflow.log_* calls in the training script. The engineer also needs the run to be nested under a parent run that tracks the overall experiment. Which approach should the engineer use?
⚠ Common exam trap
The trap here is assuming that autologging automatically creates nested runs or that manual logging is required for nesting.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Enable autologging with mlflow.pytorch.autolog() before training, and use mlflow.start_run(nested=True) to create a child run under the parent run.
Autologging for PyTorch is enabled via mlflow.pytorch.autolog(), which captures training metrics, parameters, and the model artifact automatically. To nest the run under a parent, the engineer must explicitly start a child run with mlflow.start_run(nested=True). Combining these two features satisfies both automatic logging and hierarchical run organization without manual logging calls.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use mlflow.pytorch.autolog() and rely on it to automatically create a nested run for each training session.
Why it's wrong here
Autologging does not create nested runs automatically. It logs to the currently active run, which would be the parent run if one is active. To create a nested run, you must explicitly start a run with nested=True. Relying on autologging alone would not produce the required parent-child run structure.
- ✗
Manually log all metrics and parameters using mlflow.log_metric() and mlflow.log_param(), and use mlflow.start_run(nested=True) for nesting.
Why it's wrong here
Manual logging requires explicit calls for every metric and parameter, which contradicts the requirement to avoid writing mlflow.log_* calls. While nested=True would handle nesting, the manual approach fails the primary constraint of automatic logging. This option does not meet the 'without writing explicit mlflow.log_* calls' requirement.
- ✗
Use the MLflow Tracking API to create a parent run, then call mlflow.pytorch.autolog() inside the parent run without starting a child run.
Why it's wrong here
Autologging inside a parent run without starting a child run would log all metrics and artifacts directly to the parent run, not to a nested child run. This fails the nesting requirement. The engineer needs a separate child run to isolate the training session's logs under the parent.
- ✓
Enable autologging with mlflow.pytorch.autolog() before training, and use mlflow.start_run(nested=True) to create a child run under the parent run.
Why this is correct
mlflow.pytorch.autolog() automatically captures metrics, parameters, and model artifacts during training without manual logging calls. Wrapping the training in mlflow.start_run(nested=True) creates a child run nested under an active parent run, satisfying the nesting requirement. This combination directly addresses both needs: automatic logging and hierarchical run organization.
About these practice questions
One of 300 original Databricks-ML-Pro practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-ML-Pro practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-ML-Pro exam.