From 011d8d89709d13c517a42fb5c7c3881a2ba0a1ea Mon Sep 17 00:00:00 2001 From: Kangyan-Zhou Date: Wed, 17 Dec 2025 13:13:05 -0800 Subject: [PATCH] Reserve more memory for DeepSeekOCR model and adjust server start timeout for DeepGEMM to reduce flakiness (#15277) --- test/srt/test_flashmla.py | 6 ++++-- test/srt/test_vision_openai_server_a.py | 4 ++++ test/srt/test_vision_openai_server_common.py | 17 ++++++++++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/test/srt/test_flashmla.py b/test/srt/test_flashmla.py index e9c69e5d5..548d98d24 100644 --- a/test/srt/test_flashmla.py +++ b/test/srt/test_flashmla.py @@ -35,10 +35,11 @@ class TestFlashMLAAttnBackend(unittest.TestCase): "flashmla", ] ) + # Use longer timeout for DeepGEMM JIT compilation which can take 10-20 minutes cls.process = popen_launch_server( cls.model, cls.base_url, - timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH * 2, other_args=other_args, ) @@ -91,10 +92,11 @@ class TestFlashMLAMTP(CustomTestCase): "flashmla", ] ) + # Use longer timeout for DeepGEMM JIT compilation which can take 10-20 minutes cls.process = popen_launch_server( cls.model, cls.base_url, - timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH * 2, other_args=other_args, ) diff --git a/test/srt/test_vision_openai_server_a.py b/test/srt/test_vision_openai_server_a.py index 5068dcda1..5da9e558b 100644 --- a/test/srt/test_vision_openai_server_a.py +++ b/test/srt/test_vision_openai_server_a.py @@ -162,6 +162,10 @@ class TestQwen2AudioServer(AudioOpenAITestMixin): class TestDeepseekOCRServer(TestOpenAIMLLMServerBase): model = "deepseek-ai/DeepSeek-OCR" trust_remote_code = False + extra_args = [ + "--mem-fraction-static=0.70", + "--cuda-graph-max-bs=4", + ] def verify_single_image_response_for_ocr(self, response): """Verify DeepSeek-OCR grounding output with coordinates""" diff --git a/test/srt/test_vision_openai_server_common.py b/test/srt/test_vision_openai_server_common.py index f737a5699..818c375d3 100644 --- a/test/srt/test_vision_openai_server_common.py +++ b/test/srt/test_vision_openai_server_common.py @@ -38,16 +38,23 @@ class TestOpenAIMLLMServerBase(CustomTestCase): def setUpClass(cls): cls.base_url = DEFAULT_URL_FOR_TEST cls.api_key = "sk-123456" + + # Build other_args: always include extra_args, conditionally include fixed_args + other_args = list(cls.extra_args) + if cls.trust_remote_code: + other_args.extend(cls.fixed_args) + else: + # Exclude --trust-remote-code but keep other fixed args like --enable-multimodal + other_args.extend( + arg for arg in cls.fixed_args if arg != "--trust-remote-code" + ) + cls.process = popen_launch_server( cls.model, cls.base_url, timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, api_key=cls.api_key, - other_args=( - cls.extra_args + cls.fixed_args + ["--trust-remote-code"] - if cls.trust_remote_code - else [] - ), + other_args=other_args, ) cls.base_url += "/v1"