Skip to content

[feat] Enable NVFP4 for model weight loading daemon - #32398

Open
xuantengh wants to merge 10 commits into
sgl-project:mainfrom
xuantengh:fast_recovery
Open

[feat] Enable NVFP4 for model weight loading daemon#32398
xuantengh wants to merge 10 commits into
sgl-project:mainfrom
xuantengh:fast_recovery

Conversation

@xuantengh

@xuantengh xuantengh commented Jul 25, 2026

Copy link
Copy Markdown

Motivation

#27139 enables the daemon mode for model weight loading from CUDA IPC. This PR extends its supporting range further by including NVFP4 models (e.g., nvidia/Qwen3-30B-A3B-FP4).

Modifications

The design of this PR delegates the post-process procedure of NVFP4 weight loading to daemon. The daemon process captures some of the important attributes like weights_padding_cols and intermediate_size_per_partition after loading the raw weights, and handle over them to the client then. At the client side, it just rebinds them into the related quantized parameters after receiving the CUDA IPC handle.

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): ❌ Run #30679818820
Latest PR Test (Extra): ❌ Run #30679818652

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions github-actions Bot added quant LLM Quantization blackwell SM100/SM120 labels Jul 25, 2026
@liusy58 liusy58 self-assigned this Jul 25, 2026
@liusy58

liusy58 commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

I will review this PR as soon as possible

@QiuMike
QiuMike self-requested a review July 31, 2026 05:36
@liusy58
liusy58 requested review from QiuMike and removed request for QiuMike July 31, 2026 05:52
self.module_attrs: Dict[str, Dict[str, Any]] = {}
# MoE runner backend as resolved during this daemon's model load; the
# client compares it once its own model is built.
self.moe_runner_backend: str = ""

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.

why this is needed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It was sent to the client side to ensure both sides load the weights using the same backend:

https://github.com/xuantengh/sglang/blob/8baf41f1c151f9da02243ec0db8ac083ea1a854f/python/sglang/srt/weight_cache/ipc_loader.py#L388-L401

As different MoE backends post-process the weight tensor (e.g., permute, reorder) into different physical layout, mixing backends will lead to shape mismatch or numeric error.

@liusy58
liusy58 requested review from QiuMike and removed request for QiuMike July 31, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blackwell SM100/SM120 quant LLM Quantization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants