---
title: "ClikaRT::nn::KVCacheFootprint"
sidebar_label: "KVCacheFootprint"
description: "What KVCache::make allocates for a composition, by storage class, and the two figures a serving stack budgets beside them."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--struct">struct</span>

**Header:** `ClikaRT/nn/kv_cache.h`

What [`KVCache::make`](./KVCache.md#make) allocates for a composition, by storage class, and the two figures a serving stack budgets beside them. Every device figure is the bytes the construction allocates for that class, read off the same per-row plan the cache builds its storage from (one law, never a second estimate); [`device_bytes_at_make()`](./KVCacheFootprint.md#device_bytes_at_make) is their sum. A serving stack sizes its pool against [`device_bytes_at_steady_state()`](./KVCacheFootprint.md#device_bytes_at_steady_state) plus [`snapshot_host_budget_bytes`](./KVCacheFootprint.md#snapshot_host_budget_bytes) on the host.

## Member functions

### device\_bytes\_at\_make() {#device_bytes_at_make}

<div class="api-signature">

`std::uint64_t` **`device_bytes_at_make`**() `const noexcept`

</div>

Every device byte `make` allocates.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 437

</div>

### device\_bytes\_at\_steady\_state() {#device_bytes_at_steady_state}

<div class="api-signature">

`std::uint64_t` **`device_bytes_at_steady_state`**() `const noexcept`

</div>

The device bytes a serving cache settles at: grow-on-demand rows at their ceiling, the checkpoint shadows allocated.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 442

</div>

## Data members

### continuous\_bytes {#continuous_bytes}

<div class="api-signature">

`std::uint64_t` **`continuous_bytes`** `= 0`

</div>

Continuous full-attention rows (`CrossAttentionKV` included): both planes at their construction depth, the full `max_tokens_per_seq` under `preallocate`, a small seed on a grow-on-demand row; with each per-token side's scale plane and the row's per-slot length vector.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 405

</div>

### continuous\_ceiling\_bytes {#continuous_ceiling_bytes}

<div class="api-signature">

`std::uint64_t` **`continuous_ceiling_bytes`** `= 0`

</div>

The same rows at their full depth: what a grow-on-demand row reaches as its slots fill. Equal to [`continuous_bytes`](./KVCacheFootprint.md#continuous_bytes) when every continuous row preallocates.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 409

</div>

### windowed\_bytes {#windowed_bytes}

<div class="api-signature">

`std::uint64_t` **`windowed_bytes`** `= 0`

</div>

Windowed rows: a continuous ring's planes (window-deep) and a windowed paged row's own pools and block table, one per distinct window value, provisioned outside [`PagedParams::num_blocks`](./PagedParams.md#num_blocks).

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 413

</div>

### paged\_bytes {#paged_bytes}

<div class="api-signature">

`std::uint64_t` **`paged_bytes`** `= 0`

</div>

The full-attention paged rows: every geometry group's pool planes over [`PagedParams::num_blocks`](./PagedParams.md#num_blocks) blocks (a per-token side's scale planes included) and the shared block table.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 417

</div>

### paged\_block\_bytes {#paged_block_bytes}

<div class="api-signature">

`std::uint64_t` **`paged_block_bytes`** `= 0`

</div>

The bytes one block of the full-attention paged rows costs: every geometry group's pool planes for a single block, a per-token side's scale planes included; the unit a pool planner converts a byte budget into blocks with. [`paged_bytes`](./KVCacheFootprint.md#paged_bytes) is [`PagedParams::num_blocks`](./PagedParams.md#num_blocks) of these plus the shared block table. Zero when no full-attention row is paged.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 423

</div>

### state\_bytes {#state_bytes}

<div class="api-signature">

`std::uint64_t` **`state_bytes`** `= 0`

</div>

The state rows' conv window slabs and recurrent slabs.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 425

</div>

### shadow\_bytes {#shadow_bytes}

<div class="api-signature">

`std::uint64_t` **`shadow_bytes`** `= 0`

</div>

The state rows' boundary-checkpoint shadows: the state slabs once more, allocated at a slot's first block-boundary checkpoint on a cache that carries paged rows (the prefix-adoption leg). Zero when no row is paged.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 430

</div>

### snapshot\_host\_budget\_bytes {#snapshot_host_budget_bytes}

<div class="api-signature">

`std::uint64_t` **`snapshot_host_budget_bytes`** `= 0`

</div>

HOST memory: the ceiling of the retired-state snapshot store a cache with state rows beside paged rows fills as sessions retire at block boundaries. Zero otherwise.

<div class="api-declared">

Declared in `ClikaRT/nn/kv_cache.h`, line 434

</div>
