Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
b7052cb
fix: Reset resumed streaming session's block table
albertoperdomo2 Oct 9, 2026
c3b0b51
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 9, 2026
34d9136
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 9, 2026
e016a28
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 11, 2026
9d6e1b8
chore: Rename loop variable to be more accurate
albertoperdomo2 Oct 14, 2026
3aae52b
fix: Reset SimpleCPUOffload block table for resumed streaming sessions
albertoperdomo2 Oct 14, 2026
1d584b9
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 14, 2026
3b799b8
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 15, 2026
38f13b4
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 16, 2026
6ada3af
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 16, 2026
da25bb5
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 17, 2026
e26bc84
Merge branch 'main' into fix/offload-streaming-session-block-ids
albertoperdomo2 Oct 18, 2026
dcde27b
Merge branch 'main' into fix/offload-streaming-session-block-ids
mergify[bot] Oct 21, 2026
7122c97
fix: Preserve num_store_blocks on streaming continuation
albertoperdomo2 Oct 21, 2026
7d21aa4
Merge branch 'main' into fix/offload-streaming-session-block-ids
mergify[bot] Oct 22, 2026
fe973a7
Merge branch 'main' into fix/offload-streaming-session-block-ids
vllm-agent Oct 25, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,24 @@ def take_raw_events():
assert events[0].token_ids == token_ids


@pytest.mark.parametrize("async_scheduling", [True, False])
def test_streaming_session_stores_new_chunks(request_runner, async_scheduling: bool):
"""A streaming session resumed for its next input chunk arrives with its
full block table, so its new chunks must be stored from their own blocks."""
runner = request_runner(
block_size=4, num_gpu_blocks=100, async_scheduling=async_scheduling
)
runner.manager.prepare_store.side_effect = lambda keys, req_context: (
generate_store_output(keys)
)

runner.new_request(token_ids=list(range(1, 9)), req_id="s", resumable=True)
runner.run(decoded_tokens=[100, EOS_TOKEN_ID], expected_stored=(0, 1))

runner.new_request(token_ids=list(range(200, 212)), req_id="s", resumable=True)
runner.run(decoded_tokens=[300, EOS_TOKEN_ID], expected_stored=(2, 3, 4))


@pytest.mark.parametrize("async_scheduling", [True, False])
def test_offloading_connector(request_runner, async_scheduling: bool):
block_size = 4
Expand Down
9 changes: 7 additions & 2 deletions tests/v1/kv_connector/unit/offloading_connector/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,12 @@ def new_request(
token_ids: list[int],
kv_transfer_params: dict | None = None,
skip_reading_prefix_cache: bool = False,
req_id: str | None = None,
resumable: bool = False,
):
self.req_id += 1
if req_id is None:
self.req_id += 1
req_id = str(self.req_id)

sampling_params = SamplingParams(
max_tokens=1000,
Expand All @@ -379,11 +383,12 @@ def new_request(
sampling_params.update_from_generation_config({}, EOS_TOKEN_ID)

req = Request(
request_id=str(self.req_id),
request_id=req_id,
prompt_token_ids=token_ids,
sampling_params=sampling_params,
pooling_params=None,
block_hasher=self._block_hasher,
resumable=resumable,
)
if kv_transfer_params is not None:
req.kv_transfer_params = kv_transfer_params
Expand Down
6 changes: 4 additions & 2 deletions vllm/distributed/kv_transfer/kv_connector/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,14 @@ def yield_req_data(
scheduler_output,
) -> Iterator[tuple[str, tuple[list[int], ...] | None, bool]]:
"""Yields:
(req_id, new_block_id_groups, preempted)
(req_id, block_id_groups, is_full_table)

``is_full_table`` is True when ``block_id_groups`` is the request's whole
block table (new and resumed requests) rather than this step's additions.
"""
# new requests
for req_data in scheduler_output.scheduled_new_reqs:
yield req_data.req_id, req_data.block_ids, False
yield req_data.req_id, req_data.block_ids, True

# cached requests
cached_reqs = scheduler_output.scheduled_cached_reqs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1285,11 +1285,13 @@ def _update_req_states(self, scheduler_output: SchedulerOutput) -> None:
# Used to detect sliding window blocks that got re-allocated.
new_block_ids_end: dict[str, tuple[int, ...]] = {}

for req_id, new_block_id_groups, preempted in yield_req_data(scheduler_output):
for req_id, new_block_id_groups, is_full_table in yield_req_data(
Comment thread
albertoperdomo2 marked this conversation as resolved.
Resolved
Comment thread
albertoperdomo2 marked this conversation as resolved.
Resolved
scheduler_output
):
req_status = self._req_status[req_id]
req_status.update_offload_keys()

if preempted:
if is_full_table:
for group_state in req_status.group_states:
group_state.block_ids.clear()

Expand Down
Loading