Perf/opsd continuous batching benchmark clean - #1011
Draft
nathon-lee wants to merge 2 commits into
Draft
Conversation
Signed-off-by: nathon-lee <leejianwoo@gmail.com>
Signed-off-by: nathon-lee <leejianwoo@gmail.com>
delock
self-requested a review
August 30, 2026 14:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a reproducible OPSD continuous‑batching benchmark for comparing:
The benchmark uses deterministic synthetic prompts, fixed response budgets,
greedy decoding, synchronized CUDA timing, peak‑memory reporting, and JSON
results suitable for later comparison.
This PR only changes
DeepSpeedExamples; it does not modify DeepSpeed Core.Dependency
This PR depends on DeepSpeed PR #8368.
DeepSpeed PR #8368 provides the Core continuous‑batching rollout API used by
this benchmark, including request scheduling, request retirement, pending
request refill, KV‑cache row compaction, and legacy KV‑cache compatibility.
The Core implementation from #8368 must be available through
PYTHONPATHbefore running the benchmark. This Examples PR intentionally contains only the
benchmark, tests, and documentation, and should be merged after the API from
#8368 is available in DeepSpeed
master.Validation
Integration validation used the DeepSpeed Core implementation from PR #8368.
Tested on one NVIDIA RTX A4500 with PyTorch 2.9.1+cu128,
CUDA 12.8, Transformers 4.40.2, and DeepSpeed
0.19.6+a36f78e7.
Workload:
facebook/opt‑6.7bContinuous batching avoided 64 decode tokens (
16.67%) compared with staticbatching. It improved mean latency by
30.07%and useful‑token throughput by43.00%compared with sequential eager generation.Compared with static batching, the current legacy‑KV‑cache prototype was
3.92%slower and used approximately995 MiBmore peak allocated memory.The benchmark therefore validates request scheduling, retirement, refill, and
output correctness, while exposing the remaining refill/cache‑management
overhead. It does not claim an end‑to‑end speedup over static batching.
Additional checks:
Scope and limitations
--require‑exact‑token‑matchis available for strict correctness checks.