PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #174
You are an ML engineer at a retail company. You have built a model that predicts a coupon to offer an ecommerce customer at checkout based on the items in their cart. When a customer goes to checkout,
The correct answer is B. Use a low latency database for the customers' historic purchase behavior.. To speed up slow coupon prediction times caused by joining customer cart data with historic purchase behavior from BigQuery, you should use a low-latency database for the historic purchase behavior data.
Question
Options
- AAttach an NVIDIA P100 GPU to your deployed model's instance.
- BUse a low latency database for the customers' historic purchase behavior.
- CDeploy your model to more instances behind a load balancer to distribute traffic.
- DCreate a materialized view in BigQuery with the necessary data for predictions.
How the community answered
(64 responses)- A6% (4)
- B73% (47)
- C5% (3)
- D16% (10)
Why each option
To speed up slow coupon prediction times caused by joining customer cart data with historic purchase behavior from BigQuery, you should use a low-latency database for the historic purchase behavior data.
Attaching a GPU accelerates deep learning inference but does not address data retrieval, which is identified as the bottleneck in this scenario.
The primary bottleneck is the real-time join operation with a BigQuery table for customer historic data, which is not optimized for low-latency, row-level lookups required for online predictions. Moving this data to a low-latency database like Cloud Spanner, Firestore, or Memorystore would significantly speed up data retrieval for inference, thereby reducing overall prediction latency.
Deploying to more instances behind a load balancer improves throughput by handling more concurrent requests but does not reduce the latency of individual prediction requests if the data retrieval from BigQuery remains slow.
While a materialized view can speed up queries within BigQuery, BigQuery itself is an analytical data warehouse, and retrieving single rows for real-time inference from it would still be slower than using a dedicated low-latency online serving database.
Concept tested: Optimizing online prediction latency; low-latency data sources
Source: https://cloud.google.com/architecture/architectures-for-ml-inference-on-gcp
Topics
Community Discussion
No community discussion yet for this question.