arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.07508math.NAcs.NA
收藏

大有限域上矩阵乘法的多词计算(浮点运算)

Multiword matrix multiplication over large finite fields in floating-point arithmetic

Sorbonne Université, CNRS, LIP6(索邦大学,法国国家科学研究中心,LIP6);Université Paris-Cité, LIPADE(巴黎西岱大学,LIPADE)

Jérémy Berthomieu, Stef Graillat, Dimitri Lesnoff, Theo Mary

AI总结:

本文提出了一种多词分解方法,用于高效计算大有限域上的矩阵乘法,解决了传统方法在处理大素数位数时的效率问题。

摘要:

本文关注的是高效计算模矩阵乘法C=AB mod p,这是计算机代数中的关键内核。我们聚焦于浮点运算,这允许使用高效的矩阵乘法库。然而,现有的方法仅限于素数p的位数不超过维持大小的一半(例如,双精度运算中26位),当p接近这个限制时变得相当低效。我们提出了一种新的方法,克服了这一限制,能够高效处理位数更大的素数。关键思想是使用多词分解,将A和B表示为缩放后的u和v矩阵(词)的和,具有更小的系数。我们提供了严谨的分析,证明了这种方法在适当选择缩放参数时的正确性。我们的分析确定了给定词数下可以处理的最大p的位数;特别是,我们证明了每个输入分解为两个词足以处理接近完整维持大小的位数(例如,在双精度运算中,26位限制提升到52位)。此外,我们还表明,(1,v)分解(v>1)对处理中间位数也具有兴趣。我们对各种矩阵形状和素数位数进行了广泛的实验分析。我们的性能基准测试在CPU和GPU架构上确认了所提出方法的效率,该方法在23位左右的位数上可以优于现有单词方法,并在52位的位数上保持高性能。

英文摘要:

This article is concerned with the efficient computation of modular matrix multiplication C=AB mod p, a key kernel in computer algebra. We focus on floating-point arithmetic, which allows for using efficient matrix multiplication libraries. However, the existing approach is limited to primes p with bitsize at most half the mantissa size (e.g., 26 bits with double precision arithmetic), and becomes quite inefficient when p approaches this limit. We present a new approach that overcomes this limitation and can efficiently handle primes with larger bitsizes. The key idea is to use multiword decompositions, which represent A and B as scaled sums of u and v matrices (words) with smaller coefficients. We provide a rigorous analysis that proves the correctness of this approach for suitably chosen scaling parameters. Our analysis determines the maximum bitsize of p that can be handled for a given number of words; in particular, we show that decomposing in two words each input suffices to handle bitsizes almost equal to the full mantissa size (e.g., the 26 bits limit is raised to 52 bits in double precision arithmetic). Moreover, we show that (1,v) decompositions with v>1 are also of interest to handle intermediate bitsizes. We perform an extensive experimental analysis for various matrix shapes and prime bitsizes. Our performance benchmarks on both CPU and GPU architectures confirm the efficiency of the proposed approach, which can outperform the existing single word approach for bitsizes as low as 23, and can handle bitsizes as high as 52 while retaining high performance.

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

↑