Google Professional Machine Learning Engineer Question 346
Select 3Google Cloud PlatformYou are deploying a machine learning model to production using Google Kubernetes Engine (GKE). The model is packaged in a Docker container. The container needs to handle high traffic and offer low latency for predictions. Which of the following steps should you take to successfully deploy and serve the model in this containerized environment?
- A
Use a readiness probe in the Kubernetes deployment to ensure the container is ready to handle traffic before receiving requests.
- B
Configure horizontal pod autoscaling based on CPU utilization to handle spikes in traffic.
- C
Store the model weights in a persistent disk and load them dynamically into the container during every prediction request.
- D
Expose the containerized service using a Kubernetes Service and an external load balancer.
- E
Package the model and the serving logic in separate containers to optimize resource utilization.
Show answer and explanation
Correct answers: A, B, D
Explanation
To successfully deploy and serve a containerized machine learning model in GKE, you need to ensure that the container is ready to handle requests (readiness probe), can scale to handle variable traffic loads (horizontal pod autoscaling), and is exposed correctly for external access (Kubernetes Service with a load balancer). These steps ensure reliability, scalability, and proper traffic routing, which are critical for a production-grade serving environment.
- A. Correct.
Using a readiness probe ensures that traffic is routed to the container only when it is ready to serve requests, preventing failed requests during initialization.
- B. Correct.
Configuring horizontal pod autoscaling allows the application to scale up or down based on traffic, ensuring consistent performance during high demand.
- C. Incorrect.
Storing model weights in a persistent disk and dynamically loading them during every prediction request adds significant latency and is not a best practice for serving models.
- D. Correct.
Exposing the containerized service using a Kubernetes Service and an external load balancer ensures that incoming traffic is properly routed to the appropriate pods.
- E. Incorrect.
While separating the model and serving logic into different containers might be useful in some cases, it is not necessary for this scenario and can add unnecessary complexity.