add dp 2
This commit is contained in:
@@ -243,6 +243,7 @@ class OpenAIServingChat(OpenAIServing):
|
||||
|
||||
# set up reasoning parser
|
||||
self.reasoning_parser_cls = None
|
||||
self._template_patched = False # [BI100] one-shot chat template patch
|
||||
if reasoning_parser:
|
||||
try:
|
||||
from vllm.reasoning import ReasoningParserManager
|
||||
@@ -309,6 +310,19 @@ class OpenAIServingChat(OpenAIServing):
|
||||
model_config = self.model_config
|
||||
tokenizer = await self.engine_client.get_tokenizer(lora_request)
|
||||
|
||||
# [BI100] Runtime equivalent of patch_chat_template.py.
|
||||
# Qwen3.5/3.6-MoE templates inject '<think>\n\n</think>\n\n'
|
||||
# when enable_thinking=false, which causes the model to
|
||||
# degenerate (outputs '!!!!!'). Patch it out once.
|
||||
if not self._template_patched and hasattr(tokenizer, 'chat_template'):
|
||||
_tgt = r"{{- '<think>\n\n</think>\n\n' }}"
|
||||
if isinstance(tokenizer.chat_template, str) and _tgt in tokenizer.chat_template:
|
||||
tokenizer.chat_template = tokenizer.chat_template.replace(
|
||||
_tgt, "{{- '' }}", 1)
|
||||
logger.info("[BI100] Patched chat_template: removed empty "
|
||||
"<think></think> block for non-thinking mode")
|
||||
self._template_patched = True
|
||||
|
||||
conversation, mm_data_future = parse_chat_messages_futures(
|
||||
request.messages, model_config, tokenizer)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import argparse
|
||||
import dataclasses
|
||||
import json
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
from typing import (TYPE_CHECKING, Any, Dict, List, Literal, Mapping, Optional,
|
||||
Tuple, Type, Union)
|
||||
@@ -105,7 +106,7 @@ class EngineArgs:
|
||||
Type[ExecutorBase]]] = None
|
||||
pipeline_parallel_size: int = 1
|
||||
tensor_parallel_size: int = 1
|
||||
data_parallel_size: int = 1
|
||||
data_parallel_size: int = int(os.environ.get("VLLM_DATA_PARALLEL_SIZE", "1"))
|
||||
max_parallel_loading_workers: Optional[int] = None
|
||||
block_size: int = 16
|
||||
enable_prefix_caching: bool = False
|
||||
@@ -349,12 +350,6 @@ class EngineArgs:
|
||||
type=int,
|
||||
default=EngineArgs.tensor_parallel_size,
|
||||
help='Number of tensor parallel replicas.')
|
||||
parser.add_argument('--data-parallel-size',
|
||||
'-dp',
|
||||
type=int,
|
||||
default=EngineArgs.data_parallel_size,
|
||||
help='Number of data parallel replicas. '
|
||||
'Total GPUs = tp * pp * dp.')
|
||||
parser.add_argument(
|
||||
'--max-parallel-loading-workers',
|
||||
type=int,
|
||||
|
||||
Reference in New Issue
Block a user