@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / d8e82bc06d
Fork 0

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 15, 18:30 UTC

[Bugfix] fix V1 Engine crash while handling requests with duplicate request id (#15043)

Signed-off-by: Jiahui Sun <jhsun2020@gmail.com>

Jason committed Mar 21, 2025 at 01:01 UTC d8e82bc06d96e9f8f1235926ba9674a14b2bfe31
2 files changed +16 -10
tests/v1/engine/test_engine_core.py
+16
@@ -158,6 +158,22 @@ def test_engine_core(monkeypatch: pytest.MonkeyPatch):
158 assert len(engine_core.scheduler.waiting) == 0
159 assert len(engine_core.scheduler.running) == 0
160
161 + # Sending duplicate requests with same request_id
162 + req0 = make_request()
163 + req1 = make_request()
164 + req0.request_id = req1.request_id = "test"
165 + engine_core.add_request(req0)
166 +
167 + while len(engine_core.step().outputs) > 0:
168 + pass
169 +
170 + engine_core.add_request(req1)
171 + while len(engine_core.step().outputs) > 0:
172 + pass
173 +
174 + assert len(engine_core.scheduler.waiting) == 0
175 + assert len(engine_core.scheduler.running) == 0
176 +
177
178 @create_new_process_for_each_test()
179 def test_engine_core_advanced_sampling(monkeypatch: pytest.MonkeyPatch):
vllm/v1/engine/core.py
-10
@@ -179,16 +179,6 @@ class EngineCore:
179 scheduler_stats=self.scheduler.make_stats(),
180 )
181 scheduler_output = self.scheduler.schedule()
182 -
183 - # This case may occur when the only unfinished requests are
184 - # structured output requests where the grammar has not finished
185 - # compiling yet, so there's nothing to run.
186 - if scheduler_output.total_num_scheduled_tokens == 0:
187 - return EngineCoreOutputs(
188 - outputs=[],
189 - scheduler_stats=self.scheduler.make_stats(),
190 - )
191 -
182 output = self.model_executor.execute_model(scheduler_output)
183 engine_core_outputs = self.scheduler.update_from_output(
184 scheduler_output, output) # type: ignore