Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions vllm/v1/core/sched/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1676,12 +1676,13 @@ def _update_waiting_for_remote_kv(self, request: Request) -> bool:
num_computed_tokens = len(block_ids) * self.block_size
# Handle the case where num request tokens less than one block.
num_computed_tokens = min(num_computed_tokens, request.num_tokens)
if num_computed_tokens == request.num_tokens:
num_computed_tokens -= 1
# This will cache the blocks iff caching is enabled.
self.kv_cache_manager.cache_blocks(request, num_computed_tokens)

# Update the request state for scheduling.
if num_computed_tokens == request.num_tokens:
# need to recompute last token in order to sample the next token
num_computed_tokens -= 1
request.num_computed_tokens = num_computed_tokens

# Return that we are ready.
Expand Down