Serpens: a high bandwidth memory based accelerator for general-purpose sparse matrix-vector multiplication

Linghao Song, Yuze Chi, Licheng Guo, Jason Cong

TL;DR

Serpens is a novel FPGA-based accelerator that leverages High Bandwidth Memory (HBM) to tackle the notoriously memory-bound Sparse Matrix-Vector Multiplication (SpMV) operation. By keeping random memory accesses strictly on-chip and heavily skewing HBM channel allocation toward the sparse matrix, Serpens achieves massive throughput and energy efficiency gains over existing FPGA overlays and standard GPUs.

What Problem Does This Paper Address?

Sparse Matrix-Vector Multiplication (SpMV) is a foundational operation in graph analytics, scientific computing, and sparse neural networks. However, it is incredibly difficult to accelerate. Because the matrix is sparse, memory accesses to the dense vector are highly irregular and unpredictable. This destroys data reuse and puts immense pressure on memory bandwidth, leaving compute units starved for data.

While High Bandwidth Memory (HBM) on modern FPGAs offers a potential solution, existing HBM-FPGA accelerators fall short for general-purpose SpMV:

  1. GraphLily is a generalized graph processing overlay. It wastes valuable hardware resources on generalized operations (like logical ANDs) that sit completely idle during standard SpMV.
  2. Sextans is optimized for Sparse Matrix-Matrix Multiplication (SpMM). It allocates a large chunk of its HBM channels to dense matrices. In SpMV, the dense vector is tiny by comparison, meaning Sextans wastes memory bandwidth that could have been used to stream the sparse matrix faster.

Methods

To build a highly optimized, general-purpose SpMV accelerator, the authors introduce Serpens, which relies on several key architectural choices:

  • Asymmetric HBM Channel Allocation: Since the dense vectors in SpMV are relatively small, Serpens allocates just one HBM channel for the input vector and one for the output vector. The remaining 16 to 24 channels are entirely dedicated to streaming the massive sparse matrix.
  • On-Chip Random Access (Output Stationary): Serpens partitions the dense input vector into segments that fit entirely into on-chip BRAM. It then streams the corresponding sparse matrix elements and accumulates the results in on-chip URAMs. This ensures that all off-chip HBM accesses are purely sequential, completely hiding the latency of random memory access.
  • Memory-Centric Processing Engines (PEs): Each HBM channel feeds 8 PEs. To avoid routing bottlenecks, the dense vector is broadcasted to these PEs using a high-frequency chain topology.
  • Index Coalescing & Non-Zero Reordering: FPGA URAMs have a minimum width of 72 bits, which wastes space if storing a single 32-bit float. Serpens coalesces two 32-bit values with consecutive row indices into a single URAM entry. To prevent read-after-write (RAW) and bank conflicts during this process, the authors apply a software preprocessing step that "colors" and reorders the non-zero elements before execution.

Datasets

The authors evaluated Serpens using two main sets of data:

  • 12 Large Matrices/Graphs: Sourced from SNAP, OGB, and SuiteSparse, ranging up to 2.45 million vertices and 124 million edges. This was used to compare Serpens against other FPGA accelerators (Sextans and GraphLily).
  • 2,519 SuiteSparse Matrices: A massive collection of matrices with non-zeros ranging from 1,000 to 100 million, used to benchmark Serpens against an Nvidia Tesla K80 GPU to prove its viability as a general-purpose data center accelerator.

Key Insights and Ideas

  • Generality has a steep hardware cost: GraphLily's attempt to be a "catch-all" graph accelerator means it cannot dedicate maximum logic to SpMV. By stripping away generalized operations, Serpens frees up FPGA resources to process more sparse elements in parallel.
  • SpMM architectures don't map well to SpMV: Sextans' need to stream three large matrices for SpMM forces a balanced memory channel allocation. Recognizing that SpMV only has one large matrix allows Serpens to aggressively reallocate bandwidth, proving that kernel-specific memory routing is critical for HBM utilization.
  • Tame random access by trapping it on-chip: Off-chip random access is the enemy of throughput. By partitioning the problem so that all irregular lookups happen in ultra-fast, on-chip SRAM (BRAM/URAM), the HBM is used exclusively as a massive, sequential firehose.

Key Results

  • Versus existing FPGAs: On the 12 large graphs, Serpens achieved a geomean throughput improvement of 1.91x over GraphLily and 1.76x over Sextans. It also improved energy efficiency by 1.71x and 1.90x, respectively.
  • Versus GPUs: Across the 2,519 SuiteSparse matrices, Serpens outperformed an Nvidia K80 GPU by 2.10x in throughput, 6.25x in energy efficiency, and 4.06x in bandwidth efficiency.
  • Scalability: The architecture scales beautifully. By pushing the design to use 24 HBM channels, Serpens achieved a peak performance of 60.55 GFLOP/s (30,204 MTEPS), representing a 3.79x speedup over GraphLily.

Limitations and Future Work

  • Routing Congestion: The authors noted that scaling to 24 HBM channels caused standard vendor tools (vanilla Xilinx Vitis) to fail during place-and-route due to severe congestion. They had to rely on specialized academic tools (TAPA and AutoBridge) to successfully compile the 24-channel version.
  • Preprocessing Overhead: Like many sparse accelerators, Serpens relies on a software preprocessing step to reorder non-zeros and coalesce indices. The paper does not extensively detail the dynamic time cost of this preprocessing, which could be a bottleneck if matrices change frequently at runtime.
  • Future Work: While not explicitly outlined in a dedicated section, the reliance on advanced floorplanning tools suggests future work could explore making the architecture more natively routable, or extending the memory-centric PE paradigm to multi-die (chiplet) FPGA architectures.

Summary updated

BibTeX
@inproceedings{song2022serpens,
  author = {Linghao Song and Yuze Chi and Licheng Guo and Jason Cong},
  title = {{Serpens: a high bandwidth memory based accelerator for general-purpose sparse matrix-vector multiplication}},
  booktitle = {DAC},
  year = {2022},
  doi = {10.1145/3489517.3530420},
}
Figure