Skip to content

Conversation

@XOR-op
Copy link
Collaborator

@XOR-op XOR-op commented Jan 8, 2026

Reopen #996 after branch rebase to see if OOM still happens when problematic tests are disabled

@XOR-op XOR-op added the go Trigger Buildkite CI label Jan 8, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @XOR-op, 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 addresses potential Out-Of-Memory (OOM) issues by changing the default behavior of FSDP inference. Instead of being enabled by default, FSDP inference is now opt-in, requiring users to explicitly enable it if they encounter memory constraints. This change is reflected in both the core configuration and various example scripts, alongside updated documentation to guide users on memory optimization strategies. The primary goal is to improve stability and user experience by preventing unexpected OOM errors during inference.

Highlights

  • Default FSDP Inference State: FSDP (Fully Sharded Data Parallel) inference is now disabled by default across all relevant example scripts and the core FastVideoArgs configuration. Previously, it was enabled by default.
  • Documentation Update: The inference_quick_start.md documentation has been updated to suggest enabling use_fsdp_inference=True as a potential solution for CUDA out-of-memory errors, along with dit_layerwise_offload=True.
  • CLI Argument Help Text Refinement: The help message for the --use-fsdp-inference CLI argument in fastvideo_args.py has been expanded to clarify that FSDP helps reduce GPU memory usage but may introduce weight transfer overhead, advising users to enable it if they run out of memory.
  • Example Script Modifications: Numerous basic inference example scripts (basic.py, basic_dmd.py, basic_hy15.py, basic_longcat_i2v.py, basic_longcat_t2v.py, basic_longcat_vc.py, basic_matrixgame.py, basic_matrixgame_streaming.py, basic_self_forcing_causal.py, basic_self_forcing_causal_wan2_2_i2v.py, basic_self_forcing_causal_wan2_2_t2v.py, basic_turbodiffusion.py, basic_wan2_2.py, basic_wan2_2_Fun.py, basic_wan2_2_i2v.py, basic_wan2_2_ti2v.py) have been updated to set use_fsdp_inference=False by default, with a comment guiding users to enable it if OOM occurs.

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

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 disables FSDP for inference by default, which is a sensible change to prevent potential out-of-memory issues for users with default settings. The changes are consistently applied across the codebase, including updating the default value in FastVideoArgs, modifying all relevant example scripts, and improving the documentation to guide users on when to enable FSDP. My review includes a minor suggestion to improve code style in the command-line argument help text.

Comment on lines 433 to +436
help=
"Use FSDP for inference by sharding the model weights. Latency is very low due to prefetch--enable if run out of memory.",
"Use FSDP for inference by sharding the model weights. FSDP helps reduce GPU memory usage but may introduce"
+
" weight transfer overhead depending on the specific setup. Enable if run out of memory.",
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For improved readability and adherence to Python's best practices, it's recommended to use implicit string literal concatenation for multi-line strings. This avoids the explicit use of the + operator, resulting in cleaner code.

Suggested change
help=
"Use FSDP for inference by sharding the model weights. Latency is very low due to prefetch--enable if run out of memory.",
"Use FSDP for inference by sharding the model weights. FSDP helps reduce GPU memory usage but may introduce"
+
" weight transfer overhead depending on the specific setup. Enable if run out of memory.",
help=(
"Use FSDP for inference by sharding the model weights. FSDP helps reduce GPU memory usage but may introduce "
"weight transfer overhead depending on the specific setup. Enable if run out of memory."
),

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

Labels

go Trigger Buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant