Skip to main content
QUICK REVIEW

[Paper Review] MAGE: Nearly Zero-Cost Virtual Memory for Secure Computation

Sam Kumar, David Culler|arXiv (Cornell University)|Jun 23, 2021
Cryptography and Data Security4 citations
TL;DR

MAGE introduces a novel memory programming approach that leverages the inherent obliviousness of Secure Computation (SC) to precompute memory access patterns and generate optimal, proactive memory management plans. By using Belady's MIN algorithm with asynchronous prefetching, MAGE achieves near-in-memory performance for SC workloads that exceed physical memory, outperforming OS virtual memory by up to an order of magnitude.

ABSTRACT

Secure Computation (SC) is a family of cryptographic primitives for computing on encrypted data in single-party and multi-party settings. SC is being increasingly adopted by industry for a variety of applications. A significant obstacle to using SC for practical applications is the memory overhead of the underlying cryptography. We develop MAGE, an execution engine for SC that efficiently runs SC computations that do not fit in memory. We observe that, due to their intended security guarantees, SC schemes are inherently oblivious -- their memory access patterns are independent of the input data. Using this property, MAGE calculates the memory access pattern ahead of time and uses it to produce a memory management plan. This formulation of memory management, which we call memory programming, is a generalization of paging that allows MAGE to provide a highly efficient virtual memory abstraction for SC. MAGE outperforms the OS virtual memory system by up to an order of magnitude, and in many cases, runs SC computations that do not fit in memory at nearly the same speed as if the underlying machines had unbounded physical memory to fit the entire computation.

Motivation & Objective

  • To address the critical performance bottleneck in Secure Computation (SC) caused by high memory overhead and inefficient OS virtual memory when programs exceed physical memory.
  • To exploit the inherent obliviousness of SC protocols—where memory access patterns are independent of input data—to enable proactive, precomputed memory management.
  • To design a system that achieves near-in-memory performance for SC workloads that do not fit in physical memory, effectively enabling virtual memory at nearly zero cost.
  • To overcome the limitations of heuristic-based page replacement (e.g., LRU, LFU) by using theoretically optimal algorithms like Belady's MIN in a preplanning context.

Proposed method

  • MAGE observes that SC protocols are inherently oblivious, meaning memory access patterns are data-independent and can be statically analyzed before execution.
  • It uses a domain-specific language (DSL) to represent SC circuits and statically extracts the complete memory access pattern across all program phases.
  • Based on this full access pattern, MAGE applies Belady’s MIN algorithm to determine the optimal page eviction order, minimizing total memory transfers.
  • MAGE implements asynchronous prefetching based on the precomputed access pattern, ensuring no runtime stalls due to data fetching.
  • It uses a staged planning approach to efficiently solve the large-scale memory programming problem, avoiding exponential-time solvers by coarsening the dataflow graph.
  • The system integrates with SC frameworks by generating a memory program—a sequence of preplanned data transfers between memory and storage—executed at runtime.

Experimental results

Research questions

  • RQ1Can Secure Computation (SC) be efficiently executed when the working set exceeds available physical memory?
  • RQ2Can the inherent obliviousness of SC protocols be exploited to precompute memory access patterns and enable proactive memory management?
  • RQ3Can a memory management strategy based on Belady’s MIN algorithm be practically applied in SC systems, given its theoretical optimality?
  • RQ4To what extent can memory programming reduce runtime latency and improve throughput compared to traditional OS virtual memory in SC workloads?

Key findings

  • MAGE outperforms the OS virtual memory system by up to an order of magnitude in execution speed for SC workloads that exceed physical memory capacity.
  • MAGE enables certain SC computations to run at nearly in-memory speeds, as if unbounded physical memory were available, even when the working set exceeds main memory.
  • By precomputing access patterns and using MIN-based eviction with asynchronous prefetching, MAGE eliminates runtime stalls due to memory access, achieving high utilization of compute resources.
  • The memory programming approach allows MAGE to use theoretically optimal algorithms like Belady’s MIN, which are infeasible in classic paging due to their clairvoyant nature, but are realizable here due to static analysis.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.