Hint users when wrongly execute it with partial ranks in dumper#19014
Hint users when wrongly execute it with partial ranks in dumper#19014fzyzcjy merged 12 commits intosgl-project:mainfrom
Conversation
When SGLANG_DUMPER_CLEANUP=1, all existing sglang_dump_* directories under the base dir are removed before the first dump write to disk. Rank 0 performs the cleanup with a distributed barrier for sync.
Summary of ChangesHello @fzyzcjy, 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 enhances the dumper utility by introducing an optional automatic cleanup mechanism for previously generated dump files. When enabled via a new environment variable, the dumper will now remove old 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 introduces a new feature to automatically clean up old dump directories from the dumper utility, controlled by the SGLANG_DUMPER_CLEANUP_PREVIOUS environment variable. The implementation correctly handles distributed environments by performing the cleanup on rank 0 and synchronizing with other ranks. New tests are added to verify this functionality.
My review includes a correction for a typo in a test case parameter and a suggestion to improve code style by moving an import statement to the top of the file, following PEP 8 guidelines.
| old_dir.mkdir() | ||
| (old_dir / "dummy.pt").touch() | ||
|
|
||
| dumper = _make_test_dumper(tmp_path, needs_cleanup=True) |
There was a problem hiding this comment.
There's a typo in the parameter name. The _Dumper constructor expects cleanup_previous, but needs_cleanup is used here. This will prevent the test from correctly enabling the cleanup feature.
| dumper = _make_test_dumper(tmp_path, needs_cleanup=True) | |
| dumper = _make_test_dumper(tmp_path, cleanup_previous=True) |
|
|
||
|
|
||
| def _cleanup_old_dumps(base_dir: Path) -> None: | ||
| import shutil |
Collective operations (broadcast_object_list, all_gather_object) hang silently when not all ranks participate. Add a configurable timeout (default 60s) that prints a warning if a collective op doesn't complete, helping users diagnose missing rank participation.
Add unit test (TestCollectiveTimeout) verifying the watchdog fires and prints a warning when a collective op exceeds the timeout, and a distributed test in TestDumperDistributed exercising the real on_forward_pass_start broadcast with staggered rank joins.
(cherry picked from commit 402ad07)
Motivation
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci