The attack does not corrupt a single token of output. That is what makes it worth reading.
Table IV of the paper shows the mechanism in two lines of LLVM IR. The baseline kernel emits one vectorized load:
% val = tail call { i32, i32, i32, i32 } asm sideeffect
"ld.global.v4.b32 { $0, $1, $2, $3 }, [ $4 ];"
The bit-flipped kernel emits four scalar loads instead:
% v0 = tail call i32 asm sideeffect "ld.global.b32 { $0 }, [ $1 ];"
...
Same values loaded. Same results computed. Four times as many memory transactions. On the NVIDIA side the paper traces it all the way down to SASS, where LDG.E.128 (128-bit vectorized global loads) become LDG.E.U16 — 48 of them, with zero LDG/STG.E.128 instructions remaining.
The paper is arXiv:2610.30798, Amplifying Latency and Cost of LLM Inference via Rowhammer Attack, submitted 22 October 2026 by Mrityunjay Shukla, Shubham Roy, and Biswabandan Panda at IIT Bombay. They call the attack LLVMhammer and the search tool that finds it Karnage. Measured effect on vLLM serving: 4–16% higher inference latency, across Qwen2.5-7B-Instruct, Llama-3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, and DeepSeek-llm-7B-chat, on both an RTX 4090 and an RX 7900 XTX.
Why the compiler is the target, not the kernel
Rowhammer is a DRAM reliability exploit, not a software bug. Rapidly activating one DRAM row leaks charge into physically adjacent rows until a bit flips in a neighbouring cell. The attacker picks that bit deliberately, which means the attacker gets to choose what changes — but only within a 1-bit neighbourhood of an instruction they have already selected.
LLVMhammer’s insight is that the thing worth flipping is not on the GPU at all. It is inside libtriton.so, the shared library that implements Triton’s compiler, while that library is resident in the CPU’s DRAM. Triton’s pipeline moves a kernel through four representations: Triton IR, then Triton-GPU IR, then LLVM IR, then vendor-specific machine code. The first two stages are target-independent — the same code path runs whether the eventual GPU is an NVIDIA or an AMD part. Flip a bit in a branch decision inside one of those stages, and the compiler takes a different path through an optimization pass. It emits a functionally identical kernel that is slower.
That is the vendor-agnostic property, and it is what separates this from PRowhammer, the prior GPU-side attack the authors compare against — and, notably, their own ISCA 2026 paper, with three of the same four authors. PRowhammer profiles NVIDIA SASS directly and needs the victim’s workload to dispatch through cuBLAS, so every GPU vendor needs the profiling redone. LLVMhammer flips something upstream of the vendor split, so one bit-flip location works on both.
The prior work forms a ladder. PRowhammer showed that CPU-to-GPU bit-flip propagation was possible at all, and reported that a single flip in the GGML library dropped generation quality to a BERTScore of 25%. The same group is now pushing the target one layer further up, from a library that executes on the GPU to the compiler that decides what gets compiled. GPUBreach, also at S&P 2026, extends Rowhammer to privilege escalation on GPUs. LLVMhammer is the efficiency variant, and it is the one that targets output correctness not at all.
The flip has to land somewhere useful, and the paper is careful about what “useful” means. Their three properties are P1 (resides in a target-independent stage), P2 (causes slowdown with correct output and no crash), and P3 (the slowdown holds across prompt lengths and models). A flip in an arithmetic instruction mostly corrupts one intermediate value that either gets discarded or crashes the compiler. The useful flips are control-flow flips — a conditional jump or conditional move that silently changes which branch of an optimization pass executes.
Karnage: four stages of pruning, and the arithmetic that makes it tractable
libtriton.so is a 500 MB library with over 120,000 functions. Brute-forcing bit-flips across it is obviously hopeless, so Karnage prunes in four stages.
Stage 1a filters by namespace. Functions under mlir::triton and mlir::triton::gpu implement the target-independent passes; everything else is vendor-specific. That takes 121,735 functions (NVIDIA build) down to 7,963, and 122,148 down to 8,219 for AMD — roughly a 94% cut.
Stage 1b intersects Intel Processor Trace call traces. Karnage records which functions actually execute while compiling representative kernels (matmul, vector add, fused attention, layer norm, softmax), intersects across kernels, then across both GPU platforms. The surviving 254 functions run in every compilation on every vendor.
Stage 2 selects which instructions inside those 254 functions to target: conditional jumps and conditional moves whose opcodes sit one Hamming bit apart, so a single bit-flip swaps one branch for its mirror. The paper lists the pairs explicitly — je/jne at 0x74/0x75, jl/jge at 0x7C/0x7D, cmove/cmovne at 0x44/0x45, and nine more.
Stage 3 compiles each candidate and diffs the output against the unmodified compiler, discarding flips that produce identical code. This is the stage that makes the whole thing affordable: because a flip is induced in the compiler library and the kernel launch is intercepted before any GPU work happens, this filtering runs entirely CPU-only.
Stage 4 does the actual GPU profiling and keeps only flips that measurably slow inference.
The search-space numbers in Table III are the part I keep coming back to. The namespace filter leaves 1,183,008 candidate flip locations on NVIDIA and 1,326,122 on AMD; at 30 seconds per trial, that is 9,858 and 11,051 hours of GPU time. After the Intel PT filter, 38,769 and 42,996 locations remain, or 323 and 358 hours. After compiler-output pruning and GPU profiling, 1,176 and 810 locations survive — 10 and 7 hours. Four stages turn three years of compute into a week.
I wanted to check the 120,000-function claim against a real build, so I pulled the triton 3.8.0 wheel from PyPI and unpacked it. libtriton.so on this aarch64 box is 517,292,248 bytes. nm -D --defined-only reports 135,023 exported symbols, and demangled, the unique mlir::triton* symbol names come to 7,866 — close enough to their 7,963/8,219 that the namespace filter is clearly doing what they describe. Different architecture, different build, same order of magnitude.
The part I had to dig into: why the bad kernel persists
Here is where I spent most of my time, and where the paper is thin. The attack’s persistence depends on Triton caching compiled kernels to disk and reusing them. The paper states this in one line — Triton stores kernels at ~/.triton/cache and reuses them across requests and process restarts — but the interesting question is what stops the cache from noticing that the compiler is now producing different output.
The answer is: nothing, and for a reason that took me a while to see.
I read the actual implementation in python/triton/runtime/cache.py. The cache key is built as:
key = f"{triton_key()}-{src.hash()}-{backend.hash()}-{backend_options.hash()}-{str(sorted(env_vars.items()))}"
And triton_key() looks like it should be safe. It hashes the frontend file, every module under triton.compiler.* and triton.backends.*, every module under triton.language.*, and — this is the part that made me stop — the on-disk libtriton.so itself, streamed in 1 MiB chunks through SHA-256. The compiler binary is in the key. If the compiler binary changed, the key changes.
Then I remembered what Rowhammer actually does. It flips a bit in DRAM. Not on disk. The file on disk is pristine; the mapped, resident copy of the library in the attacker’s and victim’s address space has one bit changed. The cache key is computed from the disk bytes at process start, before any flip occurs.
So I wrote a script that replicates triton_key() against the real unpacked wheel, and then simulates the flip. The computed key is 1,110 characters long, and it does contain the on-disk libtriton.so digest. Flipping one bit at file offset 0x100000 changes that file’s SHA-256 from 8e8c3182fffabae5... to 8ab7d1698236564a.... And the cache key is unchanged, because it was derived from the pristine bytes.
Then I confirmed the second half: in compiler/compiler.py, the cache-hit path is a single conditional.
always_compile = knobs.compilation.always_compile
if not always_compile and metadata_path is not None:
# cache hit!
res = CompiledKernel(src, metadata_group, hash)
If a metadata entry exists, Triton loads the previously compiled artifact and never re-enters the compiler. The corrupted kernel is sitting in ~/.triton/cache under a key that looks exactly like a legitimate one, and the only way to get rid of it is to not have compiled it in the first place.
That is the whole attack in three facts: a bit-flip changes an optimization decision, the result is functionally correct but slower, and the on-disk cache means it survives the process that made it.
A side note on cache corruption, since I went looking: Triton merged PR #8923, “[CACHE] Handle corrupted cache”, in December 2025. That is about a cache entry that is damaged on disk — a truncated file, a partial write — and the fix treats an incomplete cache group as a miss and recompiles. It is a different failure mode from this one, because a half-written cubin fails loudly and gets discarded, whereas the bit-flipped kernel is complete, valid, and loads fine. The maintainers clearly thought about corrupted caches. They did not think about a corrupted compiler.
If you have seen Triton’s cache before, you know there is a TRITON_CACHE_MANAGER knob and a TRITON_REMOTE_CACHE_BACKEND knob. Neither is mentioned in the paper, and I think both matter for the operational picture. A local ~/.triton/cache means the damage is bounded by one machine. A shared remote cache means a poisoned artifact can be served to every worker that connects, and the persistence window stops being “until someone restarts the pod” and starts being “until someone rotates the shared cache”.
The MLIR framing from the paper’s own background section is worth keeping in mind here, because it explains why the library is the right place to look. LLVM’s optimization passes are mostly target-independent by design, and MLIR extends that by having each pass understand only its own dialect and ignore the lower target-specific ones. The same pass sequence runs for NVPTX and AMDGPU. That is a deliberate, well-engineered property of the compiler stack, and it is exactly the property that makes one flip location reach two GPU vendors.
What it costs, and what I checked
The economics section is where the paper gets its numbers, and I re-derived all of them from scratch. A serving stack handling one million requests per day with a 10% throughput reduction loses 2.4 hours of capacity per day — 24 hours times 10% — which is 876 hours per year. At H100 pricing of $4.50–$10.00 per GPU-hour, that is $3,942 to $8,760 per GPU annually, and $1.0M to $2.24M across a 256-GPU deployment. Every figure the paper states, reproduced.
The framing they use is right: there is no output anomaly to prompt investigation. A 10% throughput loss looks like a traffic increase, a noisy neighbour, or a thermal regression. The expensive part is not the attack, it is the weeks of chasing a regression that has no obvious cause.
The countermeasure they propose is TRITON_ALWAYS_COMPILE, which forces Triton to bypass the cache and recompile every kernel at each inference call, plus reloading libtriton.so from disk before each session so an in-memory flip does not carry over. I confirmed the knob exists in current Triton — always_compile is defined in knobs.py and consumed at that exact compiler.py branch — and it works as described. The cost is startup compile time on every process launch, which for vLLM with many kernel variants is not small. The paper also notes that this only addresses the persistence; a flip landing in a correctness-controlling pass corrupts outputs instead, and BERTScore against the golden run drops as low as 0.25, with NVIDIA producing looping phrase fragments and AMD producing text unrelated to the prompt.
On the DRAM side the paper is admirably pessimistic. Targeted Row Refresh has been bypassed repeatedly — TRRespass and BLACKSMITH are the two I would read first — and DDR5’s Per Row Activation Counter is bypassed too, with Half-Double showing hammerings from the next row over work even where the row you are hammering is throttled. The authors cite MOAT for the argument that Panopticon’s frequency-domain approach, which inspired JEDEC’s PRAC+ABO framework in DDR5, does not actually hold up: their Jailbreak pattern drives 1,150 activations on an attack row against a Panopticon configured for a threshold of 128. None of this is new; it is a decade of the same result, and the paper does not pretend otherwise. ECC does not save you, per the cited work on targeted bit-flips against ECC-protected DRAM.
The one mitigation that comes with a brutal price tag is Memory Band-Aid, which throttles per-bank DRAM bandwidth in the memory controller to keep row activations below the threshold. Current hardware lacks per-bank limits, so it imposes a global throttle with overheads reported up to 431%. I would rather not run that in a serving path.
The other row of related work worth naming is the model-weight side of the same problem, because it shows how different the two attack surfaces are. BitHydra is explicitly a bit-flip inference cost attack against LLMs, and SBFA is a single-bit weight flip that breaks a model outright. Both target the weights, and both need the attacker to find a specific bit in a specific tensor. LLVMhammer needs no knowledge of the model at all — it targets the compiler, and the same flip works for every model the victim serves. That is the part that scales.
The parts I do not believe yet
I could not run this attack, and I want to be specific about why rather than gesturing at “hard to reproduce”.
There is no artifact. Karnage is described in detail but I found no repository or release for it, and the paper lists no code link. The whole thing rests on a DRAM rig: the evaluation platforms are an i7-4790 (Haswell) with 8 GB of Kingston DDR3 at 1600 and an i7-8700 (Coffee Lake) with 8 GB of Corsair DDR4 at 2400. Consumer desktop memory from the DDR3/DDR4 era, with Rowhammer mitigation behavior that differs sharply from modern server DDR5 with PRAC counters. The authors do cite prior work showing ECC-protected DRAM remains vulnerable to targeted bit-flips, but the gap between a DDR4 consumer rig and an ECC DDR5 cloud host is exactly where I would want data before extrapolating.
The significance data also deserves more skepticism than the abstract gives it. Table VI reports Welch’s t-test over 30 runs per configuration. At n=10 — which is roughly realistic serving load — the NVIDIA results are mostly not significant: DeepSeek 2/5 metrics, Llama 2/5, Mistral 0/5, Qwen 1/5. Only AMD Qwen hits all five. At n=100, AMD is clean across all four models while NVIDIA is still partial. At n=1000, everything is significant on both vendors. So the 4–16% headline is a maximum over configurations, and at low batch sizes on NVIDIA the effect sits inside the noise floor. I would want to know how the degradation behaves under sustained concurrent load rather than 30 repeated runs.
And the residual question the paper does not answer: Karnage finds flips that produce a correct but slower kernel. That is a narrow target, because the bit has to land in a branch that changes performance without changing semantics. There are presumably many more flips that change semantics, and the paper’s P2 filter is what excludes them from the slowdown study. Whether those are reachable in a way an attacker would find is the open question, and it is a question about Karnage’s search, not about Rowhammer.
What is left
Two things I did not get to.
First, I did not check whether TRITON_CACHE_DIR is set to a shared or ephemeral path in any of the deployment configs I have access to — which would determine whether the persistence window is minutes or months for a real fleet. That is a grep I can do in five minutes and have not done.
Second, the compiler-output diffing in Karnage’s stage 3 assumes you can compare a flipped compilation against an unflipped one. I replicated the cache-key half of the mechanism because that runs on CPU. The diffing half needs the monkey-patched kernel launch to intercept before any GPU execution, and this box has a VirtIO display adapter and no CUDA or ROCm device at all.
The unresolved part is narrower than the attack. The bit-flip is not interesting; Rowhammer has been interesting for a decade. What is new is that a GPU compiler has a shared-library, on-disk-cache, JIT architecture where a DRAM bit-flip in the host CPU can reach the GPU kernel — and the code path from “compiler makes a different decision” to “your serving stack is 16% slower forever” runs entirely through libtriton.so and ~/.triton/cache, with no output-level signal anywhere along it. Whether that architecture is a real risk in a modern cloud fleet, with ECC DDR5 and PRAC and all of it, is the question I could not answer from a paper.
Comments
Powered by GitHub Discussions via Giscus. Sign in with GitHub to leave a comment.