Improved Rectangular Matrix Multiplication using Powers of the Coppersmith-Winograd Tensor
François Le Gall, Florent Urrutia
Introduction
Matrix multiplication is one of the most important problems in mathematics and computer science. In 1969, Strassen discovered the first algorithm with subcubic complexity computing the product of two square matrices . In modern notation, Strassen’s result can be stated as an upper bound on the exponent of square matrix multiplication , defined as the minimum value such that two matrices can be multiplied using arithmetic operations for any constant . Strassen’s breakthrough initiated intense work on the complexity of matrix multiplication, which in a span of a few decades lead to several improvements, culminating in the celebrated -time algorithm for square matrix multiplication by Coppersmith and Winograd , i.e., the upper bound on the exponent of square matrix multiplication. This algorithm is obtained from a basic construction, which is nowadays often called the Coppersmith-Winograd tensor. Coppersmith and Winograd showed that analyzing this tensor gives the upper bound , and next showed that analyzing the second power of this tensor gives the improved upper bound .
A natural question, already mentioned in Coppersmith and Winograd’s paper , was whether higher powers of the Coppersmith-Winograd tensor can lead to further improvement to the complexity of matrix multiplication. Most efforts to investigate this direction quickly stopped after discovering that the third power does not seem to lead to any further improvement. More than twenty year later, however, Stothers (see also ) and Vassilevska Williams showed that the fourth power does give an improvement: the fourth power leads to the upper bound . The technically challenging analysis of the fourth power was made possible by the introduction of powerful general recursive techniques to analyze powers of tensors. Extending these techniques, Vassilevska Williams and then Le Gall succeeded in analyzing higher powers up to the 32nd power, which gave additional small improvements and lead to the current best known upper bound on the exponent of square matrix multiplication . Table 1 summarises all these results. Ambainis et al. finally showed that further improving this upper bound will be hard: they showed that analyzing higher powers of the Coppersmith-Winograd tensor (e.g., powers 64, 128,…) using the same methodology cannot give any further significant improvement on (in particular it cannot lead to a proof of the popular conjecture ).
Besides square matrix multiplication, rectangular matrix multiplication plays a central role in many algorithms as well. In addition to natural applications to computational problems in linear algebra, typical examples of application include the construction of fast algorithms for the all-pairs shortest paths problem , dynamic computation of the transitive closure , detection of subgraphs , speed-up of sparse square matrix multiplication and algorithms for bounded-difference min-plus square matrix multiplication . Rectangular matrix multiplication has also been used in computational complexity and computational geometry .
The typical problem considered when studying rectangular matrix multiplication is computing the product of an matrix by an matrix, for some parameter . Note that a basic result in algebraic complexity theory states that the algebraic complexities of the following three problems are the same: computing the product of an matrix by an matrix, computing the product of an matrix by an matrix, and computing the product of an matrix by an matrix. In this paper for concreteness we discuss only the first type of products, but all our bounds naturally hold for the two other types as well. In analogy to the square case, the exponent of rectangular matrix multiplication, denoted , is defined as the minimum value such that this product can be computed using arithmetic operations for any constant . Also note that for (i.e., for square matrices), we have .
Coppersmith showed in 1982 that . This surprising result means that the product of an matrix by an matrix can be computed in time almost linear in the size of the output (which contains entries). This discovery lead to the introduction of the following quantity :
Since proving that is equivalent to proving that , the quantity is sometimes called the dual exponent of matrix multiplication. Coppersmith’s result then corresponds to the bound . Coppersmith later showed that by analyzing the Coppersmith-Winograd tensor in the context of rectangular matrix multiplication. Fifteen years later, Le Gall showed that the second power of the Coppersmith-Winograd tensor can also be analyzed in the context of rectangular matrix multiplication, which lead to the improved lower bound . This analysis was actually much more general and gave bounds on that improved prior bounds for any . (For , i.e., square matrix multiplication, this approach recovered the upper bound from ). The results from are presented in Table 2.
2 Our results
In view of the recent progress in square matrix multiplication algorithms obtained by analyzing higher powers of the Coppersmith-Winograd tensor, it is natural to ask whether the same approach can be applied to obtain further improvements on the complexity of rectangular matrix multiplication as well. We investigate this question in this paper, and present a framework to extend the analysis of higher powers to the case of rectangular matrix multiplication. We concretely focus on the analysis of the fourth power of the Coppersmith-Winograd tensor and show that this analysis leads to non-negligible improvements. The new upper bounds we obtain on the exponent of rectangular matrix multiplication are given in Table 3 and the values for are plotted in Figure 1. Note that the curve of Figure 1 has the same shape as the curve for the second power given in . We obtain in particular the new lower bound
on the dual exponent of matrix multiplication, as stated in the following theorem.
The product of an matrix by an matrix can by computed with arithmetic operations for any constant .
This new bound improves the previous best known lower bound by Le Gall . For other values of as well, our new upper bounds on are systematically better than those of , as can be seen by comparing Table 2 and Table 3. For instance we obtain , which improves the previous upper bound . Note that for (i.e., for square matrix multiplication), we obtain the same upper bound on the exponent of square matrix multiplication as the bound obtained by analyzing the fourth power . Indeed, for our analysis becomes essentially the same as the analysis for the square case in those prior works.
A surprising, or at least unexpected, aspect of the result of Theorem 1.1 is that the improvement from the second power to the fourth power (from to ) exceeds the improvement known from the first power to the second power (from to ). This is completely different from the improvements achieved on when analyzing successive powers of the Coppersmith-Winograd tensor, which are decreasing, as summarized in Table 1. Actually, all the numerical results we have obtained confirm that for any fixed value of the improvements on decrease similarly to the square case when analyzing successive powers. For instance for and the first power gives and ; by examining Tables 2 and 3 we observe that the improvement is larger from the first power to the second power. The situation happens to be different, however, for lower bounds on . Since the curves representing the upper bounds on have horizontal asymptotes at the lower bound on (see Figure 1 of the present paper and Figure 1 in ), even small improvements on can lead to fairly significant improvements on , as our results show.
The most pressing question is now to investigate what will happen for even higher powers of the Coppersmith-Winograd tensor (e.g., power 8 or 16). We believe that this question is important since, besides its theoretical interest, further significant improvements for may be obtained in this way. A concrete approach would be to adapt to the rectangular case the numerically efficient methods based on convex optimization developed, in the setting of square matrix multiplication, to study high powers of the Coppersmith-Winograd tensor . In the other direction, it may be possible to show some limitations on the improvements achievable when studying higher powers, by generalizing the recent approach developed for the square case .
Our new bounds can be used to improve essentially all the known algorithms based on rectangular matrix multiplication algorithms (e.g., the algorithms in ). Following , we discuss below one concrete example.
Zwick has shown how to use rectangular matrix multiplication to compute the all-pairs shortest paths in weighted direct graphs where the weights are bounded integers. The time complexity obtained by Zwick for graphs with constant weights is , for any constant , where is the solution of the equation . The results from (see Table 2) show that , which gives the upper bound . The results of the present paper (see Table 3) show that , which gives the upper bound .
3 Overview of our approach
Before presenting an overview of the techniques used in this paper, we give an informal description of algebraic complexity theory (a more detailed presentation of these notions is given in Section 2).
The matrix multiplication of an matrix by an matrix can be represented by the following trilinear form, denoted as :
where , and are formal variables. This form can be interpreted as follows: the -th entry of the product of an matrix by an matrix can be obtained by setting for all and for all , setting and setting all the other -variables to zero. One can then think of the -variables as formal variables used to record the entries of the matrix product.
More generally, a trilinear form is represented as
A sum of trilinear forms is a direct sum if the ’s do not share variables. Informally, Schönhage’s asymptotic sum inequality for rectangular matrix multiplication states that, if the form can be converted into a direct sum of trilinear forms, each form being isomorphic to , then
This implies that to obtain good upper bounds on the exponent of rectangular matrix multiplication, it is enough to find a tensor of low border rank that can be converted into many independent (i.e., not sharing any variables) products of large enough rectangular matrices.
Overview of the analysis of the second power.
We now give a brief overview of the analysis of the second power of the Coppersmith-Winograd tensor given in to derive the upper bounds on of Table 2. The Coppersmith-Winograd tensor is a trilinear form introduced in . Here is a parameter (concretely, is an integer between 2 and 10). Its second power can actually be written as a sum of fifteen terms :
In order to apply Schönhage’s asymptotic sum inequality, this sum must first be converted into a direct sum. This is done using a powerful general technique known as the laser method, first introduced by Strassen and then successively generalized and refined . The first step is to take the -th tensor product of the basic construction, where is a large integer, and then zero variables so that the remaining terms do not share variables. Since we want each remaining term to be isomorphic to a rectangular matrix product in order to obtain an upper bound on via Schönhage’s asymptotic sum inequality, the choice of zeroed variables has to be done carefully. The laser method allows us, for any choice of the fifteen parameters satisfying specific constraints, to convert the -th tensor product of the basic construction into a direct sum of many terms (the number of these terms depending on the values of the ’s), each isomorphic to
The next step is to analyze each term (1) and show that it corresponds to a direct sum of matrix products of the form (the number of terms in the direct sum and the value of will depend on the values of the ’s and ). Some of the ’s (more precisely, all the ’s except , and ) can be analyzed in a straightforward way, since they correspond to matrix products. The main technical contribution of the approach from was to show that each of the remaining three terms can be converted into a large number of objects called “-tensors” in Strassen’s terminology . This conversion is done again via the laser method, which introduces additional parameters. Finally, Ref. explained how to convert these -tensors into a direct sum of matrix multiplication tensors. Combining the analysis of these fifteen terms shows that (1) corresponds to a direct sum of matrix products of the form , as wanted. Schönhage’s asymptotic sum inequality then gives the upper bound on presented in Table 2 by numerically optimizing the choice of the parameters (the choice of , the ’s and the additional parameters arising in the second extraction).
Overview of our analysis of the fourth power.
The fourth power of the Coppersmith-Winograd tensor can be written as a sum of 45 terms :
For conciseness, this tensor will be denoted through the paper. Similarly to the analysis of the second power, the laser method allows us, for any choice of parameters satisfying specific constraints, to convert the -th tensor product of the basic construction into a direct sum of many terms, each isomorphic to
We call this process the first extraction, which is explained in detail in Section 3. Note that while this extraction is more complicated than for the second power since the number of variables is larger and deriving the constraints that the parameters should satisfy is more complex, conceptually the analysis is fairly standard.
The main technical contribution of this work is a methodology to analyze each term (2). A natural strategy would be to mimic the analysis done in for the second power and analyze each component individually. While this leads to some improvement over the second power when is close to 1 (in particular, this leads to the same upper bound as in prior works analyzing the fourth power in the context of square matrix multiplication ), this strategy does not give any improvement for smaller values of (in particular, no improved lower bound on the dual exponent of matrix multiplication ). Our strategy, instead, is to analyze all the terms together via the laser method. As in the term-by-term analysis done for the second power in , this introduces a set of new parameters for each term and a set of constraints that these parameters should satisfy. A difference is that now some of the constraints are global: they can involve the parameters of all the 45 terms. We call this process the second extraction, which is explained in detail in Section 4. Note that this methodology appears to be more powerful than the term-by-term conversion to -tensors done in : First, as already mentioned, the latter approach does not seem to lead to any improvement on for the fourth power. Second, our new methodology, when applied to the analysis of the second power in replacement of the conversion into -tensors done in , already leads to upper bounds on slightly better than those found in for some values of (more precisely, we observed such improvements for values in the range ).
The second extraction outlined in the previous paragraph actually does not completely analyze (2): it simply decomposes each term into a direct sum of products of the fifteen terms arising in the analysis of the second power. To complete the analysis, we recursively apply the same strategy as for the second extraction and analyse the contribution of all these fifteen terms together, again using the laser method (which introduce two additional parameters). We call this process the third extraction, which is explained in detail in Section 5.
Finally, combining our three extractions, we conclude that the tensor can be converted into a direct sum of trilinear forms, each form being isomorphic to , for some values and depending on all the parameters introduced. Applying Schönhage’s asymptotic sum inequality then gives an inequality involving and all these parameters (the formal statement is Theorem 6.1 in Section 6). Optimizing numerically the choice of parameters, under the constraints derived on those parameters, gives the upper bounds of Table 3 and the lower bound on of Theorem 1.1.
Preliminaries
We present various known results and tools related to matrix multiplication. Two good references for an extensive treatment of this topic are and .
We define the notion of type. A type can be seen as a frequency vector.
2 Tensors, matrix multiplication and the asymptotic sum inequality
Let and be two tensors. The direct sum , is a tensor in . The tensor product is a tensor in . For any positive , we will denote the tensor (with occurrences of ) by and the tensor (with occurrences of ) by .
where spans , spans , spans and
We also consider the tensor of format which represents independent scalar products. It is denoted by and is defined as .
The intuition behind this notion is that the restriction of a tensor is easier to compute than the original tensor, in the sense that an algorithm computing a tensor can be converted into an algorithm computing a tensor with the same complexity.
This is analogous to the notion of approximate computation.
Note that by definition, . The notion of degeneration can be seen as an approximate conversion. It has the following property.
Let and be four tensors. Suppose that and . Then and .
The notion of border rank enables us to formally define the exponent of rectangular matrix multiplication, as follows. For any ,
The exponent of square matrix multiplication is .
Similarly to almost all recent works on matrix multiplications, our main tool for proving lower bounds on will be Schönhage’s asymptotic sum inequality (see for the version of the inequality given below).
Let , and be three positive integers. Let be a tensor such that . Then
3 The fourth power of Coppersmith-Winograd tensor
For any positive integer , the Coppersmith-Winograd tensor is the tensor of format defined as
Coppersmith and Winograd showed that .
Define the tensors . By regrouping terms, we can write
and the other eleven terms are obtained by permuting the indexes of the variables, the variables and variables in the above expressions (e.g., and ). Note that from the submultiplicativity of the border rank.
Let us now consider the fourth power of the Coppersmith-Winograd tensor (already studied, in the context of square matrix multiplication, in Refs. ). For any define the set
By regrouping terms, the fourth power of , which hereafter we simply denote (the value of will be implicit until the very end of the paper), can be written as
Note that , again from the submultiplicativity of the border rank.
When later working with the terms , we will sometimes consider the equivalent decomposition
Notice that we define only for triple from the set
Finally, for any triple and any triple , we define
4 Extraction from a tensor
In this subsection we explain our main tool to realize an extraction from a sum of tensors. An extraction consists in assigning some variables to zero in a tensor (thus eliminating all their contributions to the sum). If a tensor is extracted from , then trivially holds. Our primary goal is to guarantee that the resulting tensor is a direct sum of isomorphic tensors, so that the asymptotic sum inequality can be used.
All recent progresses on square or rectangular matrix multiplication have been obtained by performing extractions based on the so-called laser method . Le Gall introduced the following convenient framework to interpret such reductions in the rectangular case. In this framework, a sum of tensors corresponds to a graph whose vertices are the tensors in the sum. There is an edge between two vertices in the graph if and only if the two corresponding terms in the sum of tensors share a variable. Let denote this graph, and denote its set of vertices. Zeroing a term in the sum corresponds to removing one vertex from the graph. As mentioned above, however, terms can be zeroed only by zeroing the variables it contains. This means that such a zeroing operation may actually remove more than one vertex from the graph. Extracting a direct sum from the original tensor is then equivalent to removing vertices from the graph by such zeroing operations and reaching an edgeless graph. When using this methodology, we will like to additionally guarantee that the vertices remaining in the final graph are from a specified subset . Concretely, the set will be the set of vertices of terms matching a certain type, which will ensure that all the tensors remaining after the extraction are of this type. In our extractions we will use the following theorem from , which is tailored for this goal and was already used for the analysis of the second power of the Coppersmith-Winograd tensor.
Let be a fixed positive integer. Let be a large integer and define the set
Define the three coordinate functions as follows.
Let be a subset of such that there exist integers and for which the following property holds: for any ,
Let , and . Let be the (simple and undirected) graph with vertex set in which two distinct vertices and are connected if and only if there exists one index such that .
Assume there exists a set such that
for each ;
there exist integers and such that
for each and each .
Define a removal operation as removing all the vertices (if any) such that , for a fixed sequence and a fixed position Then, for any constant , the graph can be converted, with only removal operations, into an edgeless graph with
vertices, all of them being in .
First extraction
In this section we describe our first extraction.
Let us consider any function . For any we will often write instead of . Given , we define the following three mappings:
,, are the projections of on each of the three coordinates. We thus have
we are left only with tensors where is of type , i.e, tensors isomorphic to
First notice that for any such that , the variables in and in are disjoint. We set to zero all the variables except the ones which appear in a where is of type , that is to say we set to zero all variables which appear in a with not of type . We are thus left with only the tensors with of type .
The number of sequences of type is
as choosing a sequence of type is equivalent to choose the location of the elements for . Using the Stirling formula, we get, with the fixed and ,
Similarly, we define the number of sequences of type as and the number of sequences of type as .
For any fixed sequence of type , the number of remaining forms of type is
while the total number of remaining forms is
Define, the function which associates to any mapping the value . Using Stirling’s formula, and the fact that , we get that
Similarly, for any sequence of type , the number of remaining forms of type and the total number of remaining forms are
and for any sequence of type , the number of remaining forms of type and the total number of remaining forms are
Using the framework presented in Subsection 2.4, we get by Theorem 2.2 that for any we can further extract from the remaining a direct sum of
tensors , all of which are of type . We want the number of tensors is this direct sum to be high. For this to happen, we now formulate some conditions on .
Conditions on aa.
We first observe that can actually be written as a (concave) function of only variables, namely , , , , , , , , , , , , , , , , , , , , . This is because is defined on , and the elements of have, by definition, the same projections as , and thus for any the satisfy the following system of linear equations:
Resolving of the (homogeneous) linear system A Maple file deriving the symbolic solution of this system is available at . reduces the number of variables to 21, as claimed.
From now we will assume that satisfies the symmetry condition
Computing each one of the partial differential equations leads, after simplification and by condition (C1), to a system of non linear equations:
Note that, as the value of any is fixed from the values of only variables, and as , we have . For any satisfying these equations, we have and thus, , , .
Final statement.
By the symmetry condition (C1), this implies that . We get , and thus we obtain and
As by definition , this is equal to
Let be any positive integer. Let be any function from satisfying the constraints (C1), (C2) and (3). Then for any , the trilinear form admits a restriction which is a direct sum of trilinear forms, each of which is isomorphic to .
Second extraction
As we will see later in details in Section 6, the tensors for with one or more of their indices equal to are actually matrix products tensors. No further work is required for them. In contrast, the tensors for where do not correspond to matrix products.
We are now going to realize an extraction on all the tensors . We first study the properties of the . In Subsection 4.1, we consider the particular case of the tensors , and . In Subsection 4.2, we consider the remaining tensors, i.e., the tensors for , which are actually easier to analyze. Then, in Subsection 4.3, we explain the limitations of independent extractions and introduce our method to realize a joint extraction.
The extractions from the tensors , , can be realized similarly to the extraction from the tensor that we realized in Section 3. As the situation is similar for the three tensors, we only detail the extraction from the tensor .
The number of sequences of type is
Define the function which associates to any mapping the value
For any fixed sequence of type , the number of remaining forms with of type is
while the total number of remaining forms is
Similarly, for any fixed sequence of type , the number of remaining forms with of type is
the total number of remaining forms is
and for any fixed sequence of type , the number of remaining forms with of type is and the total number of remaining forms is .
By studying the function in a similar way as we studied the function in Section 3, we get that for satisfying the constraint
Calculations show that can be written as a function of and only, and as , we have that and thus we obtain , and .
The tensors and are analysed similarly. Imposing the constraints
implies that and .
To summarize, when analyzing , and we need to impose the following three constraints (in addition to other constraints discussed later):