Skip to content

Commit

Permalink
[Bugfix] Backport request id validation to v0 (#11036)
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Runde <[email protected]>
  • Loading branch information
joerunde authored Dec 10, 2024
1 parent d05f886 commit 9b9cef3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions vllm/engine/multiprocessing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,10 @@ async def _process_request(
if self._errored_with is not None:
raise ENGINE_DEAD_ERROR(self._errored_with)

# Ensure the request id is unique among running requests
if request_id in self.output_queues:
raise ValueError(f"Request {request_id} already exists")

# Constructing guided decoding logits processors is expensive, so we do
# it here to avoid contending with cpu resources and the GIL on the
# backend process.
Expand Down
2 changes: 1 addition & 1 deletion vllm/v1/engine/async_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async def add_request(
"""Add new request to the AsyncLLM."""

if self.detokenizer.is_request_active(request_id):
raise KeyError(f"Request {request_id} already exists.")
raise ValueError(f"Request {request_id} already exists.")

# 1) Create a new AsyncStream for the request.
stream = self._add_request_to_streams(request_id)
Expand Down

0 comments on commit 9b9cef3

Please sign in to comment.