[BugFix] Fix incremental detokenization perf issue#16963
[BugFix] Fix incremental detokenization perf issue#16963WoosukKwon merged 1 commit intovllm-project:mainfrom
Conversation
max was meant to be min - could cause O(n^2) blowup in pathological cases Signed-off-by: Nick Hill <nhill@redhat.com>
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
| prompt_len = len(prompt_suffix) | ||
| if prompt_len > 4: | ||
| for i in range(4, max(prompt_len + 1, 32)): | ||
| for i in range(4, min(prompt_len + 1, 24)): |
There was a problem hiding this comment.
Where does 24 come from? Can we use smaller numbers like 5?
There was a problem hiding this comment.
It's to try to find a small suffix to start from, or else it has to loop over the entire prompt below decoding the tokens one-by-one, which could be very long.
There was a problem hiding this comment.
So, does it mean we can't use smaller numbers?
WoosukKwon
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the fix! The performance looks normal after this PR:
============ Serving Benchmark Result ============
Successful requests: 100
Benchmark duration (s): 45.27
Total input tokens: 1000000
Total generated tokens: 20000
Request throughput (req/s): 2.21
Output token throughput (tok/s): 441.79
Total Token throughput (tok/s): 22531.15
---------------Time to First Token----------------
Mean TTFT (ms): 974.65
Median TTFT (ms): 413.66
P99 TTFT (ms): 2323.33
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms): 66.89
Median TPOT (ms): 77.80
P99 TPOT (ms): 83.48
---------------Inter-token Latency----------------
Mean ITL (ms): 66.89
Median ITL (ms): 27.12
P99 ITL (ms): 246.34
==================================================
Signed-off-by: Nick Hill <nhill@redhat.com> Signed-off-by: Frieda (Jingying) Huang <jingyingfhuang@gmail.com>
Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: Nick Hill <nhill@redhat.com> Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
Signed-off-by: Nick Hill <nhill@redhat.com> Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
maxwas meant to bemin- could cause O(n^2) blowup in pathological cases