A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Core] Simplify setting new_token_ids in CachedRequestData (#26388)
Signed-off-by: Nick Hill <nhill@redhat.com>
Nick Hill committed
Oct 7, 2025 at 20:32 UTC
067da2d1df141363f0ad65939049709b2dbd5080
1 file changed
+1
-7
vllm/v1/core/sched/scheduler.py
+1
-7
@@ -712,7 +712,6 @@ class Scheduler(SchedulerInterface):
712
num_computed_tokens: list[int] = []
713
num_output_tokens: list[int] = []
714
715
- use_connector = self.connector is not None
715
for req in itertools.chain(running_reqs, resumed_reqs):
716
req_id = req.request_id
717
req_ids.append(req_id)
@@ -729,16 +728,11 @@ class Scheduler(SchedulerInterface):
728
req.num_computed_tokens : req.num_computed_tokens + num_tokens
729
]
730
new_token_ids.append(token_ids)
732
- elif use_connector:
733
- # When using a KVConnector, we add a placeholder to avoid index
734
- # out of bounds errors. TODO: Remove this once the KVConnector
735
- # is updated to handle token IDs properly.
736
- new_token_ids.append([])
731
new_block_ids.append(
732
req_to_new_blocks[req_id].get_block_ids(allow_none=True)
733
)
734
num_computed_tokens.append(req.num_computed_tokens)
741
- num_output_tokens.append(len(req.output_token_ids))
735
+ num_output_tokens.append(req.num_output_tokens)
736
# Because resumed_reqs is usually empty, it is more efficient to do
737
# in-place appending so that we don't need to allocate a new list.
738
resumed_from_preemption = [False] * len(running_reqs)