Abstract
Sparse matrix compression is essential for reducing memory footprint in scientific and AI workloads. However, the hardware overhead of decompressing these formats can introduce significant computational bottlenecks. This paper presents Copernicus, a characterization study of seven popular sparse formats on FPGAs. Our findings reveal that the optimal format is highly dependent on data patterns and that memory bandwidth is frequently not the primary limiting factor, contrary to common assumptions.
Introduction
Sparse matrices, characterized by a high proportion of zero elements, are fundamental to fields ranging from graph analytics to neural network pruning. To optimize storage and bandwidth, compression formats like Compressed Sparse Row (CSR) or Coordinate (COO) are employed to store only non-zero values.
While these formats save space, they necessitate a "decompression" step in hardware. In Domain-Specific Architectures (DSAs) such as FPGAs, the hardware must reconstruct the matrix structure in real-time to perform computations. If the decompression logic is overly complex or slow, it can starve the compute engine, potentially making compressed execution slower than processing the original dense matrix. Copernicus addresses this by analyzing how various formats impact hardware metrics like latency, power, and throughput.
Methodology
The authors developed an evaluation platform on a Xilinx FPGA using High-Level Synthesis (HLS). The architecture follows a three-stage pipeline:
- Memory Read: Streaming compressed partitions via AXI interfaces.
- Compute: A two-stage inner pipeline consisting of a specialized Decompressor and a Dot-Product Engine.
- Memory Write: Storing the resulting partial output vectors.
The study evaluates seven distinct formats: CSR/CSC, BCSR/BCSC, COO, DOK, LIL, ELL/SELL, and DIA. A key metric introduced is $\sigma$ (sigma), representing the ratio of decompression latency to actual computation time.
Workload Characterization
The evaluation utilizes both real-world and synthetic datasets:
- SuiteSparse Collection: 20 matrices from diverse domains like electromagnetics and social networks.
- Synthetic Matrices: Random matrices with densities from 0.0001 to 0.5 (simulating pruned neural networks) and structured band/diagonal matrices (common in physics simulations).
Key Insights
The Decompression Bottleneck
A prevalent myth in sparse computing is that performance is always bound by memory bandwidth. Copernicus demonstrates that for formats like CSR, the complex logic required to identify the next non-zero element often creates a computation bottleneck. This prevents the hardware from fully utilizing available bandwidth.
Format-Specific Performance
- COO and BCSR: These emerged as the most robust "all-rounders," balancing latency and throughput across varied workloads.
- DIA: Highly efficient for structured diagonal matrices but suffers significantly with scattered data.
- CSC Penalty: Compressed Sparse Column (CSC) is particularly inefficient for row-based processing (SpMV), sometimes performing up to 30x slower than dense processing due to the need to traverse every column for a single row's elements.
Results and Power Efficiency
The study found that in highly sparse random matrices, decompression overhead can negate the benefits of compression. For most formats, the "balance ratio" (memory vs. compute latency) is low, indicating that the compute engine often idles while waiting for the decompressor.
In terms of efficiency, COO proved most power-efficient for real-world workloads, while ELL and LIL excelled in speed and efficiency for structured band matrices. Peak throughput was highest for BCSR, LIL, and DIA when the matrix structure aligned with their design.
Conclusion
Copernicus highlights the critical need to consider decompression overhead in hardware design for sparse workloads. Future hardware may benefit from reconfigurable decompression engines capable of adapting to specific matrix formats. While this study focuses on Sparse Matrix-Vector Multiplication (SpMV), future work should explore other operations like Sparse Matrix-Matrix Multiplication (SpMM) to understand different data reuse patterns.
Summary updated