fix: pause_generation should not populate running_batch on prefill nodes#20273
fix: pause_generation should not populate running_batch on prefill nodes#20273hnyls2002 merged 7 commits intosgl-project:mainfrom
Conversation
Summary of ChangesHello, 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 stability issue in the generation pausing mechanism. Previously, attempting to pause generation could cause a prefill worker to crash under specific conditions related to batch state. The changes introduce a more robust way to handle batch merging, ensuring that the system operates reliably even when internal batch structures are empty, thereby improving the overall resilience of the SGLang runtime. 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. Changelog
Activity
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 aims to fix a crash in pause_generation when self.running_batch is empty. The change correctly checks if self.running_batch is empty before merging self.last_batch. However, the fix is incomplete as it doesn't handle the case where self.last_batch itself becomes empty after filtering, which can lead to a similar crash or inconsistent state. I've suggested an addition to make the fix more robust by checking if self.last_batch is empty before the merge operation.
Note: Security Review did not run due to the size of the PR.
af18678 to
83811d0
Compare
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
3baa872 to
53a3554
Compare
Current logic: * Crashes with `AttributeError: 'NoneType' object has no attribute 'merge_batch'` at `self.sampling_info.merge_batch` * Leaks prefill request into running_batch which are never cleaned up, eventually stalling the scheduler when `--max-running-requests` is reached
53a3554 to
a7cb9f1
Compare
- Remove redundant is_prefill_only guard (disaggregation_mode check suffices) - Add running_batch.is_empty() guard for retract path to prevent crash (sgl-project#20272) - Update tests to cover retract mode instead of in_place (already fixed by sgl-project#21705) - Add idle-node retract test for empty running_batch regression
|
/rerun-test registered/disaggregation/test_disaggregation_basic.py registered/rl/test_update_weights_from_distributed.py registered/rl/test_update_weights_from_tensor.py |
|
✅ ✅ ✅ |
|
/tag-and-rerun-ci |
|
/rerun-test registered/disaggregation/test_disaggregation_basic.py |
|
✅ |
…ng_batch on prefill nodes (sgl-project#20273) Upstream SHA: 9593d43 Cherry-picked from sgl-project/sglang Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix #20272
Current logic leaks prefill request into running_batch which are never cleaned up, eventually stalling the scheduler when
--max-running-requestsis reached