Skip to content

Refactor FP4 quantization and remove deprecated JIT kernels - #30448

Merged
BBuf merged 10 commits into
mainfrom
brayden/refactor-nvfp4-kernels
Jul 14, 2026
Merged

BBuf merged 10 commits into
mainfrom
brayden/refactor-nvfp4-kernels

Conversation

@b8zhong

@b8zhong b8zhong commented Jul 8, 2026 •

Copy link
Copy Markdown
Collaborator

For MoE, must use Flashinfer CUTLASS on SM120 or trtllm-gen on SM100 (better perf in all cases) (high throughput use Flashinfer Cute-DSL)
For dense GEMM on SM100, use Flashinfer Cute-DSL, on SM120, use Flashinfer CUTLASS
For quantize, use backend = cute-dsl of fp4_quantize in Flashinfer

Fix #28663


CI States

Latest PR Test (Base): ❌ Run #29263311113
Latest PR Test (Extra): ❌ Run #29263310306

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot added quant LLM Quantization sgl-kernel blackwell SM100/SM120 diffusion SGLang Diffusion jit-kernel labels Jul 8, 2026
@b8zhong
b8zhong marked this pull request as ready for review July 8, 2026 00:43
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 8, 2026
@b8zhong b8zhong added the run-ci CI: run the baseline test suite on this PR label Jul 8, 2026
b8zhong and others added 4 commits July 7, 2026 17:50
Left over from the FP4 quantization refactor: suggest_nvfp4_global_scale
had no remaining callers after the fused NVFP4 MoE quant kernel was
removed.
# Conflicts:
#	python/sglang/srt/layers/moe/moe_runner/runner.py

FP4_GEMM_RUNNER_BACKEND_CHOICES = [
"auto",
"cutlass",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need to check whether any existing docs or scripts still use this parameter and were not updated.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Just checked, and all the references are deleted. Except for docs/, which will be deleted entirely

FlashInferCutlassMoeQuantInfo,
)

assert (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This switches the compressed-tensors NVFP4 MoE path from the old direct CUTLASS implementation to FlashInfer CUTLASS, but apply_router_weight_on_input=True now asserts during forward. If this mode is no longer supported, can we reject it earlier with a clear config error or keep a fallback for this case?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ok, just add an assertion. The only model that use apply router weight is Llama4, and it doesn't use compressed-tensors NVFP4, but actually modelopt FP4.

@BBuf BBuf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We need more benchmark results in H100/H200/B200 and so on.

@BBuf

BBuf commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

We need more benchmark results in H100/H200/B200 and so on.

We also need some end2end model accracy results, please compare the accuracy with the main branch.

@b8zhong

b8zhong commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

As expected, the performance of these kernels are no good anymore.

On SM100:
Screenshot 2026-07-10 at 9 12 44 AM
(Red is Cute-DSL)

For MoE:
image

@b8zhong

b8zhong commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

/rerun-failed-ci

@BBuf
BBuf merged commit 9756f76 into main Jul 14, 2026
215 of 269 checks passed
@BBuf
BBuf deleted the brayden/refactor-nvfp4-kernels branch July 14, 2026 01:22
@b8zhong

b8zhong commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

For anyone debugging (in case this causes CI failures): since this PR is large, you can immediately message me on Slack if there CI failures, and I'll address them promptly.

Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
…ect#30448)

Co-authored-by: root <root@sgl-b300-inference.datacrunch.io>

This branch was successfully deployed

1 active deployment
staging - docs_new — 3228d6e8 Deployed Jul 13, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blackwell SM100/SM120 bypass-fastfail diffusion SGLang Diffusion documentation Improvements or additions to documentation jit-kernel quant LLM Quantization run-ci CI: run the baseline test suite on this PR sgl-kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate and delete --moe-runner-backend cutlass, dense FP4 GEMM, FP4 quantization (in sgl-kernel)

2 participants