-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Support sanity checking weight consistency especially for RL #13854
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 @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 introduces a robust mechanism for verifying the consistency of model weights within the system. It provides a new API endpoint that allows users to perform sanity checks on the model's parameters, enabling operations like snapshotting the current weights, resetting them to random values, and comparing the current state against a previously saved snapshot. This functionality is particularly valuable for debugging and ensuring stability in dynamic model environments, such as those found in Reinforcement Learning. 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
|
|
/tag-and-rerun-ci |
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 introduces a valuable feature for sanity checking model weight consistency, which is particularly useful in Reinforcement Learning workflows. The implementation is well-structured, adding a new WeightChecker utility, exposing it through a new /check_weights HTTP endpoint, and wiring it through the TokenizerManager and Scheduler. The code is clear and follows existing patterns in the codebase. I have one suggestion to fix a minor bug in the random tensor generation logic.
| return _create_error_response(e) | ||
|
|
||
|
|
||
| @app.post("/check_weights") |
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.
do we have to add an endpoint for this?
can this be part of model info endpoint?
such that we don't add a new resource/endpoint, likewise the verb in front of endpoint
Existing SGLang frontend has too many of those endpoints
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.
it needs to mutate state for the checker, i.e. the json payload can be snapshot,reset_params,check. while I guess model info endpoint is purely read w/o any mutations.
slin1237
left a comment
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.
ref to comments
|
/tag-and-rerun-ci |
Motivation
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist