Skip to main content
QUICK REVIEW

[论文解读] Strassen's Matrix Multiplication Algorithm for Matrices of Arbitrary Order

Ivo Hedtke|arXiv (Cornell University)|Jul 13, 2010
Matrix Theory and Algorithms参考文献 11被引用 7
一句话总结

本文通过分析参数选择对计算开销的影响,研究了斯特拉森矩阵乘法算法在任意 $n \times n$ 矩阵上的表现。结果表明,斯特拉森原始参数在最坏情况下导致的浮点运算次数比最优参数高出约 20%,凸显了显著的低效性,从而推动了在实际性能中采用更优参数选择的必要性。

ABSTRACT

The well known algorithm of Volker Strassen for matrix multiplication can only be used for $(m2^k imes m2^k)$ matrices. For arbitrary $(n imes n)$ matrices one has to add zero rows and columns to the given matrices to use Strassen's algorithm. Strassen gave a strategy of how to set $m$ and $k$ for arbitrary $n$ to ensure $n\leq m2^k$. In this paper we study the number $d$ of additional zero rows and columns and the influence on the number of flops used by the algorithm in the worst case ($d=n/16$), best case ($d=1$) and in the average case ($d\approx n/48$). The aim of this work is to give a detailed analysis of the number of additional zero rows and columns and the additional work caused by Strassen's bad parameters. Strassen used the parameters $m$ and $k$ to show that his matrix multiplication algorithm needs less than $4.7n^{\log_2 7}$ flops. We can show in this paper, that these parameters cause an additional work of approx. 20 % in the worst case in comparison to the optimal strategy for the worst case. This is the main reason for the search for better parameters.

研究动机与目标

  • 分析在将斯特拉森算法应用于任意 $n \times n$ 矩阵时,其原始参数选择 ($m$, $k$) 所引入的计算开销。
  • 量化这些参数在最坏、最好和平均情况下导致的额外工作量(以浮点运算次数衡量)。
  • 将斯特拉森的参数策略与最优替代方案进行比较,展示在最坏情况下的性能差距。
  • 对填充至 $m2^k$ 尺寸时添加的零行/零列数量 ($d$) 进行详细分析,并评估其对算法效率的影响。

提出的方法

  • 本文将斯特拉森算法建模为一种递归分治方法,其在 $m2^k \times m2^k$ 尺寸矩阵上的浮点运算次数为 $7^k m^2(2m+5) - 4^k 6m^2$,并与朴素的 $n^3$ 算法进行比较。
  • 定义 $\tilde{n} = m2^k$ 为填充后的矩阵尺寸,$d = \tilde{n} - n$ 为添加的零行/零列数量。
  • 通过最坏情况($d = n/16$)、最好情况($d = 1$)和平均情况($d \approx n/48$)三种场景评估参数影响。
  • 推导出期望值 $\mathbb{E}[\tilde{n}/n] = 49/48 \approx 1.0208$,表明平均填充量约为 $n$ 的 2.08%。
  • 通过比值函数 $r(p) = F(p)/\tilde{F}(p)$ 比较斯特拉森原始参数($m=32$, $k=p-5$,对应 $n=2^p-1$)与最优参数($m=8$, $k=p-3$)的性能。
  • 利用渐近极限和单调性分析,证明斯特拉森参数在最好情况下约差 8%,在最坏情况下最多差 20%,相比最优选择。

实验结果

研究问题

  • RQ1斯特拉森原始参数选择在应用于任意 $n \times n$ 矩阵时,对浮点运算次数有何影响?
  • RQ2在最坏、最好和平均情况下,填充的零行和零列数量 ($d$) 如何变化?
  • RQ3斯特拉森原始参数与最优参数之间的性能差距(以额外计算工作量衡量)是多少?
  • RQ4对于随机 $n$,能否解析推导出期望填充尺寸 $\mathbb{E}[\tilde{n}/n]$?
  • RQ5为何斯特拉森原始参数选择在最坏情况下导致约 20% 的工作量增加?这对实际实现有何影响?

主要发现

  • 在最坏情况下,斯特拉森原始参数导致的浮点运算次数比最优参数选择高出约 20%,这是由于过度填充($d = n/16$)所致。
  • 在最好情况下(仅添加一行一列零元素,$d = 1$),斯特拉森参数仍导致约 8% 的额外工作量,相比最优参数。
  • 平均而言,期望填充比为 $\mathbb{E}[\tilde{n}/n] = 49/48 \approx 1.0208$,即平均填充量约为 $n$ 的 2.08%。
  • 比值 $r(p) = F(p)/\tilde{F}(p)$(比较斯特拉森原始参数与最优参数)从 $p=5$ 时的约 1.080 单调递减至 $p \to \infty$ 时的约 1.0729,证实了其持续的低效性。
  • 分析确认斯特拉森原始参数选择($m=32$, $k=p-5$)次优,导致显著的计算开销,从而推动了寻找更优参数集的必要性。
  • 本文证明,约 20% 的最坏情况性能差距是实际实现中寻求改进参数策略的主要原因。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。