phimoe¶
phimoe
¶
Phi-3.5-MoE (PhimoeForCausalLM).
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 norms are nn.LayerNorm. Every block's MLP is a sparse mixture of experts
that returns the routed hidden states as a bare tensor; the experts are
intermediate_size wide.
RENAME
module-attribute
¶
ENVOYS
module-attribute
¶
ENVOYS = {PhimoeDecoderLayer: Layer, PhimoeAttention: Attention, PhimoeSparseMoeBlock: Mlp}