Skip to content

Reserve more memory for DeepSeekOCR model and adjust server start timeout for DeepGEMM to reduce flakiness#15277

Merged
Kangyan-Zhou merged 2 commits intosgl-project:mainfrom
Kangyan-Zhou:fix_ci_timeout
Dec 17, 2025
Merged

Reserve more memory for DeepSeekOCR model and adjust server start timeout for DeepGEMM to reduce flakiness#15277
Kangyan-Zhou merged 2 commits intosgl-project:mainfrom
Kangyan-Zhou:fix_ci_timeout

Conversation

@Kangyan-Zhou
Copy link
Copy Markdown
Collaborator

Motivation

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

@Kangyan-Zhou
Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions Bot added the Multi-modal multi-modal language model label Dec 16, 2025
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Kangyan-Zhou, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses test flakiness in the DeepSeekOCR model by adjusting its memory allocation and CUDA graph settings within the test suite. By reserving more static memory and optimizing batching, the changes aim to enhance the stability and reliability of the DeepSeekOCR tests.

Highlights

  • DeepSeekOCR Test Stability: Added extra_args to the TestDeepseekOCRServer class to configure memory allocation and CUDA graph batching, aiming to reduce test flakiness.
  • Memory Allocation: Specifically, --mem-fraction-static=0.70 was introduced to reserve 70% of static memory for the DeepSeekOCR model.
  • CUDA Graph Optimization: The --cuda-graph-max-bs=4 argument was added to optimize CUDA graph batching, further contributing to stability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to reduce flakiness in the TestDeepseekOCRServer test by reserving more memory for the model. This is done by adding --mem-fraction-static=0.70 and --cuda-graph-max-bs=4 as extra arguments for the server launch. However, my review found a critical issue in the base test class TestOpenAIMLLMServerBase that prevents these new arguments from being used, making the change ineffective. I've provided a detailed explanation and a suggested fix for the base class logic.

Comment on lines +165 to +168
extra_args = [
"--mem-fraction-static=0.70",
"--cuda-graph-max-bs=4",
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

These extra_args will not be passed to the server due to an issue in the setUpClass method of the base class TestOpenAIMLLMServerBase.

In test/srt/test_vision_openai_server_common.py, the other_args are set as follows:

other_args=(
    cls.extra_args + cls.fixed_args + ["--trust-remote-code"]
    if cls.trust_remote_code
    else []
),

Since TestDeepseekOCRServer sets trust_remote_code = False, other_args becomes an empty list, and your new arguments are ignored.

To fix this, you should modify test/srt/test_vision_openai_server_common.py to correctly handle the arguments. For example, you could replace the other_args logic in TestOpenAIMLLMServerBase.setUpClass with the following:

        other_args = list(cls.extra_args)
        if cls.trust_remote_code:
            other_args.extend(cls.fixed_args)
        else:
            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=other_args,
        )

Also, note that ["--trust-remote-code"] is appended redundantly when trust_remote_code is true, as it's already in fixed_args. The suggested fix above also resolves this.

Since this change is ineffective without the fix in the base class, I'm marking this as critical.

@Kangyan-Zhou
Copy link
Copy Markdown
Collaborator Author

/rerun-stage list

@github-actions
Copy link
Copy Markdown
Contributor

❌ Stage list doesn't support isolated runs yet.

NVIDIA stages:

  • stage-a-test-1
  • stage-b-test-small-1-gpu
  • multimodal-gen-test-1-gpu
  • multimodal-gen-test-2-gpu
  • quantization-test
  • unit-test-backend-1-gpu
  • unit-test-backend-2-gpu
  • stage-b-test-4-gpu-b200
  • unit-test-backend-4-gpu
  • unit-test-backend-8-gpu-h200
  • unit-test-backend-8-gpu-h20
  • unit-test-backend-8-gpu-b200
  • performance-test-1-gpu-part-1
  • performance-test-1-gpu-part-2
  • performance-test-1-gpu-part-3
  • performance-test-2-gpu
  • accuracy-test-1-gpu
  • accuracy-test-2-gpu
  • unit-test-deepep-4-gpu
  • unit-test-deepep-8-gpu
  • unit-test-backend-4-gpu-b200
  • unit-test-backend-4-gpu-gb200

AMD stages:

  • sgl-kernel-unit-test-amd
  • stage-a-test-1-amd
  • unit-test-backend-1-gpu-amd
  • unit-test-backend-2-gpu-amd
  • unit-test-backend-8-gpu-amd
  • performance-test-1-gpu-part-1-amd
  • performance-test-1-gpu-part-2-amd
  • performance-test-2-gpu-amd
  • accuracy-test-1-gpu-amd
  • accuracy-test-2-gpu-amd

Other stages will be added soon. For now, use /rerun-failed-ci for those stages.

@Kangyan-Zhou
Copy link
Copy Markdown
Collaborator Author

/rerun-stage unit-test-backend-1-gpu

@Kangyan-Zhou
Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@Kangyan-Zhou Kangyan-Zhou changed the title Reserve more memory for DeepSeekOCR model to reduce flakiness Reserve more memory for DeepSeekOCR model and adjust server start timeout for DeepGEMM to reduce flakiness Dec 17, 2025
@Kangyan-Zhou Kangyan-Zhou merged commit 011d8d8 into sgl-project:main Dec 17, 2025
93 of 111 checks passed
Liwansi added a commit to iforgetmyname/sglang that referenced this pull request Dec 19, 2025
…n3_pp

* 'main' of https://github.com/sgl-project/sglang: (74 commits)
  [bug fix][pp] fix inconsistent latency between tp (sgl-project#15379)
  Fix warp illegal instruction in kimi k2 thinking PCG (sgl-project#15306)
  Fix gpt-oss yarn with `truncate` argument (sgl-project#14270)
  Monkey patch deepseek-ocr's `v_head_dim` (sgl-project#15384)
  [model-gateway] Replace PolicyRegistry RwLock with DashMap for lock-free policy lookups (sgl-project#15361)
  [PP] Fix dynamic chunking strategy for PP (sgl-project#15372)
  Fix issue: ENABLE_BELOW_SM90 cannot be enabled on aarch64 CPU (sgl-project#12967)
  Split test_piecewise_cuda_graph.py to optimize CI resource usage (sgl-project#15290)
  unified management of environment variables for vlm cuda ipc transport  (sgl-project#14501)
  Mistral Large 3 NVFP4 TRTLLM MoE support (sgl-project#15049)
  fix: adjust time for test_epd_disaggregation.py (sgl-project#15354)
  Add doc for qwen3 next (sgl-project#15337)
  feat: DeepSeek-V3.2 Streaming tool call output (sgl-project#15278)
  Feature/trtllm mha workspace size configurable sgl-project#15089 (sgl-project#15131)
  [VLM] Support cos sin cache for Qwen3-VL & GLM-4.1V (sgl-project#15205)
  [Deepseek V3.2] Support Overlap Spec + NSA (sgl-project#15307)
  Add request-level timestamp for when prefill finishes (sgl-project#14860)
  [CI] Migrate LoRA tests to test/registered/lora/ (sgl-project#15176)
  Reserve more memory for DeepSeekOCR model and adjust server start timeout for DeepGEMM to reduce flakiness (sgl-project#15277)
  Fix condition check for require_gathered_buffer (sgl-project#15328)
  ...
Prozac614 pushed a commit to Prozac614/sglang that referenced this pull request Dec 23, 2025
jiaming1130 pushed a commit to zhuyijie88/sglang that referenced this pull request Dec 25, 2025
YChange01 pushed a commit to YChange01/sglang that referenced this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Multi-modal multi-modal language model run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant