Google Professional Machine Learning Engineer Question 358
Select 3Google Cloud PlatformYou are deploying a machine learning model on Google Cloud for a real-time recommendation system. The system handles thousands of requests per second and requires low latency and high throughput. During testing, you notice that the predictions are slower than expected and consume excessive memory. Which steps should you take to optimize the performance of your ML solution?
- A
Use model quantization to reduce the size of the model and improve inference speed.
- B
Switch to a smaller VM instance type to reduce resource costs.
- C
Deploy the model using Vertex AI with a GPU for faster inference.
- D
Use batch predictions instead of online predictions to handle the request volume.
- E
Optimize the model architecture by reducing the number of layers or parameters.
Show answer and explanation
Correct answers: A, C, E
Explanation
To optimize performance for a real-time recommendation system, you should focus on techniques that reduce latency, improve throughput, and optimize resource usage. Model quantization helps reduce memory and improve inference speed. Using a GPU improves processing efficiency for high-throughput, low-latency tasks. Additionally, optimizing the model architecture ensures the model is efficient without unnecessary complexity. Batch predictions and smaller VM instances are not suitable for real-time, high-performance requirements.
- A. Correct.
Model quantization reduces the size of the model and speeds up inference by using lower precision data types (e.g., INT8 instead of FP32). This directly addresses the latency and memory issues.
- B. Incorrect.
Switching to a smaller VM instance type would likely worsen performance, as it reduces the available compute resources. This does not address the performance bottleneck.
- C. Correct.
Deploying the model with a GPU can significantly improve inference speed for compute-intensive models, especially in real-time systems requiring low latency.
- D. Incorrect.
Batch predictions are suitable for offline processing but are not appropriate for real-time systems requiring immediate responses. This would increase latency.
- E. Correct.
Reducing the number of layers or parameters in the model can improve inference speed and reduce memory usage, optimizing the model for the given constraints.