MLA-C01 Question 266
Select 2You are tasked with deploying a machine learning model into a production environment using Amazon SageMaker. The model requires GPU acceleration for inference in production, but during development and testing, CPU resources were sufficient. How should you configure the compute resources for both environments to optimize cost and performance?
- A
Use an ml.p2 instance type with GPUs for both production and testing environments.
- B
Use an ml.t2 or ml.m5 instance type with CPUs for testing and an ml.p3 instance type with GPUs for production.
- C
Use an ml.g4 instance type with GPUs for both production and testing environments.
- D
Use Amazon Elastic Inference to attach GPU acceleration to the instance for production while using an ml.t2 or ml.m5 instance type for testing.
- E
Use an Auto Scaling configuration in production with GPU instances and test the model locally on your laptop during development.
Show answer and explanation
Correct answers: B, D
Explanation
In production environments, it is important to balance performance and cost. GPU instances (e.g., ml.p3) or Elastic Inference provide the necessary acceleration for inference workloads in production. However, during testing and development, using CPU-based instances (e.g., ml.t2 or ml.m5) is sufficient and more cost-effective. This approach optimizes resource usage and ensures the solution is scalable and efficient.
- A. Incorrect.
Using an ml.p2 instance type with GPUs for both production and testing would unnecessarily increase costs during testing, as CPU-based instances are sufficient for development and testing purposes.
- B. Correct.
This is a cost-effective and efficient solution. CPU-based instances like ml.t2 or ml.m5 are sufficient for testing, while GPU-based instances like ml.p3 are optimal for production where performance is critical.
- C. Incorrect.
Using GPU-based instances like ml.g4 for both environments is not cost-efficient, as GPUs are not required for testing and development.
- D. Correct.
Attaching Amazon Elastic Inference to the production instance allows for GPU acceleration without the need for a full GPU instance, optimizing costs. CPU-based instances for testing further reduce unnecessary expenses.
- E. Incorrect.
Testing the model locally on a laptop may not accurately simulate the environment of the production instance, and using Auto Scaling with GPU instances during production is valid but does not address the testing environment efficiently.