-
Notifications
You must be signed in to change notification settings - Fork 153
update configs #846
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
update configs #846
Conversation
Summary of ChangesHello @gushiqiao, 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 primarily refines model configurations and associated inference scripts. The core changes involve adjusting the CPU offloading strategy from a block-level to a model-level granularity in several JSON configuration files, standardizing the weight registration mechanism in the 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. 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 updates several configuration files and a Python script. My review has identified a couple of issues. First, multiple configuration files are updated to set offload_granularity to model, but the codebase does not seem to support this value, which will likely cause a runtime error. Second, in transformer_weights.py, the mm_type for some modules is hardcoded to Default, which will prevent quantization settings from being applied to those modules. I've provided suggestions to address these points.
| "enable_cfg": true, | ||
| "cpu_offload": true, | ||
| "offload_granularity": "block", | ||
| "offload_granularity": "model", |
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.
The offload_granularity is set to model, but the implementation for CPU offloading appears to only support block and phase. With cpu_offload enabled in this configuration, this change will likely cause a NotImplementedError at runtime. Please either implement support for model granularity or revert this to a supported value like block.
| "offload_granularity": "model", | |
| "offload_granularity": "block", |
| self.compute_phases[0].add_module( | ||
| "before_proj", | ||
| MM_WEIGHT_REGISTER[self.mm_type]( | ||
| MM_WEIGHT_REGISTER["Default"]( |
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.
Hardcoding the MM_WEIGHT_REGISTER key to "Default" overrides the configured mm_type. This will prevent quantization schemes like int8-sgl (defined by dit_quant_scheme in config files) from being applied to the before_proj module. This seems unintentional and could lead to incorrect behavior or performance degradation when quantization is enabled. It's recommended to use self.mm_type to respect the configuration.
| MM_WEIGHT_REGISTER["Default"]( | |
| MM_WEIGHT_REGISTER[self.mm_type]( |
| self.compute_phases[-1].add_module( | ||
| "after_proj", | ||
| MM_WEIGHT_REGISTER[self.mm_type]( | ||
| MM_WEIGHT_REGISTER["Default"]( |
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.
Similar to the before_proj module, hardcoding the MM_WEIGHT_REGISTER key to "Default" for after_proj will prevent quantization from being applied. This should likely use self.mm_type to adhere to the model's configuration.
| MM_WEIGHT_REGISTER["Default"]( | |
| MM_WEIGHT_REGISTER[self.mm_type]( |
No description provided.