Skip to main content

Module streamed_qsa

Module streamed_qsa 

Source
Expand description

Compatibility exports for the canonical Etalon Qwen engine.

Structs§

QsaState
Persistent cache for one QSA layer. Keys are RoPE-rotated before entry; indexer keys deliberately remain raw because pooling precedes its norm and positional rotation. Storage is supplied by the runtime owner.
StreamedQsaBuffers
Reused scratch for one QSA step. selected and scores are bounded by the caller-owned cache capacity; no logits or cache-sized heap object is created by the operator.

Enums§

StreamedQsaError

Constants§

QWEN4EXP_QSA_COMPRESS_RATIO
QWEN4EXP_QSA_HEAD_DIM
QSA is 24×256 GQA, separate from the GatedDeltaNet 48×128 geometry.
QWEN4EXP_QSA_INDEXER_HEADS
QWEN4EXP_QSA_INDEXER_HEAD_DIM
The lightweight indexer remains four 128-wide heads.
QWEN4EXP_QSA_KV_HEADS
QWEN4EXP_QSA_MAX_SELECTED
Maximum tokens reachable per step: token_topk block members plus the open group’s causal tail (ratio - 1), matching select_width.
QWEN4EXP_QSA_QUERY_HEADS
QWEN4EXP_QSA_ROTARY_DIM
Qwen4Exp rotates only the first 64 dims of each attention/indexer head (partial NeoX RoPE, qwen4exp.rope.dimension_count).
QWEN4EXP_QSA_TOP_BLOCKS
Complete blocks selectable per step (index_budget // index_ratio).
QWEN4EXP_QSA_TOP_K
Trained indexer budget in TOKENS (qwen4exp.attention.indexer.top_k = 2048): complete four-token blocks compete for TOP_K / COMPRESS_RATIO slots and the members of the still-open trailing group are always visible.

Functions§

execute_streamed_qsa
Execute one causal QSA decode step. rope_theta is explicit so the bounded operator cannot silently invent a positional encoding policy; the Qwen4Exp runtime passes the GGUF model value (10,000,000 for this model).