[Disagg] Skip health check enqueue when PD disagg queues have backlog#20191
[Disagg] Skip health check enqueue when PD disagg queues have backlog#20191hnyls2002 merged 1 commit 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 improves the robustness of the system's health check mechanism, particularly in disaggregated modes. It prevents health checks from being processed if they would be blocked by existing requests in specialized internal queues, thereby providing a more accurate reflection of the system's ability to handle new requests under current load conditions. 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 enhances the health check logic for prefill/decode (PD) disaggregation mode. The changes ensure that health checks are not blocked by backlogs in PD-specific queues, which correctly reflects a busy but healthy server state. The logic appears sound. I have one suggestion to make the code more idiomatic.
Note: Security Review did not run due to the size of the PR.
| will_block_in_pd_queue = False | ||
| if self.disaggregation_mode == DisaggregationMode.PREFILL: | ||
| # If bootstrap queue has backlog, health check will also be blocked there | ||
| will_block_in_pd_queue = ( | ||
| len(self.disagg_prefill_bootstrap_queue.queue) > 0 | ||
| or len(self.disagg_prefill_inflight_queue) > 0 | ||
| ) | ||
| elif self.disaggregation_mode == DisaggregationMode.DECODE: | ||
| # If prealloc/transfer queue has backlog, health check will also be blocked there | ||
| will_block_in_pd_queue = ( | ||
| len(self.disagg_decode_prealloc_queue.queue) > 0 | ||
| or len(self.disagg_decode_transfer_queue.queue) > 0 | ||
| ) |
There was a problem hiding this comment.
For checking if a queue has a backlog, it's more idiomatic in Python to check the truthiness of the collection directly (e.g., if my_list:) or use bool(my_list) rather than checking len(my_list) > 0. This can make the code slightly more concise and Pythonic. You can refactor this block to use bool() for clarity.
| will_block_in_pd_queue = False | |
| if self.disaggregation_mode == DisaggregationMode.PREFILL: | |
| # If bootstrap queue has backlog, health check will also be blocked there | |
| will_block_in_pd_queue = ( | |
| len(self.disagg_prefill_bootstrap_queue.queue) > 0 | |
| or len(self.disagg_prefill_inflight_queue) > 0 | |
| ) | |
| elif self.disaggregation_mode == DisaggregationMode.DECODE: | |
| # If prealloc/transfer queue has backlog, health check will also be blocked there | |
| will_block_in_pd_queue = ( | |
| len(self.disagg_decode_prealloc_queue.queue) > 0 | |
| or len(self.disagg_decode_transfer_queue.queue) > 0 | |
| ) | |
| will_block_in_pd_queue = False | |
| if self.disaggregation_mode == DisaggregationMode.PREFILL: | |
| # If bootstrap queue has backlog, health check will also be blocked there | |
| will_block_in_pd_queue = ( | |
| bool(self.disagg_prefill_bootstrap_queue.queue) or | |
| bool(self.disagg_prefill_inflight_queue) | |
| ) | |
| elif self.disaggregation_mode == DisaggregationMode.DECODE: | |
| # If prealloc/transfer queue has backlog, health check will also be blocked there | |
| will_block_in_pd_queue = ( | |
| bool(self.disagg_decode_prealloc_queue.queue) or | |
| bool(self.disagg_decode_transfer_queue.queue) | |
| ) |
|
/rerun-stage stage-c-test-8-gpu-h20 |
|
✅ Triggered |
disagg_prefill_bootstrap_queue/disagg_prefill_inflight_queuebacklog on prefill nodedisagg_decode_prealloc_queue/disagg_decode_transfer_queuebacklog on decode nodereturn_health_check_ctfast-path to defer health check signal to next batch completion