TL;DR
This paper introduces a universal, high-performance GPU framework for the Brakerski-Fan-Vercauteren (BFV) homomorphic encryption scheme. By implementing novel kernel fusion strategies and extending support for the "Halevi-Polyakov-Shoup" (HPS) variant to large parameter sets, the authors achieve up to a 31.9× speedup over CPU-based libraries and significantly outperform previous state-of-the-art GPU implementations.
What Problem Does This Paper Address?
Homomorphic Encryption (HE) is the "holy grail" of privacy, allowing data to be processed while remaining encrypted. However, the BFV scheme—a popular choice for integer-based HE—is notoriously slow. The primary bottlenecks are the massive ciphertext moduli and the complex "division-and-rounding" operations required for decryption and multiplication.
While Residue Number System (RNS) variants like BEHZ and HPS were designed to break these large numbers into smaller, machine-word-sized chunks, they still demand immense computational power. Previous GPU acceleration efforts were often "siloed," focusing on specific variants or limited by hardware constraints (like the 53-bit precision limit of double-precision floats in HPS). This paper seeks to create a unified, highly optimized framework that supports all major BFV variants and scales to the large parameters required for modern security.
Methods
The authors propose a three-tiered hierarchical architecture:
- Low-level Ring Arithmetic: Optimized modular reduction (Barrett reduction) using CUDA PTX instructions to minimize instruction counts.
- RNS-level Operations: A two-kernel approach for RNS base conversion that balances parallelism with memory efficiency, utilizing loop unrolling to reduce pipeline overhead.
- High-level Homomorphic Modules: The core of the framework, which includes:
- Intra-Arithmetic & Inter-Conversion Fusion: Instead of calling separate kernels for every step, the authors "fuse" operations (e.g., combining scalar multiplication with base conversion). This drastically reduces slow Global Memory (GMEM) access.
- Digit Decomposition for HPS: To bypass the floating-point precision limits that previously restricted HPS to small parameters, they use a digit decomposition technique to handle large moduli.
- Leveled HPS Support: They implement a leveled approach where the ciphertext modulus is reduced as the computation depth increases, significantly cutting down on redundant work.
Datasets
The framework was evaluated using standard BFV parameter sets (log N ranging from 13 to 15, and log Q from 120 to 660 bits). Performance was benchmarked against:
- OpenFHE: A leading multi-threaded CPU-based HE library.
- State-of-the-art GPU implementations: Specifically, the BEHZ implementations by Badawi et al. and other recent works.
- Hardware: Testing was conducted on NVIDIA RTX 3090 Ti and Tesla A100 GPUs.
Key Insights and Ideas
- Memory is the Bottleneck: In GPU-accelerated HE, the time spent moving data between memory and registers often outweighs the actual calculation time. Kernel fusion is the most effective "lever" for performance because it keeps data in fast registers/shared memory for longer.
- Unlocking HPS: HPS is mathematically more efficient than BEHZ for scaling operations but was historically avoided for large-scale security due to precision issues. This paper proves that with digit decomposition, HPS is not only viable but often superior on GPUs.
- The Power of "Leveled" Logic: By adopting a leveled structure (similar to the BGV scheme), the authors show that for deep computation circuits (like binary trees of multiplications), the performance gap between a standard implementation and a leveled one grows exponentially, reaching up to 4×.
Key Results
- Vs. CPU: The A100 implementation achieved a 31.9× speedup over OpenFHE running on a high-end multi-threaded CPU.
- Vs. Previous GPU Work: Compared to the previous best BEHZ implementation, this framework improved tensoring speed by 39.7% and relinearization by 29.9%.
- Decryption: Decryption saw speedups of 14.3× to 16.6× compared to CPU baselines.
- Scalability: The leveled HPS variant maintained high performance even at a multiplication depth of 20, where traditional variants would become prohibitively slow.
Limitations and Future Work
While the paper significantly advances BFV acceleration, some areas remain for exploration:
- Noise Management: The HPS variant, especially with digit decomposition, introduces complex error terms that require careful parameter tuning to ensure decryption remains successful.
- Multi-GPU Scaling: While the framework is designed to be generic, the current results focus on single-GPU performance. Extending the fusion strategies to handle inter-GPU communication for even larger workloads is a logical next step.
- Scheme Expansion: The authors suggest that their hierarchical design could be extended to other HE schemes like CKKS (for fixed-point arithmetic) or BGV.
Summary updated