arxiv.org·2026/10/22
针对LLM推理中下一步该加2:4半结构化稀疏还是降一档精度的问题,作者在等比特(计入稀疏索引)和等tensor-core tier下,对Transformer层各类GEMM操作数在多代GPU上测量kernel,并纳入在线剪枝与量化。结果显示,只要还有更低精度可用,加2:4都比降一档精度更差:精度更低且速度更慢,因为2:4沿硬件强制轴每组四个丢弃的能量不随比特数减少,而量化误差随位数增加减半。量化到FP8 floor后,2:4仍把线性层加速1.3–1.7×;作者报告H100上重训练的2:4模型以FP8由vLLM服务,prefill吞吐比dense FP8高27%,GSM8K准确率相当。但质量必须靠重训练恢复,perplexity先恢复而推理能力停滞;Blackwell稀疏FP4采用成对4:8模式,损失更大,1B token重训练预算未恢复可用推理精度。
为什么重要 在 vLLM 与 LLM Compressor 移除 2:4 支持的背景下,本文给出何时值得用:仅在量化地板叠加权重,并需用 GSM8K 而非 perplexity 判断重训完成。适合 在 Ada/Hopper/Blackwell 上做 LLM 压缩部署与推理加速的工程师。
自 Ampere 起,NVIDIA tensor core 便支持 2:4 半结构化稀疏,且该模式可与量化组合。当两者结合时,实际问题在于下一步选哪条路:从给定精度出发,是加入 2:4 稀疏,还是降到下一个更低精度?我们在相同比特数(计入稀疏元数据)与相同名义 tensor core 层级下,对 transformer 层的全部六个 GEMM 操作数进行两者对比,内核在三代 GPU 上实测,并包含在线剪枝与量化。
结果表明,只要还有更低的精度可用,加入 2:4 都是更差的一步——精度更低且速度更慢,因为 2:4 沿硬件强制轴从每四个元素中丢弃的能量不会随比特数缩减,而量化误差会。一旦量化达到硬件支持的最低精度,2:4 仍能将线性层提速 1.3–1.7×;在 H100 上,经重训练的 2:4 模型以 FP8 由 vLLM 服务时,prefill 吞吐比稠密 FP8 模型高 27%,GSM8K 准确率持平。
然而其质量必须靠重训练找回,且困惑度的恢复远早于推理能力;在 Blackwell 上,其稀疏 FP4 采用成对的 4:8 模式,损失更大,我们的重训练预算未能将其恢复。
NVIDIA tensor cores have supported 2:4 semi-structured sparsity since Ampere, and the pattern composes with quantization.
When the two are combined, the practical question is which step to take next: from a given precision, add 2:4 sparsity or drop to the next lower precision?
We compare the two at equal bits, with sparsity metadata counted, and at equal nominal tensor-core tiers, over all six GEMM operands of a transformer layer, with kernels measured on three GPU generations and online pruning and quantization included.
Our results show that as long as a lower precision is available, adding 2:4 is the worse step, both less accurate and slower, because the energy that 2:4 discards from each group of four along the hardware-forced axis does not shrink with bits, while quantization error does.
Once quantization reaches the lowest precision the hardware supports, 2:4 still speeds up linear layers by 1.3--1.7x}, and on an H100 a retrained 2:4 model served in FP8 by vLLM reaches 27% higher prefill throughput than the dense FP8 model, with GSM8K accuracy on par.
Its quality has to be won back by retraining, however, which restores perplexity long before reasoning; on Blackwell, whose sparse FP4 uses a pairwise 4:8 pattern, the loss is larger and our retraining budget did not recover it.
线性层加速
FP8 上 2:4 vs dense,三 GPU
H100 prefill
retrained 2:4 FP8 vs dense FP8
Blackwell 4:8
sparse NVFP4 vs dense NVFP4
one-shot PPL
W4A16 one-shot 2:4 后 WikiText-2
GSM8K 恢复
1B token 重训仅恢复丢失的 1/4
注释 · 加速数据为 prefill 形状线性层;模型质量用 GSM8K 而非 perplexity 判断。出自 摘要、§6.1、§6.3
注释 · 三 GPU 均显示 2:4 在 FP8 地板上有 1.3-1.7× 加速。出自 Table 2

EVIDENCE / METHODS
风险提示
2:4 FP16 的误差是 dense FP8 的 5–16 倍,108 个 compute cells 只赢 6 个。
在 equal bits 下,2:4 在每个 storage budget 都输给量化,8 bits 差距超一个数量级,3.1 bits 仍未追平。在 equal tiers 下,2:4 只在对 MXFP4 和 row-wise INT8 for attention probabilities 时获胜,对 FP8 与 NVFP4 全败。因此,只要还有更低精度可用,添加 2:4 是更差的一步。
注释 · 工程上:只要还有更低精度可选,先量化后稀疏,不要先添加 2:4。出自 §4.1
原版排版与图表 · 手机无法内嵌时可在浏览器打开。PDF 插件内选文不能传给网页助手。