Expand description
Stable LatentMoE CPU reference.
latent = down_proj(h) // hidden → moe_latent (no pre-norm)
scores = sigmoid(router(h)); top-k on scores+bias // noaux_tc
y = Σ w_i expert_i(latent) // SiTU-GLU experts
y = RMSNorm(y) if latent_moe_use_norm; y = up_proj(y)
out = y + shared_experts(h) // shared stay full-widthStructs§
Functions§
- expert_
situ - One SiTU-GLU expert:
down( situ(w1 x, w3 x) ). Weights are[out, in]. - latent_
moe_ forward - Routed latent path + optional shared expert (identity-scale for tests).
- mix_
routed_ experts - Mix selected SiTU-GLU experts into latent. Empty
w1means packed-only (no host dequant) — CUDA grouped GEMM must have run instead. - moe_
from - sigmoid_
topk - noaux_tc: sigmoid(logits) for mix weights;
scores + biasonly ranks.