[Feat][NVFP4] Enable NVFP4 MoE for Qwen series models (eg. Qwen3-Next) #13761#13761
[Feat][NVFP4] Enable NVFP4 MoE for Qwen series models (eg. Qwen3-Next) #13761#13761Fridge003 merged 13 commits intosgl-project:mainfrom
Conversation
Co-authored-by: Sam Li <lsam@nvidia.com> Co-authored-by: Kaixi Hou <kaixih@nvidia.com>
Summary of ChangesHello @samuellees, 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 support for NVFP4 Mixture-of-Experts (MoE) for Qwen series models, optimized for Blackwell GPUs. The changes involve adapting the MoE layer to dynamically configure routing parameters and updating the server's argument parsing to correctly handle 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
|
There was a problem hiding this comment.
Code Review
This pull request enables NVFP4 MoE for Qwen series models on Blackwell GPUs. The changes involve updating server arguments to recognize modelopt_fp4 quantization for MoE backend selection and generalizing the MoE layer to support different routing methods. A new nightly test is added to verify the functionality and accuracy. The changes appear correct and well-tested. I've identified a minor code duplication issue in server_args.py that could be refactored for better maintainability.
| self.quantization = quant_method | ||
| if ( | ||
| self.quantization == "fp8" | ||
| (self.quantization == "fp8" or self.quantization == "modelopt_fp4") |
There was a problem hiding this comment.
nit: maybe self.quantization in ("fp8", "modelopt_fp4")?
…sgl-project#13761 (sgl-project#13761) Co-authored-by: Kaixi Hou <kaixih@nvidia.com>
PR Dependency
Motivation
Enable NVFP4 MoE for Qwen series models (eg. Qwen3-Next) on Blackwell GPUs
TODO
Accuracy Tests
I also reproduced the Qwen3-30B-A3B NVFP4 accuracy result as it was shown in PR13556
Modifications
Benchmarking and Profiling
Checklist