Repository navigation
[RunInference] Fix ModelManager active accounting when spawning after eviction - #41901
Conversation
|
Assigning reviewers: R: @kennknowles added as fallback since no labels match configuration Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
I think @tvalentyn is a possible good reviewer here. The PR didn't get tagged appropriately. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41901 +/- ##
=========================================
Coverage 59.63% 59.64%
Complexity 5188 5188
=========================================
Files 1471 1471
Lines 188508 188541 +33
Branches 3885 3885
=========================================
+ Hits 112418 112456 +38
+ Misses 72678 72673 -5
Partials 3412 3412
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #41900
Right now, when
ModelManager.should_spawn_model()frees up memory using_evict_to_make_space()it returns True without updating_pending_reservations,_total_active_jobsor_active_counts[tag].This breaks the counters:
_total_active_jobsstays 0 while the new model is actually running, so an unknown model can enter isolation mode and delete it mid-inference.release_model()runs later,_total_active_jobsgoes negative._spawn_new_model()still subtractsest_costfrom_pending_reservations(messing up other concurrent loads) and drops_active_counts[tag]below 0 if the load fails.Changes
_pending_reservations,_total_active_jobsand_active_counts[tag]inshould_spawn_model()even when space is freed via eviction.sdks/python/apache_beam/ml/inference/model_manager_test.py:test_eviction_spawn_updates_active_accountingtest_eviction_spawn_load_failure_preserves_accountingtest_eviction_spawn_protected_from_isolation_flush