Paper 2026/1870
Terrazzo: Memory-Aware GPU Framework for Private Transformer Inference
Abstract
Fully homomorphic encryption (FHE) allows a server to run inference directly on encrypted data, making it a promising foundation for private transformer inference. Its dominant scheme, CKKS (Cheon, Kim, Kim and Song), has no native matrix multiplication, so the encrypted matrix multiplications at the heart of transformers dominate inference cost. The recent matrix FHE scheme of Gentry and Lee (GL) supports matrix multiplication natively, but its ciphertexts, plaintexts, and evaluation keys are so large that a direct GPU implementation would require terabytes of VRAM for even small language models. We present Terrazzo, a GPU framework for the GL scheme, co-designed across cryptography, algorithms, and kernels to fit private inference on a commodity GPU. Terrazzo bootstraps into a compact Y-decoded representation, so nonlinear layers never hold full ciphertexts live; tiles all work over GL's independently schedulable ciphertext slices in L2-sized tiles; confines grafting-based modulus management to application levels around a sprout-free bootstrap; and keeps every model weight at its cleartext footprint with an expansion-free plaintext pipeline. Terrazzo targets batched inference, in which one client submits many inputs under one key set: one encrypted BERT-base pass carries up to 256 inputs and takes 273.7s on a consumer RTX 5090 and 640.3s on an A100, which is also the latency of a single input. At full occupancy this is 1.07s and 2.50s per input, 26 - 241x below the per-input latency of prior single-A100 systems. Per-slice bootstrap speedup over Cheddar and Theodosian, the state-of-the-art CKKS GPU works, is 1.91 - 3.48x on the RTX 5090 and 2.20 - 2.77x on the A100.
Comments