一句话:提出 PyTorch 兼容的 RandNLA 库 Panther,以 C++/CUDA 后端加速线性层、卷积与注意力,BERT 内存最多省 75%。
现代深度模型训练受限于 GPU 内存与算力。随机数值线性代数(RandNLA)虽可压缩模型,但缺乏统一的生产级库。本文提出 Panther,一个 PyTorch 兼容库,将已有 RandNLA 算法整合为高性能框架,提供 sketched 线性层、二维卷积、多头注意力及随机矩阵分解(如 pivoted CholeskyQR)的即插即用替换,并配有自定义 C++/CUDA 后端 pawX,支持 CPU 与 GPU。评估中,仅数行代码替换 PyTorch 线性层后,Panther 在 BERT 上实现最高 75% 内存节省且损失相当。代码以 MIT 许可证开源。
Training modern deep learning models is increasingly constrained by GPU memory and compute limits. While Randomized Numerical Linear Algebra (RandNLA) offers proven techniques to compress these models, the lack of a unified, production-grade library prevents widely adopting these methods. We present Panther, a PyTorch-compatible library that consolidates established RandNLA algorithms into a single high-performance framework. Panther engineers efficient, drop-in replacements for standard components including sketched linear layers, 2D convolution, multi-head attention, and randomized matrix decompositions (such as pivoted CholeskyQR). By implementing a custom C++/CUDA backend (pawX), Panther provides an optimized implementation that can run on both CPUs and GPUs. We demonstrate the effectiveness of RandNLA techniques and Panther's ease of adoption. By replacing standard PyTorch linear layers with Panther layers (requiring only a few lines of code) we achieve significant memory savings (up to 75%) on BERT while maintaining comparable loss. Source code is available (MIT License) at https://github.com/FahdSeddik/panther, along with demonstration video at https://youtu.be/7M3RQb4KWxs.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2601-15473,
title = {Panther: Faster and Cheaper Computations with Randomized Numerical Linear Algebra},
author = {Fahd Seddik and Abdulrahman Elbedewy and Gaser Elmasry and Mohamed Abdelmoniem and Yahia Zakaria},
booktitle = {FSE},
year = {2026},
doi = {10.1145/3803437.3806409}
}