← MIC coverage of Transformers model types

microsoft/phi-2

huggingface-mic/phi-2-mic@af26f3c429a4 ← microsoft/phi-2@810d367871c1 · PhiForCausalLM · random weights

CI: no failure on main in 30 days · MIC failures dashboard

Original2.8Bparameters
Fixture6.7Mparameters
Layer stacks1compared
Findings0to review

✓ Same architecture, smaller

Every module class, layer kind and checked property of the original is in the fixture.

Layer stacks

One square per layer, colored by kind: the layer's module classes and type attributes. Hover a square for its index and kind.

model.layers

Original · 32
Fixture · 2
KindOriginalFixture
DecoderLayer322✓ kept

Where the parameters are

Share of each model's parameters per component. Vocabulary and patch sizes are kept, so embeddings usually take a larger share of the fixture.

Original
Fixture
ComponentOriginalShareFixtureShare
model.layers2.5B90.6%66.7K1.0%
lm_head131.1M4.7%3.3M49.9%
model.embed_tokens131.1M4.7%3.3M49.1%
model.final_layernorm5.1K0.0%1280.0%

Preserved properties

ConfigPropertyOriginalFixture
modelattention styleMHA (32 heads, 32 KV)MHA (4 heads, 4 KV)✓ kept
modelRoPE typedefaultdefault✓ kept
modelmodel_typephiphi✓ kept
modelvocab_size5120051200✓ kept
modeltie_word_embeddingsFalseFalse✓ kept
modelhidden_actgelu_newgelu_new✓ kept
modelmax_position_embeddings20482048✓ kept

Module classes

Instances of each class in the built model (prefix Phi omitted).

ClassOriginalFixture
Linear19313
Dropout333
LayerNorm333
NewGELUActivation322
Attention322
DecoderLayer322
MLP322
Embedding11
ModuleList11
ForCausalLM11
Model11
RotaryEmbedding11

Config changes

5 fields changed, 24 unchanged.

FieldOriginalFixture
hidden_size256064
intermediate_size10240128
num_attention_heads324
num_hidden_layers322
num_key_value_heads324