ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 127 - Professional Machine Learning Engineer discussion

Report
Export

You are working on a system log anomaly detection model for a cybersecurity organization. You have developed the model using TensorFlow, and you plan to use it for real-time prediction. You need to create a Dataflow pipeline to ingest data via Pub/Sub and write the results to BigQuery. You want to minimize the serving latency as much as possible. What should you do?

A.
Containerize the model prediction logic in Cloud Run, which is invoked by Dataflow.
Answers
A.
Containerize the model prediction logic in Cloud Run, which is invoked by Dataflow.
B.
Load the model directly into the Dataflow job as a dependency, and use it for prediction.
Answers
B.
Load the model directly into the Dataflow job as a dependency, and use it for prediction.
C.
Deploy the model to a Vertex AI endpoint, and invoke this endpoint in the Dataflow job.
Answers
C.
Deploy the model to a Vertex AI endpoint, and invoke this endpoint in the Dataflow job.
D.
Deploy the model in a TFServing container on Google Kubernetes Engine, and invoke it in the Dataflow job.
Answers
D.
Deploy the model in a TFServing container on Google Kubernetes Engine, and invoke it in the Dataflow job.
Suggested answer: B

Explanation:

The best option for creating a Dataflow pipeline for real-time anomaly detection is to load the model directly into the Dataflow job as a dependency, and use it for prediction. This option has the following advantages:

It minimizes the serving latency, as the model prediction logic is executed within the same Dataflow pipeline that ingests and processes the data. There is no need to invoke external services or containers, which can introduce network overhead and latency.

It simplifies the deployment and management of the model, as the model is packaged with the Dataflow job and does not require a separate service or container. The model can be updated by redeploying the Dataflow job with a new model version.

It leverages the scalability and reliability of Dataflow, as the model prediction logic can scale up or down with the data volume and handle failures and retries automatically.

The other options are less optimal for the following reasons:

Option A: Containerizing the model prediction logic in Cloud Run, which is invoked by Dataflow, introduces additional latency and complexity. Cloud Run is a serverless platform that runs stateless containers, which means that the model prediction logic needs to be initialized and loaded every time a request is made. This can increase the cold start latency and reduce the throughput. Moreover, Cloud Run has a limit on the number of concurrent requests per container, which can affect the scalability of the model prediction logic. Additionally, this option requires managing two separate services: the Dataflow pipeline and the Cloud Run container.

Option C: Deploying the model to a Vertex AI endpoint, and invoking this endpoint in the Dataflow job, also introduces additional latency and complexity. Vertex AI is a managed service that provides various tools and features for machine learning, such as training, tuning, serving, and monitoring. However, invoking a Vertex AI endpoint from a Dataflow job requires making an HTTP request, which can incur network overhead and latency. Moreover, this option requires managing two separate services: the Dataflow pipeline and the Vertex AI endpoint.

Option D: Deploying the model in a TFServing container on Google Kubernetes Engine, and invoking it in the Dataflow job, also introduces additional latency and complexity. TFServing is a high-performance serving system for TensorFlow models, which can handle multiple versions and variants of a model. However, invoking a TFServing container from a Dataflow job requires making a gRPC or REST request, which can incur network overhead and latency. Moreover, this option requires managing two separate services: the Dataflow pipeline and the Google Kubernetes Engine cluster.

[Dataflow documentation]

[TensorFlow documentation]

[Cloud Run documentation]

[Vertex AI documentation]

[TFServing documentation]

asked 18/09/2024
Haleem SHITOU OGUNGBEMI
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first