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


##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -308,17 +308,13 @@ class _ModelManager:
   parameter, if that is set it will only hold that many models in memory at
   once before evicting one (using LRU logic).

Review Comment:
   remove doc statement for `max_models`



##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -587,6 +588,14 @@ def run_inference(
           keys,
           self._unkeyed.run_inference(unkeyed_batch, model, inference_args))
 
+    # The first time a MultiProcessShared ModelManager is used for inference
+    # from this process, we should increment its max model count
+    if self._max_models_per_worker_hint is not None:
+      lock = threading.Lock()
+      if lock.acquire(blocking=False):

Review Comment:
   curious why are we not using a blocking lock?



-- 
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