Repository navigation
Conversation
|
Pulled your fix, works on my end. Thank you for your work! |
|
/bot review |
Automated code reviewCode review: PR #28913 - router model eviction raceThe core approach (reserving Blocking(point 1) Permanent hang in the new stopping-model wait loop - (point 2) Unrelated, undisclosed changes in this PR - Will slow the review(point 3) Reservation is lost across instance replacement - (point 4) Unload semantics change - a request that waits out an explicit (point 5) Inconsistent handling of the draft context probe - (point 6) Test nits - Nits(point 7) This review was generated automatically by pi coding agent using |
Squash of ggml-org#28913 at 05c7def. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
CI is currently showing two failing checks. The NVIDIA WebGPU check is failing with a |
|
Please address the review points. |
|
I ran my Fable 5.1 agent on it and it found things the bot didn't, but he validated the majority of what the bot found. It was too large and complex for me to review quickly : Thanks for the fix. I reproduced both variants of #28698 locally and reviewed the diff against master. Confirming the two state bugs the automated review found, adding a third window it missed, plus a few notes. Repro setupRouter with three small models, Variant A, request for A, then a request for B 2.1s later so B queues while A is still LOADING: Variant B, A loaded and idle, request for B, then a request for A 50ms later: The diagnosis in the PR description matches what the logs show, and the direction (make the model count as busy before the readiness check is released) is the right one. Confirming the automated reviewIts point 1 (permanent hang in the new stopping wait loop) is real. The loop only leaves on UNLOADED or on entry erasure, so if the child exits and another request reloads the model while the waiter sits in Its point 3 (reservation lost across instance replacement) is real too, and I checked the mechanism: Its point 2 (out of scope changes) is worth acting on: the One more window, not covered by either the PR or the bot
Design notesThe reservation is threaded through a Taking the reservation during LOADING is what exposes it to the instance replacement described above. Taking it at the moment the model is observed ready, under the same lock that releases the queue entry, keeps the handoff atomic and leaves the protection during the load to the queue entry, which Re-spawning the model in the UNLOADED branch means an explicit Tests
The router preset already sets |
05c7def to
c6af405
Compare
c6af405 to
bc37cf4
Compare
|
@pwilkin I've addressed the review feedback. Could you please take another look? |
|
@ServeurpersoCom Thanks for the detailed review. I addressed the two state/race issues identified by the automated review, removed the unrelated changes from #28242, and also updated the stopping_models/UNLOADED transition so it is synchronized under the same mutex as you suggested for the additional race window. I also verified the relevant router regression tests locally. |
|
@ServeurpersoCom The remaining 3 CI checks (gpu-openvino-low-perf, gpu-vulkan-intel-linux, and gpu-vulkan-intel-windows) have been queued for ~21 hours and are still waiting for their self-hosted runners. All other CI checks have completed successfully. Just flagging this in case the runners need attention. |
|
I will have a look on either this should be done along with an upcoming refactoring, or can be a separate fix on its own |
|
Thanks for digging into this. I reproduced both variants on master with the script from the issue, which simply sends requests to two models at once, and fixed them in #29217 with two small targeted commits that reuse the existing request queue of ngxson's scheduler instead of adding a new reservation mechanism; the full server test suite passes with both. With AI-generated fixes answering AI reviews, the patch kept growing, and for concurrency code like this it was simpler to restart from zero than to review it. |
Overview
Fixes #28698 by reserving
req_countduringensure_model_ready()and preventing requests from treating stopping models as ready.Added regression tests for:
tick(),pick_victim(), and LRU behavior are unchanged.Additional information
Tests:
unit/test_router.py— 16 passed.Requirements