Octave KV: A Native 3-bit KV Cache for AMD GPUs in vLLM#

Octave KV: A Native 3-bit KV Cache for AMD GPUs in vLLM
December 04, 2026 by Miguel Ángel Hidalgo Mora, Doug Lehr.
14 min read. | 3343 total words.

Long-context serving on a GPU usually runs out of KV-cache memory long before it runs out of compute. Octave KV is a 3-bit KV cache for AMD GPUs, with native HIP kernels for AMD Radeon™ Graphics (RDNA™ 3 architecture, RX 7900 XTX) and Instinct™ GPUs (CDNA™ 3 architecture, MI300X). It is part of vLLM as the ROCM_OCTAVE attention backend (PR #59774, RFC #59773), and we (INCloud Solutions) have served it in production since October 2, 2026, in our in-house coding assistant for our developers, on three production servers with four RX 7900 XTX each (plus a fourth for development).

Octave KV lets each GPU hold several times more context. On four RX 7900 XTX GPUs with 8 GB of KV cache per GPU, the compact format holds 2.07M tokens where fp16 holds 446k (4.6×), and on one MI300X GPU the octave_k3v3 format holds 7.01M tokens against 3.60M for AITER’s fp8 cache. Quality stays where it was: GSM8K stays at fp16 level (92.4 against 91.8 for fp16 and 89.8 for TurboQuant), and at 380k tokens of context next-token NLL rises by only 0.0015 nats over fp16, 2.5× less than TurboQuant at the same size. Long-context decode also gets faster. Per layer at 380k tokens on RDNA3, decode is 4.6× faster than TurboQuant and MTP verification 11× faster. On MI300X, single-request decode matches AITER fp8 and is faster per layer from 32k tokens on (65 against 103 µs at 128k).

In this blog you will learn how the Octave KV format works, how its kernels use the AMD matrix units, and how we measured each number. You will also get the exact commands to reproduce the results and to try Octave KV on your own long-context workloads.

Why Another KV Cache Format#

We serve Qwen3.8-27B (W4A16) with tensor parallel 4 and MTP speculative decoding on boxes with four RX 7900 XTX, 96 GB in total. Our users send whole repositories, long documents and agent sessions that run for hours. With an fp16 KV cache and 8 GB per GPU for it, a box holds about 446k tokens, so a single long request fills it.

Below 8 bits, the options on ROCm were TurboQuant, UltraQuant (gfx950 only) and KVarN (CUDA-first). TurboQuant (vLLM’s TURBOQUANT backend, with ROCm support added by AMD engineers) gets the core idea right: a random rotation followed by a Lloyd-Max codebook. We started from it and built on top of it for our specific workload, long-context serving with MTP on RDNA3, where three things mattered most to us:

  • MTP verification that can be captured in CUDA graphs, with no host-device copies per layer.

  • A prefill that reads the packed cache directly instead of going through FlashAttention.

  • Kernels tuned by hand for the RDNA3 matrix units. With TurboQuant’s portable Triton kernels, generating the first output token for a 380k-token prompt took 621 s, against 371 s with fp16.

So Octave KV keeps TurboQuant’s idea, adds a few format changes, and pairs it with HIP kernels written for the matrix instructions of each architecture.

What Octave KV Adds on Top of TurboQuant#

The core idea is the same as TurboQuant’s: a random rotation and a Lloyd-Max codebook. The differences are in the format and in kernels designed around MTP and the AMD matrix units:

TurboQuant on ROCm

Octave KV

What it buys

Bits in K

the same width over the whole head (k3v4: K 3-bit, V 4-bit)

the 64 RoPE dims in their own block at 4 bits, the rest at 3

NLL stays flat as the context grows; TurboQuant’s grows

Scale

one fp16 norm per K vector; the _nc presets rescale the reconstruction to that norm (|x̂| = |x|)

norm-preserving: x · x̂ equals the squared norm of x

scores are not shrunk (x · x̂ = |x|², vs |x|² cos θ when keeping the norm); 2-3× less NLL at 380k than a least-squares scale

V quantization

not rotated; uniform 3- or 4-bit levels between the vector’s min and max (fp16 scale + zero point)

rotated like K (random signs + Walsh-Hadamard over the 256 dims); Lloyd-Max codebook at 3 or 4 bits; one norm-preserving fp16 scale

the same Gaussian codebook fits V; the V scale folds into the softmax probabilities, so PV runs on fp16 WMMA/MFMA straight from the codes; one fp16 per vector instead of two

Prefill

goes through FlashAttention

reads the packed cache directly, like decode

no expanded copy of the prefix: 30% faster prefill chunk at 380k

MTP verification

a multi-token path with host-device copies per layer

the query tokens of a request share every K/V read

4 tokens cost about as much as 1: 11× faster

CUDA graphs

the multi-token path cannot be captured

metadata built on the device, no host syncs

the whole decode, MTP included, is captured

Codebook

generic Triton kernels

one v_perm_b32 per four codes, straight into int8 WMMA / MFMA

nothing expanded to fp16 in memory

Portability

Triton everywhere, slow on RDNA3

native HIP per architecture; refuses to start if a kernel is missing

no silent slow path

How the Format Works#

1. Rotate, Then Quantize#

The figure below shows the first step: each vector is rotated, then each coordinate is mapped to one of eight codebook levels.

Rotate, then quantize

Each (token, KV head) vector is stored as one packed slot. Before quantizing, we flip its signs at random and apply a Walsh-Hadamard transform. After this rotation the coordinates are close to Gaussian whatever the model, so one fixed codebook fits every model: the 8-level Lloyd-Max codebook of N(0, 1). There is no calibration and there are no per-model tables. Three bits give eight levels, one octave, which is where the name comes from.

2. The Scale That Keeps Long Context Sharp#

The figure below compares the projection-preserving scale with a least-squares scale.

The projection-preserving scale

Each vector gets one scale (four on the blocked K layout, one per 64-dim block). We pick it so that the reconstruction keeps the dot product with the original, x · x̂ = |x|².

We started with the usual least-squares scale, and it was clearly worse. It shrinks every vector by about 3%, which makes the attention softmax a little flatter. Over hundreds of thousands of tokens that adds up: next-token NLL at 380k came out 2-3× higher than with the norm-preserving scale.

3. 196 Bytes per Token per KV Head#

As you can see in the figure below, the compact format packs one token’s K and V for one KV head into 196 bytes.

196 bytes per token per KV head

For head size 256 there are three formats. They differ only in how K is stored:

Cache dtype

K

V

Bytes per slot

Bits per value

octave_k3v3_compact

whole head rotated, 3-bit

3-bit

196

3.06

octave_k3v3

4 blocks of 64: RoPE block 4-bit, the rest 3-bit

3-bit

216

3.38

octave_k3v4

as above

4-bit

248

3.88

An fp16 slot is 1024 bytes, so the compact format is 5.2× smaller. The measured capacity grows a little less than the byte ratio, because the recurrent state of the model’s Gated DeltaNet layers has a fixed size per request and does not shrink with the KV-cache format. For reference, turboquant_3bit_nc uses 198 bytes and turboquant_k3v4_nc 230.

The blocked formats exploit partial rotary embeddings. In the Qwen3-Next / Qwen3.5 / 3.6 / 3.8 family only 64 of the 256 head dims carry RoPE, so the first K block holds exactly those dims and gets one extra bit.

How the Kernels Use the Hardware#

Most of the speed does not come from the format. It comes from writing each kernel for what the GPU does well, instead of going through a generic compiler.

The Codebook Costs One Instruction#

The figure below shows how the packed codes go from memory to the matrix units with a single lookup instruction.

The codebook costs one instruction

Each code is an index into an eight-entry table. One v_perm_b32 turns four packed codes into four int8 codebook values. The products then run on the matrix units straight from those values: WMMA on Radeon, MFMA on Instinct. Nothing is expanded to fp16 in memory; the cache stays packed until it is in registers.

  • RDNA3 prefill: QK is an int8 WMMA, with one scale per 64-dim block applied afterwards. Eight loader waves unpack 16-token tiles into double-buffered LDS one tile ahead of sixteen compute waves.

  • RDNA3 decode: the values go into an fp16 WMMA with a constant offset that is removed in the softmax. PV uses fp16 WMMA with the V scale folded into the probabilities.

  • MI300X:

    • QK runs on v_mfma_i32_16x16x32_i8, with the query split into high and low int8 halves.

    • V is widened to fp16 by a single v_perm that turns each codebook byte into an exact fp16 denormal, which the MI300 MFMA keeps.

    • The decode keeps its accumulators in VGPRs, so it runs two waves per SIMD.

Made for MTP#

The figure below shows how the query tokens of one MTP verification step share every K/V read.

Made for MTP

With speculative decoding, each step verifies several tokens of the same request (four with MTP k=3). In Octave KV those query tokens share every K/V tile they read, so verifying four tokens costs almost the same as decoding one. The metadata is built on the device with no host synchronization, and the whole decode path, MTP included, is captured in CUDA graphs.

Methodology#

Hardware and model.

  • RDNA3: 4× RX 7900 XTX (gfx1100), TP4, with 8 GB of KV cache per GPU, --max-num-seqs 6, --max-num-batched-tokens 2048 and CUDA graphs on.

  • MI300X: one MI300X (gfx942), TP1, fp16 activations, MTP k=3, --max-model-len 131072.

  • Model: Qwen3.8-27B, W4A16 (compressed-tensors, int4, group 32), an internal checkpoint that produced every table in this post, on both RDNA3 and MI300X. To reproduce the results, use cyankiwi/Qwen3.8-27B-AWQ-INT4, a public checkpoint with the same scheme and architecture; KV token counts will differ slightly.

Only the cache dtype changes between rows of a table. On RDNA3, the fp16 rows use vLLM’s TRITON_ATTN backend, which vLLM picks automatically on gfx1100 (on newer vLLM builds, pin it with --attention-backend TRITON_ATTN). The TurboQuant rows use the TURBOQUANT backend and the Octave KV rows ROCM_OCTAVE; both are selected by the cache dtype.

Evaluations.

  • Capacity: the KV-cache size in tokens that vLLM reports at startup.

  • GSM8K: tests/evals/gsm8k/gsm8k_eval.py through the chat endpoint, thinking off, temperature 0.6.

    • RDNA3: run without MTP for every row. The run-to-run noise is about ±1.2 points.

    • MI300X: with MTP.

  • Long-context quality: next-token NLL over a single 380k-token document, reported as the increase over fp16.

  • Retrieval (NIAH):

    • The haystack is vLLM’s own Python source, cut at 32k, 64k and 126k tokens.

    • It holds 16 look-alike keys (# PROJECT KEY Aldebaran: WK3DEGZD).

    • The model is asked for each key’s value, thinking off.

  • Kernel speed: benchmarks/attention_benchmarks. On RDNA3, with 6 query heads and 1 KV head, i.e. one TP4 shard of the model. On MI300X, with 24 query heads and 4 KV heads, i.e. the whole model on one GPU (TP1), with CUDA graphs.

  • End-to-end speed: vllm bench serve with random prompts, --ignore-eos and no prefix reuse.

Correctness.

  • Every kernel is tested against a PyTorch reference that defines the byte layout (tests/kernels/attention/test_rocm_octave.py). The tests cover:

    • store, decode and prefill for all three formats;

    • 1 and 4 query tokens;

    • 1 to 256 KV splits;

    • fp16 and bf16.

  • To check that the tests can fail, we broke the kernels on purpose several times: a wrong codebook, a least-squares scale, a missing query debias. Each time the relevant tests failed.

Results on RDNA3#

Capacity and Quality#

KV cache

Bytes

KV tokens

GSM8K

NLL over fp16 at 380k

fp16, TRITON_ATTN

1024

445,825

91.8

—

turboquant_k3v4_nc

230

1,790,625

89.8

+0.00155

turboquant_3bit_nc

198

2,053,571

—

+0.00368

octave_k3v4

248

1,678,832

91.4

+0.00086

octave_k3v3

216

1,897,520

92.4

+0.00125

octave_k3v3_compact

196

2,068,468

91.8

+0.00150

GSM8K cannot tell Octave KV from fp16; NLL is where the formats separate. At about 200 bytes per slot, the compact format loses 2.5× less than turboquant_3bit_nc (+0.00150 against +0.00368), about what turboquant_k3v4_nc loses with 34 more bytes. The blocked formats also stay flat as the context grows, while TurboQuant’s error grows with it.

Speed#

Attention per layer at 380k tokens of context, one TP4 shard:

fp16

turboquant_k3v4_nc

octave_k3v3_compact

octave_k3v3

decode, 1 token

2370 µs

2565 µs

563 µs

614 µs

MTP verify, 4 tokens

48.8 ms

6.65 ms

0.58 ms

0.62 ms

prefill, 2048-token chunk

125.6 ms

86.6 ms

60.8 ms

63.9 ms

fp16 is vLLM’s TRITON_ATTN backend, which splits the KV only for single-token decode; its multi-token path is not optimized for long context.

Time to first token, end to end with MTP and a cold prefix:

fp16

turboquant_k3v4_nc

octave_k3v3_compact

octave_k3v3

100k

61.5 s

59.9 s

57.2 s

56.7 s

380k

371 s

621 s

297 s

300 s

At 100k all backends are within 8% of each other, because the model’s GEMMs and the all-reduce dominate. At 380k, decode with MTP runs at 152 tok/s with octave_k3v3_compact, against 2.7 tok/s with fp16 on TRITON_ATTN, whose multi-token path does not split the context.

In production this is what changed: going from 128k to 512k tokens of context, four times longer, only takes decode from 153 to 127 tok/s. A box that held one long request now serves about four at 512k.

Results on MI300X#

The same format and the same model run on Instinct, with kernels written for the CDNA3 MFMA instructions, as the figure below summarizes.

From Radeon to Instinct

KV cache

KV tokens

GSM8K

NIAH

Decode at 126k

TPOT 1 user, 8k / 32k / 100k

TTFT 100k

16 users, 8k

octave_k3v3

7,014,973

98.0

28/28

52 tok/s

15 / 18 / 16 ms

20.2 s

221 tok/s

octave_k3v4

6,391,547

97.5

28/28

52 tok/s

15 / 15 / 19 ms

20.2 s

226 tok/s

octave_k3v3_compact

7,446,005

97.0

28/28

50 tok/s

16 / 18 / 16 ms

20.1 s

211 tok/s

fp8, ROCM_AITER_FA

3,597,048

97.0

28/28

50 tok/s

15 / 17 / 16 ms

18.6 s

235 tok/s

fp16, ROCM_ATTN

1,952,899

97.0

28/28

6 tok/s

22 / 45 / 108 ms

23.1 s

120 tok/s

On one MI300X, Octave KV holds about twice the tokens of AITER’s fp8 cache (53 against 27 concurrent 128k requests) at the same single-request speed. Per layer, decode is faster than AITER fp8 from 32k on (65 against 103 µs at 128k, with 24 query heads and 4 KV heads, TP1).

AITER is still ahead with 16 concurrent users and in time to first token at 100k. That points at our prefill over a cached prefix, which is the next thing to improve.

The fp8 row is forced with --attention-backend ROCM_AITER_FA. With only VLLM_ROCM_USE_AITER=1, vLLM picks ROCM_ATTN.

How to Try It#

Octave KV is selected with the cache dtype:

vllm serve cyankiwi/Qwen3.8-27B-AWQ-INT4 \
  --kv-cache-dtype octave_k3v3 \
  --tensor-parallel-size 4

octave_k3v3_compact gives the most tokens and octave_k3v4 the lowest NLL.

Requirements:

  • GPU: gfx1100 (RDNA3) or gfx942 (MI300X). On other GPUs the backend refuses to start and says which kernel is missing, instead of silently falling back to a slow path.

  • Model: head size 256 with 64 rotary dims, i.e. the Qwen3-Next and Qwen3.5 / 3.6 / 3.8 family. Models with full RoPE or other head sizes are rejected at startup.

  • GQA: up to 8 query heads per KV head on each GPU.

Reproducing the MI300X Numbers#

These are the commands behind the MI300X table, with the public checkpoint. Any vLLM build that includes PR #59774 (merged on October 26, 2026) has the backend; we ran on a rocm/vllm-dev image with ROCm 7.2. With the public checkpoint and octave_k3v3, vLLM reports 7,114,588 KV tokens (54 concurrent 128k requests), close to the 7.01M in the table.

1. Serve. Only --kv-cache-dtype changes between rows. Drop it for the fp16 row, and for the fp8 row use --kv-cache-dtype fp8 --attention-backend ROCM_AITER_FA with VLLM_ROCM_USE_AITER=1.

vllm serve cyankiwi/Qwen3.8-27B-AWQ-INT4 \
  --served-model-name Qwen3.8-27B --port 8000 \
  --kv-cache-dtype octave_k3v3 --dtype float16 \
  --max-model-len 131072 --gpu-memory-utilization 0.90 \
  --reasoning-parser qwen3 --enable-prefix-caching --max-num-seqs 64 \
  --speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
  --override-generation-config '{"temperature":0.6,"top_p":0.95,"top_k":20,"min_p":0.0}'

The KV capacity is the GPU KV cache size line that vLLM prints at startup.

2. GSM8K (chat, thinking off):

python3 tests/evals/gsm8k/gsm8k_eval.py --port 8000 --use-chat-completions \
  --max-tokens 2048 --temperature 0.6 \
  --chat-template-kwargs '{"enable_thinking": false}'

3. Serving speed (random prompts, 512 output tokens, no prefix reuse). One user at 8k, 32k and 100k, then 16 users at 8k:

for spec in "8000 1 6" "32000 1 4" "100000 1 3" "8000 16 64"; do
  set -- $spec
  vllm bench serve --backend vllm --model Qwen3.8-27B \
    --tokenizer cyankiwi/Qwen3.8-27B-AWQ-INT4 --port 8000 \
    --dataset-name random --random-input-len $1 --random-output-len 512 \
    --ignore-eos --max-concurrency $2 --num-prompts $3 --seed 0
done

4. Attention per layer (the whole model on one GPU, TP1: 24 query heads, 4 KV heads, head size 256, with CUDA graphs). The batch specs read as <requests>q<query tokens>s<context>:

python benchmarks/attention_benchmarks/benchmark.py \
  --backends ROCM_OCTAVE --kv-cache-dtype octave_k3v3 \
  --model Qwen/Qwen3.5-27B --head-dim 256 --num-q-heads 24 --num-kv-heads 4 \
  --cuda-graphs --batch-specs q1s8k q1s32k q1s128k 16q1s32k 64q1s8k q4s32k 2q2ks8k

For the AITER row, use --backends ROCM_AITER_FA --kv-cache-dtype fp8.

5. NIAH. niah_octave.py builds the haystack from a vLLM checkout’s Python sources, inserts the 16 keys and asks for each one with thinking off. It is a single file with no dependencies and reads the model name from the server. Use the same vLLM checkout for every row, because the haystack depends on it:

python niah_octave.py --vllm-src /path/to/vllm --out niah_octave_k3v3.jsonl

Summary#

In this blog you explored Octave KV, a native 3-bit KV cache for AMD GPUs that is now part of vLLM as the ROCM_OCTAVE attention backend. You saw how a random rotation, a fixed Lloyd-Max codebook and a norm-preserving scale keep quality at fp16 level in under 200 bytes per token per KV head. You also saw how HIP kernels written for the WMMA and MFMA matrix units turn that format into faster long-context decode and MTP verification. On four RX 7900 XTX graphics the compact format holds 4.6× more tokens than fp16, and on one MI300X it holds about twice as many as AITER’s fp8 cache at the same single-request speed. The capacity gain is a ratio of bytes, so it holds on every card, from a 24 GB Radeon to a 192 GB Instinct. You can try it today by setting --kv-cache-dtype on any vLLM build that includes PR #59774.

We want every ROCm user to have a compressed KV cache without writing their own kernels, and the work continues. Next, we plan to bring Octave KV to more architectures, starting with RDNA4 and gfx950 (MI355X); the design document (docs/design/rocm_octave.md) lists what each architecture has to implement. We also plan to support head size 128, which would open the format to more model families, and to speed up prefill over a cached prefix on MI300X to close the gap with AITER in time to first token. Stay tuned to ROCm Blogs for follow-up posts as this work lands.

Disclaimers#

The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions, and typographical errors. The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap changes, component and motherboard version changes, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. Any computer system has risks of security vulnerabilities that cannot be completely prevented or mitigated. AMD assumes no obligation to update or otherwise correct or revise this information. However, AMD reserves the right to revise this information and to make changes from time to time to the content hereof without obligation of AMD to notify any person of such revisions or changes. THIS INFORMATION IS PROVIDED ‘AS IS.” AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY INACCURACIES, ERRORS, OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION. AMD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE LIABLE TO ANY PERSON FOR ANY RELIANCE, DIRECT, INDIRECT, SPECIAL, OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. AMD, the AMD Arrow logo, AMD Instinct, Radeon, RDNA, CDNA, ROCm, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies. © 2026 Advanced Micro Devices, Inc. All rights reserved