跳到正文
arXiv (AI + Vision + Imaging)· Shangzhen Zhu, Muyan Hu, Tomasz Kozlowski·· 2 天前精选AI 评分55

Rowmax-PoT:在预训练LLM中近似softmax并加速FlashAttention-4内核

Approximating Softmax in Pretrained LLMs: Model Sensitivity and Kernel Acceleration

AI 导读

研究团队在十款0.5B-72B冻结解码器模型上考察推理阶段近似softmax的敏感度,发现概率分配的位置数量与行内分辨率可大幅压缩,但对相同位置做均匀加权会损害模型表现,分辨率预算放在行最大值附近更有利。

推荐理由

论文在十款冻结模型上刻画 softmax 近似的位置敏感度,并给出 B200 上的内核加速实测数据,可作为注意力算子优化的参考。

正文 · 原文

arXiv:2609.33586v2 Announce Type: replace Abstract: On NVIDIA Blackwell B200, tensor-core throughput outpaces special-function exponential throughput by more than two orders of magnitude, exposing exponential evaluation in fused attention kernels. A pretrained Transformer, however, may not need it evaluated accurately at every element. We characterize what a pretrained model does need by approximating softmax at inference in ten frozen decoder-only models (0.5B-72B). The number of positions the softmax map assigns probability to and within-row resolution can be cut substantially, yet uniform weighting of the same positions is damaging. Where a fixed resolution budget is placed matters as much as its size, with resolution near the row maximum consistently favored. Perturbations matched on scalar distortion produce model-dependent responses of opposite sign. These findings motivate Rowmax-PoT, a coarse logarithmic weight representation anchored at each row maximum, and Rowmax-H15, its hardware specialization in FlashAttention-4. On B200, the patched FP8 attention forward is 12.4% faster at causal 8K and 25.8% faster at non-causal 8K in host-side call-latency measurements; board energy per forward falls by 8.4% at causal 16K. Measured separately on the BF16 kernel path at 2K, Rowmax-H15 increases perplexity by 0.091-0.492% across five models from three families.

来源:arXiv (AI + Vision + Imaging) · arxiv.org