Skip to content

[Blog] Add "Toward a Cleaner Quantization Stack in SGLang"#366

Open
ping1jing2 wants to merge 14 commits into
lm-sys:mainfrom
ping1jing2:quantization_blog
Open

[Blog] Add "Toward a Cleaner Quantization Stack in SGLang"#366
ping1jing2 wants to merge 14 commits into
lm-sys:mainfrom
ping1jing2:quantization_blog

Conversation

@ping1jing2

Copy link
Copy Markdown

No description provided.


* **Memory capacity** determines how large a model can be, how much KV cache remains available, and how many requests can run concurrently. The impact is especially visible in large checkpoints. For example, the original Qwen3.5-397B-A17B checkpoint occupies approximately 807 GB, while its FP8 version requires about 406 GB.

* **Memory bandwidth** strongly affects inference latency. Lower-bit weights reduce the amount of data transferred during each operation, allowing optimized kernels to improve time to first token, inter-token latency, and throughput.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lower-bit weights can reduce memory traffic in weight-bandwidth-bound workloads, especially during decode. The end-to-end benefit depends on kernel efficiency, quantization overhead, and the prefill/decode workload mix.

@BBuf BBuf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few spots I think we should tighten before publishing.

<div align="center">
<img src="/images/blog/2026-07-24-cleaner-quantization-stack/02-diff-diagram.png" alt="Before and after quantization architecture" />
<br>
<em>Figure 1: The refactor separates format-specific weight handling from platform-specific processing and kernel execution.</em>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we call this the target architecture instead of the “after” state? The linked roadmap still tracks the Scheme/Kernel split and platform-based selection as ongoing work.


* **Memory capacity** determines how large a model can be, how much KV cache remains available, and how many requests can run concurrently. The impact is especially visible in large checkpoints. For example, the original Qwen3.5-397B-A17B checkpoint occupies approximately 807 GB, while its FP8 version requires about 406 GB.

* **Memory bandwidth** strongly affects inference latency. Lower-bit weights reduce the amount of data transferred during each operation, allowing optimized kernels to improve time to first token, inter-token latency, and throughput.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The table below actually shows TTFT regressing by ~22% for W8A8 and ~10% for W4A4/W8A8. I’d qualify this: quantization helps bandwidth-bound decode here, but not necessarily prefill or TTFT.

<div align="center">
<img src="/images/blog/2026-07-24-cleaner-quantization-stack/03-table.jpg" alt="Quantization performance and accuracy comparison" />
<br>
<em>Figure 2: Performance and accuracy comparison for Qwen3-30B-A3B with tensor parallelism 4 on Ascend A3, using 64 prompts, concurrency 64, and 2048-token input and output lengths.</em>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add the accuracy dataset/metric, exact checkpoint, SGLang commit, launch command, software stack, and number of runs. Otherwise this table is hard to interpret or reproduce.

<div align="center">
<img src="/images/blog/2026-07-24-cleaner-quantization-stack/05-kernel_reusing_Diagram.png" alt="Multiple quantization schemes reusing shared hardware kernels" />
<br>
<em>Figure 4: Multiple checkpoint formats can share the same backend kernel.</em>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This reads as if AWQ, GPTQ, and Compressed-Tensors already share one WnA16 kernel. If this is the target state, please label it that way and mention that reuse depends on compatible layouts, scales, zero points, and group sizes.


We are grateful to the broader SGLang community, including quantization codeowners Cheng Wan (@ch-wan), Xiaoyu Zhang (@BBuf), Zhiyu Cheng (@Edwardf0t1), Fan Yin (@FlamingoPg), and Peng Zhang (@AniZpZ), as well as all contributors who have implemented formats, developed kernels, reviewed architectural changes, and validated quantization paths across CUDA, ROCm, Ascend NPU, XPU, CPU, and other backends.

Special thanks to the Intel Neural Compressor and AutoRound contributors for their collaboration on AutoRound integration, and to the NVIDIA, AMD, ModelOpt, Compressed-Tensors, Quark, GGUF, and hardware-backend communities whose work continues to expand the range of efficient inference formats available to SGLang.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Compressed-Tensors in SGLang is explicitly adapted from vLLM. We should acknowledge the vLLM contributors here as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The cover skips the Method and Kernel layers and uses “Backend Dispatch” instead, so it does not quite match the four-layer architecture in the post. Can we align the labels?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I’d change “After” to “Target Architecture” since this migration is still in progress.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NPUMXFP8LinearMethod is shown as a Kernel, while the layer above is also called Method. Could we clarify that this box is a kernel runner/backend adapter?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this be a Markdown/HTML table instead of a JPEG? It would read better on mobile and be easier to update.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe mark the shared WnA16 kernel as “target” and note that reuse requires compatible layouts and quantization semantics.

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.

3 participants