DP-100 · Question #169
Drag and Drop Question You create a multi-class image classification deep learning experiment by using the PyTorch framework. You plan to run the experiment on an Azure Compute cluster that has…
The correct answer is Configure a DataTransferStep() to fetch new image data from public web portal, running on the cpu-compute compute target.; Configure a PythonScriptStep() to run image_resize.py on the cpu-compute compute target.; Configure an EstimatorStep() to run an estimator that runs the bird_classifier_train.py model training script on the gpu_compute compute target. To retrain a deep learning model efficiently and cost-effectively, the pipeline must sequentially fetch new data, preprocess it on CPU for minimal cost, and then train the model on GPU to minimize training time.
Question
Exhibit
Answer Area
Drag items
Correct arrangement
- Configure a DataTransferStep() to fetch new image data from public web portal, running on the cpu-compute compute target.
- Configure a PythonScriptStep() to run image_resize.py on the cpu-compute compute target.
- Configure an EstimatorStep() to run an estimator that runs the bird_classifier_train.py model training script on the gpu_compute compute target.
Explanation
To retrain a deep learning model efficiently and cost-effectively, the pipeline must sequentially fetch new data, preprocess it on CPU for minimal cost, and then train the model on GPU to minimize training time.
Approach. The goal is to define an Azure Machine Learning pipeline for monthly retraining of a PyTorch deep learning image classification model on GPU nodes, optimizing for minimal cost and minimal training time. The correct sequence of three steps is:
-
Configure a DataTransferStep() to fetch new image data from public web portal, running on the cpu-compute compute target.
- Reasoning: The first logical step in any retraining pipeline is to acquire new data. A DataTransferStep is specifically designed for fetching data from external sources. Running this step on a 'cpu-compute' target is cost-effective because data transfer operations typically do not require the specialized processing power of GPUs.
-
Configure a PythonScriptStep() to run image_resize.py on the cpu-compute compute target.
- Reasoning: After fetching, image data often requires preprocessing, such as resizing, before it can be used for model training. A PythonScriptStep is suitable for executing custom data manipulation scripts. Performing this preprocessing on a 'cpu-compute' target helps keep costs down, as image resizing is generally a CPU-bound task and does not benefit significantly from GPUs.
-
Configure an EstimatorStep() to run an estimator that runs the bird_classifier_train.py model training script on the gpu-compute compute target.
- Reasoning: The problem specifies a 'deep learning experiment' using PyTorch, requiring 'minimal time to train' and utilizing 'nodes with GPUs'. Deep learning training, especially for image classification, is computationally intensive and benefits enormously from GPUs. An EstimatorStep is the recommended and most robust way to submit deep learning training jobs in Azure ML, as it handles environment setup, logging, and framework integration efficiently. Using the 'gpu-compute' target is crucial for achieving the 'minimize training time' objective for a deep learning model.
Common mistakes.
- common_mistake. A common mistake is selecting a 'cpu-compute' target for the deep learning model training step. For example, 'Configure an EstimatorStep() to run an estimator that runs the bird_classifier_train.py model training script on the cpu-compute compute target' or 'Configure a PythonScriptStep() to run bird_classifier_train.py on the cpu-compute compute target'. This is incorrect because deep learning experiments are designed to leverage GPUs for significantly faster training times, and the question explicitly states the cluster has GPUs and the goal is to 'minimize the time required to train the model'. While a CPU might be cheaper per hour, the much longer training duration on a CPU would result in higher overall costs and fail to meet the performance requirement. Another mistake would be an incorrect sequence, such as attempting to train the model before fetching or preprocessing the data. Combining fetching and resizing into a single 'PythonScriptStep' (e.g., 'Configure a PythonScriptStep() to run both image_fetcher.py and image_resize.py on the cpu-compute compute target') is less optimal because a dedicated 'DataTransferStep' offers more specialized features for data ingestion, and breaking down tasks into distinct steps improves modularity and monitoring within a pipeline.
Concept tested. Azure Machine Learning pipelines, compute targets (CPU vs. GPU), deep learning model retraining strategies, cost optimization in cloud ML, and the appropriate use of different pipeline steps (DataTransferStep, PythonScriptStep, EstimatorStep) for data ingestion, preprocessing, and model training.
Topics
Community Discussion
No community discussion yet for this question.
