olmoe¶
olmoe
¶
OLMoE (OlmoeForCausalLM).
Llama's tree and Llama's block: model.{embed_tokens, layers[i].{input_layernorm,
self_attn, post_attention_layernorm, mlp}, norm} and lm_head, the residual
added in the block, attention through the shared eager forward. The attention
norms its queries and keys (q_norm, k_norm) across all heads before the
rotary embedding, and optionally clamps them (clip_qkv); both happen before
the interface call, so the queries and keys are read after them. Every MLP is a
sparse mixture of experts that returns the routed hidden states as a bare tensor;
its experts are intermediate_size wide.