Discover the most cost-effective TensorFlow estimator configuration for training machine learning models on Amazon SageMaker. Learn how to leverage SageMaker Training Compiler and managed spot training to optimize costs.
Table of Contents
Question
A manufacturing company wants to create a machine learning (ML) model to predict when equipment is likely to fail. A data science team already constructed a deep learning model by using TensorFlow and a custom Python script in a local environment. The company wants to use Amazon SageMaker to train the model.
Which TensorFlow estimator configuration will train the model MOST cost-effectively?
A. Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
B. Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Turn on managed spot training by setting the use_spot_instances parameter to True. Pass the script to the estimator in the call to the TensorFlow fit() method.
C. Adjust the training script to use distributed data parallelism. Specify appropriate values for the distribution parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
D. Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Set the MaxWaitTimeInSeconds parameter to be equal to the MaxRuntimeInSeconds parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
Answer
B. Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Turn on managed spot training by setting the use_spot_instances parameter to True. Pass the script to the estimator in the call to the TensorFlow fit() method.
Explanation
B. Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Turn on managed spot training by setting the use_spot_instances parameter to True. Pass the script to the estimator in the call to the TensorFlow fit() method.
Using SageMaker Training Compiler optimizes the training process by compiling the model graph and making it more efficient. This reduces training time and costs.
Enabling managed spot training with use_spot_instances=True allows SageMaker to use spare EC2 capacity at a discounted price, further reducing costs. SageMaker automatically provisions and manages the spot instances.
Passing the script to the estimator in the TensorFlow fit() method ensures the compiled and spot-optimized configuration is applied during training.
The other options are less cost-effective:
A. Only uses Training Compiler without managed spot training, missing cost savings.
C. Distributed data parallelism can speed up training but doesn’t necessarily reduce costs.
D. Setting MaxWaitTimeInSeconds equal to MaxRuntimeInSeconds negates the cost benefits of spot instances by waiting the entire maximum runtime.
Therefore, B provides the most cost-effective configuration by combining SageMaker Training Compiler and managed spot training.
Amazon AWS Certified Machine Learning – Specialty (MLS-C01) certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Amazon AWS Certified Machine Learning – Specialty (MLS-C01) exam and earn Amazon AWS Certified Machine Learning – Specialty (MLS-C01) certification.