Skip to content

Conversation

@gushiqiao
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 transformer_weights.py module, and enhancing the example prompts in the shell scripts for better clarity and detail in model inference.

Highlights

  • CPU Offload Granularity Update: The offload_granularity setting in six JSON configuration files (across bf16 and int8 configurations for wan22_vace models) has been updated from "block" to "model". This change likely affects how model components are offloaded to the CPU to manage memory.
  • Standardized Weight Registration: The transformer_weights.py file was modified to use a hardcoded "Default" key for MM_WEIGHT_REGISTER when adding before_proj and after_proj modules. This standardizes the weight registration process, potentially simplifying module initialization.
  • Enhanced Inference Prompts: The example inference scripts (run_wan22_moe_vace.sh and run_wan22_moe_vace_dist.sh) have been updated with a more detailed Chinese prompt for generation. Additionally, a commented-out line related to int8 configuration was removed from these scripts.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gushiqiao gushiqiao merged commit 309963f into main Jan 29, 2026
2 checks passed
@gushiqiao gushiqiao deleted the gsq/vace-update branch January 29, 2026 07:46
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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.

Suggested change
"offload_granularity": "model",
"offload_granularity": "block",

self.compute_phases[0].add_module(
"before_proj",
MM_WEIGHT_REGISTER[self.mm_type](
MM_WEIGHT_REGISTER["Default"](
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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"](
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
MM_WEIGHT_REGISTER["Default"](
MM_WEIGHT_REGISTER[self.mm_type](

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants