From 16f0b30d2e6e27f16269733f32d5c76ee379692a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 07:05:40 +0000 Subject: [PATCH] =?UTF-8?q?fix(critical):=203=20bugs=20causing=200.0=20sco?= =?UTF-8?q?re=20=E2=80=94=20OOM=20crash=20+=20thinking=20param=20+=20multi?= =?UTF-8?q?modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug 1 (FATAL): computility-run.yaml max-model-len 256000 → 131072, gpu-memory-utilization 0.95 → 0.90, max-num-batched-tokens 4096 → 8192. Server OOM'd on t2_n_2, killed all subsequent modules (replay=0, opencompass=0). Bug 2 (functional): protocol.py thinking={enable:true/false} was accepted but NEVER mapped to chat_template_kwargs.enable_thinking. Qwen3 template never received the parameter → t1a, t1c, d07, d10 all FAIL. Bug 3 (functional): chat_utils.py _placeholder_str didn't handle qwen3_5 model_type for multimodal → d05_multimodal HTTP 400 TypeError. Expected: functional pass rate 0.41 → 0.90+, server stays alive for all 4 modules, total score 0.0 → 60000+ (matching reference sub 168). --- computility-run.yaml | 6 +++--- qwen3_6_scripts/chat_utils.py | 6 ++++-- qwen3_6_scripts/protocol.py | 11 +++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/computility-run.yaml b/computility-run.yaml index b13d04c1..f02fcda2 100644 --- a/computility-run.yaml +++ b/computility-run.yaml @@ -8,9 +8,9 @@ command: - --served-model-name - llm - --max-model-len - - '256000' + - '131072' - --gpu-memory-utilization - - '0.95' + - '0.90' - --trust-remote-code - -tp - '4' @@ -19,7 +19,7 @@ command: - --disable-log-requests - --disable-frontend-multiprocessing - --max-num-batched-tokens - - '4096' + - '8192' - --enable-chunked-prefill - --max-seq-len-to-capture - '32768' diff --git a/qwen3_6_scripts/chat_utils.py b/qwen3_6_scripts/chat_utils.py index 37d99629..9be41e0b 100644 --- a/qwen3_6_scripts/chat_utils.py +++ b/qwen3_6_scripts/chat_utils.py @@ -172,7 +172,8 @@ class BaseMultiModalItemTracker(ABC, Generic[_T]): return "" if model_type == "mllama": return "<|image|>" - if model_type in ("qwen2_vl","qwen2_5_vl"): + if model_type in ("qwen2_vl", "qwen2_5_vl", + "qwen3_5", "qwen3_5_moe"): return "<|vision_start|><|image_pad|><|vision_end|>" if model_type == "molmo": return "" @@ -183,7 +184,8 @@ class BaseMultiModalItemTracker(ABC, Generic[_T]): return "<|reserved_special_token_0|>" raise TypeError(f"Unknown model type: {model_type}") elif modality == "video": - if model_type in ("qwen2_vl","qwen2_5_vl"): + if model_type in ("qwen2_vl", "qwen2_5_vl", + "qwen3_5", "qwen3_5_moe"): return "<|vision_start|><|video_pad|><|vision_end|>" raise TypeError(f"Unknown model type: {model_type}") else: diff --git a/qwen3_6_scripts/protocol.py b/qwen3_6_scripts/protocol.py index 98792004..75d7ef15 100644 --- a/qwen3_6_scripts/protocol.py +++ b/qwen3_6_scripts/protocol.py @@ -408,6 +408,17 @@ class ChatCompletionRequest(OpenAIBaseModel): if data.get("max_completion_tokens") is not None and data.get("max_tokens") is None: data["max_tokens"] = data["max_completion_tokens"] + # Map thinking={enable:true/false} → chat_template_kwargs.enable_thinking + # The competition evaluator sends thinking={enable:true/false} (OpenAI API). + # Qwen3's chat template expects enable_thinking=True/False in kwargs. + thinking = data.get("thinking") + if isinstance(thinking, dict): + enable = thinking.get("enable") + if enable is not None: + ctk = data.get("chat_template_kwargs") or {} + ctk["enable_thinking"] = bool(enable) + data["chat_template_kwargs"] = ctk + messages = data.get("messages") if not isinstance(messages, list): return data