
Answer-first summary for fast verification
Answer: Use the RunInference API with WatchFilePattern in a Dataflow job that wraps around the model and serves predictions.
The correct answer is D. The RunInference API with WatchFilePattern in a Dataflow job is recommended in this scenario for several reasons. The RunInference API allows for the serving of machine learning models directly within an Apache Beam pipeline, providing both flexibility and portability. The WatchFilePattern feature enables automatic detection of model changes in Cloud Storage, allowing for seamless updates without requiring manual interventions or managing endpoint deployments. This combination helps achieve low latency for predictions and minimizes the effort needed to update the model frequently, aligning perfectly with the requirements of minimizing prediction latency and reducing update effort.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your company manages an ecommerce website where users can add items to their cart and receive recommendations for additional products they might be interested in. You developed a machine learning model that provides these recommendations in near real time. The current workflow is designed as follows: 1. The website will send a message with relevant user and cart data to Pub/Sub and then awaits a message back from Pub/Sub containing the prediction. 2. The predictions are stored in BigQuery for analytics and reporting purposes. 3. The machine learning model itself is stored in a Cloud Storage bucket, where it will be updated frequently to ensure accuracy and relevance. Considering the goal to minimize prediction latency and reduce the effort required to frequently update the model, how should you reconfigure the architecture?
A
Write a Cloud Function that loads the model into memory for prediction. Configure the function to be triggered when messages are sent to Pub/Sub.
B
Create a pipeline in Vertex AI Pipelines that performs preprocessing, prediction, and postprocessing. Configure the pipeline to be triggered by a Cloud Function when messages are sent to Pub/Sub.
C
Expose the model as a Vertex AI endpoint. Write a custom DoFn in a Dataflow job that calls the endpoint for prediction.
D
Use the RunInference API with WatchFilePattern in a Dataflow job that wraps around the model and serves predictions.
No comments yet.