Trinity: A General Purpose FHE Accelerator

Xianglong Deng, Shengyu Fan, Zhicheng Hu, Zhuoyu Tian, Zihao Yang, Jiangrui Yu, Dingyuan Cao, Dan Meng, Rui Hou, Meng Li, Qian Lou, Mingzhe Zhang

Introduction

Fully Homomorphic Encryption (FHE) is often described as the "holy grail" of data privacy, as it enables the processing of sensitive information without ever requiring decryption. Despite its potential, the practical implementation of FHE has been hindered by massive computational overhead and a fundamental divide in encryption methodologies. The field is currently split between two primary paradigms: Arithmetic FHE (such as CKKS), which is optimized for high-throughput SIMD-style calculations like neural network weighted sums, and Logic FHE (such as TFHE), which excels at precise logic operations, comparisons, and branching.

Real-world applications, such as secure database queries or complex AI inference, frequently require the strengths of both paradigms. However, existing hardware accelerators are "single-scheme" specialists. To run a hybrid application today, a system would require two separate, complex accelerators, leading to hardware redundancy, increased silicon area, and significant performance bottlenecks during the "Scheme Conversion" process. Trinity addresses these challenges as the first multi-modal hardware accelerator designed to unifiedly support both arithmetic and logic-style encryption schemes.

The Trinity Architecture

Trinity introduces an ASIC-based design centered on three core innovations that allow it to outperform specialized hardware while maintaining a smaller physical footprint.

1. Mathematical Unification

Historically, TFHE has relied on Fast Fourier Transforms (FFT), while CKKS utilizes Number Theoretic Transforms (NTT). Trinity eliminates the need for complex floating-point FFT hardware by replacing the FFT in TFHE with a specific version of NTT. By carefully selecting a prime modulus, the authors unified the heavy lifting of both schemes into a single hardware unit.

2. Configurable Units (CUs)

Rather than employing rigid, dedicated units for specific tasks, Trinity utilizes Configurable Units. These units are designed to be dynamically remapped to perform either NTT operations or Multiply-Accumulate (MAC) operations (typically used in systolic arrays). This flexibility allows the hardware to adapt to the specific mathematical needs of the workload at hand.

3. Dynamic Workload Scheduling

CKKS and TFHE exhibit different resource bottlenecks; CKKS workloads involve a significant portion of MAC operations (~40%), whereas TFHE is dominated by NTT (~75%). Trinity employs a compiler-driven allocation strategy that shifts hardware resources on the fly. This ensures high utilization and prevents specific parts of the chip from sitting idle during execution.

Evaluation and Methodology

The researchers evaluated Trinity using a comprehensive suite of standard FHE benchmarks:

  • CKKS Workloads: Included Packed Bootstrapping, Logistics Regression, and ResNet-20 inference.
  • TFHE Workloads: Focused on Programmable Bootstrapping (PBS) and Neural Network inference on the MNIST dataset (NN-20, NN-50, and NN-100).
  • Hybrid Workloads: Utilized HE3DB, a benchmark for homomorphic SQL-like queries (specifically Query 6 from TPC-H), which requires TFHE for filtering and CKKS for aggregation.

Key Results and Insights

Trinity demonstrates that a general-purpose approach can actually exceed the performance of specialized designs:

  • Speed Benchmarks: Trinity is 1.49× faster than SHARP (the state-of-the-art for CKKS) and 4.23× faster than Morphling (the state-of-the-art for TFHE).
  • Conversion Efficiency: The accelerator achieves a staggering 919.3× speedup for FHE scheme conversion compared to standard CPU implementations.
  • Area Efficiency: Despite its multi-modal capabilities, Trinity’s circuit area is only 85% of the combined area of the two leading specialized accelerators it replaces.
  • Hybrid Performance: For complex hybrid applications like HE3DB, Trinity is 13.42× faster than a multi-accelerator system.

The success of Trinity stems from the realization that TFHE's reliance on FFT could be bypassed by a hardware-friendly NTT, and that a "grouped" architecture could handle the massive disparity in polynomial lengths between CKKS ($N=2^{16}$) and TFHE ($N=1024$).

Limitations and Future Directions

While Trinity represents a significant leap forward, certain constraints remain. The selection of a specific prime modulus to unify NTT hardware may limit the fine-tuning of some TFHE parameters. Additionally, the system's performance is highly dependent on the "Workload Allocation" compiler; suboptimal scheduling could lead to decreased hardware utilization. Future research may focus on scaling Trinity to multi-chip or data-center environments where inter-chip communication becomes a primary bottleneck.

Conclusion

Trinity proves that generality in FHE acceleration does not require a sacrifice in performance. By unifying the mathematical foundations of arithmetic and logic encryption, Trinity provides a highly efficient, area-saving solution for the next generation of privacy-preserving applications.

Summary updated

BibTeX
@inproceedings{deng2024trinity,
  author = {Xianglong Deng and Shengyu Fan and Zhicheng Hu and Zhuoyu Tian and Zihao Yang and Jiangrui Yu and Dingyuan Cao and Dan Meng and Rui Hou and Meng Li and Qian Lou and Mingzhe Zhang},
  title = {{Trinity: A General Purpose FHE Accelerator}},
  booktitle = {MICRO},
  year = {2024},
}
Figure