Expand description
Block AttnRes CPU reference.
Each sublayer mixes a learned softmax over completed block residuals plus the current intra-block partial sum (Moonshot Block AttnRes):
K_i = RMSNorm(V_i)
α = softmax_i( q · K_i )
h = Σ α_i V_iq is the per-layer *_res_proj row. Mix=0 is the identity skip (return
the partial / skip source). Mix=1 is the full softmax mixture.
Structs§
- Attn
ResHub - Stream map keyed by hidden/residual pointer bits (
DevicePtr.0). Layer 0 inserts; last layerremoves on success. AnyErrdrops the entry (umbrella940bd4eeb).
Functions§
- attnres_
blend - Test / ablation lever:
mix=0returnsskip;mix=1returnsmixed. - attnres_
mix - Apply AttnRes with an explicit mix lever.
mix=0is identity skip. - attnres_
softmax_ mix - Softmax mixture over residual sources.
sources[0]is conventionally the skip (current partial block).queryis[hidden](*_res_proj). - rms_
norm - Vanilla RMSNorm:
x * w / sqrt(mean(x^2) + eps).