-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[HotFix]: Add missing SGLANG_EPLB_HEATMAP_COLLECTION_INTERVAL env var #12776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @hzh0425, 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 hotfix addresses a critical runtime error in the scheduler that occurred when attempting to collect expert distribution metrics. By defining a previously missing environment variable and adjusting its usage, the pull request ensures the stability of the system and proper functioning of metric collection for expert load balancing. Highlights
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.
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 provides a hotfix for a crash related to expert distribution metrics. The fix correctly adds the missing SGLANG_EPLB_HEATMAP_COLLECTION_INTERVAL environment variable, resolving the AttributeError. Additionally, the pull request improves the code by refactoring the access to this environment variable to use the .get() method, which prevents a potential TypeError and makes the code more robust and readable. The changes are minimal, targeted, and correct, which is excellent for a hotfix. I have no further suggestions for improvement.
| and self._collection_counter % envs.SGLANG_EPLB_HEATMAP_COLLECTION_INTERVAL | ||
| == 0 | ||
| ): | ||
| interval = envs.SGLANG_EPLB_HEATMAP_COLLECTION_INTERVAL.get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use this one for parsing int env
from sglang.srt.utils import get_int_env_var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interval = get_int_env_var("SGLANG_EPLB_HEATMAP_COLLECTION_INTERVAL", 0)
Are you suggesting changing it to something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated @Fridge003
Motivation
Problem: When launching with --enable-expert-distribution-metrics in PD disaggregation mode, the scheduler crashed with AttributeError: 'Envs' object has no attribute 'SGLANG_EPLB_HEATMAP_COLLECTION_INTERVAL'.
Root Cause: Missing environment variable definition in Envs class for EPLB heatmap collection interval.
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist