CHET: Compiler and Runtime for Homomorphic Evaluation of Tensor Programs

Roshan Dathathri, Olli Saarikivi, Hao Chen, Kim Laine, Kristin E. Lauter, Saeed Maleki, Madanlal Musuvathi, Todd MytkowiczarXiv 2018

Abstract

Fully Homomorphic Encryption (FHE) allows for computation on encrypted data, providing a robust solution for privacy-preserving cloud computing. However, FHE is notoriously difficult to program due to manual noise management, complex data vectorization, and parameter selection. This paper introduces CHET, an optimizing compiler and runtime designed to automate the translation of standard tensor programs into efficient FHE circuits. By abstracting cryptographic complexities through a novel Homomorphic Instruction Set Architecture (HISA) and a specialized CipherTensor datatype, CHET enables the evaluation of deep neural networks with performance that exceeds expert hand-written implementations.

Introduction

Cloud computing often requires users to expose sensitive plaintext data to service providers. Fully Homomorphic Encryption (FHE) offers a mathematical solution by allowing servers to perform operations directly on ciphertexts. Despite its promise, FHE adoption is hindered by its complexity. Developers must manage "cryptographic noise," handle 1D vector packing for 4D tensors, and select parameters that balance security and performance. CHET addresses these challenges by providing an end-to-end software stack that hides these complexities from machine learning engineers.

The CHET Compiler Architecture

The CHET compiler automates the conversion of high-level tensor computation graphs into optimized homomorphic circuits. It performs symbolic analysis to track multiplicative depth and automatically selects encryption parameters to ensure both security and precision.

The CHET compiler takes high-level tensor descriptions and produces optimized homomorphic circuits.

The compiler also employs a cost model to optimize data layouts, searching for the most efficient way to tile tensors based on the specific neural network architecture.

End-to-End System Workflow

The CHET system operates in a client-server model. The client handles encryption and decryption using keys generated based on the compiler's output, while the server executes the optimized homomorphic tensor circuit within the CHET runtime.

The end-to-end workflow between client and server using the CHET runtime.

Key Innovations: HISA and CipherTensor

CHET introduces two primary abstractions to simplify FHE programming:

  1. Homomorphic Instruction Set Architecture (HISA): HISA decouples high-level tensor operations from low-level FHE library implementations. It provides a unified interface for core operations like addition, multiplication, and rotation, allowing the compiler to target different cryptographic backends seamlessly.
  2. CipherTensor Datatype: To handle the mismatch between 4D tensors and 1D ciphertexts, CHET uses the CipherTensor datatype. This structure pairs encrypted data with plaintext metadata, allowing operations like reshaping and padding to be performed as "free" metadata updates rather than expensive homomorphic operations.

Experimental Results

CHET was evaluated on neural network inference tasks using MNIST and CIFAR-10 datasets. Because FHE does not support non-linear functions like ReLU, models were retrained using polynomial approximations.

Key findings include:

  • Performance: CHET-generated code outperformed expert hand-written implementations. For an industrial model with 5 convolutional layers, latency was reduced from 2,413 seconds to 312 seconds.
  • Scalability: The authors successfully evaluated a modified SqueezeNet on CIFAR-10, which consisted of 10 convolutional layers—the deepest FHE-evaluated network at the time of publication.
  • Optimization Impact: Automatic rotation key pruning, which generates only the necessary keys for specific network rotations, nearly halved the inference latency for SqueezeNet.

Conclusion and Future Work

While CHET significantly lowers the barrier to using FHE, the underlying technology remains computationally expensive, with inference times measured in minutes rather than milliseconds. Future work involves integrating "bootstrapping" techniques into HISA to support even deeper networks without the performance degradation associated with increasing encryption parameters.

Summary updated

BibTeX
@misc{dathathri2018chet,
  author = {Roshan Dathathri and Olli Saarikivi and Hao Chen and Kim Laine and Kristin E. Lauter and Saeed Maleki and Madanlal Musuvathi and Todd Mytkowicz},
  title = {{CHET: Compiler and Runtime for Homomorphic Evaluation of Tensor Programs}},
  year = {2018},
  eprint = {1810.00845},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.00845},
}
Figure