Coded Fourier Transform

Qian Yu, Mohammad Ali Maddah-Ali, A. Salman Avestimehr

I Introduction

Discrete Fourier transform (DFT) is one of the fundamental operations, which has been broadly used in many applications, including signal processing, data analysis, and machine learning algorithms. Due to the increasing size and dimension of data, many modern applications require massive amount of computation and storage, which can not be provided by a single machine. Thus, finding efficient design of algorithms including DFT in a distributed computing environment has gained considerable attention. For example, several distributed DFT implementations, such as FFTW and PFFT , have been introduced and used widely.

A major performance bottleneck in distributed computing problems is the latency caused by “stragglers" , which are the small fraction of computing nodes at the high latency tail that prolongs the computation. Mitigating this effect involves creating certain types of “computation reduncancy”, such that the computation can be completed even without collecting the intermediate results assigned to the stragglers. For example, one can replicate the same computing task onto multiple nodes to provide this redundancy .

Recently, it has been shown that coding theoretic concepts that were originally developed for communication systems can also be useful in distributed computing systems, playing a transformational role by improving the performance of computation in various aspects. In this context, two “coded computing” concepts has been proposed: The first one, introduced in , injects computation redundancy in order to alleviate the communication bottleneck and accelerate distributed computing algorithms (e.g., Coded Terasort ). The second coded computing concept, introduced in , utilizes coding to handle the straggler effects and speed up the computations for distributed matrix multiplication. This technique has been further extended to decentralized “master-less” architectures , distributed convolution , short dot linear transform and gradient computation .

More recently, polynomial code has been proposed for distributed massive matrix multiplication, for optimal straggler effect mitigation. It was shown that by designing a pair of codes, whose multiplicative product forms an Maximum Distance Separable (MDS) code, one can orderwise improve upon the prior arts in terms of the recovery threshold (i.e., the number of workers that the master needs to wait in order to be able to compute the final output), while optimizing other metrics including computation latency and communication load. This provides the first code that achieves the optimum recovery threshold. Furthermore, it allows mapping the reconstruction problem of the final output to polynomial interpolation, which can be solved efficiently, bridging the rich literature of algebraic coding and distributed matrix multiplication. Moreover, a variation of the polynomial code was applied to coded convolution, and its order-optimality has been proved.

Our main result in this paper is the development of an optimal computing strategy, referred to as the coded FFT. This computing design achieves the optimum recovery threshold mm, while allowing the the master to decode the final output with low complexity. Furthermore, we extend this technique to settings including computing multi-dimensional Fourier transform, and propose the corresponding optimal computation strategies.

To develop coded FFT, we leverage two key algebraic properties of the Fourier transform operations. First due to its recursive structures, we can decompose the DFT into multiple identical and simpler operations (i.e., DFT over shorter vectors), which suits the distributed computing framework and can be potentially assigned to multiple worker nodes. Secondly, due to the linearity of Fourier transform, we can apply linear codes on the input data, which commutes with the DFT operation and translates to the computing results. These two properties allow us to develop a coded computing strategy where the outputs from the worker nodes has certain MDS properties, which can optimally mitigate straggler effects.

II System Model and Main Results

Given the above system model, we can design the functions to compute ai\boldsymbol{a}_{i}s’ and bi\boldsymbol{b}_{i}s’ for the workers. We refer to these functions as the encoding functions and the computing functions. We say that a computation strategy consists of NN encoding functions and NN computing functions, denoted by

that are used to compute the ai\boldsymbol{a}_{i}s’ and bi\boldsymbol{b}_{i}s’. Specifically, given a computation strategy, each worker ii stores ai\boldsymbol{a}_{i} and computes bi\boldsymbol{b}_{i} according to the following equations:

For any integer kk, we say a computation strategy is kk-recoverable if the master can recover XX given the computing results from any kk workers using certain decoding functions. We define the recovery threshold of a computation strategy as the minimum integer kk such that the computation strategy is kk-recoverable.

The goal of this paper is to find the optimal computation strategy that achieves the minimum possible recovery threshold, while allowing efficient decoding at the master node. This essentially provides the computation strategy with the maximum robustness against the straggler effect, which only requires a low additional computation overhead.

We summarize our main results in the following theorems:

In a distributed Fourier transform problem of computing X=F{x}\boldsymbol{X}=\mathcal{F}\{\boldsymbol{x}\} using NN workers that each can store and process 1m\frac{1}{m} fraction of the input x\boldsymbol{x}, we can achieve the following recovery threshold

Furthermore, the above recovery threshold can be achieved by a computation strategy, referred to as the Coded FFT, which allows efficient decoding at the master node, i.e., with a complexity that scales linearly with respect to the size ss of the input data.

Moreover, we can prove the optimally of coded FFT, which is formally stated in the following theorem

In a distributed Fourier transform environment with NN workers that each can store and process 1m\frac{1}{m} fraction of the input vector, the following recovery threshold

The above converse demonstrates that our proposed coded FFT design is optimal in terms of recovery threshold. Moreover, we can prove that coded FFT is also optimal in terms of the communication load (see Section IV).

While in the above results we focused on the developing the optimal coding technique for the one dimensional Fourier transform. The techniques developed in this paper can be easily generalized to the nn-dimensional Fourier transform operations. Specifically, we can show that in a general nn-dimensional Fourier transform setting, the optimum recovery threshold K∗=mK^{*}=m can still be achieved, using a generalized version of the coded FFT strategy (see Section V). Similarly, this also generalized to the scenario where we aim to compute the Fourier transform of multiple input vectors. The optimum recovery threshold K∗=mK^{*}=m can also be achieved (see Section VI).

Although the coded FFT strategy was designed focusing on optimally handling the stragglers issues, it can also be applied to the fault tolerance computing setting (e.g., as considered in , where a module can produce arbitrary error results under failure), to improve robustness to failures in computing. Specifically, given that the coded FFT produces computing results that are coded by an MDS code, it also enables detecting, or correcting maximum amounts errors even when the erroneous workers can produce arbitrary computing results.

III Coded FFT: the Optimal Computation Strategy

In this section, we prove Theorem 1 by proposing an optimal computation strategy, referred to as Coded FFT. We start by demonstrate this computation strategy and the corresponding decoding procedures through a motivating example.

We aim to design a computation strategy to achieve a recovery threshold of 22.

In order to design the optimal strategy, we exploit two key properties of the DFT operation. Firstly, DFT has the following recursive structure:

where vectors c0\boldsymbol{c}_{0} and c1\boldsymbol{c}_{1} are the interleaved version of the input vector:

This structure decomposes the Fourier transform into two identical and simpler operations: the Fourier transform of c0\boldsymbol{c}_{0} and c1\boldsymbol{c}_{1}, defined as follows.

Hence, computing the Fourier transform of a vector is essentially computing the Fourier transforms of its sub-components. This property has been exploited in the context of single machine algorithms and led to the famous Cooley-Tukey algorithm .

On the other hand, we exploit the linearity of the DFT operation to inject linear codes in the computation to provide robustness against stragglers. Specifically, given that the Fourier transform of any linearly coded vector equals the linear combination of the Fourier transforms of the individual vectors, by injecting MDS code on the interleaved vectors c0\boldsymbol{c}_{0} and c1\boldsymbol{c}_{1} and computing their Fourier transforms, we obtain a coded version of the vectors C0\boldsymbol{C}_{0} and C1\boldsymbol{C}_{1}. This provides the redundancy to mitigate the straggler effects.

Specifically, we encode c0\boldsymbol{c}_{0} and c1\boldsymbol{c}_{1} using a (3,2)(3,2)-MDS code, and let each worker store one of the coded vectors. I.e.,

Each worker computes the Fourier transform bi=F{ai}\boldsymbol{b}_{i}=\mathcal{F}{\{\boldsymbol{a}_{i}\}} of its assigned vector. Specifically, each worker ii computes

To prove that this computation strategy gives a recovery threshold of 22, we need to design a valid decoding function for any subset of 22 workers. We demonstrate this decodability through a representative scenario, where the master receives the computation results from worker 11 and worker 22 as shown in Figure 2. The decodability for the other 22 possible scenarios can be proved similarly.

According to the designed computation strategy, the server can first recover the computing result of worker given the results from the other workers as follows:

After recovering b0\boldsymbol{b}_{0}, we can verify that the server can then recover the final output X\boldsymbol{X} using b0\boldsymbol{b}_{0} and b1\boldsymbol{b}_{1} as follows:

III-B General Description of Coded FFT

Now we present an optimal computing strategy that achieves the optimum recovery threshold stated in Theorem 1, for any parameter values of NN and mm. First of all we interleave the input vector x\boldsymbol{x} into mm vectors of length sm\frac{s}{m}, denoted by c0,...,cm−1\boldsymbol{c}_{0},...,\boldsymbol{c}_{m-1}. Specifically, we let the jjth element of each ci\boldsymbol{c}_{i} equal

Note that if the master node can recover all the above Fourier transform Ci\boldsymbol{C}_{i} of the interleaved vectors, the final output can be computed based on the following identities:

where  mod (i,sm)\bmod(i,\frac{s}{m}) denotes the remainder of ii divided by sm\frac{s}{m}.

Based on this observation, we can naturally view the distributed Fourier transform problem as a problem of distributedly computing a list of linear transformations, i.e., computing the Fourier transform of ci\boldsymbol{c}_{i}’s. We inject the redundancy as follows to provide robustness to the computation:

We first encode the c0,c1,...,cm−1\boldsymbol{c}_{0},\boldsymbol{c}_{1},...,\boldsymbol{c}_{m-1} using an arbitrary (N,m)(N,m)-MDS code, where the coded vectors are denoted a0,...,aN−1\boldsymbol{a}_{0},...,\boldsymbol{a}_{N-1} and are assigned to the workers correspondingly. Then each worker ii computes the Fourier of ai\boldsymbol{a}_{i}, and return it to the master. Given the linearity of Fourier transform, the computing results b0,...,bN−1\boldsymbol{b}_{0},...,\boldsymbol{b}_{N-1} are essentially linear combinations of the Fourier transform Ci\boldsymbol{C}_{i}’s, which are coded by the same MDS code. Hence, after the master receives any mm computing results, it can decode the message Ci\boldsymbol{C}_{i}’s, and proceed to recover the final result. This allows achieving the recovery threshold of mm.

The recovery threshold K∗=mK^{*}=m achieved by coded FFT can not be achieved using computation strategies that were developed for generic matrix-by-vector multiplication in the literature . Specifically, the conventional uncoded repetition strategy requires a recovery threshold of N−Nm2+1N-\frac{N}{m^{2}}+1, and the short-dot (or short-MDS) strategy provided in requires N−Nm+mN-\frac{N}{m}+m. Hence, by developing a coding strategy for the specific purpose of computing Fourier transform, we can achieve order-wise improvement in the recovery threshold.

III-C Decoding Complexity of Coded FFT

Now we show that coded FFT allows an efficient decoding algorithm at the master for recovering the output. After receiving the computing results, the master needs to recover the output in two steps: decoding the MDS code and then computing X\boldsymbol{X} from the intermediate value Ci\boldsymbol{C}_{i}’s.

For the first step, the master needs of decode an (N,m)(N,m)-MDS code by sm\frac{s}{m} times. This can be computed efficiently, by selecting an MDS code with low decoding complexity for the coded FFT design. There has been various works on finding efficiently decodable MDS codes (e.g.,). In general, an upper bound on the decoding complexity of (N,m)(N,m)-MDS code is given by O(mlog⁡2mlog⁡log⁡m)O(m\log^{2}m\log\log m), which can be attained by the Reed-Solomon codes and using fast polynomial interpolation as the decoding algorithm. Consequently, the first step of the decoding algorithm has a complexity of at most O(slog⁡2mlog⁡log⁡m)O(s\log^{2}m\log\log m), which scales linearly with respect to ss.

For the second step, the master node needs to evaluate equation (23) to recover the final result. Equivalently, the master needs to compute

To conclude, our proposed coded FFT strategy allows efficient decoding with a complexity of at most O(slog⁡2mlog⁡log⁡m)O(s\log^{2}m\log\log m), which is linear to the input size ss. The decoding computation is bottlenecked by the first step of the algorithm, which is essentially decoding an (N,m)(N,m)-MDS code by sm\frac{s}{m} times. To achieve the best performance, one can pick any MDS code with a decoding algorithm that requires the minimum amount of computation based on the problem scenatio .

IV Optimality of coded FFT

In this section, we prove Theorem 2 through a matching information theoretic converse. Specifically, we need to prove that for any computation strategy, the master needs to wait for at least mm workers in order to recover the final output.

V n𝑛n-dimensional Coded FFT

Fourier transform in higher dimensional spaces is a frequently used operation in image processing and machine learning applications. In this section, we consider the problem of designing optimal codes for this operation. We show that the coded FFT strategy can be naturally extended to this scenario, and achieves the optimum performances. We start by formulating the system model and state the main results.

We consider a problem of computing an nn-dimensional Discrete Fourier transform T=F{t}T=\mathcal{F}\{t\} in a distributed computing environment with a master node and NN worker nodes. The input tt and the output TT are tensors of order nn, with dimension s0×s1×...×sn−1s_{0}\times s_{1}\times...\times s_{n-1}. For brevity, we denote the total number of elements in each tensor by ss, i.e., s≜s0s1...sn−1s\triangleq s_{0}s_{1}...s_{n-1}.

Similar to the one dimensional Fourier transform problem, we design the functions to compute ai\boldsymbol{a}_{i}s’ and bi\boldsymbol{b}_{i}s’ for the workers, and refer to them as the computation strategy. We aim to find an optimal computation strategy that achieves the minimum possible recovery threshold, while allowing efficient decoding at the master node.

Our main results are summarized in the following theorems:

In an nn-dimensional distributed Fourier transform problem of computing T=F{t}T=\mathcal{F}\{\boldsymbol{t}\} using NN workers that each can store and process 1m\frac{1}{m} fraction of the input tt, we can achieve the following recovery threshold

Furthermore, the above recovery threshold can be achieved by a computation strategy, referred to as the nn-dimentional Coded FFT, which allows efficient decoding at the master node, i.e., with a complexity that scales linearly with respect to the size ss of the input data.

Moreover, we can prove the optimally of nn-dimensional coded FFT, which is formally stated in the following theorem.

is optimal.Similar to the 11-dimensional case, this optimally can be generalized to base fields with infinite cardinally, by taking into account of some practical implementation constrains.

V-B General Description of n𝑛n-dimensional Coded FFT

We first prove Theorem 3 by proposing an optimal computation strategy, referred to as nn-dimensional Coded FFT, that achieves the recovery threshold K∗=mK^{*}=m for any parameter values of NN and mm.

We denote the discrete Fourier transform of each interleaved tensor ci0i1...in−1c_{i_{0}i_{1}...i_{n-1}} by Ci0i1...in−1C_{i_{0}i_{1}...i_{n-1}}. Specifically,

Note that if the master node can recover all the above Fourier transform Ci0i1...in−1C_{i_{0}i_{1}...i_{n-1}} of the interleaved tensors, the final output can be computed based on the following identity:

Specifically, we encode the ci0i1...in−1c_{i_{0}i_{1}...i_{n-1}}’s using an arbitrary (N,m)(N,m)-MDS code, where the coded tensors are denoted a0,...,aN−1\boldsymbol{a}_{0},...,\boldsymbol{a}_{N-1} and are assigned to the workers correspondingly. Then each worker ii computes the Fourier of tensor ai\boldsymbol{a}_{i}, and return it to the master. Given the linearity of Fourier transform, the computing results b0,...,bN−1\boldsymbol{b}_{0},...,\boldsymbol{b}_{N-1} are essentially linear combinations of the Fourier transform Ci0i1...in−1C_{i_{0}i_{1}...i_{n-1}}’s, which are coded by the same MDS code. Hence, after the master receives any mm computing results, it can decode the message Ci0i1...in−1C_{i_{0}i_{1}...i_{n-1}}’s, and proceed to recover the final result. This allows achieving the recovery threshold of mm.

In terms of the decoding complexity, nn-dimensional coded FFT also requires first decoding an MDS code, and then recovering the final result by computing Fourier transforms of tensors with lower dimension. Similar to the one dimensional FFT, the bottleneck of the decoding algorithm is also the first step, which requires decoding an (N,m)(N,m)-MDS code by sm\frac{s}{m} times. This decoding complexity is upper bounded by O(slog⁡2mlog⁡log⁡m)O(s\log^{2}m\log\log m), which is linear with respect to the input size ss. It can be further improved in practice by using any MDS code or MDS decoding algorithms with better computational performances.

V-C Optimally of n𝑛n-dimensional Coded FFT

Moreover, the above converse can also be extended to prove that the nn-dimensional Coded FFT is optimal in terms of communication.

VI Coded FFT with multiple inputs

Coded FFT can also be extended to optimally handle computation tasks with multiple inputs entries. In this section, we consider the problem of designing optimal codes for such scenario.

For this problem, we can find an optimal computation strategy that achieves the minimum possible recovery threshold, while allowing efficient decoding at the master node. We summarize this result in the following theorems:

For an nn-dimensional distributed Fourier transform problem using NN workers, if each worker can store and process 1m\frac{1}{m} fraction of the qq inputs, we can achieve the following recovery threshold

Furthermore, the above recovery threshold can be achieved by a computation strategy, which allows efficient decoding at the master node, i.e., with a complexity that scales linearly with respect to the size ss of the input data.

Moreover, we prove the optimally of our proposed computation strategy, which is formally stated in the following theorem.

In an nn-dimensional distributed Fourier transform environment with NN workers that each can store and process 1m\frac{1}{m} fraction of the input vector, the following recovery threshold

VI-B General Description of Coded FFT with Multiple Inputs

As explained in Section V-B, if the master node can obtain the Fourier transforms of all the interleaved tensors, then the final outputs can be computed efficiently. Hence, we can view this distributed Fourier transform problem as a problem of computing a list of linear transformations, and we inject the redundancy using MDS code similar to the single input coded FFT strategy.

Given the linearity of Fourier transform, the computing results b0,...,bN−1\boldsymbol{b}_{0},...,\boldsymbol{b}_{N-1} are essentially linear combinations of the Fourier transforms of the interleaved tensors, which are coded by the same MDS code. Hence, after the master receives any mm computing results, it can decode all the needed intermediate values, and proceed to recover the final result. This allows achieving the recovery threshold of mm.

In terms of the decoding complexity, one can show that the bottleneck of the decoding algorithm is the decoding of the (N,m)(N,m)-MDS code by sm\frac{s}{m} times, using similar arguments mentioned in Section V. This decoding complexity is upper bounded by O(slog⁡2mlog⁡log⁡m)O(s\log^{2}m\log\log m), which is linear with respect to the input size ss. It can be further improved in practice by using any MDS code or MDS decoding algorithms with better computational performances.

VI-C Optimally of Coded FFT with multiple inputs

Moreover, the above converse also applies for proving the optimally of Coded FFT in terms of communication.

VII Conclusions

We considered the problem of computing the Fourier transform of high-dimensional vectors, distributedly over a cluster of machines. We propose a computation strategy, named as coded FFT, which achieves the optimal recovery threshold, defined as the minimum number of workers that the master node needs to wait for in order to compute the output. We also extended coded FFT to settings including computing general nn-dimensional Fourier transforms, and provided the optimal computing strategy for those settings. There are several interesting future directions, including the practical demonstration of coded FFT over distributed clusters, generalization of coded FFT to more general master-less architectures, and extension of coded FFT to other computing architectures (e.g., edge and fog computing architectures ).

VIII Acknowledgement

This work is in part supported by NSF grant CIF 1703575, ONR award N000141612189, and a research gift from Intel. This material is based upon work supported by Defense Advanced Research Projects Agency (DARPA) under Contract No. HR001117C0053. The views, opinions, and/or findings expressed are those of the author(s) and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government.

References