AMOOOMA opened a new pull request, #40714:
URL: https://github.com/apache/beam/pull/40714

   ## Summary
   
   When `RunInference` updates its model via side input (`ModelMetadata`), 
`_RunInferenceDoFn._load_model` acquires the new model under the updated 
`model_id` tag (`self._cur_tag`) so `ModelManager` caches and evicts the new 
model version separately from the previous version, while the 
`BeamML_RunInference` transform annotation remains fixed at construction time 
(`self._model_tag` / `model_identifier`).
   
   This PR passes `metric_tag=self._model_tag` through `_SharedModelWrapper` to 
`ModelManager.acquire_model(..., metric_tag=...)`, and maps `metric_tag` to the 
active version tag in `ModelManager` and `ResourceEstimator` so 
`num_loaded_models_<metric_tag>` and `memory_estimate_mb_<metric_tag>` continue 
reporting under the original `metric_tag` across runtime side-input model 
updates.
   
   ## Testing
   - Updated 
`test_run_inference_dofn_model_update_acquires_and_releases_matching_tag` in 
`base_test.py` to verify `metric_tag` preservation across model updates.
   - Added `test_model_manager_metrics_with_metric_tag` in 
`model_manager_test.py`.
   


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