[论文解读] CHET: Compiler and Runtime for Homomorphic Evaluation of Tensor Programs
CHET 是一个编译器和运行时系统,通过引入同态指令集架构(HISA),实现了对深度神经网络(DNN)推理工作负载的高效全同态加密(FHE)计算。它自动化了关键优化——如数据布局选择、旋转密钥管理与内核融合——其性能超越了标准卷积神经网络(CNN)上的手写优化实现。
Fully Homomorphic Encryption (FHE) refers to a set of encryption schemes that allow computations to be applied directly on encrypted data without requiring a secret key. This enables novel application scenarios where a client can safely offload storage and computation to a third-party cloud provider without having to trust the software and the hardware vendors with the decryption keys. Recent advances in both FHE schemes and implementations have moved such applications from theoretical possibilities into the realm of practicalities. This paper proposes a compact and well-reasoned interface called the Homomorphic Instruction Set Architecture (HISA) for developing FHE applications. Just as the hardware ISA interface enabled hardware advances to proceed independent of software advances in the compiler and language runtimes, HISA decouples compiler optimizations and runtimes for supporting FHE applications from advancements in the underlying FHE schemes. This paper demonstrates the capabilities of HISA by building an end-to-end software stack for evaluating neural network models on encrypted data. Our stack includes an end-to-end compiler, runtime, and a set of optimizations. Our approach shows generated code, on a set of popular neural network architectures, is faster than hand-optimized implementations.
研究动机与目标
- 为解决当前 FHE 编程缺乏高级抽象的问题,该问题目前需要低层级、易出错的手动调优。
- 将 FHE 方案的演进与编译器和运行时开发解耦,以支持独立创新。
- 构建一个端到端系统,能够在加密数据上安全高效地编译并执行 DNN 推理。
- 自动化关键性能优化,如数据布局选择与旋转密钥管理。
- 证明自动化编译可超越手写优化的 FHE 实现,用于 DNN。
提出的方法
- 设计并规范了同态指令集架构(HISA),一种抽象 FHE 操作的紧凑接口。
- 实现了将高层 DNN 模型转换为使用 HISA 优化的 FHE 编译代码的编译器。
- 运行时系统负责管理内存布局、执行调度与 FHE 参数管理,以实现高效计算。
- 基于 HEAAN FHE 方案定制的成本模型,自动选择每种模型的最优数据布局。
- 通过编译器优化 pass 实现内核融合与旋转密钥优化,以减少噪声增长并提升性能。
- 集成多项式近似方法,用于非多项式激活函数(如 ReLU),以实现 FHE 兼容性。
实验结果
研究问题
- RQ1像 HISA 这样的高级抽象能否有效实现 FHE 方案演进与应用级编译器和运行时开发的解耦?
- RQ2自动数据布局选择在最小化 DNN 的 FHE 计算成本方面有多有效?
- RQ3编译器优化(如内核融合与旋转密钥管理)在多大程度上能提升 FHE 性能?
- RQ4自动化编译能否超越手写优化的 FHE 实现,用于 DNN 推理?
- RQ5该系统如何处理 FHE 加密 DNN 推理中的精度与噪声管理问题?
主要发现
- CHET 为流行 DNN 生成的代码性能优于手写优化实现,证明了自动化优化的有效性。
- 旋转密钥优化 pass 显著提升了所有评估网络的性能,图 9 中观察到平均延迟降低。
- 基于成本模型的自动数据布局选择优于手动布局选择,后者易出错且难以调优。
- 该系统成功编译并执行了迄今为止最深的基于 FHE 的 CNN,实现了全同态加密下的复杂模型。
- 对激活函数使用多项式近似,实现了 FHE 兼容性,同时保持了高模型精度。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。