Skip to main content
QUICK REVIEW

[Paper Review] Large-Scale Discrete Fourier Transform on TPUs

Tianjian Lu, Yifan Chen|arXiv (Cornell University)|Feb 9, 2020
Parallel Computing and Optimization TechniquesComputer Science34 references11 citations
TL;DR

This paper presents two parallel algorithms—KDFT (based on Kronecker product and dense matrix multiplication) and FFT (based on Cooley-Tukey with phase adjustment)—for large-scale 3D discrete Fourier transforms on TPU clusters. Implemented in TensorFlow, both leverage TPU’s matrix multiplication strength and a one-shuffle communication scheme, achieving 8.3 seconds for an 8192³ DFT on a full 2048-core TPU Pod, demonstrating high parallel efficiency and low communication overhead.

ABSTRACT

In this work, we present two parallel algorithms for the large-scale discrete Fourier transform (DFT) on Tensor Processing Unit (TPU) clusters. The two parallel algorithms are associated with two formulations of DFT: one is based on the Kronecker product, to be specific, dense matrix multiplications between the input data and the Vandermonde matrix, denoted as KDFT in this work; the other is based on the famous Cooley-Tukey algorithm and phase adjustment, denoted as FFT in this work. Both KDFT and FFT formulations take full advantage of TPU's strength in matrix multiplications. The KDFT formulation allows direct use of nonuniform inputs without additional step. In the two parallel algorithms, the same strategy of data decomposition is applied to the input data. Through the data decomposition, the dense matrix multiplications in KDFT and FFT are kept local within TPU cores, which can be performed completely in parallel. The communication among TPU cores is achieved through the one-shuffle scheme in both parallel algorithms, with which sending and receiving data takes place simultaneously between two neighboring cores and along the same direction on the interconnect network. The one-shuffle scheme is designed for the interconnect topology of TPU clusters, minimizing the time required by the communication among TPU cores. Both KDFT and FFT are implemented in TensorFlow. The three-dimensional complex DFT is performed on an example of dimension $8192 imes 8192 imes 8192$ with a full TPU Pod: the run time of KDFT is 12.66 seconds and that of FFT is 8.3 seconds. Scaling analysis is provided to demonstrate the high parallel efficiency of the two DFT implementations on TPUs.

Motivation & Objective

  • To enable high-performance, large-scale discrete Fourier transforms (DFT) on TPU clusters for scientific computing workloads.
  • To exploit TPU’s strength in matrix multiplication by formulating DFT as dense matrix operations using the Kronecker product (KDFT) and Cooley-Tukey FFT (FFT).
  • To design a communication-efficient data decomposition and inter-core communication scheme tailored to TPU’s interconnect topology.
  • To achieve strong scaling and high parallel efficiency for 3D DFT across thousands of TPU cores.
  • To demonstrate the feasibility and performance of DFT acceleration on TPUs for real-world scientific applications.

Proposed method

  • Formulating the 3D DFT as matrix multiplication between input data and a Vandermonde matrix using the Kronecker product (KDFT), enabling direct handling of non-uniform inputs.
  • Implementing the FFT via the Cooley-Tukey algorithm with phase adjustment, reducing computational complexity from O(N²) to O(N log N).
  • Applying data decomposition to localize dense matrix multiplications within individual TPU cores, enabling full parallelism across the cluster.
  • Using a one-shuffle communication scheme that enables simultaneous send and receive operations between neighboring TPU cores along the same interconnect direction, minimizing communication latency.
  • Mapping both KDFT and FFT to TensorFlow for portable, scalable execution on TPU Pods with hardware-optimized operations like einsum and collective_permute.
  • Leveraging TPU’s high-bandwidth memory (128 GiB) and direct chip-to-chip interconnects to minimize bottlenecks in large-scale data movement.

Experimental results

Research questions

  • RQ1Can the Kronecker product formulation of DFT be efficiently parallelized on TPU clusters using matrix multiplication primitives?
  • RQ2How does the performance of the FFT-based DFT compare to the direct matrix multiplication (KDFT) formulation on TPUs for large 3D problems?
  • RQ3To what extent does the one-shuffle communication scheme minimize inter-TPU communication overhead in large-scale DFT computations?
  • RQ4What is the strong scaling behavior of 3D DFT on a full TPU Pod with up to 2048 cores?
  • RQ5Can TPU-based DFT implementations achieve high parallel efficiency and low latency for scientific computing workloads?

Key findings

  • The 3D FFT on a full 2048-core TPU Pod achieved a runtime of 8.30 seconds for an 8192×8192×8192 DFT, significantly outperforming the 12.66-second runtime of KDFT on the same problem.
  • For a 2048×2048×2048 problem, both KDFT and FFT achieved nearly identical computation times (0.120s and 0.118s), indicating that TPU’s matrix multiplication performance dominates over algorithmic complexity differences at scale.
  • Strong scaling analysis showed near-linear performance scaling up to 128 cores for the 3D FFT on a 2048³ problem, with close-to-ideal speedup observed.
  • Communication time, dominated by all_to_all and collective_permute operations, became the bottleneck when scaling beyond 128 cores, indicating a need for further optimization in large-scale communication patterns.
  • The 3D KDFT and FFT implementations demonstrated high parallel efficiency, with computation time scaling approximately linearly with problem size when normalized by algorithmic complexity.
  • The one-shuffle communication scheme effectively minimized inter-TPU communication latency by enabling simultaneous send and receive operations along the same interconnect direction.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.