一句话:重新设计 CKKS 全同态加密方案,将密文数据紧密打包进定长字,使加速器获得接近满额的算术效率。
全同态加密(FHE)可直接在加密数据上计算。尽管 FHE 在 CPU 上很慢,但近期硬件加速器已补偿了大部分开销,使深度神经网络等复杂程序达到实时性能。然而最先进的 FHE 方案 CKKS 在加速器上效率低下:CKKS 用大小差异很大的整数(通常 30 至 60 位)表示加密数据,导致寄存器与算术数据通路中大量比特未被利用。这种浪费在 CPU 上影响甚微,但加速器以乘法为主,利用率低会造成巨大的面积与能耗开销。BitPacker 是首个面向加速器的 FHE 方案重新设计,它把加密数据紧凑地打包在固定字长中,从而在加速器上实现接近满额的算术效率。在最新加速器上,BitPacker 平均提升性能 59%、最高 3 倍,并平均降低能耗 59%;它不降低精度,且无需改动硬件即可应用于此前所有加速器。
Fully Homomorphic Encryption (FHE) enables computing directly on encrypted data. Though FHE is slow on a CPU, recent hardware accelerators compensate most of FHE's overheads, enabling real-time performance in complex programs like deep neural networks. However, the state-of-the-art FHE scheme, CKKS, is inefficient on accelerators. CKKS represents encrypted data using integers of widely different sizes (typically 30 to 60 bits). This leaves many bits unused in registers and arithmetic datapaths. This overhead is minor in CPUs, but accelerators are dominated by multiplications, so poor utilization causes large area and energy overheads. We present BitPacker, a new implementation of CKKS that keeps encrypted data packed in fixed-size words, enabling near-full arithmetic efficiency in accelerators. BitPacker is the first redesign of an FHE scheme that targets accelerators. On a state-of-the-art accelerator, BitPacker improves performance by gmean 59% and by up to 3×, and reduces energy by gmean 59%. BitPacker does not reduce precision and can be applied to all prior accelerators without hardware changes.