Skip to content

phi3

phi3

Phi-3 / 3.5 / 4 (Phi3ForCausalLM).

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. Queries, keys and values are indexed out of one fused qkv_proj.

RENAME module-attribute

RENAME = {'model.embed_tokens': 'embed_tokens', 'model.layers': 'layers', 'model.norm': 'norm', 'activation_fn': 'act_fn'}

ENVOYS module-attribute

ENVOYS = {Phi3DecoderLayer: Layer, Phi3Attention: Attention, Phi3MLP: Mlp}