Skip to content

Commit

Permalink
[V1] Avoid sending text prompt to core engine (#11963)
Browse files Browse the repository at this point in the history
Signed-off-by: Roger Wang <[email protected]>
  • Loading branch information
ywang96 authored Jan 12, 2025
1 parent 4b657d3 commit b25cfab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vllm/v1/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class EngineCoreRequest:
# due to circular imports and typing we have in data.py

request_id: str
#NOTE(Nick): I don't think we need to pass prompt here since it should
# always be tokenized?
# NOTE(ywang96): original text prompt is needed when a request is added to
# Detokenizer, but set to None when it is added to EngineCoreClient.
prompt: Optional[str]
prompt_token_ids: List[int]
mm_inputs: Optional[List[Optional["MultiModalKwargs"]]]
Expand Down
6 changes: 6 additions & 0 deletions vllm/v1/engine/core_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ def _send_input(self, request_type: EngineCoreRequestType,
self.input_socket.send_multipart(msg, copy=False)

def add_request(self, request: EngineCoreRequest) -> None:
# NOTE: text prompt is not needed in the core engine as it has been
# tokenized.
request.prompt = None
self._send_input(EngineCoreRequestType.ADD, request)

def abort_requests(self, request_ids: List[str]) -> None:
Expand Down Expand Up @@ -257,6 +260,9 @@ async def _send_input(self, request_type: EngineCoreRequestType,
await self.input_socket.send_multipart(msg, copy=False)

async def add_request_async(self, request: EngineCoreRequest) -> None:
# NOTE: text prompt is not needed in the core engine as it has been
# tokenized.
request.prompt = None
await self._send_input(EngineCoreRequestType.ADD, request)

async def abort_requests_async(self, request_ids: List[str]) -> None:
Expand Down

0 comments on commit b25cfab

Please sign in to comment.