[Perf][Rust Frontend] Coalesce decoded chunks per engine update - #55012
Conversation
Assisted-by: OpenAI Codex Signed-off-by: Bugen Zhao <i@bugenzhao.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe decoded text event stream now skips intermediate chunk appending when a finish reason exists. The terminal flush path emits the final decoded text. ChangesDecoded output handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change coalesces decoded chunks per engine update while preserving terminal flushing and existing streaming behavior. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/ci run |
|
✅ Triggered Buildkite CI #86935 for commit |
…-project#55012) Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Purpose
Streaming engine updates can carry multiple generated tokens with MTP or speculative decoding. The Rust frontend currently extracts and appends a decoded chunk after every token, then yields one
TextDeltafor the whole engine update.This change extracts at most one decoded chunk after each nonterminal engine update. Per-token decoding and stop-string checks remain in place, while terminal updates continue through the existing
flush()path.Local release microbenchmark results for the full incremental decode loop (
push_token+ decode +next_chunk+ append), using the Qwen3.5-0.8B tokenizer, 1,000 requests with 256 output tokens each, CPU 69 affinity, and the median of 7 samples:The benchmark harness was temporary and is excluded from this PR. End-to-end gains depend on the share of frontend CPU spent in incremental detokenization.
Test Plan
cargo nextest run -p vllm-textcargo clippy -p vllm-text --all-targets -- -D warningsgit diff --check origin/main...HEADTest Result
vllm-text: 90 passed, 1 skipped.AI assistance was used for code changes, validation, benchmarking, and PR preparation. Every changed line and the reported benchmark scope were reviewed by the submitter.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.