Amplifying Latency and Cost of LLM Inference via Rowhammer Attack
作者: Mrityunjay Shukla, Shubham Roy, Biswabandan Panda
分类: cs.CR, cs.LG
发布日期: 2026-10-22
💡 一句话要点
提出LLVMhammer攻击以降低LLM推理性能并增加成本
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: Rowhammer攻击 大型语言模型 GPU推理 编译安全 性能优化 LLVM Triton 位翻转
📋 核心要点
- 现有的GPU优化方法在推理性能上存在潜在的安全隐患,尤其是针对大型语言模型的攻击。
- 论文提出LLVMhammer攻击,通过Rowhammer诱导位翻转,影响Triton编译管道中的性能优化过程。
- 实验结果表明,LLVMhammer在多种LLM上实现了4-16%的推理延迟增加,并且可能导致输出质量显著下降。
📝 摘要(中文)
大型语言模型(LLMs)通过优化的GPU内核实现高效推理,然而,本文研究了Rowhammer攻击对GPU推理性能的影响。我们提出了LLVMhammer,这是首个通过在Triton编译管道中诱导位翻转来导致LLM推理减速的Rowhammer攻击。该攻击使得Triton生成功能上相同但次优的GPU内核,导致推理延迟增加4-16%。此外,LLVMhammer还可能破坏LLM输出,降低BERTScore至25%,揭示了Triton编译管道中位翻转的安全隐患。
🔬 方法详解
问题定义:本文旨在解决大型语言模型推理过程中可能遭受的Rowhammer攻击带来的性能下降问题。现有方法未能考虑到编译过程中的安全性,导致潜在的性能损失和输出错误。
核心思路:论文的核心思路是利用Rowhammer攻击诱导位翻转,从而影响Triton编译管道中的关键优化过程,生成次优的GPU内核。通过这种方式,攻击者可以在不改变输出正确性的情况下,显著降低推理性能。
技术框架:整体架构包括LLVMhammer攻击工具和Karnage工具。Karnage用于识别Triton编译管道中可利用的位翻转位置,而LLVMhammer则通过这些位置实施攻击,导致推理延迟增加。
关键创新:最重要的技术创新在于首次将Rowhammer攻击应用于GPU编译管道,导致生成的内核在功能上相同但性能上显著低效。这种攻击方式是GPU供应商无关的,具有广泛的适用性。
关键设计:关键设计包括对Triton编译管道的深入分析,以识别影响性能的优化阶段,并通过Karnage工具自动化识别可利用的位翻转位置。
📊 实验亮点
实验结果显示,LLVMhammer在多种大型语言模型上实现了4-16%的推理延迟增加,且在不同GPU供应商上均可导致输出质量下降,BERTScore最低降至25%。这些结果强调了编译管道安全性的重大影响。
🎯 应用场景
该研究的潜在应用领域包括大型语言模型的安全性评估和优化。通过揭示编译过程中的安全隐患,研究可以促使开发更安全的编译工具和推理框架,从而提高LLM在实际应用中的可靠性和安全性。
📄 摘要(原文)
Large language models (LLMs) achieve high inference efficiency using optimized GPU kernels generated by just-in-time (JIT) compilation frameworks such as Triton. Triton compiles GPU kernels through an MLIR/LLVM-based pipeline. We investigate whether a Rowhammer-induced bit-flip in the CPU's DRAM can degrade GPU-based LLM inference performance while preserving output correctness. We present LLVMhammer, the first Rowhammer attack that causes LLM inference slowdown by inducing a bit-flip in Triton's compilation pipeline. A bit-flip in a performance-critical optimization pass causes Triton to generate a functionally identical but suboptimal GPU kernel. Since Triton caches the generated kernel on disk, a single successful bit-flip causes persistent slowdown across subsequent inference executions. Triton's target-independent stages are shared across GPU vendors, which makes our attack GPU vendor-agnostic. To identify exploitable bit-flip locations without manual inspection, we build Karnage, a tool that isolates useful bit-flip locations in Triton's target-independent compilation pipeline. We evaluate LLVMHammer across a diverse set of LLMs, including Qwen2.5-7B-Instruct, Llama-3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, and Deepseek-llm-7B-chat, across NVIDIA RTX 4090 and AMD RX 7900 XTX GPUs. LLVMhammer increases inference latency of an LLM inference server running on a single GPU by 4-16\%, which, in turn, can translate into additional annual operating costs at the scale of multi-GPU deployments. We further show that LLVMhammer can also corrupt LLM outputs across different GPU vendors, reducing BERTScore to as low as 25\%, illustrating the broader security implications of bit-flips in Triton's compilation pipeline.