[Bugfix] Engine Crash When Enable Decode Offloading in PD Disagg without storage backend#20677
[Bugfix] Engine Crash When Enable Decode Offloading in PD Disagg without storage backend#20677MMuzzammil1 wants to merge 1 commit intosgl-project:mainfrom
Conversation
… None Signed-off-by: Mohd Muzzammil <me.muzzammil@samsung.com>
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 critical bug causing an engine crash when the decode offloading feature is used in a disaggregated setup without an active storage backend. The fix introduces a new flag to intelligently gate storage-dependent operations, ensuring that the system only attempts to interact with a storage backend if one has been explicitly configured, thereby enhancing stability and preventing runtime errors. 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
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
The pull request effectively addresses the engine crash that occurred when decode offloading was enabled without an L3 storage backend. The introduction of the enable_storage flag and its consistent use across __init__, offload_kv_cache, check_offload_progress, and _check_offload_progress methods correctly gates storage-related operations. This ensures that backup logic and hash computations are only triggered when a storage backend is actually configured, preventing None object access errors. The changes are well-targeted and improve the robustness of the system.
|
hi @MMuzzammil1 |
Thanks for the info @hzh0425. Could you please then review this PR that adds sanity check in the server args: #20732 Actually I thought decode offload might also have hierarchy of L2 and L3 in PD Disagg, but I was wrong. |
Motivation
When running the decode node with
--disaggregation-decode-enable-offload-kvcacheflag, if there is no L3 storage backend, the Engine Crashes, because theack_backup_queue,backup_queueofHiCacheControllerisNone(https://github.com/sgl-project/sglang/blob/main/python/sglang/srt/disaggregation/decode_kvcache_offload_manager.py#L177, https://github.com/sgl-project/sglang/blob/main/python/sglang/srt/managers/cache_controller.py#L324).Modifications
Added
enable_storageflag. Trigger backup logic only when this flag is set.Checklist