Skip to content

support nvfp4 for ar models#907

Merged
helloyongyang merged 2 commits intomainfrom
ar
Feb 27, 2026
Merged

support nvfp4 for ar models#907
helloyongyang merged 2 commits intomainfrom
ar

Conversation

@chengtao-lv
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 integrates NVFP4 quantization for autoregressive video generation models, focusing on the 'Self Forcing' architecture. The changes encompass new configuration definitions, refined model loading logic to accommodate quantized weights, and updated tooling for model conversion and inference. The primary goal is to enhance the performance and efficiency of these models through lower-precision computation.

Highlights

  • NVFP4 Quantization Support: Introduced support for NVFP4 quantization for autoregressive video generation models, specifically the 'Self Forcing' model, enabling more efficient inference.
  • New Configuration and Inference Script: Added a dedicated JSON configuration file (wan_t2v_sf_nvfp4.json) and a shell script (run_wan_t2v_sf_nvfp4.sh) to facilitate running NVFP4 quantized Self Forcing models.
  • Model Loading and Conversion Enhancements: Updated the WanSFModel to handle quantized checkpoints and introduced a new utility script (add_scale_to_models.py) for adding scaling parameters to quantized models. The converter.py script was also extended to support self_forcing model type during weight conversion.
  • Documentation Update: The README files (English and Chinese) were updated to announce the new NVFP4 quantization support for Self Forcing models.

🧠 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
  • README.md
    • Updated news section with NVFP4 quantization support for Self Forcing models.
  • README_zh.md
    • Updated Chinese news section with NVFP4 quantization support for Self Forcing models.
  • configs/self_forcing/wan_t2v_sf_nvfp4.json
    • Added a new configuration file for NVFP4 quantized Self Forcing models.
  • lightx2v/common/ops/mm/mm_weight.py
    • Added a commented line in the act_quant_nvfp4 method.
  • lightx2v/models/networks/wan/sf_model.py
    • Removed unused os import.
    • Refactored _load_ckpt to directly use sf_model_path and handle different checkpoint structures.
    • Added a conditional to_cuda call based on model class and quantization status.
    • Introduced _load_quant_ckpt method for loading quantized model checkpoints.
  • scripts/self_forcing/run_wan_t2v_sf.sh
    • Updated a comment for the sf_model_path variable.
  • scripts/self_forcing/run_wan_t2v_sf_nvfp4.sh
    • Added a new inference script for running NVFP4 quantized Self Forcing models.
  • tools/convert/add_scale_to_models.py
    • Added a new utility script to compute and add scaling factors to quantized models.
  • tools/convert/converter.py
    • Modified convert_weights to extract generator_ema for self_forcing model type.
    • Extended model type choices to include self_forcing.
    • Added configuration for self_forcing model conversion parameters.
Activity
  • No human activity (comments, reviews) has been recorded on this pull request yet.
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.

@helloyongyang helloyongyang merged commit 3a2bf8f into main Feb 27, 2026
2 checks passed
@helloyongyang helloyongyang deleted the ar branch February 27, 2026 12:43
@gemini-code-assist
Copy link
Contributor

Warning

Gemini is experiencing higher than usual traffic and was unable to create the review. Please try again in a few hours by commenting /gemini review.

helloyongyang pushed a commit that referenced this pull request Mar 6, 2026
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.

2 participants