Repository navigation
[LLM serving 2/x] Add batching-backed serving session lifecycle - #23277
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23277
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b6eb36b with merge base 273ecf9 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
mergennachin
left a comment
There was a problem hiding this comment.
Looks good to me. When generation is added, please test that resetting or closing a session stops its current response before reporting success, and that other sessions can continue generating.
ffb3ce7 to
cd6e869
Compare
15fa4f2 to
8e060fb
Compare
cd6e869 to
5f693b4
Compare
8e060fb to
5127145
Compare
5127145 to
53cdd22
Compare
Give serving clients stable logical session keys while keeping physical execution and cleanup in the existing batching runtime. Reset replaces state under the same key and reports reopening failure explicitly; bounded admission and ordered lifecycle operations make later concurrent generation safe to add separately. Runner owns thread-safe Pending/Ready/Failed initialization state and contains initialization exceptions; serving uses the original executor directly. Test Plan: Serving and batching CMake targets passed. Standalone validation passed 20 lifecycle tests and 164 batching tests, 100 normal lifecycle repetitions, 25 ThreadSanitizer repetitions, and 19 lifecycle tests with exceptions disabled. Initialization exceptions settle as not-ready errors rather than terminating the engine thread. Authored with AI assistance from Devmate.
53cdd22 to
b6eb36b
Compare
This PR needs a
|
Introduce an experimental ServingRuntime that manages named sessions on top of the existing batching runtime. It owns one Runner and scheduler, while physical session state and cleanup remain with batching::Session.
This PR covers lifecycle management only. Generation, tokenization, streaming, and prefix reuse are added separately; no new scheduler or decode loop is introduced.