VC-Attention:用于低位注意力的值平滑与Softmax转换

·

研究论文 · 2026/09/17

VC-Attention 是一个免训练的低比特注意力框架,通过值平滑(V-Smooth)与融合概率转换(ExpCast-FP8)解决扩散 Transformer 视频生成中注意力的精度与速度瓶颈。V-Smooth 通过轻量在线聚类重排值 token,使硬件块内 token 更易量化,仅量化减去块均值后的残差,并利用在线 softmax 已维护的行和恢复该均值。ExpCast-FP8 用一次融合乘加将对数域分数直接映射为 E4M3 概率编码,消除 FP32 指数运算与格式转换。该框架已在 B200、B300、H200、RTX PRO 6000 和 RTX 5090 上实现,在 Wan2.2、LongCat-Video、HunyuanVideo-1.5 和 MiniMax-H3 上,相比低比特基线提升保真度,注意力核相比 BF16 FlashAttention-4 在数据中心 Blackwell 和 Hopper 上加速 1.46-1.59 倍,在工作站显卡上加速 2.3-3.6 倍,端到端生成片段分别快 1.13-1.19 倍和 1.36-1.70 倍。

该工作针对扩散 Transformer 视频生成中注意力部署的核心瓶颈,提出免训练的低比特方案,在多个主流 GPU 和视频生成模型上同时实现精度提升与显著加速,具有较高的实用价值。

Diffusion Transformers deliver state-of-the-art video generation, but their long spatiotemporal sequences make attention the dominant deployment cost, and a deployable low-bit kernel must be accurate and fast. Accuracy is limited by outliers: a block's quantization scale is set by its largest entries, leaving typical entries confined to a narrow range of representable values. Prior work smooths queries and keys, but value outliers follow no fixed channel or spatiotemporal structure and remain the dominant source of output error. Speed is limited by softmax: low-bit Tensor Cores accelerate only the two matrix multiplications, so the high-precision exponential between them becomes the longest pipeline stage on datacenter GPUs. We propose VC-Attention, a training-free low-bit attention framework that addresses both by pairing Value smoothing with a fused probability Cast. V-Smooth reorders value tokens by lightweight online clustering, so the tokens in a hardware block quantize well together. It quantizes only the residual after subtracting the block mean, and restores that mean from the row sum the online softmax already maintains. ExpCast-FP8 maps log-domain scores directly to E4M3 probability codes with one fused multiply-add, eliminating the FP32 exponential and the format conversion. We implement VC-Attention for B200, B300, H200, RTX PRO 6000, and RTX 5090. Across Wan2.2, LongCat-Video, HunyuanVideo-1.5, and MiniMax-H3, VC-Attention improves fidelity over low-bit baselines, speeds up the attention kernel over BF16 FlashAttention-4 by 1.46-1.59x on datacenter Blackwell and Hopper and by 2.3-3.6x on workstation cards, and generates a clip 1.13-1.19x and 1.36-1.70x faster end to end.

阅读原文

参与讨论