From f9dadfbee331aeff9cb45c94e635ab8e16335a10 Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Mon, 11 Nov 2024 10:42:07 -0800 Subject: [PATCH] [V1] Fix detokenizer ports (#10224) Signed-off-by: Woosuk Kwon --- vllm/v1/tokenizer/detokenizer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vllm/v1/tokenizer/detokenizer.py b/vllm/v1/tokenizer/detokenizer.py index bf1be5d54140a..8d80ebbc5cc45 100644 --- a/vllm/v1/tokenizer/detokenizer.py +++ b/vllm/v1/tokenizer/detokenizer.py @@ -48,11 +48,13 @@ def __init__(self, tokenizer_name: str, tokenizer_mode: str, # For example, it does not terminate properly. We need to improve this. self.push_port = get_open_port() self.pull_port = get_open_port() + # NOTE: The push port of the engine process should be the same as the + # pull port of the detokenizer process. Vice versa. self.detokenizer = DetokenizerProc(tokenizer_name=tokenizer_name, tokenizer_mode=tokenizer_mode, trust_remote_code=trust_remote_code, - push_port=self.push_port, - pull_port=self.pull_port) + push_port=self.pull_port, + pull_port=self.push_port) self.detokenizer.start() self.zmq_context = zmq.Context() @@ -95,8 +97,8 @@ def __init__( self.tokenizer_name = tokenizer_name self.tokenizer_mode = tokenizer_mode self.trust_remote_code = trust_remote_code - # NOTE: The pull_port of the detokenizer should be the same as the - # push_port of the engine. Vice versa. + # NOTE: The pull_port of the detokenizer process should be the same as + # the push_port of the engine process. Vice versa. self.pull_port = pull_port self.push_port = push_port