From 2f1c795202ef1000e8eb8a4ce0829e43948ffe7e Mon Sep 17 00:00:00 2001 From: Travis Johnson Date: Tue, 30 Sep 2025 11:16:52 -0600 Subject: [PATCH 1/3] test: add assertion that batch_update does not have duplicate removals Signed-off-by: Travis Johnson --- tests/v1/worker/test_spyre_input_batch.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/v1/worker/test_spyre_input_batch.py b/tests/v1/worker/test_spyre_input_batch.py index 36badfba..25f3a613 100644 --- a/tests/v1/worker/test_spyre_input_batch.py +++ b/tests/v1/worker/test_spyre_input_batch.py @@ -36,6 +36,10 @@ def _remove_requests(input_batch: SamplingInputBatch, batch_size: int, for index in req_indices_to_remove: input_batch.remove_request(reqs[index].req_id) req_ids_to_remove.add(reqs[index].req_id) + + # assert that all indices to remove are unique + removed = input_batch.batch_update_builder.removed + assert len(set(removed)) == len(removed), "Duplicate removed indices" return req_ids_to_remove From 10ede63169ed52f0f872d67dcc4aaea233af34ce Mon Sep 17 00:00:00 2001 From: Travis Johnson Date: Tue, 7 Oct 2025 16:09:57 -0600 Subject: [PATCH 2/3] fix: unbatch request removals in CB Signed-off-by: Travis Johnson --- vllm_spyre/v1/worker/spyre_model_runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vllm_spyre/v1/worker/spyre_model_runner.py b/vllm_spyre/v1/worker/spyre_model_runner.py index 437fcbfd..4e7d34b8 100644 --- a/vllm_spyre/v1/worker/spyre_model_runner.py +++ b/vllm_spyre/v1/worker/spyre_model_runner.py @@ -394,7 +394,10 @@ def update_states(self, scheduler_output: SchedulerOutput): for req_id in scheduler_output.finished_req_ids: self.input_batch.remove_request(req_id) self.requests.pop(req_id, None) - self.input_batch.refresh_metadata() + # TODO: Processing multiple removals at once can break alignment + # of logitprocs. Refactor so that we can batch removals to the + # `input_batch` + self.input_batch.refresh_metadata() def _get_prompt_logprobs_dict( self, From c34263cbcb0c61ca7487c5bc95ba351f00ef2db0 Mon Sep 17 00:00:00 2001 From: Travis Johnson Date: Wed, 8 Oct 2025 09:19:01 -0600 Subject: [PATCH 3/3] test: comment out duplicate check Signed-off-by: Travis Johnson --- tests/v1/worker/test_spyre_input_batch.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/v1/worker/test_spyre_input_batch.py b/tests/v1/worker/test_spyre_input_batch.py index 25f3a613..b5dc0924 100644 --- a/tests/v1/worker/test_spyre_input_batch.py +++ b/tests/v1/worker/test_spyre_input_batch.py @@ -37,9 +37,13 @@ def _remove_requests(input_batch: SamplingInputBatch, batch_size: int, input_batch.remove_request(reqs[index].req_id) req_ids_to_remove.add(reqs[index].req_id) - # assert that all indices to remove are unique - removed = input_batch.batch_update_builder.removed - assert len(set(removed)) == len(removed), "Duplicate removed indices" + # FIXME: it is a bug in the current implementation that removed indices may + # be duplicated, which can break logitsprocs tracking. Once fixed we should + # add this assert. + # see also: https://github.com/vllm-project/vllm-spyre/issues/508 + # removed = input_batch.batch_update_builder.removed + # assert len(set(removed)) == len(removed), "Duplicate removed indices" + return req_ids_to_remove