Unverified Commit 9b9cef31 authored by Joe Runde's avatar Joe Runde Committed by GitHub
Browse files

[Bugfix] Backport request id validation to v0 (#11036)


Signed-off-by: default avatarJoe Runde <Joseph.Runde@ibm.com>
parent d05f8867
...@@ -576,6 +576,10 @@ class MQLLMEngineClient(EngineClient): ...@@ -576,6 +576,10 @@ class MQLLMEngineClient(EngineClient):
if self._errored_with is not None: if self._errored_with is not None:
raise ENGINE_DEAD_ERROR(self._errored_with) 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 # Constructing guided decoding logits processors is expensive, so we do
# it here to avoid contending with cpu resources and the GIL on the # it here to avoid contending with cpu resources and the GIL on the
# backend process. # backend process.
......
...@@ -152,7 +152,7 @@ class AsyncLLM(EngineClient): ...@@ -152,7 +152,7 @@ class AsyncLLM(EngineClient):
"""Add new request to the AsyncLLM.""" """Add new request to the AsyncLLM."""
if self.detokenizer.is_request_active(request_id): 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. # 1) Create a new AsyncStream for the request.
stream = self._add_request_to_streams(request_id) stream = self._add_request_to_streams(request_id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment