HadaCore:Tensor Core加速的Hadamard变换核
HadaCore: Tensor Core Accelerated Hadamard Transform Kernel
AI总结:
本研究提出适配Tensor Core的改进FWHT算法HadaCore,通过硬件感知任务分解利用张量核心加速,在A100、H100 GPU上实现显著提速,且半精度下数值准确,可保障Llama3量化推理的MMLU基准精度。
摘要:
我们提出HadaCore,这是一种针对现代GPU硬件中的Tensor Core(张量核心)优化的改进型快速沃尔什-哈达玛变换(Fast Walsh-Hadamard Transform, FWHT)算法。HadaCore沿用原始FWHT算法的递归结构,保持相同的渐近运行时复杂度,同时采用硬件感知的任务分解方式以利用Tensor Core加速,减少了计算和数据交换带来的瓶颈。在Nvidia A100和H100 GPU上,与现有最优的原始算法实现相比,HadaCore分别实现了1.1-1.4倍和1.0-1.3倍的加速比,峰值增益分别达3.5倍和3.6倍。我们还证明,使用FP16或BF16时,该实现具备数值准确性,在搭载量化(FP8)注意力的Llama3端到端推理中运行时,可在MMLU基准上达到相当的精度。
英文摘要:
We present HadaCore, a modified Fast Walsh-Hadamard Transform (FWHT) algorithm optimized for the Tensor Cores present in modern GPU hardware. HadaCore follows the recursive structure of the original FWHT algorithm, achieving the same asymptotic runtime complexity but leveraging a hardware-aware work decomposition that benefits from Tensor Core acceleration. This reduces bottlenecks from compute and data exchange. On Nvidia A100 and H100 GPUs, HadaCore achieves speedups of 1.1-1.4x and 1.0-1.3x, with a peak gain of 3.5x and 3.6x respectively, when compared to the existing state-of-the-art implementation of the original algorithm. We also show that when using FP16 or BF16, our implementation is numerically accurate, enabling comparable accuracy on MMLU benchmarks when used in an end-to-end Llama3 inference run with quantized (FP8) attention.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。