Expand description
Qwen3.8-27B authored in LOGOS.
The model is a hybrid: of its 64 layers, 48 are Gated DeltaNet (a fixed-size associative memory,
rewritten per token) and 16 are gated attention (a growing KV cache). full_attention_interval = 4 puts
the attention layers at indices 3, 7, 11 … 63. That 3:1 ratio is why the model caches only a quarter of
its depth, and it is what makes the checkpoint cheap to run relative to its parameter count.
gen_qwen38_lg emits the whole forward as a .lg program — the artifact the claim “authored in LOGOS”
rests on. Every line is ordinary LOGOS tensor sugar; nothing here is a compiler intrinsic. Following the
Qwen3-30B precedent the .lg is the SINGLE-TOKEN forward (KV caches declared one row deep), and the
generation harness is what grows the cache and replays the step.
Structs§
- Qwen38
Cfg - Everything the emitter needs, read from the checkpoint rather than assumed. Field names mirror the GGUF metadata keys so a mismatch is easy to spot.
Constants§
- QWEN38_
EXTRA_ KERNELS - The last two kernels the hybrid needs: an f32-weight GEMV for GDN’s tiny gate projections (quantizing a
[d, 48]matrix would risk the gates for a rounding error that buys 0.26% of bandwidth), a KV-cache store that splits the fused projection’s k and v halves into their caches, and the SwiGLU epilogue fused with the activation re-quantization so the FFN’s middle never round-trips through global memory as f32.
Functions§
- emit_
qwen38_ generate - Emit a self-contained CUDA program that generates from the real Qwen3.8-27B weights and reports throughput.
- emit_
qwen38_ mtp_ probe - Emit the MTP ACCEPT-RATE PROBE.
- gen_
qwen38_ decode_ batch_ embed_ lg - A batched decode step’s embedding lookups alone.
- gen_
qwen38_ decode_ batch_ head_ lg - A batched decode step’s head alone.
- gen_
qwen38_ decode_ batch_ layer_ lg - Layer
lof a batched decode step alone. - gen_
qwen38_ decode_ batch_ lg - B decode steps at once, each sequence with its own state. See
author::decode_batch. - gen_
qwen38_ decode_ batch_ tp_ layer_ lg - Layer
lof a batched tensor-parallel decode step alone. - gen_
qwen38_ decode_ batch_ tp_ lg - A batched decode step, tensor-parallel over
tpchips. Seeauthor::tp_decode_batch. - gen_
qwen38_ decode_ embed_ lg - A decode step’s embedding lookup alone.
- gen_
qwen38_ decode_ head_ lg - A decode step’s head alone: the final norm, the LM head and the arg-max.
- gen_
qwen38_ decode_ layer_ lg - Layer
lof a decode step alone, its attention reading a KV cache ofctxpositions up topos. - gen_
qwen38_ decode_ step_ lg - One decode step: token
tokat positionpos(1-based) in, the next token out, the KV caches and the Gated-DeltaNet state carried. Seeauthor::decode_step. - gen_
qwen38_ filled_ lg - The authored forward (
gen_qwen38_lg) with every declared tensor filled DETERMINISTICALLY right after its declaration (a hash of the element index salted by the tensor’s name, in (-0.2, 0.2)) and the first and last logit shown — the self-contained program the demo corpus (examples/rdu_demo/qwen38_tiny.lg) and the tier-agreement locks run without a weight file. Fills follow declarations because the weights are declared per block, interleaved with the compute that reads them. - gen_
qwen38_ head_ lg - The final norm and LM head alone.
- gen_
qwen38_ layer_ lg - Layer
lalone, as the forward writes it. - gen_
qwen38_ lg - The whole Qwen3.8 forward as a LOGOS program — the single token with no history — and its weight manifest.
- gen_
qwen38_ prefill_ head_ lg - A prefill chunk’s head alone.
- gen_
qwen38_ prefill_ layer_ lg - Layer
lof a prefill chunk ofchunkrows frompos0alone. - gen_
qwen38_ prefill_ lg - A prefill chunk of one sequence from position
pos0. Seeauthor::prefill. - gen_
qwen38_ tp_ decode_ layer_ lg - Layer
lof a tensor-parallel decode step alone. - gen_
qwen38_ tp_ decode_ step_ lg - A whole decode step, tensor-parallel over
tpchips. Seeauthor::tp_decode_step. - qwen38_
rope_ cache - The rotary cache for
rowspositions,rope_dim / 2pairs a row: rowp(1-based) holds the cosines and the sines of(p − 1)·θ^(−2i/rope_dim)— the anglesgk_qk_norm_rope_partturns 0-based positionp − 1by, over the rotary width — each computed in f64 and rounded once.