[Bugfix][Scheduler] Let pooling chunked prefill use full context (#48039)

Signed-off-by: Tommy <tran.tommy@hotmail.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Tommy
2026-10-07 07:32:00 +00:00
committed by GitHub
co-authored by OpenAI Codex Harry Mellor
parent cbee82324c
commit e6fc81bc78
3 changed files with 30 additions and 2 deletions
+19
View File
@@ -35,6 +35,7 @@ from vllm.multimodal.inputs import (
MultiModalKwargsItem,
PlaceholderRange,
)
from vllm.pooling_params import PoolingParams
from vllm.sampling_params import SamplingParams, StructuredOutputsParams
from vllm.utils.hashing import sha256
from vllm.v1.core.encoder_cache_manager import EncoderCacheManager
@@ -279,6 +280,24 @@ def test_schedule(enable_prefix_caching: bool, prompt_logprobs: int | None):
assert scheduler.running[i] == request
def test_pooling_chunked_prefill_can_finish_at_max_model_len():
scheduler = create_scheduler(
max_num_seqs=1, max_model_len=8, max_num_batched_tokens=4, runner="pooling"
)
assert scheduler.max_model_len == 8
request = Request(
request_id="pool",
prompt_token_ids=[1] * 8,
sampling_params=None,
pooling_params=PoolingParams(task="embed"),
)
scheduler.add_request(request)
scheduler.schedule()
# The final chunk must reach max_model_len, not stop one token short.
assert scheduler.schedule().num_scheduled_tokens == {"pool": 4}
def test_scheduler_stats_route_to_existing_output_client():
scheduler = create_scheduler()
request = create_requests(num_requests=1)[0]