A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption

Fully Homomorphic Encryption (FHE) enables computing on encrypted data, letting clients securely offload computation to untrusted servers. While enticing, FHE has two key challenges that limit its applicability: it has high performance overheads (10,000× over unencrypted computation) and it is extre...

Full description

Bibliographic Details
Main Authors: Krastev, Aleksandar, Samardzic, Nikola, Langowski, Simon, Devadas, Srinivas, Sanchez, Daniel
Format: Article
Language:English
Published: Association for Computing Machinery (ACM) 2024
Online Access:https://hdl.handle.net/1721.1/155458
_version_ 1811073714204180480
author Krastev, Aleksandar
Samardzic, Nikola
Langowski, Simon
Devadas, Srinivas
Sanchez, Daniel
author_facet Krastev, Aleksandar
Samardzic, Nikola
Langowski, Simon
Devadas, Srinivas
Sanchez, Daniel
author_sort Krastev, Aleksandar
collection MIT
description Fully Homomorphic Encryption (FHE) enables computing on encrypted data, letting clients securely offload computation to untrusted servers. While enticing, FHE has two key challenges that limit its applicability: it has high performance overheads (10,000× over unencrypted computation) and it is extremely hard to program. Recent hardware accelerators and algorithmic improvements have reduced FHE’s overheads and enabled large applications to run under FHE. These large applications exacerbate FHE’s programmability challenges. Writing FHE programs directly is hard because FHE schemes expose a restrictive, low-level interface that prevents abstraction and composition. Specifically, FHE requires packing encrypted data into large vectors (tens of thousands of elements long), FHE provides limited operations on these vectors, and values have noise that grows with each operation, which creates unintuitive performance tradeoffs. As a result, translating large applications, like neural networks, into efficient FHE circuits takes substantial tedious work. We address FHE’s programmability challenges with the Fhelipe FHE compiler. Fhelipe exposes a simple, numpy-style tensor programming interface, and compiles high-level tensor programs into efficient FHE circuits. Fhelipe’s key contribution is automatic data packing, which chooses data layouts for tensors and packs them into ciphertexts to maximize performance. Our novel framework considers a wide range of layouts and optimizes them analytically. This lets compile large FHE programs efficiently, unlike prior FHE compilers, which either use inefficient layouts or do not scale beyond tiny programs. We evaluate on both a state-of-the-art FHE accelerator and a CPU. is the first compiler that matches or exceeds the performance of large hand-optimized FHE applications, like deep neural networks, and outperforms a state-of-the-art FHE compiler by gmean 18.5. At the same time, dramatically simplifies programming, reducing code size by 10–48.
first_indexed 2024-09-23T09:37:27Z
format Article
id mit-1721.1/155458
institution Massachusetts Institute of Technology
language English
last_indexed 2024-09-23T09:37:27Z
publishDate 2024
publisher Association for Computing Machinery (ACM)
record_format dspace
spelling mit-1721.1/1554582024-07-09T03:53:02Z A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption Krastev, Aleksandar Samardzic, Nikola Langowski, Simon Devadas, Srinivas Sanchez, Daniel Fully Homomorphic Encryption (FHE) enables computing on encrypted data, letting clients securely offload computation to untrusted servers. While enticing, FHE has two key challenges that limit its applicability: it has high performance overheads (10,000× over unencrypted computation) and it is extremely hard to program. Recent hardware accelerators and algorithmic improvements have reduced FHE’s overheads and enabled large applications to run under FHE. These large applications exacerbate FHE’s programmability challenges. Writing FHE programs directly is hard because FHE schemes expose a restrictive, low-level interface that prevents abstraction and composition. Specifically, FHE requires packing encrypted data into large vectors (tens of thousands of elements long), FHE provides limited operations on these vectors, and values have noise that grows with each operation, which creates unintuitive performance tradeoffs. As a result, translating large applications, like neural networks, into efficient FHE circuits takes substantial tedious work. We address FHE’s programmability challenges with the Fhelipe FHE compiler. Fhelipe exposes a simple, numpy-style tensor programming interface, and compiles high-level tensor programs into efficient FHE circuits. Fhelipe’s key contribution is automatic data packing, which chooses data layouts for tensors and packs them into ciphertexts to maximize performance. Our novel framework considers a wide range of layouts and optimizes them analytically. This lets compile large FHE programs efficiently, unlike prior FHE compilers, which either use inefficient layouts or do not scale beyond tiny programs. We evaluate on both a state-of-the-art FHE accelerator and a CPU. is the first compiler that matches or exceeds the performance of large hand-optimized FHE applications, like deep neural networks, and outperforms a state-of-the-art FHE compiler by gmean 18.5. At the same time, dramatically simplifies programming, reducing code size by 10–48. 2024-07-08T18:28:27Z 2024-07-08T18:28:27Z 2024-06-20 2024-07-01T07:57:40Z Article http://purl.org/eprint/type/JournalArticle 2475-1421 https://hdl.handle.net/1721.1/155458 Krastev, Aleksandar, Samardzic, Nikola, Langowski, Simon, Devadas, Srinivas and Sanchez, Daniel. 2024. "A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption." Proceedings of the ACM on Programming Languages, 8 (PLDI). PUBLISHER_CC en 10.1145/3656382 Proceedings of the ACM on Programming Languages Creative Commons Attribution-ShareAlike https://creativecommons.org/licenses/by-sa/4.0/ The author(s) application/pdf Association for Computing Machinery (ACM) Association for Computing Machinery
spellingShingle Krastev, Aleksandar
Samardzic, Nikola
Langowski, Simon
Devadas, Srinivas
Sanchez, Daniel
A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption
title A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption
title_full A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption
title_fullStr A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption
title_full_unstemmed A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption
title_short A Tensor Compiler with Automatic Data Packing for Simple and Efficient Fully Homomorphic Encryption
title_sort tensor compiler with automatic data packing for simple and efficient fully homomorphic encryption
url https://hdl.handle.net/1721.1/155458
work_keys_str_mv AT krastevaleksandar atensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT samardzicnikola atensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT langowskisimon atensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT devadassrinivas atensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT sanchezdaniel atensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT krastevaleksandar tensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT samardzicnikola tensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT langowskisimon tensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT devadassrinivas tensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption
AT sanchezdaniel tensorcompilerwithautomaticdatapackingforsimpleandefficientfullyhomomorphicencryption