Skip to content

[Fix] Revert back to using CUTLASS mm_fp4 backend#17369

Merged
Fridge003 merged 2 commits into
sgl-project:mainfrom
bzhng-development:brayden/tiny-fix-flashinfer-mmfp4
Jan 31, 2026
Merged

[Fix] Revert back to using CUTLASS mm_fp4 backend#17369
Fridge003 merged 2 commits into
sgl-project:mainfrom
bzhng-development:brayden/tiny-fix-flashinfer-mmfp4

Conversation

@b8zhong
Copy link
Copy Markdown
Collaborator

@b8zhong b8zhong commented Jan 19, 2026

Motivation

After manually installing nvidia-cudnn-cu13==9.18.0.77, it still seems to be worse (mm_fp4 picks this when cudnn >= 9.15.xx and CUDA 13, so hold off on this change for now (otherwise API will pick incorrect backend)

image

Issue reported in flashinfer-ai/flashinfer#2375

Modifications

Change it back to earlier behaviour.

@github-actions github-actions Bot added the quant LLM Quantization label Jan 19, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @b8zhong, 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 aims to resolve a performance degradation issue encountered when using FlashInfer's FP4 GEMM operations, specifically with nvidia-cudnn-cu13. By modifying the backend selection logic, it ensures that the CUTLASS mm_fp4 backend is explicitly utilized, thereby restoring the expected performance and preventing the API from selecting a suboptimal backend.

Highlights

  • FP4 GEMM Backend Reversion: This PR reverts the FP4 GEMM backend selection logic to explicitly use the CUTLASS backend for FlashInfer operations when the backend is set to auto-detection.
  • Performance Regression Fix: The change addresses a reported performance regression observed with nvidia-cudnn-cu13==9.18.0.77, where the mm_fp4 backend was performing worse than expected.

🧠 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
Copy Markdown
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 reverts the mm_fp4 backend to use 'cutlass' by default when the backend is set to 'auto'. This is a sensible temporary fix to address the performance degradation caused by flashinfer's auto-selection logic picking a suboptimal backend. The change is clear and directly addresses the issue described. I have one suggestion to improve maintainability.

Comment thread python/sglang/srt/layers/quantization/modelopt_quant.py
@b8zhong
Copy link
Copy Markdown
Collaborator Author

b8zhong commented Jan 20, 2026

/tag-and-rerun-ci

@Fridge003
Copy link
Copy Markdown
Collaborator

/rerun-stage unit-test-backend-4-gpu-b200

@github-actions
Copy link
Copy Markdown
Contributor

✅ Triggered unit-test-backend-4-gpu-b200 to run independently (skipping dependencies).

@github-actions
Copy link
Copy Markdown
Contributor

🔗 View workflow run

@Fridge003
Copy link
Copy Markdown
Collaborator

/rerun-stage unit-test-backend-4-gpu-b200

@github-actions
Copy link
Copy Markdown
Contributor

✅ Triggered unit-test-backend-4-gpu-b200 to run independently (skipping dependencies).

@github-actions
Copy link
Copy Markdown
Contributor

🔗 View workflow run

@Fridge003
Copy link
Copy Markdown
Collaborator

B200 fp4 gemm tests passed

@Fridge003 Fridge003 merged commit ef134d4 into sgl-project:main Jan 31, 2026
258 of 276 checks passed
@b8zhong b8zhong deleted the brayden/tiny-fix-flashinfer-mmfp4 branch January 31, 2026 15:23
sfiisf pushed a commit to sfiisf/sglang that referenced this pull request Feb 5, 2026
mmangkad added a commit to mmangkad/sglang that referenced this pull request Feb 7, 2026
Johnsonms pushed a commit to Johnsonms/sglang that referenced this pull request Feb 14, 2026
0826joyce pushed a commit to 0826joyce/sglang-perf-opt that referenced this pull request May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

quant LLM Quantization run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants