arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2211.16749cs.LGcs.AIcs.AR
收藏

HEAT:用于Transformer压缩的硬件高效自动张量分解

HEAT: Hardware-Efficient Automatic Tensor Decomposition for Transformer Compression

NVIDIA(英伟达);Caltech(加州理工学院)

Jiaqi Gu, Ben Keller, Jean Kossaifi, Anima Anandkumar, Brucek Khailany, David Z. Pan

摘要:

Transformers在自然语言处理和计算机视觉方面取得了卓越的性能。它们的自我注意和前馈层是过度参数化的,限制了推理速度和能量效率。张量分解是一种很有前途的技术,通过利用张量代数性质来表示因子分解形式的参数,以减少参数冗余。先前的努力使用手动或启发式因子分解设置,而没有硬件感知的定制,导致硬件效率低下和性能大幅下降。在这项工作中,我们提出了一个硬件感知的张量分解框架,称为HEAT,它可以有效地探索可能的分解的指数空间,并通过硬件感知的协同优化自动选择张量化形状和分解秩。我们共同研究张量收缩路径优化和融合Einsum映射策略,以弥合理论优势和实际硬件效率提高之间的差距。我们的两阶段知识蒸馏流程解决了可训练性瓶颈,从而显著提高了因子化Transformers的最终准确性。总的来说,我们的实验表明,我们的硬件感知因子分解BERT变体将能量延迟产品减少了5.7倍,准确性损失小于1.1%,并实现了比手动调整和启发式基线更好的效率-准确性帕累托前沿。

英文摘要:

Transformers have attained superior performance in natural language processing and computer vision. Their self-attention and feedforward layers are overparameterized, limiting inference speed and energy efficiency. Tensor decomposition is a promising technique to reduce parameter redundancy by leveraging tensor algebraic properties to express the parameters in a factorized form. Prior efforts used manual or heuristic factorization settings without hardware-aware customization, resulting in poor hardware efficiencies and large performance degradation. In this work, we propose a hardware-aware tensor decomposition framework, dubbed HEAT, that enables efficient exploration of the exponential space of possible decompositions and automates the choice of tensorization shape and decomposition rank with hardware-aware co-optimization. We jointly investigate tensor contraction path optimizations and a fused Einsum mapping strategy to bridge the gap between theoretical benefits and real hardware efficiency improvement. Our two-stage knowledge distillation flow resolves the trainability bottleneck and thus significantly boosts the final accuracy of factorized Transformers. Overall, we experimentally show that our hardware-aware factorized BERT variants reduce the energy-delay product by 5.7x with less than 1.1% accuracy loss and achieve a better efficiency-accuracy Pareto frontier than hand-tuned and heuristic baselines.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑