Last updated: 2026-11-17

Inference Runtime

KV Storage

All API Sections

Storage accounting for the opt-in ROCm Qwen KV cache.

Computes checked allocation sizes for F32 rows and independently scaled 32-value Q8 blocks. Cache storage is independent of GGUF weight quantization.

1 exports 3 methods src/compute/kv_storage.zig

1 exports shown

enum

Format

#
pub const Format = enum

No public doc comment yet.

src/compute/kv_storage.zig:8

Methods

3

method

Format.rowBytes

#
pub fn rowBytes(self: Format, dimensions: u32) !usize

Checked bytes per token's K or V row, including Q8 scales.

src/compute/kv_storage.zig:19

method

Format.bytes

#
pub fn bytes(self: Format, tokens: usize, dimensions: u32) !usize

Checked size or row offset; zero tokens produces offset zero.

src/compute/kv_storage.zig:29