feat: add native continuous batching benchmark#2345
Conversation
|
Quick status note: I'm reworking this draft into a much smaller implementation that reuses the existing continuous-batching scheduler and the new per-request timing output from 20e5b61. The plan is for Python to launch a synchronized cohort of normal generate() calls, with only an aggregate cohort/overflow summary added on top—no second native benchmark scheduler or timing model. Please don't spend time adapting the current draft; I'll force-update it once the simpler version is tested. |
080d7ed to
19df5fe
Compare
19df5fe to
686956a
Compare
|
Update/correction to my earlier status note: the force-updated branch now uses a lean native C++ cohort runner, not a Python cohort of generate() calls. Python is only the CLI/ctypes/reporting bridge; atomic submission, real slot/overflow scheduling, waiting, validation, cleanup, and aggregate timing are all native and reuse the existing scheduler plus the BatchRequest PP/TG lines from 20e5b61. The focused tests and CPU/CUDA syntax checks pass. I am leaving the PR as a draft only until a loaded-model smoke test is available. |
Note
This remains a draft until it has had a loaded-model smoke test.
Summary
Adds a continuous-batching benchmark whose execution core is native C++. Python is limited to CLI validation, normal
generation_inputsmarshalling through ctypes, synthetic prompt construction, and console formatting.The native runner:
--parallelrequestsexercise real overflow waves;There is no second scheduler or parallel Python request runner. The existing native
BatchRequestlines from20e5b61remain the source of per-request PP/TG timings.Output
The console reports:
Metric-scope lines state that
BatchRequestPP/TG excludes native queue time, cohort latency includes it, and HTTP/SSE/Horde/network overhead is outside this benchmark.CLI
With four slots and eight jobs, this runs two native queue waves. A bare
--benchmark-batcheddefaults jobs to the slot count. Omitting--benchmark-contextdivides loaded context across the jobs that can be active concurrently.The synthetic benchmark alone uses deterministic greedy sampling and bans EOS. It does not normalize or override sampler settings for API or Horde generations.
Legacy
--benchmarkwith--parallelrequests > 1is rejected with guidance to add--benchmark-batched: the legacy path launches only one request and reads legacy timing globals, so its result is not a valid concurrent-batching measurement.Validation
git diff --checkand CLI help checks pass.A loaded-model runtime smoke is still outstanding, so the PR remains a draft.