Bugfix for ds-vl2#15894
Conversation
Summary of ChangesHello @Hexq0210, 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 a bug by enhancing both the model configuration and attention mechanisms for DeepSeekV2 models, alongside significant improvements to the SGLang router's load balancing logic. It refines how Rotary Positional Embeddings are applied in DeepSeekV2 on NPU backends and introduces more flexible, configurable round-robin strategies for distributing requests across prefill and decode servers, aiming to improve stability and control over request routing. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request appears to introduce a bugfix related to RoPE embeddings for DeepSeek models and adds a round-robin load balancing mechanism to the mini_lb.py router for testing purposes. The changes in model_config.py, deepseek_v2_attention_mla_npu.py, and deepseek_v2.py seem correct and consistent. The modifications in mini_lb.py are also functionally sound, but I've identified a few areas for improvement to enhance code clarity and conciseness, such as removing a redundant initialization and simplifying increment operations.
| self.dp_attention_round_robin_size_dict = dict.fromkeys(self.prefill_urls, 0) | ||
| self.dp_attention_round_robin_size_dict = { | ||
| url: i * 20000 for i, url in enumerate(self.prefill_urls) | ||
| } |
There was a problem hiding this comment.
This initialization of self.dp_attention_round_robin_size_dict is redundant as it's immediately overwritten by the dictionary comprehension on the next lines. Removing the first line will make the code cleaner.
self.dp_attention_round_robin_size_dict = {
url: i * 20000 for i, url in enumerate(self.prefill_urls)
}| self.dp_attention_round_robin_size_dict[prefill_server] = ( | ||
| self.dp_attention_round_robin_size_dict[prefill_server] + 1 | ||
| ) |
| if is_instance_round_robin: | ||
| pidx = self.req_nums % len(self.prefill_urls) | ||
| didx = self.req_nums % len(self.decode_urls) | ||
| self.req_nums = self.req_nums + 1 |
…glang into eagle-sche * 'ifmn/eagle-dp-attn' of https://github.com/sgl-project/sglang: (22 commits) dp scheduler enhance support with chunked prefill (sgl-project#16071) modify suffix decoding CI dependency update (sgl-project#16063) fix rotary_embedding init npu (sgl-project#16011) feat: bugfix and accuracy fix for stablelm2_1_6b (sgl-project#15932) Update model and feature support for Ascend NPU (sgl-project#16005) Bugfix for Llama4 (sgl-project#15929) Bugfix for ds-vl2 (sgl-project#15894) gme qwen vl runners fix (sgl-project#15899) add profiling in scheduler (sgl-project#15876) llama use triton rope op (sgl-project#15855) suffix decoding adapt npu suffix decoding adapt npu Add suffix decoding speculative algorithm from feature 13553 cherry sgl-project#15434: qwen3 vl performance update cherry sgl-project#15597: fix Qwen3-VL-30B-A3B-Instruct accuracy loss [Schedule] bug fix for schedule enhancer (sgl-project#15834) minilb support roundrobin (sgl-project#15824) fix torchair compile issue cherry sgl-project#15187: lora fix ... # Conflicts: # python/sglang/srt/managers/scheduler.py # python/sglang/srt/managers/scheduler_enhancer.py
Motivation
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist