I spent last week measuring the actual energy cost of local LLM inference on a Radeon PRO W7900 — joules per token, not just tokens per second. Four things bit me, and each one produced numbers that looked plausible enough to publish. Posting them here in case they save someone else the time.
The sensor lags about eighteen seconds. power1_average is a long-window moving average. My first benchmark ran short bursts and reported 14 W under full load on a card with a 241 W cap. Not an error — just a number that looked vaguely idle. Fix: 90-second sustained runs, discard the first 25 seconds of samples.
Cloud instances expose every GPU on the host. /sys/class/drm/card*/device/hwmon/hwmon*/power1_average gives you readings from cards that aren’t yours. Resolve your assigned card by PCI bus first:
rocm-smi --showbus # e.g. 0000:43:00.0
# then match PCI_SLOT_NAME in /sys/class/drm/card*/device/uevent
A liveness check is not a model check. I benchmarked a 14B and got results identical to the 7B, to one decimal place. The previous llama-server still held the port, the new one failed to bind, and curl /v1/models returning 200 confirmed something was answering — never what. Verify the served model name, not just that the port responds.
Offered concurrency is not served concurrency. This one my own validity check couldn’t catch. I count in-flight requests client-side, which was correctly 16 — but the server was started with -np 4, so everything above 4 was queuing. Concurrency 8 and 16 were concurrency 4, measured twice. If you benchmark batching, read the server’s parallel slot count too.
Two results that surprised me, once the measurement was actually sound:
Batching from concurrency 1 to 16 gives 8.7× better tokens per joule, and the factor is essentially the same on a 7B and a 14B (8.70× vs 8.80×). Absolute efficiency halves when the model doubles — the 14B/7B ratio is 0.53 / 0.52 / 0.54 across the three levels, which looks like a memory-bandwidth-bound decode.
And power draw isn’t monotonic in batch size: both models peak at concurrency 4 (229 W and 237 W) and then draw less at 16 (168 W and 185 W) while doing about seven times the work.
I couldn’t confirm the mechanism. mclk sits pinned at 1124 MHz at every concurrency level, so clocks say nothing about actual memory traffic. If anyone has bandwidth counters working on RDNA3, I’d like to hear how — that’s the piece I’m missing.
Code, raw results, logs, and the three rejected runs (including the -np 4 one): GitHub - Artkill24/costbench: Measured energy cost of on-prem LLM inference on AMD ROCm: 8.7× tokens-per-joule from batching, with a cost-governance gateway and agent built on the measurements. · GitHub — MIT.