riteshghorse commented on code in PR #30164:
URL: https://github.com/apache/beam/pull/30164#discussion_r1473377956


##########
sdks/python/apache_beam/ml/transforms/embeddings/vertex_ai.py:
##########
@@ -49,9 +54,20 @@
     "CLASSIFICATION",
     "CLUSTERING"
 ]
+
+errors = (
+    ResourceExhausted,
+    ServiceUnavailable,
+    Aborted,
+    DeadlineExceeded,
+)

Review Comment:
   Should we add `TooManyRequests` as well? 



##########
sdks/python/apache_beam/ml/transforms/embeddings/vertex_ai.py:
##########
@@ -73,6 +89,8 @@ def __init__(
     self.task_type = task_type
     self.title = title
 
+  @retry.with_exponential_backoff(
+      retry_filter=retry_on_vertex_ai_errors, num_retries=5)

Review Comment:
   IIUC, this will retry on entire batch rather just the failed elements? We 
could potentially separated the VertexAI call and decorate that method instead 
like 
https://github.com/apache/beam/blob/89d1c06e1eab530c4e95a807a035b450c340e5f8/sdks/python/apache_beam/ml/inference/vertex_ai_inference.py#L193



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to