tencent/HunyuanOCR
Original996.2Mparameters
Fixture9.1Mparameters
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.language_model.layers
Original · 24
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| DenseV1DecoderLayer | 24 | 2 | ✓ kept |
model.vision_tower.layers
Original · 27
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| VisionBlock | 27 | 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.language_model.layers | 415.3M | 41.7% | 74.0K | 0.8% |
| model.vision_tower.layers | 411.5M | 41.3% | 66.9K | 0.7% |
| model.language_model | 123.7M | 12.4% | 7.7M | 85.4% |
| model.vision_tower | 45.7M | 4.6% | 1.2M | 13.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | hunyuan_vl | hunyuan_vl | ✓ kept |
| model | tie_word_embeddings | True | True | ✓ kept |
| text_config | attention style | GQA (16 heads, 8 KV) | GQA (4 heads, 2 KV) | ✓ kept |
| text_config | RoPE type | dynamic | dynamic | ✓ kept |
| text_config | model_type | hunyuan_vl_text | hunyuan_vl_text | ✓ kept |
| text_config | vocab_size | 120818 | 120818 | ✓ kept |
| text_config | tie_word_embeddings | True | True | ✓ kept |
| text_config | hidden_act | silu | silu | ✓ kept |
| text_config | max_position_embeddings | 131072 | 131072 | ✓ kept |
| vision_config | attention style | MHA (16 heads, 16 KV) | MHA (4 heads, 4 KV) | ✓ kept |
| vision_config | model_type | hunyuan_vl_vision | hunyuan_vl_vision | ✓ kept |
| vision_config | hidden_act | gelu | gelu | ✓ kept |
| vision_config | patch_size | 16 | 16 | ✓ kept |
| vision_config | num_channels | 3 | 3 | ✓ kept |
Module classes
Instances of each class in the built model (prefix HunYuanVL omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 332 | 28 |
| RMSNorm | 99 | 11 |
| LayerNorm | 54 | 4 |
| GELUActivation | 28 | 3 |
| VisionAttention | 27 | 2 |
| VisionBlock | 27 | 2 |
| VisionMLP | 27 | 2 |
| DenseV1Attention | 24 | 2 |
| DenseV1DecoderLayer | 24 | 2 |
| MLP | 24 | 2 |
| SiLUActivation | 24 | 2 |
| Conv2d | 3 | 3 |
| Embedding | 2 | 2 |
| ModuleList | 2 | 2 |
| ForConditionalGeneration | 1 | 1 |
| Model | 1 | 1 |
| RotaryEmbedding | 1 | 1 |
| TextModel | 1 | 1 |
| VisionPatchEmbed | 1 | 1 |
| VisionPatchMerger | 1 | 1 |
| VisionTransformer | 1 | 1 |
Config changes
14 fields changed, 68 unchanged.
| Field | Original | Fixture |
|---|---|---|
| text_config.head_dim | 128 | 16 |
| text_config.hidden_size | 1024 | 64 |
| text_config.intermediate_size | 3584 | 128 |
| text_config.num_attention_heads | 16 | 4 |
| text_config.num_hidden_layers | 24 | 2 |
| text_config.num_key_value_heads | 8 | 2 |
| text_config.rope_parameters | {"alpha": 1000.0, "beta_fast": 32, "beta_slow": 1, "factor": 1.0, "mscale": 1… | {"alpha": 1000.0, "beta_fast": 32, "beta_slow": 1, "factor": 1.0, "mrope_sect… |
| vision_config.hidden_size | 1152 | 64 |
| vision_config.intermediate_size | 4304 | 128 |
| vision_config.num_attention_heads | 16 | 4 |
| vision_config.num_hidden_layers | 27 | 2 |
| vision_config.num_key_value_heads | 16 | 4 |
| vision_config.out_hidden_size | 1024 | 64 |
| vision_config.text_hidden_size | 1024 | 64 |