Block Subsampled Randomized Hadamard Transform for Nyström Approximation on Distributed Architectures

Oleg Balabanov, Matthias Beaupère, Laura Grigori, Victor LedererICML 2023

TL;DR

Researchers have developed the Block Subsampled Randomized Hadamard Transform (BSRHT), a new sketching matrix designed specifically for distributed computing. It combines the computational speed of structured transforms with the parallel scalability of Gaussian matrices, achieving a 2.5x speedup in Nyström low-rank approximations without sacrificing accuracy.

What Problem Does This Paper Address?

When dealing with massive datasets, we often use "sketching"—multiplying a giant matrix by a smaller random one to reduce its dimensionality while preserving its essential geometric properties. This is critical for tasks like linear regression or low-rank approximations (e.g., the Nyström method).

However, there is a classic trade-off between two popular sketching methods:

  1. Gaussian Matrices: These are "unstructured." They are easy to use in parallel (distributed) environments because you can process chunks of data independently and then sum the results. The downside? They are computationally expensive to multiply (high FLOP count).
  2. Subsampled Randomized Hadamard Transforms (SRHT): These are "structured." They are incredibly fast to compute because they use the Fast Walsh-Hadamard Transform. The downside? They are a nightmare to implement on distributed architectures because they require complex "butterfly" communication patterns across all processors.

The authors address this gap by asking: Can we create a sketching matrix that is as fast as SRHT but as easy to distribute as a Gaussian matrix?

Methods

The authors introduce the Block SRHT (BSRHT). Instead of applying one giant Hadamard transform across the entire dataset, they break the sketching matrix into blocks.

Each processor in a distributed system holds a local block of the data. Under the BSRHT scheme, each processor applies a local SRHT to its own data. These local results are then combined using a simple "sum-reduce" operation—the same efficient communication pattern used by Gaussian matrices.

Mathematically, they prove that this block-wise approach still functions as an Oblivious Subspace Embedding (OSE). This means it preserves the distances and angles of a low-dimensional subspace with high probability, provided the number of rows is sufficient. Crucially, they show that the number of rows required for BSRHT is nearly the same as for a standard, global SRHT.

Datasets

The researchers evaluated their method using two well-known machine learning datasets:

  • MNIST: The classic dataset of handwritten digits.
  • YearPredictionMSD: A subset of the Million Song Dataset used for predicting the release year of songs.

To create the large-scale matrices needed for testing, they applied a Radial Basis Function (RBF) kernel to these datasets, generating dense positive definite matrices of size $65536 \times 65536$.

Key Insights and Ideas

  • The "Best of Both Worlds": The BSRHT effectively "localizes" the computation. By using local Hadamard transforms, you get the $O(n \log n)$ speed of structured matrices, but by using the block structure, you get the $O(\log p)$ communication efficiency of unstructured ones.
  • Theoretical Parity: One might worry that breaking the transform into blocks would weaken its mathematical guarantees. The paper’s "Main Theorem" (Theorem 2.1) provides the rigorous proof that BSRHT is just as reliable as the standard SRHT, with a row requirement that only depends logarithmically on the total dimension $n$.
  • Memory Efficiency: On very large scales, Gaussian matrices can actually become a liability because storing the random matrix itself consumes significant RAM. Because BSRHT is structured, it can be generated "on the fly" with a random seed, drastically reducing the memory footprint per processor.
Memory footprint comparison between Gaussian and BSRHT methods across varying MPI process counts.

Key Results

  • Speed: In distributed Nyström approximation tests, BSRHT was up to 2.5x faster than Gaussian sketching.
  • Scalability: The authors demonstrated "strong scalability" on up to 1536 CPU cores. As the number of processors increased, BSRHT maintained its performance edge, whereas Gaussian methods eventually hit memory or computation bottlenecks.
Runtime scalability comparison showing BSRHT outperforming Gaussian sketching as the number of MPI processes increases.
  • Accuracy: The approximation error (measured via trace norm) for BSRHT was virtually identical to that of Gaussian matrices. You get the speed for "free" without a penalty in precision.
  • Communication: The volume of data exchanged during the sum-reduce operation for BSRHT is significantly lower than the global communication required by a standard SRHT.

Limitations and Future Work

While BSRHT is a major step forward for distributed randomized linear algebra, the authors note a few considerations:

  • Local Dimension Requirements: The efficiency gains are most pronounced when the local data dimension ($r$) and the sampling dimension ($l$) are "large enough." In extremely fragmented systems with tiny local blocks, the overhead might diminish the returns.
  • Broadening Applications: This paper focuses heavily on the Nyström method for positive semi-definite matrices. While the authors mention that BSRHT is a general-purpose OSE, future work could explore its performance in other randomized algorithms, such as Randomized SVD for general matrices or solving overdetermined least-squares problems.
  • Asynchronous Systems: While BSRHT improves on previous "block-sampling" methods by reducing communication, exploring how it handles stragglers in asynchronous distributed systems remains an open area.

Summary updated

BibTeX
@inproceedings{balabanov2023block,
  author = {Oleg Balabanov and Matthias Beaupère and Laura Grigori and Victor Lederer},
  title = {{Block Subsampled Randomized Hadamard Transform for Nyström Approximation on Distributed Architectures}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=EMN99LtfYA},
}
Figure