Skip to main content

KVLayerSpec

One decoder layer's storage row: Kind says WHAT it stores, Layout says HOW a token-indexed row is laid out.

conv_states (property)​

(self) -> list[clika_runtime._core.nn.KVLayerSpec.ConvState]

head_dim (property)​

(self) -> int

k_scale (property)​

(self) -> float | None

kind (property)​

(self) -> clika_runtime._core.nn.KVLayerSpec.Kind

kv_heads (property)​

(self) -> int

layout (property)​

(self) -> clika_runtime._core.nn.KVLayerSpec.Layout

preallocate (property)​

(self) -> bool

recurrent_state (property)​

(self) -> clika_runtime._core.nn.KVLayerSpec.RecurrentState | None

v_head_dim (property)​

(self) -> int

v_scale (property)​

(self) -> float | None

window (property)​

(self) -> int

ConvState​

ConvState(*args, **kwargs)

One short-conv rolling window: dim channels by width taps.

Kind​

Kind(*values)

WHAT a cache layer holds: token-indexed attention keys and values (AttentionKV, CrossAttentionKV) or a per-slot state slab (ConvState, RecurrentState, HybridState).

Layout​

Layout(*values)

HOW a token-indexed row is laid out (Auto follows the cache's mode); ignored by the state kinds, whose slabs are slot-resident either way.

RecurrentState​

RecurrentState(*args, **kwargs)

The recurrent slab geometry, per slot [heads, k_dim, v_dim].

__init__​

__init____init__(self, *, kind: clika_runtime._core.nn.KVLayerSpec.Kind = Kind.AttentionKV, layout: clika_runtime._core.nn.KVLayerSpec.Layout = Layout.Auto, kv_heads: int = 0, head_dim: int = 0, v_head_dim: int = 0, window: int = 0, preallocate: bool = False, k_scale: float | None = None, v_scale: float | None = None, conv_states: collections.abc.Sequence[clika_runtime._core.nn.KVLayerSpec.ConvState] = [], recurrent_state: clika_runtime._core.nn.KVLayerSpec.RecurrentState | None = None) -> None

init(self, *, kind: clika_runtime._core.nn.KVLayerSpec.Kind = Kind.AttentionKV, layout: clika_runtime._core.nn.KVLayerSpec.Layout = Layout.Auto, kv_heads: int = 0, head_dim: int = 0, v_head_dim: int = 0, window: int = 0, preallocate: bool = False, k_scale: float | None = None, v_scale: float | None = None, conv_states: collections.abc.Sequence[clika_runtime._core.nn.KVLayerSpec.ConvState] = [], recurrent_state: clika_runtime._core.nn.KVLayerSpec.RecurrentState | None = None) -> None

Zero geometry fields inherit the cache config's defaults; window > 0 makes a sliding row; the state fields serve the state kinds.