Paper 2024/2063

The Number of the Beast: Reducing Additions in Fast Matrix Multiplication Algorithms for Dimensions up to 666

Erik Mårtensson, Lund University, Advenica AB, Sweden
Paul Stankovski Wagner, Lund University
Abstract

While a naive algorithm for multiplying two 2 × 2 matrices requires eight multiplications and four additions, Strassen showed how to compute the same matrix product using seven multiplications and 18 additions. Winograd reduced the number of additions to 15, which was assumed to be optimal. However, by introducing a change of basis, Karstadt and Schwartz showed how to lower the number of additions to 12, which they further showed to be optimal within this generalized Karstadt-Schwartz (KS) framework. Since the cost of the change of basis is smaller than one addition (per each recursive level), it is disregarded in this cost metric. In this work we present improved methods for classical optimization of the number of additions in Strassen-type matrix multiplication schemes, but for larger matrix sizes, and without including any change of basis. We find specific examples where our methods beat the best instances found within the KS framework, the most impressive one being Laderman’s algorithm for multiplying 3 × 3 matrices, which we reduce from the naive 98 additions to 62, compared to 74 in the KS framework. We indicate that our approach performs better compared to previous work within the KS framework, as the matrix dimensions increase. We additionally apply our algorithms to another reference set of algorithms due to Moosbauer and Kauers for which we do not have results in the KS framework as a comparison. For parameters (n, m, k), when multiplying an (n × m) matrix with an (m × k) matrix, the schoolbook algorithm uses nk(m − 1) additions. Using the reference set of algorithms we find that our algorithm leads to an optimized number of additions of roughly cnk(m − 1), where c is a small constant which is independent of the dimensions. We further provide concrete and practical implementations of our methods that are very efficient for dimensions including (and surpassing) the 666 limit, i.e. (n, m, k) = (6, 6, 6), in our reference set of fast multiplication algorithms.

Metadata
Available format(s)
PDF
Category
Foundations
Publication info
Preprint.
Keywords
Fast matrix multiplicationStrassen's algorithmcryptanalysis
Contact author(s)
erik martensson @ eit lth se
paul stankovski_wagner @ eit lth se
History
2024-12-23: approved
2024-12-23: received
See all versions
Short URL
https://ia.cr/2024/2063
License
Creative Commons Attribution
CC BY

BibTeX

@misc{cryptoeprint:2024/2063,
      author = {Erik Mårtensson and Paul Stankovski Wagner},
      title = {The Number of the Beast: Reducing Additions in Fast Matrix Multiplication Algorithms for Dimensions up to 666},
      howpublished = {Cryptology {ePrint} Archive, Paper 2024/2063},
      year = {2024},
      url = {https://eprint.iacr.org/2024/2063}
}
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.