Google Professional Machine Learning Engineer Question 355
Select 2Google Cloud PlatformYou are deploying a machine learning model on Google Cloud for a real-time fraud detection system. The solution must handle high transaction volumes with minimal latency and avoid exceeding memory limits on the prediction infrastructure. Which of the following approaches should you take to optimize the ML solution for performance, latency, and memory usage?
- A
Use Vertex AI's online prediction with optimized model serialization formats like TensorFlow SavedModel or ONNX.
- B
Deploy the model on a Compute Engine instance with auto-scaling enabled and high-memory machine types.
- C
Enable GPU acceleration for prediction, even if the model is lightweight and CPU-optimized.
- D
Perform model quantization to reduce model size and improve inference speed.
- E
Batch incoming requests for predictions instead of processing each request individually.
Show answer and explanation
Correct answers: A, D
Explanation
Optimizing an ML solution for performance, latency, and memory usage involves choosing the right deployment strategy and optimizing the model itself. Using Vertex AI's online prediction provides an efficient, scalable environment for serving models, while model quantization reduces computational overhead and memory usage, improving inference speed. Other options, like GPU acceleration and batching, may not align with the specific requirements of real-time fraud detection.
- A. Correct.
Using Vertex AI's online prediction with optimized model serialization formats ensures fast and efficient model deployment. Formats like TensorFlow SavedModel or ONNX are designed for optimal inference performance.
- B. Incorrect.
Deploying the model on a Compute Engine instance with high-memory machine types might increase memory capacity, but it may not address latency or throughput issues effectively. Auto-scaling might also add overhead in real-time scenarios.
- C. Incorrect.
GPU acceleration is typically unnecessary for lightweight models optimized for CPU inference. It may lead to unnecessary costs without improving performance.
- D. Correct.
Model quantization reduces the model's size and memory requirements while improving inference speed, making it an effective method for optimizing performance and latency.
- E. Incorrect.
Batching requests might reduce throughput for real-time applications like fraud detection, where each transaction must be processed with minimal delay.