mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-09 07:55:01 +08:00
[Perf][Easy] Early stop in request_block_hasher (#26112)
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
This commit is contained in:
parent
e0986ea07b
commit
201c971e96
@ -585,6 +585,10 @@ def get_request_block_hasher(
|
||||
start_token_idx = len(request.block_hashes) * block_size
|
||||
num_tokens = request.num_tokens
|
||||
|
||||
if start_token_idx + block_size > num_tokens:
|
||||
# Early stop when there no new full blocks created.
|
||||
return []
|
||||
|
||||
curr_mm_idx = 0
|
||||
if start_token_idx > 0:
|
||||
# Set curr_mm_idx = -1 to indicate the last mm input.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user