ibm-granite/granite-docling-258M
Original257.5Mparameters
Fixture6.7Mparameters
Layer stacks2compared
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.vision_model.encoder.layers
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| EncoderLayer | 12 | 2 | ✓ kept |
model.text_model.layers
Original · 30
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| LlamaDecoderLayer | 30 | 2 | ✓ 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
| Component | Original | Share | Fixture | Share |
|---|---|---|---|---|
| model.text_model.layers | 106.2M | 41.2% | 74.0K | 1.1% |
| model.vision_model.encoder.layers | 85.1M | 33.0% | 66.9K | 1.0% |
| model.text_model | 57.8M | 22.4% | 6.4M | 95.2% |
| model.connector | 7.1M | 2.7% | 65.5K | 1.0% |
| model.vision_model | 1.4M | 0.5% | 114.9K | 1.7% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | idefics3 | idefics3 | ✓ kept |
| model | vocab_size | 100352 | 100352 | ✓ kept |
| model | tie_word_embeddings | True | True | ✓ kept |
| vision_config | model_type | idefics3_vision | idefics3_vision | ✓ kept |
| vision_config | hidden_act | gelu_pytorch_tanh | gelu_pytorch_tanh | ✓ kept |
| vision_config | image_size | 512 | 512 | ✓ kept |
| vision_config | patch_size | 16 | 16 | ✓ kept |
| vision_config | num_channels | 3 | 3 | ✓ kept |
| text_config | attention style | GQA (9 heads, 3 KV) | GQA (4 heads, 2 KV) | ✓ kept |
| text_config | RoPE type | default | default | ✓ kept |
| text_config | model_type | llama | llama | ✓ kept |
| text_config | vocab_size | 100352 | 100352 | ✓ kept |
| text_config | tie_word_embeddings | True | True | ✓ kept |
| text_config | hidden_act | silu | silu | ✓ kept |
| text_config | max_position_embeddings | 8192 | 8192 | ✓ kept |
Module classes
Instances of each class in the built model (prefix Idefics3 omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 284 | 28 |
| LlamaRMSNorm | 61 | 5 |
| LlamaAttention | 30 | 2 |
| LlamaDecoderLayer | 30 | 2 |
| LlamaMLP | 30 | 2 |
| SiLUActivation | 30 | 2 |
| LayerNorm | 25 | 5 |
| GELUTanh | 12 | 2 |
| EncoderLayer | 12 | 2 |
| VisionAttention | 12 | 2 |
| VisionMLP | 12 | 2 |
| Embedding | 2 | 2 |
| ModuleList | 2 | 2 |
| Conv2d | 1 | 1 |
| Connector | 1 | 1 |
| Encoder | 1 | 1 |
| ForConditionalGeneration | 1 | 1 |
| Model | 1 | 1 |
| SimpleMLP | 1 | 1 |
| VisionEmbeddings | 1 | 1 |
| VisionTransformer | 1 | 1 |
| LlamaModel | 1 | 1 |
| LlamaRotaryEmbedding | 1 | 1 |
Config changes
10 fields changed, 59 unchanged.
| Field | Original | Fixture |
|---|---|---|
| text_config.head_dim | 64 | 16 |
| text_config.hidden_size | 576 | 64 |
| text_config.intermediate_size | 1536 | 128 |
| text_config.num_attention_heads | 9 | 4 |
| text_config.num_hidden_layers | 30 | 2 |
| text_config.num_key_value_heads | 3 | 2 |
| vision_config.hidden_size | 768 | 64 |
| vision_config.intermediate_size | 3072 | 128 |
| vision_config.num_attention_heads | 12 | 4 |
| vision_config.num_hidden_layers | 12 | 2 |