TL;DR
SAGE introduces the first purely software-based attestation mechanism for GPUs, enabling verifiable and confidential code execution on NVIDIA Ampere (A100) hardware without relying on vendor-embedded hardware secrets. By pairing a local CPU enclave (Intel SGX) with a cycle-accurate, resource-saturating GPU verification function, SAGE establishes a dynamic Root of Trust (RoT) capable of detecting the injection of even a single adversarial instruction.
What Problem Does This Paper Address?
Accelerators like GPUs process the vast majority of modern machine learning and data analytics workloads, many of which involve sensitive data (e.g., healthcare records, proprietary financial models). While Trusted Execution Environments (TEEs) like Intel SGX and ARM TrustZone are standard on CPUs, hardware-based TEEs for GPUs are still nascent, closed-source, or vulnerable to implementation flaws.
Historically, software-based attestation has bridged this gap on CPUs by having an untrusted device compute a time-sensitive, self-checking checksum over its memory. However, porting this to GPUs has remained an open challenge due to the massive parallelism, non-deterministic scheduling, complex memory hierarchies, lack of true random number generators (TRNGs), and proprietary, poorly documented instruction sets (SASS).
Methods
SAGE dynamically establishes an untampered execution environment on the GPU through a coordinated protocol between a host CPU verifier (running inside an Intel SGX enclave) and the GPU:
- Time-Optimal Verification Function (VF): The authors created a custom instruction generation and patching framework to bypass NVCC/PTX compiler inefficiencies and directly emit optimized native binary microcode (SASS). The VF maximally saturates the GPU by utilizing all 108 Streaming Multiprocessors (SMs), interleaving ALU and FMA instructions to eliminate pipeline stalls, and occupying 32 registers per thread. If an attacker attempts to run malicious code concurrently, register spilling to shared memory introduces an unmissable latency penalty (4 vs. 30 cycles).
- Self-Verifying, Strongly-Ordered Checksum: The VF computes a pseudo-random memory traversal checksum over its own binary and memory space based on an unpredictable nonce challenge sent by the SGX verifier. The checksum incorporates self-modifying code to prevent memory-copy attacks (where an attacker redirects pointers to an unaltered copy of the code).
- GPU-Native Race-Condition TRNG: Because GPUs lack on-chip TRNGs accessible without trusting the host OS, SAGE exploits hardware race conditions from simultaneous thread accesses to shared memory variables to extract physical entropy.
- Modified SAKE Key Establishment: Using the computed checksum as a short-lived secret, the GPU and CPU verifier execute an adapted SAKE protocol (based on Diffie-Hellman and Guy Fawkes hash chains) to establish a symmetric key ($sk_{VD}$). The GPU allocates execution memory via in-kernel
malloc()—which CUDA isolates from host driver/OS mapping—allowing encrypted and authenticated payload transfers.
+------------------+ +---------------------+
| Host CPU (SGX) | | Untrusted GPU (A100)|
+------------------+ +---------------------+
| |
|---- 1. Dispatch VF & Send Nonce ------->| (Saturates all SMs,
| | Registers, & Pipelines)
| |
[Measures Time]|<--- 2. Return Checksum (Self-Verified) -|
[Validates T] | |
|<=== 3. Modified SAKE Key Exchange =====>| (Uses GPU Race TRNG)
| (Establishes Shared sk_VD) |
| |
|---- 4. Send Authenticated User Kernel ->| (Runs isolated via
| | device malloc)
Datasets
Not discussed in the paper. The evaluation does not use standard machine learning training/evaluation datasets; instead, it evaluates execution runtimes using synthetic checksum microbenchmarks and a standard multi-layer perceptron (MLP) network topology (weights: $784 \times 100$ and $100 \times 10$ with ReLU).
Key Insights and Ideas
- Total Resource Exhaustion as an Attestation Primitive: On massively multi-threaded architectures, timing detection only works if no compute slack exists. SAGE configures thread blocks and register counts so that even a minimal adversarial task forces register spilling or instruction starvation, immediately exposing the tampering through execution delays.
- Microcode Control is Mandatory: Code compiled through NVIDIA’s standard PTX toolchain is roughly 2.3× slower than handwritten native SASS microcode. Without generating SASS directly, the compiler-induced slack leaves a window wide enough for an attacker to forge checksums or interleave malicious instructions undetected.
- Complementing, Not Just Replacing, Hardware TEEs: Pure software attestation does not rely on private keys fused into silicon during manufacturing. Thus, SAGE provides defense-in-depth: even if hardware vendor keys are leaked or hardware-level architectural bugs emerge, the software verification guarantees remain sound.
Key Results
- Attack Detection Granularity: In a 100,000-iteration benchmark ($T_{avg} = 0.4941\text{ s}$, $\sigma = 0.0009\text{ s}$), injecting just a single adversarial NOP pushed runtime to $T_{min} = 0.4966\text{ s}$, clearly exceeding the detection threshold ($T_{avg} + 2.5\sigma = 0.4964\text{ s}$).
- Peak Utilization: The optimized reference checksum achieves 99% of peak GPU computational throughput, running ~230% faster than PTX-compiled code.
- TRNG Performance: The GPU race-condition TRNG achieves 4 kB/s throughput and passed all NIST SP 800-22, DIEHARD, and ENT statistical tests (yielding 7.999996 bits of entropy per byte), generating a 256-bit key in ~8 ms.
- Low Practical Overhead: For deep learning workloads, SAGE adds less than 5% execution overhead to GPU kernels with runtimes greater than 14.24 ms.
Limitations and Future Work
- Instruction Cache Invalidation: The Ampere architecture lacks an unprivileged instruction-cache invalidation instruction. To force the CPU/GPU to reload self-modifying code, the authors had to inflate the loop to 8,342 instructions (128 kB) to overflow the L2 instruction cache, dropping compute efficiency to 75% due to instruction fetch stalls.
- Kernel Occupancy Assumption: Once the dynamic RoT hands execution over to the user kernel, protection against concurrent adversary takeover requires user kernels to maintain maximal GPU occupancy.
- Architectural Portability: SAGE was engineered and validated specifically for the NVIDIA Ampere A100. Extending it to other architectures (Hopper, Ada Lovelace, or AMD GPUs) requires reverse-engineering proprietary instruction encodings and pipeline timings.
- Hybrid Framework Support: SAGE currently targets standalone GPU kernels; extending it to dynamic hybrid CPU–GPU execution runtimes (like TensorFlow or PyTorch runtime graphs) remains future work.
Summary updated