diff --git a/README.md b/README.md index 3ad872e999da0a733a1440a4b9c7f0d5947974b9..de40fc1eaf2130d15d4ada2faaaaceb197154652 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,22 @@ --- -title: Model Architectures -emoji: 👀 -colorFrom: pink -colorTo: purple +title: Transformers Model Architectures +emoji: 📐 +colorFrom: indigo +colorTo: blue sdk: static pinned: false +license: apache-2.0 --- -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +# 🤗 Transformers — Model Architecture Gallery + +Static, dependency-free architecture diagrams for every model in +[`huggingface/transformers`](https://github.com/huggingface/transformers), generated by +introspecting each model built on the `meta` device (no weights, no network). + +- **full** view — the decoder/encoder block decomposed top-to-bottom (attention or SSM mixer, + Q/K/V/O projections with real dims, norms, MLP / Sparse MoE, residual stream, mask grids). +- **diff** view — for models with a `modular_*.py`, what each model overrides / adds / removes + versus the parent it inherits from. + +Open `index.html` for the browsable gallery. diff --git a/afmoe.diff.svg b/afmoe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..eef5311518623fe21657e4aa44070e48b7c7ac7b --- /dev/null +++ b/afmoe.diff.svg @@ -0,0 +1,223 @@ + + + + +afmoe +diff vs llama (+qwen2_moe,gpt_oss) · 7 overridden · 21 added · 0 deleted · 5 new · 4 inherited-as-is + +AfmoeModel · base model +32 × AfmoeDecoderLayerAfmoeDecoderLayer× 32 +AfmoeForCausalLM · task head +layers (idx) +Self-Attention · AfmoeAttention (2 layer types — same modules, mask differs) +Sparse MoE · LlamaMLP ↩ inheritedMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [200192 × 2048] → [1, 6, 2048] +AfmoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +q_norm: AfmoeRMSNorm 128q_norm RMSNorm 128 +k_norm: AfmoeRMSNorm 128k_norm RMSNorm 128 +gate_proj: Linear [2048→2048]gate_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +AfmoeRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→6144]gate_proj [2048→6144] +up_proj: Linear [2048→6144]up_proj [2048→6144] +down_proj: Linear [6144→2048]down_proj [6144→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +AfmoeForCausalLMLM HeadLinear [2048→200192] +Softmax +logits[1, 6, 200192] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 + +model id +arcee-ai/Trinity-Mini +parent +llama +classes +11 +overridden +7 +added +21 +new classes +5 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +AfmoeAttention +ovr __init__,forward + +AfmoeForCausalLM +ovr __init__,forward; 3 attr + +AfmoeDecoderLayer +add __init__,forward + +AfmoeModel +add __init__,forward + +AfmoePreTrainedModel +add _init_weights; 12 attr + +AfmoeSparseMoeBlock +add __init__,forward + +AfmoeTokenChoiceRouter +add __init__,forward + \ No newline at end of file diff --git a/afmoe.svg b/afmoe.svg new file mode 100644 index 0000000000000000000000000000000000000000..b0fbc17f303858d7d92f82cf02a0ea040d97da41 --- /dev/null +++ b/afmoe.svg @@ -0,0 +1,225 @@ + + + + +afmoe +sparse-moe · 24× sliding +MoE + 8× full +MoE + +AfmoeModel · base model +32 × AfmoeDecoderLayerAfmoeDecoderLayer× 32 +AfmoeForCausalLM · task head +layers (idx) +Self-Attention · AfmoeAttention (2 layer types — same modules, mask differs) +Sparse MoE · AfmoeMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [200192 × 2048] → [1, 6, 2048] +AfmoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +q_norm: AfmoeRMSNorm 128q_norm RMSNorm 128 +k_norm: AfmoeRMSNorm 128k_norm RMSNorm 128 +gate_proj: Linear [2048→2048]gate_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +AfmoeRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→6144]gate_proj [2048→6144] +up_proj: Linear [2048→6144]up_proj [2048→6144] +down_proj: Linear [6144→2048]down_proj [6144→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +AfmoeForCausalLMLM HeadLinear [2048→200192] +Softmax +logits[1, 6, 200192] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 + +model id +arcee-ai/Trinity-Mini +model_type +afmoe +config +AfmoeConfig +decoder +sparse-moe +layers +32 +hidden +2,048 +intermediate +6,144 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +200,192 +max_pos +16,384 +sliding_window +1,024 +experts (top-k) +64 (top-6) +tie_embeddings +False +legend + +self-attention + +sliding + +full + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/aimv2.diff.svg b/aimv2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..8155968e44bd9522978ff413f53921431b2a067e --- /dev/null +++ b/aimv2.diff.svg @@ -0,0 +1,219 @@ + + + + +aimv2 +diff vs siglip (+clip,llama) · 3 overridden · 62 added · 0 deleted · 9 new · 5 inherited-as-is + +Aimv2Model · base model +12 × Aimv2EncoderLayerAimv2EncoderLayer× 12 +image ⊕ text attention +Vision encoder · Aimv2VisionM…×24 +Self-Attention · Aimv2Attention +Aimv2EncoderLayer×24 +MLP · SiglipMLP ↩ inherited +attention · Aimv2Attention +ffn · SiglipMLP ↩ inherited + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [49408 × 768] → [1, 6, 768] +Aimv2RMSNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention6 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +Aimv2RMSNormpre-FFN [1, 6, 768] +gate_proj: Linear [768→2048]gate_proj [768→2048] +up_proj: Linear [768→2048]up_proj [768→2048] +down_proj: Linear [2048→768]down_proj [2048→768] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 768] +LM HeadLinear [768→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +gate_proj: Linear [1024→2816]gate_proj [1024→2816] +up_proj: Linear [1024→2816]up_proj [1024→2816] +down_proj: Linear [2816→1024]down_proj [2816→1024] +act_fn: SiLUActivationact_fn SiLU +rms_norm1: Aimv2RMSNorm 1024rms_norm1 RMSNorm 1024 +rms_norm2: Aimv2RMSNorm 1024rms_norm2 RMSNorm 1024 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +apple/aimv2-large-patch14-224- +parent +siglip +classes +16 +overridden +3 +added +62 +new classes +9 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Aimv2Attention +ovr __init__ + +Aimv2AttentionPoolingHead +add __init__,forward + +Aimv2Config +3 attr + +Aimv2EncoderLayer +add __init__,forward + +Aimv2Model +ovr __init__,forward; 1 attr + +Aimv2PreTrainedModel +add _init_weights; 8 attr + +Aimv2TextConfig +add __post_init__; 15 attr + +Aimv2TextModel +add __init__,forward,get_input_embeddings,se… + +Aimv2VisionConfig +14 attr + +Aimv2VisionEmbeddings +add __init__,forward + +Aimv2VisionModel +add __init__,forward,get_input_embeddings; 3… + \ No newline at end of file diff --git a/aimv2.svg b/aimv2.svg new file mode 100644 index 0000000000000000000000000000000000000000..ce3187c75bda863b0105514532a4478b972a30c4 --- /dev/null +++ b/aimv2.svg @@ -0,0 +1,207 @@ + + + + +aimv2 +multimodal · vision → projector → LLM · dense + +Aimv2Model · base model +12 × Aimv2EncoderLayerAimv2EncoderLayer× 12 +image ⊕ text attention +Vision encoder · Aimv2VisionM…×24 +Self-Attention · Aimv2Attention +Aimv2EncoderLayer×24 +MLP · Aimv2MLP +attention · Aimv2Attention +ffn · Aimv2MLP + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [49408 × 768] → [1, 6, 768] +Aimv2RMSNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention6 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +Aimv2RMSNormpre-FFN [1, 6, 768] +gate_proj: Linear [768→2048]gate_proj [768→2048] +up_proj: Linear [768→2048]up_proj [768→2048] +down_proj: Linear [2048→768]down_proj [2048→768] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 768] +LM HeadLinear [768→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +gate_proj: Linear [1024→2816]gate_proj [1024→2816] +up_proj: Linear [1024→2816]up_proj [1024→2816] +down_proj: Linear [2816→1024]down_proj [2816→1024] +act_fn: SiLUActivationact_fn SiLU +rms_norm1: Aimv2RMSNorm 1024rms_norm1 RMSNorm 1024 +rms_norm2: Aimv2RMSNorm 1024rms_norm2 RMSNorm 1024 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +apple/aimv2-large-patch14-224… +inputs +input_ids, pixel_values +model_type +aimv2 +config +Aimv2Config +decoder +dense +layers +12 +hidden +768 +intermediate +2,048 +heads / kv +6 / 6 +attention +MHA +norm +RMSNorm +positional +n/a +vocab +49,408 +max_pos +77 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/albert.svg b/albert.svg new file mode 100644 index 0000000000000000000000000000000000000000..e9ac8ad0bd0cda2de8ecf11597aaaf04247fefe8 --- /dev/null +++ b/albert.svg @@ -0,0 +1,180 @@ + + + + +albert +dense · 1× MHA + +AlbertModel · base model +12 × AlbertLayerAlbertLayer× 12 +AlbertForMaskedLM · task head +Self-Attention · AlbertAttention +MLP · Linear + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣hey'␣hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30000 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +attention_dropout: Dropoutattention_dropout Dropout +output_dropout: Dropoutoutput_dropout Dropout +query: Linear [4096→4096]query [4096→4096] +key: Linear [4096→4096]key [4096→4096] +value: Linear [4096→4096]value [4096→4096] +dense: Linear [4096→4096]dense [4096→4096] +LayerNorm: LayerNorm 4096LayerNorm LayerNorm 4096 +scaled dot-product attention64 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 4096] +gelu_new +down_proj +residual add+ +Final LayerNorm[1, 6, 4096] +AlbertForMaskedLMPool (CLS / mean)[1, 6, 4096] → [1, 4096] +AlbertForMaskedLMClassifier headLinear [4096→2] +Softmax +class logits[1, 2] (2 classes) + +model id +albert/albert-xxlarge-v2 +model_type +albert +config +AlbertConfig +decoder +dense +layers +12 +hidden +4,096 +intermediate +16,384 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,000 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/align.svg b/align.svg new file mode 100644 index 0000000000000000000000000000000000000000..9277d803d2126ccbe3c08da5d81608582aa2bc2d --- /dev/null +++ b/align.svg @@ -0,0 +1,207 @@ + + + + +align +multimodal · vision → projector → LLM · dense + +AlignModel · base model +12 × AlignTextLayerAlignTextLayer× 12 +image ⊕ text attention +Self-Attention · AlignTextAttention +Vision encoder · AlignVisionMod…×64 +AlignVisionBlock×55 +output · AlignTextSelfOutput +squeeze_excite · AlignVisionSqu… +depthwise_conv · AlignVisionDept… +self · AlignTextSelfAttention +projection · AlignVisionFinalBloc… + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] +example image +pixel_values[1, 3, 336, 336] +depthwise_conv_pad: ZeroPad2ddepthwise_conv_pad ZeroPad… +depthwise_conv: AlignVisionDepthwiseConv2ddepthwise_convVisionDepthwiseConv2d +depthwise_norm: BatchNorm2d 64depthwise_normBatchNorm2d 64 +depthwise_act: SiLUdepthwise_act SiLU +squeeze: AdaptiveAvgPool2dsqueeze AdaptiveAvgPool2d +reduce: Conv2dreduce Conv2d +expand: Conv2dexpand Conv2d +act_reduce: SiLUact_reduce SiLU +act_expand: Sigmoidact_expand Sigmoid +project_conv: Conv2dproject_conv Conv2d +project_bn: BatchNorm2d 32project_bn BatchNorm2d 32 +dropout: Dropoutdropout Dropout +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +kakaobrain/align-base +inputs +input_ids, pixel_values +model_type +align +config +AlignConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/altclip.diff.svg b/altclip.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7a7260e56c17b9e204f85c3dd3061536098817eb --- /dev/null +++ b/altclip.diff.svg @@ -0,0 +1,245 @@ + + + + +altclip +diff vs clip (+roberta,chinese_clip) · 13 overridden · 31 added · 0 deleted · 5 new · 10 inherited-as-is + +AltCLIPModel · base model +24 × AltRobertaLayerAltRobertaLayer× 24 +image ⊕ text attention +Vision encoder · AltCLIPTextMo…×12 +Self-Attention · AltRobertaAttention +AltRobertaLayer×24 +Vision encoder · AltCLIPVisionM…×12 +AltCLIPEncoderLayer×12 +attention · AltRobertaAttention +output · AltRobertaSelfOutput +self_attn · CLIPAttention ↩ inheri… +self · AltRobertaSelfAttention +self · AltRobertaSelfAttention +output · AltRobertaSelfOutput +output · AltRobertaOutput +mlp · CLIPMLP ↩ inherited +intermediate · AltRobertaInterm… + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250002 × 1024] → [1, 6, 1024] +Normpre-attention [1, 6, 1024] +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +dropout: Dropoutdropout Dropout +dense: Linear [1024→1024]dense [1024→1024] +LayerNorm: LayerNorm 1024LayerNorm LayerNorm 1024 +dropout: Dropoutdropout Dropout +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→250002] +Softmax +logits[1, 6, 250002] +example image +pixel_values[1, 3, 336, 336] +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +dropout: Dropoutdropout Dropout +dense: Linear [1024→1024]dense [1024→1024] +LayerNorm: LayerNorm 1024LayerNormLayerNorm 1024 +dropout: Dropoutdropout Dropout +dense: Linear [1024→4096]dense [1024→4096] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense: Linear [4096→1024]dense [4096→1024] +LayerNorm: LayerNorm 1024LayerNorm LayerNorm 1024 +dropout: Dropoutdropout Dropout +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +BAAI/AltCLIP +parent +clip +classes +23 +overridden +13 +added +31 +new classes +5 +inherited as-is +10 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +AltCLIPEncoderLayer +ovr __init__ + +AltCLIPPreTrainedModel +ovr _init_weights; 2 attr + +AltCLIPVisionModel +ovr forward + +AltRobertaAttention +ovr __init__ + +AltRobertaEncoder +ovr __init__ + +AltRobertaLayer +ovr __init__ + +AltRobertaSelfAttention +ovr __init__ + +AltCLIPConfig +1 attr + +AltCLIPModel +ovr __init__,forward,get_image_features,get_… + +AltCLIPTextConfig +17 attr + +AltCLIPTextModel +add __init__,forward; 4 attr + +AltCLIPVisionConfig +rename only + +AltRobertaModel +add __init__,forward; 4 attr + \ No newline at end of file diff --git a/altclip.svg b/altclip.svg new file mode 100644 index 0000000000000000000000000000000000000000..27e908a117c8ca24e31f0ee1c8019d74c78a3849 --- /dev/null +++ b/altclip.svg @@ -0,0 +1,227 @@ + + + + +altclip +multimodal · vision+vision → projector → LLM · dense + +AltCLIPModel · base model +24 × AltRobertaLayerAltRobertaLayer× 24 +image ⊕ text attention +Vision encoder · AltCLIPTextMo…×12 +Self-Attention · AltRobertaAttention +AltRobertaLayer×24 +Vision encoder · AltCLIPVisionM…×12 +AltCLIPEncoderLayer×12 +attention · AltRobertaAttention +output · AltRobertaSelfOutput +self_attn · AltCLIPAttention +self · AltRobertaSelfAttention +self · AltRobertaSelfAttention +output · AltRobertaSelfOutput +output · AltRobertaOutput +mlp · AltCLIPMLP +intermediate · AltRobertaInterm… + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250002 × 1024] → [1, 6, 1024] +Normpre-attention [1, 6, 1024] +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +dropout: Dropoutdropout Dropout +dense: Linear [1024→1024]dense [1024→1024] +LayerNorm: LayerNorm 1024LayerNorm LayerNorm 1024 +dropout: Dropoutdropout Dropout +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→250002] +Softmax +logits[1, 6, 250002] +example image +pixel_values[1, 3, 336, 336] +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +dropout: Dropoutdropout Dropout +dense: Linear [1024→1024]dense [1024→1024] +LayerNorm: LayerNorm 1024LayerNormLayerNorm 1024 +dropout: Dropoutdropout Dropout +dense: Linear [1024→4096]dense [1024→4096] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense: Linear [4096→1024]dense [4096→1024] +LayerNorm: LayerNorm 1024LayerNorm LayerNorm 1024 +dropout: Dropoutdropout Dropout +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +BAAI/AltCLIP +inputs +input_ids, pixel_values +model_type +altclip +config +AltCLIPConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +250,002 +max_pos +514 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/apertus.diff.svg b/apertus.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..33f3c9f775338dcbbaacb009a42ca67d6530a77e --- /dev/null +++ b/apertus.diff.svg @@ -0,0 +1,181 @@ + + + + +apertus +diff vs llama (+nemotron) · 6 overridden · 24 added · 0 deleted · 1 new · 5 inherited-as-is + +ApertusModel · base model +32 × ApertusDecoderLayerApertusDecoderLayer× 32 +ApertusForCausalLM · task head +Self-Attention · ApertusAttention +MLP · ApertusMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 4096] → [1, 6, 4096] +ApertusRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: ApertusRMSNorm 128q_norm RMSNorm 128 +k_norm: ApertusRMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +ApertusRMSNormpre-FFN [1, 6, 4096] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: XIELUActivationact_fn XIELU +residual add+ +Final RMSNorm[1, 6, 4096] +ApertusForCausalLMLM HeadLinear [4096→131072] +Softmax +logits[1, 6, 131072] + +model id +swiss-ai/Apertus-8B-Instruct-2 +parent +llama +classes +10 +overridden +6 +added +24 +new classes +1 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ApertusAttention +ovr __init__,forward + +ApertusDecoderLayer +ovr __init__,forward + +ApertusForCausalLM +ovr forward + +ApertusMLP +ovr __init__ + +ApertusConfig +add __post_init__; 23 attr + \ No newline at end of file diff --git a/apertus.svg b/apertus.svg new file mode 100644 index 0000000000000000000000000000000000000000..6a8d7415790afda95d4b371964889034a172424c --- /dev/null +++ b/apertus.svg @@ -0,0 +1,181 @@ + + + + +apertus +dense · 32× MHA + +ApertusModel · base model +32 × ApertusDecoderLayerApertusDecoderLayer× 32 +ApertusForCausalLM · task head +Self-Attention · ApertusAttention +MLP · ApertusMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 4096] → [1, 6, 4096] +ApertusRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: ApertusRMSNorm 128q_norm RMSNorm 128 +k_norm: ApertusRMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +ApertusRMSNormpre-FFN [1, 6, 4096] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: XIELUActivationact_fn XIELU +residual add+ +Final RMSNorm[1, 6, 4096] +ApertusForCausalLMLM HeadLinear [4096→131072] +Softmax +logits[1, 6, 131072] + +model id +swiss-ai/Apertus-8B-Instruct-… +model_type +apertus +config +ApertusConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +131,072 +max_pos +65,536 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/arcee.diff.svg b/arcee.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..4410a2ced1f8973ee3296345dd0ca21df40a2e60 --- /dev/null +++ b/arcee.diff.svg @@ -0,0 +1,167 @@ + + + + +arcee +diff vs llama (+nemotron) · 0 overridden · 23 added · 0 deleted · 1 new · 5 inherited-as-is + +ArceeModel · base model +32 × ArceeDecoderLayerArceeDecoderLayer× 32 +ArceeForCausalLM · task head +Self-Attention · LlamaAttention ↩ inherited +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2560] → [1, 6, 2560] +ArceeRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→2560]k_proj [2560→2560] +v_proj: Linear [2560→2560]v_proj [2560→2560] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention32 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +ArceeRMSNormpre-FFN [1, 6, 2560] +up_proj: Linear [2560→18432]up_proj [2560→18432] +down_proj: Linear [18432→2560]down_proj [18432→2560] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +residual add+ +Final RMSNorm[1, 6, 2560] +ArceeForCausalLMLM HeadLinear [2560→32000] +Softmax +logits[1, 6, 32000] + +model id +arcee-ai/AFM-4.5B +parent +llama +classes +6 +overridden +0 +added +23 +new classes +1 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ArceeConfig +23 attr + \ No newline at end of file diff --git a/arcee.svg b/arcee.svg new file mode 100644 index 0000000000000000000000000000000000000000..f16bf00e37bd2b3e4a2588dc4fe99df55b5781eb --- /dev/null +++ b/arcee.svg @@ -0,0 +1,179 @@ + + + + +arcee +dense · 32× MHA + +ArceeModel · base model +32 × ArceeDecoderLayerArceeDecoderLayer× 32 +ArceeForCausalLM · task head +Self-Attention · ArceeAttention +MLP · ArceeMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2560] → [1, 6, 2560] +ArceeRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→2560]k_proj [2560→2560] +v_proj: Linear [2560→2560]v_proj [2560→2560] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention32 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +ArceeRMSNormpre-FFN [1, 6, 2560] +up_proj: Linear [2560→18432]up_proj [2560→18432] +down_proj: Linear [18432→2560]down_proj [18432→2560] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +residual add+ +Final RMSNorm[1, 6, 2560] +ArceeForCausalLMLM HeadLinear [2560→32000] +Softmax +logits[1, 6, 32000] + +model id +arcee-ai/AFM-4.5B +model_type +arcee +config +ArceeConfig +decoder +dense +layers +32 +hidden +2,560 +intermediate +18,432 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/aria.diff.svg b/aria.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..94694671a5fc1ddf1a2fcfbe2f4208b7b8186cb5 --- /dev/null +++ b/aria.diff.svg @@ -0,0 +1,271 @@ + + + + +aria +diff vs llama (+llava) · 17 overridden · 78 added · 0 deleted · 14 new · 4 inherited-as-is + +AriaModel · base model +32 × AriaTextDecoderLayerAriaTextDecoderLayer× 32 +AriaForConditionalGeneration · task head +image ⊕ text attention +Projector · AriaProjector +Sparse MoE · AriaTextMoELayerMoE +Vision encoder · Idefics3VisionT…×12 +Self-Attention · LlamaTextAttention ↩ inherited +Idefics3EncoderLayer×12 +cross_attn · AriaCrossAttention +shared_experts · AriaSharedExpertsMLP (×8 · d… +self_attn · Idefics3VisionAttention +experts · AriaExperts (×8 · dim 4096) +feed_forward · AriaProjectorMLP +mlp · Idefics3VisionMLP +multihead_attn · MultiheadAttent… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +AriaTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +AriaTextRMSNormpre-FFN [1, 6, 4096] +router: Linear top-2 of 8router top-2 of 8 +fc1: AriaGroupedExpertsGemm 8×4096×8192fc1 GroupedExpertsGemm 8×4096×8192 +fc2: AriaGroupedExpertsGemm 8×4096×4096fc2 GroupedExpertsGemm 8×4096×4096 +gate_proj: Linear [4096→8192]gate_proj [4096→8192] +up_proj: Linear [4096→8192]up_proj [4096→8192] +down_proj: Linear [8192→4096]down_proj [8192→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +AriaForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→3072]fc1 [1152→3072] +fc2: Linear [3072→1152]fc2 [3072→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +q_proj: Linear [1152→1152]q_proj [1152→1152] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +out_proj: NonDynamicallyQuantizableLinear [1152→1152]out_projNonDynamicallyQuantizableLinear [… +linear: Linear [1152→1152]linear [1152→1152] +dropout: Dropoutdropout Dropout +layer_norm: LayerNorm 1152layer_norm LayerNorm 1152 +layer_norm_kv: LayerNorm 1152layer_norm_kv LayerNorm 1152 +layer_norm: LayerNorm 1152layer_norm LayerNorm 1152 +linear_in: Linear [1152→4096]linear_in [1152→4096] +linear_out: Linear [4096→4096]linear_out [4096→4096] +act: NewGELUActivationact NewGELU +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +rhymes-ai/Aria +parent +llama +classes +25 +overridden +17 +added +78 +new classes +14 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +AriaForConditionalGeneration +ovr forward,get_image_features,prepare_input… + +AriaSharedExpertsMLP +ovr __init__ + +AriaTextDecoderLayer +ovr __init__ + +AriaTextForCausalLM +ovr __init__,forward; 1 attr + +AriaTextModel +ovr __init__ + +AriaConfig +add __post_init__; 10 attr + +AriaCrossAttention +add __init__,forward + +AriaExperts +add __init__,forward,route_tokens_to_experts + +AriaGroupedExpertsGemm +add __init__,forward + +AriaImageProcessor +add __init__,_get_padding_size,_pad_for_patc… + +AriaImageProcessorKwargs +4 attr + +AriaImagesKwargs +3 attr + +AriaModel +ovr __init__,forward,get_image_features; add… + +AriaPreTrainedModel +add _init_weights; 4 attr + +AriaProcessor +add __init__,_get_num_multimodal_tokens,repl… + +AriaProcessorKwargs +2 attr + +AriaProjector +add __init__,forward + +AriaProjectorMLP +add __init__,forward + +AriaTextConfig +8 attr + +AriaTextMoELayer +add __init__,forward + +AriaTextPreTrainedModel +add _init_weights; 10 attr + \ No newline at end of file diff --git a/aria.svg b/aria.svg new file mode 100644 index 0000000000000000000000000000000000000000..289a5b72aef34e6fd15b13320a3624a487163d99 --- /dev/null +++ b/aria.svg @@ -0,0 +1,233 @@ + + + + +aria +multimodal · vision → projector → LLM · sparse-moe + +AriaModel · base model +32 × AriaTextDecoderLayerAriaTextDecoderLayer× 32 +AriaForConditionalGeneration · task head +image ⊕ text attention +Projector · AriaProjector +Sparse MoE · AriaTextMoELayerMoE +Vision encoder · Idefics3VisionT…×12 +Self-Attention · AriaTextAttention +Idefics3EncoderLayer×12 +cross_attn · AriaCrossAttention +shared_experts · AriaSharedExpertsMLP (×8 · d… +self_attn · Idefics3VisionAttention +experts · AriaExperts (×8 · dim 4096) +feed_forward · AriaProjectorMLP +mlp · Idefics3VisionMLP +multihead_attn · MultiheadAttent… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +AriaTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +AriaTextRMSNormpre-FFN [1, 6, 4096] +router: Linear top-2 of 8router top-2 of 8 +fc1: AriaGroupedExpertsGemm 8×4096×8192fc1 GroupedExpertsGemm 8×4096×8192 +fc2: AriaGroupedExpertsGemm 8×4096×4096fc2 GroupedExpertsGemm 8×4096×4096 +gate_proj: Linear [4096→8192]gate_proj [4096→8192] +up_proj: Linear [4096→8192]up_proj [4096→8192] +down_proj: Linear [8192→4096]down_proj [8192→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +AriaForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→3072]fc1 [1152→3072] +fc2: Linear [3072→1152]fc2 [3072→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +q_proj: Linear [1152→1152]q_proj [1152→1152] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +out_proj: NonDynamicallyQuantizableLinear [1152→1152]out_projNonDynamicallyQuantizableLinear [… +linear: Linear [1152→1152]linear [1152→1152] +dropout: Dropoutdropout Dropout +layer_norm: LayerNorm 1152layer_norm LayerNorm 1152 +layer_norm_kv: LayerNorm 1152layer_norm_kv LayerNorm 1152 +layer_norm: LayerNorm 1152layer_norm LayerNorm 1152 +linear_in: Linear [1152→4096]linear_in [1152→4096] +linear_out: Linear [4096→4096]linear_out [4096→4096] +act: NewGELUActivationact NewGELU +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +rhymes-ai/Aria +inputs +input_ids, pixel_values +built via +AutoModel +model_type +aria +config +AriaConfig +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +4,096 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +experts (top-k) +8 (top-2) +tie_embeddings +False +legend + +vision encoder + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/audio_spectrogram_transformer.diff.svg b/audio_spectrogram_transformer.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..def50e756c91ec8f28307b9655b8b67a7cac59fc --- /dev/null +++ b/audio_spectrogram_transformer.diff.svg @@ -0,0 +1,175 @@ + + + + +audio_spectrogram_transformer +diff vs vit · 7 overridden · 12 added · 0 deleted · 5 new · 3 inherited-as-is + +ASTModel · base model +12 × ASTLayerASTLayer× 12 +ASTForAudioClassification · task head +Self-Attention · ViTAttention ↩ inherited +MLP · ViTMLP ↩ inherited + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +ASTForAudioClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +ASTForAudioClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +MIT/ast-finetuned-audioset-10- +parent +vit +classes +9 +overridden +7 +added +12 +new classes +5 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ASTPreTrainedModel +ovr _init_weights; 6 attr + +ASTEmbeddings +add __init__,forward,get_shape + +ASTForAudioClassification +add __init__,forward + +ASTMLPHead +add __init__,forward + +ASTModel +add __init__,forward,get_input_embeddings + +ASTPatchEmbeddings +add __init__,forward + \ No newline at end of file diff --git a/audio_spectrogram_transformer.svg b/audio_spectrogram_transformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..57ef6950e8c6719c9aea0ccff28e55f04876f8cb --- /dev/null +++ b/audio_spectrogram_transformer.svg @@ -0,0 +1,172 @@ + + + + +audio_spectrogram_transformer +dense · 12× MHA + +ASTModel · base model +12 × ASTLayerASTLayer× 12 +ASTForAudioClassification · task head +Self-Attention · ASTAttention +MLP · ASTMLP + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +ASTForAudioClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +ASTForAudioClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +MIT/ast-finetuned-audioset-10… +model_type +audio-spectrogram-transformer +config +ASTConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/audioflamingo3.diff.svg b/audioflamingo3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..f622359d2d18efe14a7af6f31e3b99bc3d009b2a --- /dev/null +++ b/audioflamingo3.diff.svg @@ -0,0 +1,204 @@ + + + + +audioflamingo3 +diff vs voxtral (+qwen2_audio,whisper) · 10 overridden · 10 added · 0 deleted · 1 new · 3 inherited-as-is + +AudioFlamingo3Model · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +AudioFlamingo3ForConditionalGeneration · task head +Self-Attention · Qwen2Attention +Audio encoder · AudioFlamingo…×32 +AudioFlamingo3EncoderLay…×32 +MLP · Qwen2MLP +self_attn · VoxtralAttention ↩ inh… +Projector · AudioFlamingo3MultiModal… + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +AudioFlamingo3ForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] +input_features[1, 128, 3000] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +out_proj: Linear [1280→1280]out_proj [1280→1280] +self_attn_layer_norm: LayerNorm 1280self_attn_layer_normLayerNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +final_layer_norm: LayerNorm 1280final_layer_normLayerNorm 1280 +linear_1: Linear [1280→4096]linear_1 [1280→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens + +model id +nvidia/audio-flamingo-3-hf +parent +voxtral +classes +9 +overridden +10 +added +10 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +AudioFlamingo3Encoder +ovr forward; 1 attr + +AudioFlamingo3ForConditionalGeneration +ovr __init__,forward,get_audio_features,prep… + +AudioFlamingo3MultiModalProjector +ovr __init__ + +AudioFlamingo3CausalLMOutputWithPast +6 attr + +AudioFlamingo3Model +ovr __init__,forward,get_audio_features; 3 a… + +AudioFlamingo3PreTrainedModel +1 attr + \ No newline at end of file diff --git a/audioflamingo3.svg b/audioflamingo3.svg new file mode 100644 index 0000000000000000000000000000000000000000..2e4dd2cc33f1dd787b72475e2d0c74017d305fa8 --- /dev/null +++ b/audioflamingo3.svg @@ -0,0 +1,209 @@ + + + + +audioflamingo3 +multimodal · audio → projector → LLM · dense + +AudioFlamingo3Model · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +AudioFlamingo3ForConditionalGeneration · task head +Self-Attention · Qwen2Attention +Audio encoder · AudioFlamingo…×32 +AudioFlamingo3EncoderLay…×32 +MLP · Qwen2MLP +self_attn · AudioFlamingo3Attent… +Projector · AudioFlamingo3MultiModal… + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +AudioFlamingo3ForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] +input_features[1, 128, 3000] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +out_proj: Linear [1280→1280]out_proj [1280→1280] +self_attn_layer_norm: LayerNorm 1280self_attn_layer_normLayerNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +final_layer_norm: LayerNorm 1280final_layer_normLayerNorm 1280 +linear_1: Linear [1280→4096]linear_1 [1280→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens + +model id +nvidia/audio-flamingo-3-hf +inputs +input_ids, input_features +built via +AutoModel +model_type +audioflamingo3 +config +AudioFlamingo3Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +True +legend + +audio encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/autoformer.svg b/autoformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..f5c6ab2d61b6ef215531e1d1458c801d9e5bcdad --- /dev/null +++ b/autoformer.svg @@ -0,0 +1,169 @@ + + + + +autoformer +dense · 2× MHA + +AutoformerModel · base model +2 × AutoformerEncoderLayerAutoformerEncoderLayer× 2 +Self-Attention · AutoformerAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 64] → [1, 6, 64] +LayerNormpre-attention [1, 6, 64] +k_proj: Linear [64→64]k_proj [64→64] +v_proj: Linear [64→64]v_proj [64→64] +q_proj: Linear [64→64]q_proj [64→64] +out_proj: Linear [64→64]out_proj [64→64] +scaled dot-product attention2 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 64] +LM HeadLinear [64→?] +Softmax +logits[1, 6, ?] + +model id +huggingface/autoformer-touris… +model_type +autoformer +config +AutoformerConfig +decoder +dense +layers +2 +hidden +64 +intermediate +— +heads / kv +2 / 2 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/aya_vision.diff.svg b/aya_vision.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ee8ef8e149640164517ac1ed0d94fa236049c458 --- /dev/null +++ b/aya_vision.diff.svg @@ -0,0 +1,246 @@ + + + + +aya_vision +diff vs llava · 4 overridden · 3 added · 0 deleted · 1 new · 2 inherited-as-is + +AyaVisionModel · base model +40 × Cohere2DecoderLayerCohere2DecoderLayer× 40 +AyaVisionForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Cohere2Attention (2 layer types — same modules, mask differs) +Vision encoder · SiglipVisionMo…×26 +SiglipEncoderLayer×26 +MLP · Cohere2MLP +Projector · AyaVisionMultiModalProjec… +self_attn · SiglipAttention +mlp · SiglipMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +Cohere2LayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Cohere2LayerNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→22528]gate_proj [8192→22528] +up_proj: Linear [8192→22528]up_proj [8192→22528] +down_proj: Linear [22528→8192]down_proj [22528→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +AyaVisionForConditionalGenerationLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 +layer 36: sliding_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: full_attention39 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→4304]fc1 [1152→4304] +fc2: Linear [4304→1152]fc2 [4304→1152] +layernorm: LayerNorm 4608layernorm LayerNorm 4608 +linear_1: Linear [4608→8192]linear_1 [4608→8192] +act: SiLUActivationact SiLU +linear_2: Linear [4096→8192]linear_2 [4096→8192] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +CohereForAI/aya-vision-8b +parent +llava +classes +6 +overridden +4 +added +3 +new classes +1 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +AyaVisionForConditionalGeneration +ovr forward + +AyaVisionModel +ovr forward,get_image_features + +AyaVisionPreTrainedModel +1 attr + +AyaVisionMultiModalProjector +add __init__,forward,pixel_shuffle + \ No newline at end of file diff --git a/aya_vision.svg b/aya_vision.svg new file mode 100644 index 0000000000000000000000000000000000000000..142497d75d830cf8d4076c2bc5403429ed172f28 --- /dev/null +++ b/aya_vision.svg @@ -0,0 +1,263 @@ + + + + +aya_vision +multimodal · vision → projector → LLM · dense + +AyaVisionModel · base model +40 × Cohere2DecoderLayerCohere2DecoderLayer× 40 +AyaVisionForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Cohere2Attention (2 layer types — same modules, mask differs) +Vision encoder · SiglipVisionMo…×26 +SiglipEncoderLayer×26 +MLP · Cohere2MLP +Projector · AyaVisionMultiModalProjec… +self_attn · SiglipAttention +mlp · SiglipMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +Cohere2LayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Cohere2LayerNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→22528]gate_proj [8192→22528] +up_proj: Linear [8192→22528]up_proj [8192→22528] +down_proj: Linear [22528→8192]down_proj [22528→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +AyaVisionForConditionalGenerationLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 +layer 36: sliding_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: full_attention39 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→4304]fc1 [1152→4304] +fc2: Linear [4304→1152]fc2 [4304→1152] +layernorm: LayerNorm 4608layernorm LayerNorm 4608 +linear_1: Linear [4608→8192]linear_1 [4608→8192] +act: SiLUActivationact SiLU +linear_2: Linear [4096→8192]linear_2 [4096→8192] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +CohereForAI/aya-vision-8b +inputs +input_ids, pixel_values +built via +AutoModel +model_type +aya_vision +config +AyaVisionConfig +decoder +dense +layers +40 +hidden +8,192 +intermediate +22,528 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +sliding_window +4,096 +tie_embeddings +True +legend + +vision encoder + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/bamba.diff.svg b/bamba.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..4116428ecaba51d4e97a2491b60a8bbdf318543c --- /dev/null +++ b/bamba.diff.svg @@ -0,0 +1,182 @@ + + + + +bamba +diff vs llama (+jamba,mamba2) · 4 overridden · 23 added · 0 deleted · 4 new · 5 inherited-as-is + +BambaModel · base model +32 × BambaDecoderLayerBambaDecoderLayer× 32 +BambaForCausalLM · task head +Token Mixer (SSM) · BambaMixer +MLP · LlamaMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128000 × 4096] → [1, 6, 4096] +BambaRMSNormpre-mixer [1, 6, 4096] +act: SiLUActivationact SiLU +conv1d: Conv1d 8704×1×4conv1d Conv1d 8704×1×4 +in_proj: Linear [4096→17024]in_proj [4096→17024] +norm: BambaRMSNormGated 8192norm RMSNormGated 8192 +out_proj: Linear [8192→4096]out_proj [8192→4096] +selective state-space scan (SSM) +mamba attention mask (q↓ × k→)mamba mask +residual add+ +BambaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +BambaForCausalLMLM HeadLinear [4096→128000] +Softmax +logits[1, 6, 128000] + +model id +ibm-fms/Bamba-9.8b-2.2T-hf +parent +llama +classes +11 +overridden +4 +added +23 +new classes +4 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +BambaDecoderLayer +ovr __init__,forward + +BambaFlashAttentionKwargs +5 attr + +BambaForCausalLM +ovr __init__,forward; add prepare_inputs_for… + +BambaMixer +add __init__,cuda_kernels_forward,forward,to… + +BambaModel +add __init__,_update_mamba_mask,forward + +BambaPreTrainedModel +add _init_weights; 9 attr + \ No newline at end of file diff --git a/bamba.svg b/bamba.svg new file mode 100644 index 0000000000000000000000000000000000000000..1a2b8ee898468079156a9181e39f227f93ceaf0e --- /dev/null +++ b/bamba.svg @@ -0,0 +1,179 @@ + + + + +bamba +ssm · 32× Mamba + +BambaModel · base model +32 × BambaDecoderLayerBambaDecoderLayer× 32 +BambaForCausalLM · task head +Token Mixer (SSM) · BambaMixer +MLP · BambaMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128000 × 4096] → [1, 6, 4096] +BambaRMSNormpre-mixer [1, 6, 4096] +act: SiLUActivationact SiLU +conv1d: Conv1d 8704×1×4conv1d Conv1d 8704×1×4 +in_proj: Linear [4096→17024]in_proj [4096→17024] +norm: BambaRMSNormGated 8192norm RMSNormGated 8192 +out_proj: Linear [8192→4096]out_proj [8192→4096] +selective state-space scan (SSM) +mamba attention mask (q↓ × k→)mamba mask +residual add+ +BambaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +BambaForCausalLMLM HeadLinear [4096→128000] +Softmax +logits[1, 6, 128000] + +model id +ibm-fms/Bamba-9.8b-2.2T-hf +model_type +bamba +config +BambaConfig +decoder +ssm +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +128,000 +max_pos +262,144 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/bark.svg b/bark.svg new file mode 100644 index 0000000000000000000000000000000000000000..591fa68109e8f3765ece760da28cbcda5e9b7429 --- /dev/null +++ b/bark.svg @@ -0,0 +1,177 @@ + + + + +bark +dense · 32× Attention + +BarkModel · base model +32 × BarkBlockBarkBlock× 32 +Self-Attention · BarkSelfAttention +MLP · BarkMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +attn_dropout: Dropoutattn_dropout Dropout +resid_dropout: Dropoutresid_dropout Dropout +att_proj: Linear [768→2304]att_proj [768→2304] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +in_proj: Linear [768→3072]in_proj [768→3072] +out_proj: Linear [3072→768]out_proj [3072→768] +dropout: Dropoutdropout Dropout +gelu: GELUgelu GELU +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +suno/bark +model_type +bark +config +BarkConfig +decoder +dense +layers +32 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/bart.svg b/bart.svg new file mode 100644 index 0000000000000000000000000000000000000000..3faf6ca3f4050db9c463b105033b99a10f1fdd9c --- /dev/null +++ b/bart.svg @@ -0,0 +1,170 @@ + + + + +bart +dense · 12× MHA + +BartModel · base model +12 × BartEncoderLayerBartEncoderLayer× 12 +BartForConditionalGeneration · task head +Self-Attention · BartAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +BartForConditionalGenerationLM HeadLinear [1024→50265] · tied +Softmax +logits[1, 6, 50265] + +model id +facebook/bart-large +model_type +bart +config +BartConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/beit.diff.svg b/beit.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..8b4f3424d48c52bcb46ce37e919234ace3e502b0 --- /dev/null +++ b/beit.diff.svg @@ -0,0 +1,214 @@ + + + + +beit +diff vs vit (+resnet,swin) · 10 overridden · 30 added · 0 deleted · 14 new · 3 inherited-as-is + +BeitModel · base model +12 × BeitLayerBeitLayer× 12 +BeitForImageClassification · task head +Self-Attention · BeitAttention +MLP · ViTMLP ↩ inherited + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +BeitForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +BeitForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/beit-base-patch16-22 +parent +vit +classes +22 +overridden +10 +added +30 +new classes +14 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +BeitAttention +ovr __init__ + +BeitConvLayer +ovr __init__ + +BeitEmbeddings +ovr __init__,forward + +BeitLayer +ovr __init__,forward + +BeitBackbone +add __init__,forward + +BeitFCNHead +add __init__,forward + +BeitFPNNeck +add __init__,forward + +BeitFPNUpBlock +add __init__,forward + +BeitForImageClassification +add __init__,forward + +BeitForMaskedImageModeling +add __init__,forward,get_output_embeddings + +BeitForSemanticSegmentation +add __init__,forward + +BeitModel +add __init__,forward + +BeitModelOutputWithPooling +rename only + +BeitPooler +add __init__,forward + +BeitPreTrainedModel +ovr _init_weights; 4 attr + +BeitPyramidPoolingBlock +add __init__,forward + +BeitPyramidPoolingModule +add __init__,forward + +BeitRelativePositionBias +add __init__,forward,generate_relative_posit… + +BeitUperHead +add __init__,forward,psp_forward + \ No newline at end of file diff --git a/beit.svg b/beit.svg new file mode 100644 index 0000000000000000000000000000000000000000..ce14b00681c45315fac72ed865901f2f4f94ee88 --- /dev/null +++ b/beit.svg @@ -0,0 +1,172 @@ + + + + +beit +dense · 12× MHA + +BeitModel · base model +12 × BeitLayerBeitLayer× 12 +BeitForImageClassification · task head +Self-Attention · BeitAttention +MLP · BeitMLP + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +BeitForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +BeitForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/beit-base-patch16-2… +model_type +beit +config +BeitConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +8,192 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/bert.svg b/bert.svg new file mode 100644 index 0000000000000000000000000000000000000000..fe2e98112db609aafafa0453033cc48af6eff8aa --- /dev/null +++ b/bert.svg @@ -0,0 +1,175 @@ + + + + +bert +dense · 12× MHA + +BertModel · base model +12 × BertLayerBertLayer× 12 +BertLMHeadModel · task head +Self-Attention · BertAttention +output · BertSelfOutput +self · BertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +BertLMHeadModelLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +google-bert/bert-base-uncased +model_type +bert +config +BertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/bert_generation.svg b/bert_generation.svg new file mode 100644 index 0000000000000000000000000000000000000000..e8c77152aa41571186ab65e5d24ba6ecc8099cf8 --- /dev/null +++ b/bert_generation.svg @@ -0,0 +1,175 @@ + + + + +bert_generation +dense · 24× MHA + +BertGenerationEncoder · base model +24 × BertGenerationLayerBertGenerationLayer× 24 +BertGenerationDecoder · task head +Self-Attention · BertGenerationAttention +output · BertGenerationSelfOutput +self · BertGenerationSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50358 × 1024] → [1, 6, 1024] +Normpre-attention [1, 6, 1024] +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +dropout: Dropoutdropout Dropout +dense: Linear [1024→1024]dense [1024→1024] +LayerNorm: LayerNorm 1024LayerNorm LayerNorm 1024 +dropout: Dropoutdropout Dropout +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +BertGenerationDecoderLM HeadLinear [1024→50358] · tied +Softmax +logits[1, 6, 50358] + +model id +google/bert_for_seq_generatio… +model_type +bert-generation +config +BertGenerationConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,358 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/big_bird.svg b/big_bird.svg new file mode 100644 index 0000000000000000000000000000000000000000..5fe92a0a86f8234a0227e2c561f388666e2f2e71 --- /dev/null +++ b/big_bird.svg @@ -0,0 +1,174 @@ + + + + +big_bird +dense · 12× MHA + +BigBirdModel · base model +12 × BigBirdLayerBigBirdLayer× 12 +BigBirdForCausalLM · task head +Self-Attention · BigBirdAttention +output · BigBirdSelfOutput +self · BigBirdBlockSparseAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50358 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +BigBirdForCausalLMLM HeadLinear [768→50358] · tied +Softmax +logits[1, 6, 50358] + +model id +google/bigbird-roberta-base +model_type +big_bird +config +BigBirdConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,358 +max_pos +4,096 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/bigbird_pegasus.svg b/bigbird_pegasus.svg new file mode 100644 index 0000000000000000000000000000000000000000..1c1c43103eafb4ba7691a86d08098e3c78531051 --- /dev/null +++ b/bigbird_pegasus.svg @@ -0,0 +1,171 @@ + + + + +bigbird_pegasus +dense · 16× MHA + +BigBirdPegasusModel · base model +16 × BigBirdPegasusEncoderLayerBigBirdPegasusEncoderLayer× 16 +BigBirdPegasusForConditionalGeneration · task head +Self-Attention · BigBirdPegasusEncoderAttention +self · BigBirdPegasusBlockSparseAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [96103 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +output: Linear [1024→1024]output [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +BigBirdPegasusForConditionalGenerationLM HeadLinear [1024→96103] · tied +Softmax +logits[1, 6, 96103] + +model id +google/bigbird-pegasus-large-… +model_type +bigbird_pegasus +config +BigBirdPegasusConfig +decoder +dense +layers +16 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +96,103 +max_pos +4,096 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/biogpt.diff.svg b/biogpt.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ec76a43405a58eb107ad53104ce35579cd2fb267 --- /dev/null +++ b/biogpt.diff.svg @@ -0,0 +1,177 @@ + + + + +biogpt +diff vs bart (+opt) · 3 overridden · 21 added · 0 deleted · 5 new · 2 inherited-as-is + +BioGptModel · base model +24 × BioGptDecoderLayerBioGptDecoderLayer× 24 +BioGptForCausalLM · task head +Self-Attention · BartAttention ↩ inherited + +input_idstokenize("Hey, how are you?") → [1, 7] +token 0: 'He'He0 +token 1: 'y</w>'y</…1 +token 2: ',</w>',</…2 +token 3: 'how</w>'how…3 +token 4: 'are</w>'are…4 +token 5: 'you</w>'you…5 +token 6: '?</w>'?</…6 +Token Embeddingweight [42384 × 1024] → [1, 7, 1024] +LayerNormpre-attention [1, 7, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 7, 1024] +BioGptForCausalLMLM HeadLinear [1024→42384] · tied +Softmax +logits[1, 7, 42384] + +model id +microsoft/biogpt +parent +bart +classes +9 +overridden +3 +added +21 +new classes +5 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +BioGptDecoderLayer +ovr __init__,forward + +BioGptLearnedPositionalEmbedding +ovr forward + +BioGptForCausalLM +add __init__,forward,get_output_embeddings,s… + +BioGptForSequenceClassification +add __init__,forward,get_input_embeddings,se… + +BioGptForTokenClassification +add __init__,forward + +BioGptModel +add __init__,forward + +BioGptPreTrainedModel +8 attr + \ No newline at end of file diff --git a/biogpt.svg b/biogpt.svg new file mode 100644 index 0000000000000000000000000000000000000000..a8dc67033aa68e3ccbbe020631079adf7c977b15 --- /dev/null +++ b/biogpt.svg @@ -0,0 +1,171 @@ + + + + +biogpt +dense · 24× MHA + +BioGptModel · base model +24 × BioGptDecoderLayerBioGptDecoderLayer× 24 +BioGptForCausalLM · task head +Self-Attention · BioGptAttention + +input_idstokenize("Hey, how are you?") → [1, 7] +token 0: 'He'He0 +token 1: 'y</w>'y</…1 +token 2: ',</w>',</…2 +token 3: 'how</w>'how…3 +token 4: 'are</w>'are…4 +token 5: 'you</w>'you…5 +token 6: '?</w>'?</…6 +Token Embeddingweight [42384 × 1024] → [1, 7, 1024] +LayerNormpre-attention [1, 7, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 7, 1024] +BioGptForCausalLMLM HeadLinear [1024→42384] · tied +Softmax +logits[1, 7, 42384] + +model id +microsoft/biogpt +model_type +biogpt +config +BioGptConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +42,384 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/bit.svg b/bit.svg new file mode 100644 index 0000000000000000000000000000000000000000..429b241c69d9888e69b42b31a72b32d3aef520da --- /dev/null +++ b/bit.svg @@ -0,0 +1,155 @@ + + + + +bit +⚠ no transformer block (conv backbone) — shown from config · dense · 2× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +preactivationBitGroupNormActivation → attentionBitGroupNormActivation → MLP×1 +bottleneckBitGroupNormActivation → attentionBitGroupNormActivation → MLP×1 +Final BitGroupNormActivation +Pool + Classifier head→ class logits [1, 2] + +model id +google/bit-50 +model_type +bit +config +BitConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BitGroupNormActivation +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/bitnet.diff.svg b/bitnet.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..05f11aef3a3c20ee621c40e36cab4cabf192eed8 --- /dev/null +++ b/bitnet.diff.svg @@ -0,0 +1,176 @@ + + + + +bitnet +diff vs llama (+gemma) · 8 overridden · 0 added · 0 deleted · 0 new · 3 inherited-as-is + +BitNetModel · base model +30 × BitNetDecoderLayerBitNetDecoderLayer× 30 +BitNetForCausalLM · task head +Self-Attention · BitNetAttention +MLP · BitNetMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 2560] → [1, 6, 2560] +BitNetRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→640]k_proj [2560→640] +v_proj: Linear [2560→640]v_proj [2560→640] +o_proj: Linear [2560→2560]o_proj [2560→2560] +attn_sub_norm: BitNetRMSNorm 2560attn_sub_norm RMSNorm 2560 +scaled dot-product attention20 heads · head_dim 128 · GQA 20:5 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +BitNetRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→6912]gate_proj [2560→6912] +up_proj: Linear [2560→6912]up_proj [2560→6912] +down_proj: Linear [6912→2560]down_proj [6912→2560] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +ffn_sub_norm: BitNetRMSNorm 6912ffn_sub_norm RMSNorm 6912 +residual add+ +Final RMSNorm[1, 6, 2560] +BitNetForCausalLMLM HeadLinear [2560→128256] +Softmax +logits[1, 6, 128256] + +model id +microsoft/bitnet-b1.58-2B-4T +parent +llama +classes +6 +overridden +8 +added +0 +new classes +0 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +BitNetAttention +ovr __init__,forward + +BitNetForCausalLM +ovr forward; 3 attr + +BitNetMLP +ovr __init__,forward + \ No newline at end of file diff --git a/bitnet.svg b/bitnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..e2af9533190a7242fe3c0944358fd900cc84a5fe --- /dev/null +++ b/bitnet.svg @@ -0,0 +1,182 @@ + + + + +bitnet +dense · 30× GQA + +BitNetModel · base model +30 × BitNetDecoderLayerBitNetDecoderLayer× 30 +BitNetForCausalLM · task head +Self-Attention · BitNetAttention +MLP · BitNetMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 2560] → [1, 6, 2560] +BitNetRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→640]k_proj [2560→640] +v_proj: Linear [2560→640]v_proj [2560→640] +o_proj: Linear [2560→2560]o_proj [2560→2560] +attn_sub_norm: BitNetRMSNorm 2560attn_sub_norm RMSNorm 2560 +scaled dot-product attention20 heads · head_dim 128 · GQA 20:5 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +BitNetRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→6912]gate_proj [2560→6912] +up_proj: Linear [2560→6912]up_proj [2560→6912] +down_proj: Linear [6912→2560]down_proj [6912→2560] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +ffn_sub_norm: BitNetRMSNorm 6912ffn_sub_norm RMSNorm 6912 +residual add+ +Final RMSNorm[1, 6, 2560] +BitNetForCausalLMLM HeadLinear [2560→128256] +Softmax +logits[1, 6, 128256] + +model id +microsoft/bitnet-b1.58-2B-4T +model_type +bitnet +config +BitNetConfig +decoder +dense +layers +30 +hidden +2,560 +intermediate +6,912 +heads / kv +20 / 5 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +128,256 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/blenderbot.svg b/blenderbot.svg new file mode 100644 index 0000000000000000000000000000000000000000..d502dc0243c50f59721080b25f02a39e9746efb0 --- /dev/null +++ b/blenderbot.svg @@ -0,0 +1,170 @@ + + + + +blenderbot +dense · 2× MHA + +BlenderbotModel · base model +2 × BlenderbotEncoderLayerBlenderbotEncoderLayer× 2 +BlenderbotForConditionalGeneration · task head +Self-Attention · BlenderbotAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [8008 × 2560] → [1, 6, 2560] +LayerNormpre-attention [1, 6, 2560] +k_proj: Linear [2560→2560]k_proj [2560→2560] +v_proj: Linear [2560→2560]v_proj [2560→2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +out_proj: Linear [2560→2560]out_proj [2560→2560] +scaled dot-product attention32 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 2560] +BlenderbotForConditionalGenerationLM HeadLinear [2560→8008] · tied +Softmax +logits[1, 6, 8008] + +model id +facebook/blenderbot-3B +model_type +blenderbot +config +BlenderbotConfig +decoder +dense +layers +2 +hidden +2,560 +intermediate +— +heads / kv +32 / 32 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +8,008 +max_pos +128 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/blenderbot_small.svg b/blenderbot_small.svg new file mode 100644 index 0000000000000000000000000000000000000000..9643ac7e56ed34249fee95e22406b5ed27e0d3ea --- /dev/null +++ b/blenderbot_small.svg @@ -0,0 +1,170 @@ + + + + +blenderbot_small +dense · 8× MHA + +BlenderbotSmallModel · base model +8 × BlenderbotSmallEncoderLayerBlenderbotSmallEncoderLayer× 8 +BlenderbotSmallForConditionalGeneration · task head +Self-Attention · BlenderbotSmallAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention16 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 512] +BlenderbotSmallForConditionalGenerationLM HeadLinear [512→50265] · tied +Softmax +logits[1, 6, 50265] + +model id +facebook/blenderbot_small-90M +model_type +blenderbot-small +config +BlenderbotSmallConfig +decoder +dense +layers +8 +hidden +512 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/blip.svg b/blip.svg new file mode 100644 index 0000000000000000000000000000000000000000..5b29e87afebfef3a92d0e80ce0a50dc4d24d457d --- /dev/null +++ b/blip.svg @@ -0,0 +1,203 @@ + + + + +blip +multimodal · vision → projector → LLM · dense + +BlipModel · base model +12 × BlipTextLayerBlipTextLayer× 12 +BlipForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · BlipTextAttention +Vision encoder · BlipVisionModel×12 +BlipEncoderLayer×12 +output · BlipTextSelfOutput +self · BlipTextSelfAttention +self_attn · BlipAttention +mlp · BlipMLP + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30524 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention8 heads · head_dim 96 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +BlipForConditionalGenerationLM HeadLinear [768→30524] · tied +Softmax +logits[1, 6, 30524] +example image +pixel_values[1, 3, 336, 336] +dropout: Dropoutdropout Dropout +qkv: Linear [768→2304]qkv [768→2304] +projection: Linear [768→768]projection [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Salesforce/blip-vqa-base +inputs +input_ids, pixel_values +model_type +blip +config +BlipConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,524 +max_pos +512 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/blip_2.svg b/blip_2.svg new file mode 100644 index 0000000000000000000000000000000000000000..b370142c6b1b03fd3aba0042a044a5cee4d141ca --- /dev/null +++ b/blip_2.svg @@ -0,0 +1,199 @@ + + + + +blip_2 +multimodal · vision → projector → LLM · dense + +Blip2Model · base model +12 × OPTDecoderLayerOPTDecoderLayer× 12 +Blip2ForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · OPTAttention +Vision encoder · Blip2VisionMo…×39 +Blip2EncoderLayer×39 +mlp · Blip2MLP +self_attn · Blip2Attention + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50272 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +Blip2ForConditionalGenerationLM HeadLinear [768→50272] +Softmax +logits[1, 6, 50272] +example image +pixel_values[1, 3, 336, 336] +qkv: Linear [1408→4224]qkv [1408→4224] +projection: Linear [1408→1408]projection [1408→1408] +layer_norm1: LayerNorm 1408layer_norm1 LayerNorm 1408 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1408→6144]fc1 [1408→6144] +fc2: Linear [6144→1408]fc2 [6144→1408] +layer_norm2: LayerNorm 1408layer_norm2 LayerNorm 1408 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Salesforce/blip2-opt-2.7b +inputs +input_ids, pixel_values +built via +AutoModelForCausalLM, AutoModelForSeq2SeqLM +model_type +blip-2 +config +Blip2Config +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,272 +max_pos +2,048 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/bloom.svg b/bloom.svg new file mode 100644 index 0000000000000000000000000000000000000000..5a73d561b7b7e29c10d5723be85a359311e3f6bd --- /dev/null +++ b/bloom.svg @@ -0,0 +1,176 @@ + + + + +bloom +dense · 2× MHA + +BloomModel · base model +2 × BloomBlockBloomBlock× 2 +BloomForCausalLM · task head +Self-Attention · BloomAttention +MLP · BloomMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250880 × 64] → [1, 6, 64] +LayerNormpre-attention [1, 6, 64] +query_key_value: Linear [64→192]query_key_value [64→192] +dense: Linear [64→64]dense [64→64] +attention_dropout: Dropoutattention_dropout Dropout +scaled dot-product attention8 heads · head_dim 8 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 64] +dense_h_to_4h: Linear [64→256]dense_h_to_4h [64→256] +gelu_impl: BloomGelugelu_impl Gelu +dense_4h_to_h: Linear [256→64]dense_4h_to_h [256→64] +residual add+ +Final LayerNorm[1, 6, 64] +BloomForCausalLMLM HeadLinear [64→250880] · tied +Softmax +logits[1, 6, 250880] + +model id +bigscience/bloom +model_type +bloom +config +BloomConfig +decoder +dense +layers +2 +hidden +64 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +250,880 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/blt.diff.svg b/blt.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..93014cbb1ecabdea1e350016086164f4a3969f7d --- /dev/null +++ b/blt.diff.svg @@ -0,0 +1,198 @@ + + + + +blt +diff vs mllama (+llama) · 12 overridden · 27 added · 0 deleted · 6 new · 2 inherited-as-is + +BltModel · base model +25 × BltTransformerLayerBltTransformerLayer× 25 +BltForCausalLM · task head +Self-Attention · BltSelfAttention +MLP · MllamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [260 × ?] → [1, 6, ?] +BltRMSNormpre-attention [1, 6, ?] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +BltRMSNormpre-FFN [1, 6, ?] +gate_proj: Linear [2048→5632]gate_proj [2048→5632] +up_proj: Linear [2048→5632]up_proj [2048→5632] +down_proj: Linear [5632→2048]down_proj [5632→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, ?] +BltForCausalLMLM HeadLinear [?→260] +Softmax +logits[1, 6, 260] + +model id +itazap/blt-1b-hf +parent +mllama +classes +13 +overridden +12 +added +27 +new classes +6 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +BltCrossAttention +ovr __init__,forward + +BltPreTrainedModel +ovr _init_weights; 6 attr + +BltRotaryEmbedding +ovr forward + +BltSelfAttention +ovr __init__ + +BltTransformerLayer +ovr __init__ + +BltForCausalLM +add __init__,forward; 4 attr + +BltGlobalTransformer +add __init__,forward; 2 attr + +BltLocalDecoder +add __init__,forward; 1 attr + +BltLocalEncoder +add __init__,forward,patch_reduce; 2 attr + +BltModel +add __init__,_patch_ids_from_lengths,forward… + +BltPatcher +add __init__,forward,patch_lengths_from_entr… + \ No newline at end of file diff --git a/blt.svg b/blt.svg new file mode 100644 index 0000000000000000000000000000000000000000..27aa07e046e725310a01e1925c93837795a48bc3 --- /dev/null +++ b/blt.svg @@ -0,0 +1,180 @@ + + + + +blt +dense · 25× Attention + +BltModel · base model +25 × BltTransformerLayerBltTransformerLayer× 25 +BltForCausalLM · task head +Self-Attention · BltSelfAttention +MLP · BltMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [260 × ?] → [1, 6, ?] +BltRMSNormpre-attention [1, 6, ?] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +BltRMSNormpre-FFN [1, 6, ?] +gate_proj: Linear [2048→5632]gate_proj [2048→5632] +up_proj: Linear [2048→5632]up_proj [2048→5632] +down_proj: Linear [5632→2048]down_proj [5632→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, ?] +BltForCausalLMLM HeadLinear [?→260] +Softmax +logits[1, 6, 260] + +model id +itazap/blt-1b-hf +model_type +blt +config +BltConfig +decoder +dense +layers +25 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +RMSNorm +positional +RoPE +vocab +260 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/bridgetower.svg b/bridgetower.svg new file mode 100644 index 0000000000000000000000000000000000000000..361c96a889565819676c1823d61f86c740f45e2a --- /dev/null +++ b/bridgetower.svg @@ -0,0 +1,264 @@ + + + + +bridgetower +multimodal · vision+vision+vision+vision+vision → projector → LLM · dense + +BridgeTowerModel · base model +12 × BridgeTowerTextLayerBridgeTowerTextLayer× 12 +image ⊕ text attention +Vision encoder · ModuleList×12 +BridgeTowerBertCrossLayer×6 +Self-Attention · BridgeTowerAttention +Vision encoder · ModuleList×12 +Vision encoder · BridgeTowerVi…×12 +BridgeTowerResidualAttention×12 +attention · BridgeTowerAttention +crossattention · BridgeTowerAtte… +output · BridgeTowerSelfOutput +self · BridgeTowerSelfAttention +self · BridgeTowerCrossAttent… +self · BridgeTowerSelfAttention +mlp · ModuleDict +output · BridgeTowerOutput +output · BridgeTowerSelfOutput +output · BridgeTowerSelfOutput +Vision encoder · BridgeTowerPo…×12 +intermediate · BridgeTowerInter… +attn · MultiheadAttention +0 · BridgeTowerLinkTower +1 · BridgeTowerLinkTower +2 · BridgeTowerLinkTower +3 · BridgeTowerLinkTower +4 · BridgeTowerLinkTower + + + + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→50265] +Softmax +logits[1, 6, 50265] +example image +pixel_values[1, 3, 336, 336] +out_proj: NonDynamicallyQuantizableLinear [768→768]out_projNonDynamicallyQuantizableLinear [… +ln_1: LayerNorm 768ln_1 LayerNorm 768 +c_fc: Linear [768→3072]c_fc [768→3072] +gelu: QuickGELUActivationgelu QuickGELU +c_proj: Linear [3072→768]c_proj [3072→768] +ln_2: LayerNorm 768ln_2 LayerNorm 768 +example image +pixel_values[1, 3, 336, 336] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +dense: Linear [768→3072]dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense: Linear [3072→768]dense [3072→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +example image +pixel_values[1, 3, 336, 336] +dense: Linear [768→768]dense [768→768] +activation: Tanhactivation Tanh +example image +pixel_values[1, 3, 336, 336] +Vision encoder · LayerNormLayerNormbridgetower_vision_model · 12 layers · h=7…×12 +example image +pixel_values[1, 3, 336, 336] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +BridgeTower/bridgetower-base +inputs +input_ids, pixel_values +model_type +bridgetower +config +BridgeTowerConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +514 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/bros.svg b/bros.svg new file mode 100644 index 0000000000000000000000000000000000000000..02766c630d3a9359411d95eadd149d7d9a698489 --- /dev/null +++ b/bros.svg @@ -0,0 +1,175 @@ + + + + +bros +dense · 12× MHA + +BrosModel · base model +12 × BrosLayerBrosLayer× 12 +BrosForTokenClassification · task head +Self-Attention · BrosAttention +output · BrosSelfOutput +self · BrosSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +BrosForTokenClassificationLM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] + +model id +jinho8345/bros-base-uncased +model_type +bros +config +BrosConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/camembert.diff.svg b/camembert.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9530284ceded1228b1b5cd5aca9062a896abf48b --- /dev/null +++ b/camembert.diff.svg @@ -0,0 +1,182 @@ + + + + +camembert +diff vs roberta · 15 overridden · 0 added · 0 deleted · 0 new · 1 inherited-as-is + +CamembertModel · base model +12 × CamembertLayerCamembertLayer× 12 +CamembertForCausalLM · task head +Self-Attention · RobertaAttention ↩ inherited +output · RobertaSelfOutput ↩ inherited +self · RobertaSelfAttention ↩ inherited + +input_idstokenize("Hey, how are you?") → [1, 7] +token 0: '␣Hey'␣He…0 +token 1: ',',1 +token 2: '␣h'␣h2 +token 3: 'ow'ow3 +token 4: '␣are'␣are4 +token 5: '␣you'␣you5 +token 6: '?'?6 +Token Embeddingweight [30522 × 768] → [1, 7, 768] +Normpre-attention [1, 7, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 7, 768] +CamembertForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 7, 30522] + +model id +almanach/camembert-base +parent +roberta +classes +8 +overridden +15 +added +0 +new classes +0 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +CamembertForCausalLM +ovr __init__,forward; 1 attr + +CamembertForMaskedLM +ovr __init__,forward; 1 attr + +CamembertForMultipleChoice +ovr __init__,forward + +CamembertForQuestionAnswering +ovr __init__,forward + +CamembertForSequenceClassification +ovr __init__,forward + +CamembertForTokenClassification +ovr __init__,forward + +CamembertPreTrainedModel +1 attr + \ No newline at end of file diff --git a/camembert.svg b/camembert.svg new file mode 100644 index 0000000000000000000000000000000000000000..280a193f1e0be570899928510d2707dfe2faa05a --- /dev/null +++ b/camembert.svg @@ -0,0 +1,176 @@ + + + + +camembert +dense · 12× MHA + +CamembertModel · base model +12 × CamembertLayerCamembertLayer× 12 +CamembertForCausalLM · task head +Self-Attention · CamembertAttention +output · CamembertSelfOutput +self · CamembertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 7] +token 0: '␣Hey'␣He…0 +token 1: ',',1 +token 2: '␣h'␣h2 +token 3: 'ow'ow3 +token 4: '␣are'␣are4 +token 5: '␣you'␣you5 +token 6: '?'?6 +Token Embeddingweight [30522 × 768] → [1, 7, 768] +Normpre-attention [1, 7, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 7, 768] +CamembertForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 7, 30522] + +model id +almanach/camembert-base +model_type +camembert +config +CamembertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/canine.svg b/canine.svg new file mode 100644 index 0000000000000000000000000000000000000000..c5179a89ac3abec70790f046f318ceb8db6e37a6 --- /dev/null +++ b/canine.svg @@ -0,0 +1,179 @@ + + + + +canine +dense · 12× MHA + +CanineModel · base model +12 × CanineLayerCanineLayer× 12 +CanineForSequenceClassification · task head +Self-Attention · CanineAttention +output · CanineSelfOutput +self · CanineSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 10] +token 0: 'H'H0 +token 1: 'e'e1 +token 2: 'y'y2 +token 3: ',',3 +token 4: ' ' 4 +token 5: 'h'h5 +token 6: 'o'o6 +token 7: 'w'w7 +token 8: ' ' 8 +token 9: 'a'a9 +Token Embeddingweight [? × 768] → [1, 10, 768] +Normpre-attention [1, 10, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 10, 768] +CanineForSequenceClassificationLM HeadLinear [768→?] +Softmax +logits[1, 10, ?] + +model id +google/canine-s +model_type +canine +config +CanineConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +16,384 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/chameleon.svg b/chameleon.svg new file mode 100644 index 0000000000000000000000000000000000000000..9577decb5ecc33ce59f9c706c3641936ee85ebbd --- /dev/null +++ b/chameleon.svg @@ -0,0 +1,182 @@ + + + + +chameleon +dense · 32× MHA + +ChameleonModel · base model +32 × ChameleonDecoderLayerChameleonDecoderLayer× 32 +ChameleonForConditionalGeneration · task head +Self-Attention · ChameleonAttention +MLP · ChameleonMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 4096] → [1, 6, 4096] +ChameleonRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: ChameleonLayerNorm 32×128q_norm LayerNorm 32×128 +k_norm: ChameleonLayerNorm 32×128k_norm LayerNorm 32×128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +ChameleonRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +ChameleonForConditionalGenerationLM HeadLinear [4096→65536] +Softmax +logits[1, 6, 65536] + +model id +facebook/chameleon-7b +model_type +chameleon +config +ChameleonConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +65,536 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/chinese_clip.diff.svg b/chinese_clip.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..4c748b9c13d09262d7335ec1ba0f93aa71bfd0b4 --- /dev/null +++ b/chinese_clip.diff.svg @@ -0,0 +1,236 @@ + + + + +chinese_clip +diff vs clip (+align,bert) · 12 overridden · 22 added · 0 deleted · 4 new · 12 inherited-as-is + +ChineseCLIPModel · base model +12 × ChineseCLIPTextLayerChineseCLIPTextLayer× 12 +image ⊕ text attention +Self-Attention · CLIPTextAttention ↩ inherited +Vision encoder · ChineseCLIPTe…×12 +CLIPTextLayer ↩ inherited×12 +Vision encoder · ChineseCLIPVi…×12 +ChineseCLIPVisionLayer×12 +attention · CLIPTextAttention ↩ i… +output · CLIPTextSelfOutput ↩ inherited +self_attn · CLIPVisionAttention ↩… +self · ChineseCLIPTextSelfAtt… +self · ChineseCLIPTextSelfAttention +output · CLIPTextOutput ↩ inheri… +mlp · CLIPVisionMLP ↩ inherited +output · CLIPTextSelfOutput ↩… +intermediate · CLIPTextInterme… + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] +example image +pixel_values[1, 3, 336, 336] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +dense: Linear [768→3072]dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense: Linear [3072→768]dense [3072→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +OFA-Sys/chinese-clip-vit-base- +parent +clip +classes +22 +overridden +12 +added +22 +new classes +4 +inherited as-is +12 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ChineseCLIPModel +ovr __init__,forward,get_image_features,get_… + +ChineseCLIPPreTrainedModel +ovr _init_weights; 2 attr + +ChineseCLIPTextSelfAttention +ovr __init__ + +ChineseCLIPVisionEncoder +ovr __init__ + +ChineseCLIPVisionLayer +ovr __init__ + +ChineseCLIPVisionModel +ovr __init__,forward + +ChineseCLIPConfig +1 attr + +ChineseCLIPTextConfig +15 attr + +ChineseCLIPTextModel +add __init__,forward; 4 attr + +ChineseCLIPVisionConfig +rename only + \ No newline at end of file diff --git a/chinese_clip.svg b/chinese_clip.svg new file mode 100644 index 0000000000000000000000000000000000000000..a900671f8b89b5996f890c95a3bd3a59a6142da7 --- /dev/null +++ b/chinese_clip.svg @@ -0,0 +1,227 @@ + + + + +chinese_clip +multimodal · vision+vision → projector → LLM · dense + +ChineseCLIPModel · base model +12 × ChineseCLIPTextLayerChineseCLIPTextLayer× 12 +image ⊕ text attention +Self-Attention · ChineseCLIPTextAttention +Vision encoder · ChineseCLIPTe…×12 +ChineseCLIPTextLayer×12 +Vision encoder · ChineseCLIPVi…×12 +ChineseCLIPVisionLayer×12 +attention · ChineseCLIPTextAtten… +output · ChineseCLIPTextSelfOutput +self_attn · ChineseCLIPVisionAtte… +self · ChineseCLIPTextSelfAtt… +self · ChineseCLIPTextSelfAttention +output · ChineseCLIPTextOutput +mlp · ChineseCLIPVisionMLP +output · ChineseCLIPTextSelf… +intermediate · ChineseCLIPTextI… + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] +example image +pixel_values[1, 3, 336, 336] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +dense: Linear [768→3072]dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense: Linear [3072→768]dense [3072→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +OFA-Sys/chinese-clip-vit-base… +inputs +input_ids, pixel_values +model_type +chinese_clip +config +ChineseCLIPConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/chmv2.diff.svg b/chmv2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..a170bde029f2526c41d10f2dff278c28b643c750 --- /dev/null +++ b/chmv2.diff.svg @@ -0,0 +1,193 @@ + + + + +chmv2 +diff vs dpt (+depth_anything) · 0 overridden · 55 added · 0 deleted · 10 new · 2 inherited-as-is + +CHMv2ForDepthEstimation · base model +24 × DINOv3ViTLayerDINOv3ViTLayer× 24 +Self-Attention · DINOv3ViTAttention +MLP · DINOv3ViTMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: GELUActivationact_fn GELU +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +facebook/dinov3-vitl16-chmv2-d +parent +dpt +classes +12 +overridden +0 +added +55 +new classes +10 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +CHMv2Config +add __post_init__; 15 attr + +CHMv2FeatureFusionLayer +add __init__,forward + +CHMv2FeaturesToDepth +add __init__,_create_mixlog_bins,_create_out… + +CHMv2ForDepthEstimation +add __init__,forward,get_input_embeddings + +CHMv2Head +add __init__,forward,forward_features + +CHMv2ImageProcessor +add post_process_depth_estimation; 8 attr + +CHMv2ImageProcessorKwargs +4 attr + +CHMv2PreTrainedModel +add _init_weights; 9 attr + +CHMv2ReassembleStage +add __init__,forward + +CHMv2UpsampleConvHead +add __init__,forward + \ No newline at end of file diff --git a/chmv2.svg b/chmv2.svg new file mode 100644 index 0000000000000000000000000000000000000000..95c3f7e21e6568733bdcfe45dcc077332162ee8e --- /dev/null +++ b/chmv2.svg @@ -0,0 +1,178 @@ + + + + +chmv2 +dense · 24× Attention + +CHMv2ForDepthEstimation · base model +24 × DINOv3ViTLayerDINOv3ViTLayer× 24 +Self-Attention · DINOv3ViTAttention +MLP · DINOv3ViTMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: GELUActivationact_fn GELU +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +facebook/dinov3-vitl16-chmv2-… +model_type +chmv2 +config +CHMv2Config +decoder +dense +layers +24 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/clap.svg b/clap.svg new file mode 100644 index 0000000000000000000000000000000000000000..630b1f2414ce5e2172870dc2a3122c71e67677da --- /dev/null +++ b/clap.svg @@ -0,0 +1,213 @@ + + + + +clap +multimodal · audio+audio → projector → LLM · dense + +ClapModel · base model +12 × ClapTextLayerClapTextLayer× 12 +Audio encoder · ClapAudioModel×4 +Self-Attention · ClapTextAttention +ClapAudioLayer×4 +attention · ClapAudioAttention +output · ClapTextSelfOutput +Audio encoder · ClapProjectionL…×4 +self · ClapAudioSelfAttention +self · ClapTextSelfAttention +intermediate · ClapAudioInterme… +output · ClapAudioOutput +output · ClapAudioSelfOutput + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→50265] +Softmax +logits[1, 6, 50265] +input_features[1, 128, 3000] +layernorm_before: LayerNorm 96layernorm_before LayerNorm 96 +query: Linear [96→96]query [96→96] +key: Linear [96→96]key [96→96] +value: Linear [96→96]value [96→96] +dropout: Dropoutdropout Dropout +dense: Linear [96→96]dense [96→96] +dropout: Dropoutdropout Dropout +drop_path: Identitydrop_path Identity +layernorm_after: LayerNorm 96layernorm_after LayerNorm 96 +dense: Linear [96→384]dense [96→384] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense: Linear [384→96]dense [384→96] +dropout: Dropoutdropout Dropout +input_features[1, 128, 3000] +linear1: Linear [768→512]linear1 [768→512] +activation: ReLUactivation ReLU +linear2: Linear [512→512]linear2 [512→512] +Projector · Linearalign features → text hidden dim +merge at modality tokens + +model id +laion/clap-htsat-fused +inputs +input_ids, input_features +model_type +clap +config +ClapConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +514 +tie_embeddings +None +legend + +audio encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/clip.svg b/clip.svg new file mode 100644 index 0000000000000000000000000000000000000000..a4e8c09b17b3faa222c5a0e13de10bb7273055ae --- /dev/null +++ b/clip.svg @@ -0,0 +1,218 @@ + + + + +clip +multimodal · vision+vision → projector → LLM · dense + +CLIPModel · base model +12 × CLIPEncoderLayerCLIPEncoderLayer× 12 +CLIPForImageClassification · task head +image ⊕ text attention +Vision encoder · CLIPTextModel×12 +Vision encoder · CLIPVisionMod…×12 +Self-Attention · CLIPAttention +CLIPEncoderLayer×12 +CLIPEncoderLayer×12 +MLP · CLIPMLP +self_attn · CLIPAttention +self_attn · CLIPAttention +mlp · CLIPMLP +mlp · CLIPMLP + + + + + + + + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 512]+ position embeddings +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +CLIPForImageClassificationLM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +openai/clip-vit-base-patch32 +inputs +input_ids, pixel_values +model_type +clip +config +CLIPConfig +decoder +dense +layers +12 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +49,408 +max_pos +77 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/clipseg.diff.svg b/clipseg.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..77f0c0146971bed7697e2c83c9288ab574fcd990 --- /dev/null +++ b/clipseg.diff.svg @@ -0,0 +1,241 @@ + + + + +clipseg +diff vs clip · 9 overridden · 26 added · 0 deleted · 7 new · 6 inherited-as-is + +CLIPSegModel · base model +12 × CLIPSegEncoderLayerCLIPSegEncoderLayer× 12 +image ⊕ text attention +Vision encoder · CLIPSegTextM…×12 +Vision encoder · CLIPSegVision…×12 +Self-Attention · CLIPAttention ↩ inherited +CLIPEncoderLayer ↩ inherit…×12 +CLIPEncoderLayer ↩ inherit…×12 +MLP · CLIPMLP ↩ inherited +self_attn · CLIPAttention ↩ inheri… +self_attn · CLIPAttention ↩ inheri… +mlp · CLIPMLP ↩ inherited +mlp · CLIPMLP ↩ inherited + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +CIDAS/clipseg-rd64 +parent +clip +classes +19 +overridden +9 +added +26 +new classes +7 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +CLIPSegDecoderLayer +ovr forward + +CLIPSegModel +ovr forward,get_image_features,get_text_feat… + +CLIPSegPreTrainedModel +ovr _init_weights; 1 attr + +CLIPSegTextModel +ovr forward + +CLIPSegVisionEmbeddings +ovr forward + +CLIPSegVisionModel +ovr forward + +CLIPSegConfig +8 attr + +CLIPSegDecoder +add __init__,forward + +CLIPSegDecoderOutput +3 attr + +CLIPSegForImageSegmentation +add __init__,forward,get_conditional_embeddi… + +CLIPSegImageSegmentationOutput +add to_tuple; 6 attr + +CLIPSegTextConfig +1 attr + +CLIPSegVisionConfig +1 attr + \ No newline at end of file diff --git a/clipseg.svg b/clipseg.svg new file mode 100644 index 0000000000000000000000000000000000000000..d41d52f056ee106aee24601a89263ba538992f92 --- /dev/null +++ b/clipseg.svg @@ -0,0 +1,223 @@ + + + + +clipseg +multimodal · vision+vision → projector → LLM · dense + +CLIPSegModel · base model +12 × CLIPSegEncoderLayerCLIPSegEncoderLayer× 12 +image ⊕ text attention +Vision encoder · CLIPSegTextM…×12 +Vision encoder · CLIPSegVision…×12 +Self-Attention · CLIPSegAttention +CLIPSegEncoderLayer×12 +CLIPSegEncoderLayer×12 +MLP · CLIPSegMLP +self_attn · CLIPSegAttention +self_attn · CLIPSegAttention +mlp · CLIPSegMLP +mlp · CLIPSegMLP + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +CIDAS/clipseg-rd64 +inputs +input_ids, pixel_values +model_type +clipseg +config +CLIPSegConfig +decoder +dense +layers +12 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +49,408 +max_pos +77 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/clvp.svg b/clvp.svg new file mode 100644 index 0000000000000000000000000000000000000000..1a421a8d742e3d4f4dde97f01076aab92a7377c9 --- /dev/null +++ b/clvp.svg @@ -0,0 +1,184 @@ + + + + +clvp +dense · 20× MHA + +ClvpModelForConditionalGeneration · base model +20 × ClvpEncoderLayerClvpEncoderLayer× 20 +Self-Attention · ClvpSelfAttention +MLP · ClvpEncoderMLP +fc1 · ClvpGatedLinearUnit + + + +input_idstokenize("Hey, how are you?") → [1, 10] +token 0: 'he'he0 +token 1: 'y'y1 +token 2: ',',2 +token 3: '[SPACE]'[…3 +token 4: 'h'h4 +token 5: 'ow'ow5 +token 6: '[SPACE]'[…6 +token 7: 'are'a…7 +token 8: '[SPACE]'[…8 +token 9: 'you'y…9 +Token Embeddingweight [256 × 768] → [1, 10, 768] +ClvpRMSNormpre-attention [1, 10, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +ClvpRMSNormpre-FFN [1, 10, 768] +activation_fn: GELUActivationactivation_fn GELU +proj: Linear [768→3072]proj [768→3072] +fc2: Linear [1536→768]fc2 [1536→768] +dropout_layer: Dropoutdropout_layer Dropout +residual add+ +Final RMSNorm[1, 10, 768] +LM HeadLinear [768→256] +Softmax +logits[1, 10, 256] + +model id +susnato/clvp_dev +model_type +clvp +config +ClvpConfig +decoder +dense +layers +20 +hidden +768 +intermediate +1,536 +heads / kv +12 / 12 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +256 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/codegen.svg b/codegen.svg new file mode 100644 index 0000000000000000000000000000000000000000..d6b61c658551f0ba6aa59a1f5b0215fb85a974c5 --- /dev/null +++ b/codegen.svg @@ -0,0 +1,178 @@ + + + + +codegen +dense · 28× MHA + +CodeGenModel · base model +28 × CodeGenBlockCodeGenBlock× 28 +CodeGenForCausalLM · task head +Self-Attention · CodeGenAttention +MLP · CodeGenMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50400 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +attn_dropout: Dropoutattn_dropout Dropout +resid_dropout: Dropoutresid_dropout Dropout +qkv_proj: Linear [4096→12288]qkv_proj [4096→12288] +out_proj: Linear [4096→4096]out_proj [4096→4096] +scaled dot-product attention16 heads · head_dim 256 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 4096] +fc_in: Linear [4096→16384]fc_in [4096→16384] +fc_out: Linear [16384→4096]fc_out [16384→4096] +act: NewGELUActivationact NewGELU +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 4096] +CodeGenForCausalLMLM HeadLinear [4096→50400] +Softmax +logits[1, 6, 50400] + +model id +Salesforce/codegen-2B-mono +model_type +codegen +config +CodeGenConfig +decoder +dense +layers +28 +hidden +4,096 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,400 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/cohere.diff.svg b/cohere.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e4bfef4bb27f77002d87e5cf7be450336db5774d --- /dev/null +++ b/cohere.diff.svg @@ -0,0 +1,186 @@ + + + + +cohere +diff vs llama · 7 overridden · 4 added · 0 deleted · 2 new · 0 inherited-as-is + +CohereModel · base model +40 × CohereDecoderLayerCohereDecoderLayer× 40 +CohereForCausalLM · task head +Self-Attention · CohereAttention +MLP · CohereMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +CohereLayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +CohereLayerNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→22528]gate_proj [8192→22528] +up_proj: Linear [8192→22528]up_proj [8192→22528] +down_proj: Linear [22528→8192]down_proj [22528→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +CohereForCausalLMLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] + +model id +CohereForAI/c4ai-command-r-v01 +parent +llama +classes +7 +overridden +7 +added +4 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +CohereAttention +ovr __init__,forward + +CohereForCausalLM +ovr __init__,forward + +CohereMLP +ovr __init__ + +CohereModel +ovr __init__ + +CohereRotaryEmbedding +ovr forward + +CohereDecoderLayer +add __init__,forward + +CohereLayerNorm +add __init__,forward + \ No newline at end of file diff --git a/cohere.svg b/cohere.svg new file mode 100644 index 0000000000000000000000000000000000000000..6173b9ce93f408a0dd17a9705113101075a82ec8 --- /dev/null +++ b/cohere.svg @@ -0,0 +1,180 @@ + + + + +cohere +dense · 40× MHA + +CohereModel · base model +40 × CohereDecoderLayerCohereDecoderLayer× 40 +CohereForCausalLM · task head +Self-Attention · CohereAttention +MLP · CohereMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +CohereLayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +CohereLayerNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→22528]gate_proj [8192→22528] +up_proj: Linear [8192→22528]up_proj [8192→22528] +down_proj: Linear [22528→8192]down_proj [22528→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +CohereForCausalLMLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] + +model id +CohereForAI/c4ai-command-r-v01 +model_type +cohere +config +CohereConfig +decoder +dense +layers +40 +hidden +8,192 +intermediate +22,528 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/cohere2.diff.svg b/cohere2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..292cfa221d1c2e5c992e8a9687298985e92af17c --- /dev/null +++ b/cohere2.diff.svg @@ -0,0 +1,225 @@ + + + + +cohere2 +diff vs cohere (+gemma2) · 9 overridden · 26 added · 0 deleted · 1 new · 2 inherited-as-is + +Cohere2Model · base model +40 × Cohere2DecoderLayerCohere2DecoderLayer× 40 +Cohere2ForCausalLM · task head +layers (idx) +Self-Attention · Cohere2Attention (2 layer types — same modules, mask differs) +MLP · CohereMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +Cohere2LayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Cohere2LayerNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→22528]gate_proj [8192→22528] +up_proj: Linear [8192→22528]up_proj [8192→22528] +down_proj: Linear [22528→8192]down_proj [22528→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +Cohere2ForCausalLMLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 +layer 36: sliding_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: full_attention39 + +model id +CohereForAI/c4ai-command-r-v01 +parent +cohere +classes +8 +overridden +9 +added +26 +new classes +1 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Cohere2Attention +ovr __init__,forward + +Cohere2DecoderLayer +ovr __init__,forward + +Cohere2Model +ovr __init__,forward + +Cohere2PreTrainedModel +2 attr + +Cohere2RotaryEmbedding +ovr forward + +Cohere2Config +add __post_init__; 25 attr + \ No newline at end of file diff --git a/cohere2.svg b/cohere2.svg new file mode 100644 index 0000000000000000000000000000000000000000..320bac666f44f97ef60d57b8571e5ffac6256879 --- /dev/null +++ b/cohere2.svg @@ -0,0 +1,228 @@ + + + + +cohere2 +dense · 30× sliding + 10× full + +Cohere2Model · base model +40 × Cohere2DecoderLayerCohere2DecoderLayer× 40 +Cohere2ForCausalLM · task head +layers (idx) +Self-Attention · Cohere2Attention (2 layer types — same modules, mask differs) +MLP · Cohere2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +Cohere2LayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Cohere2LayerNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→22528]gate_proj [8192→22528] +up_proj: Linear [8192→22528]up_proj [8192→22528] +down_proj: Linear [22528→8192]down_proj [22528→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +Cohere2ForCausalLMLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 +layer 36: sliding_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: full_attention39 + +model id +CohereForAI/c4ai-command-r-v01 +model_type +cohere2 +config +Cohere2Config +decoder +dense +layers +40 +hidden +8,192 +intermediate +22,528 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +sliding_window +4,096 +tie_embeddings +True +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/cohere2_moe.diff.svg b/cohere2_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..a40274dddbdf5b2316ec9f24e24e9907a5cc4586 --- /dev/null +++ b/cohere2_moe.diff.svg @@ -0,0 +1,233 @@ + + + + +cohere2_moe +diff vs cohere2 (+llama,mixtral) · 9 overridden · 5 added · 0 deleted · 2 new · 3 inherited-as-is + +Cohere2MoeModel · base model +40 × Cohere2MoeDecoderLayerCohere2MoeDecoderLayer× 40 +Cohere2MoeForCausalLM · task head +layers (idx) +Self-Attention · Cohere2MoeAttention (2 layer types — same modules, mask differs) +Sparse MoE · Cohere2MoeSparseMoeBlockMoE +experts · Cohere2MoeExperts (×8 · dim 22528) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +Cohere2MoeLayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPE θ=10,000rotary positions → Q, K +residual add+ +Cohere2MoeLayerNormpre-FFN [1, 6, 8192] +gate: Cohere2MoeTopKRouter top-2 of 8gate TopKRouter top-2 of 8 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +Cohere2MoeForCausalLMLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 +layer 36: sliding_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: full_attention39 + +model id +CohereLabs/command-a-plus-05-2 +parent +cohere2 +classes +12 +overridden +9 +added +5 +new classes +2 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Cohere2MoeAttention +ovr __init__,forward + +Cohere2MoeDecoderLayer +ovr __init__ + +Cohere2MoeExperts +ovr __init__ + +Cohere2MoeForCausalLM +ovr forward + +Cohere2MoeMLP +ovr __init__ + +Cohere2MoeModel +ovr __init__,forward + +Cohere2MoePreTrainedModel +add _init_weights; 1 attr + +Cohere2MoeSparseMoeBlock +add __init__,forward + +Cohere2MoeTopKRouter +add __init__,forward + \ No newline at end of file diff --git a/cohere2_moe.svg b/cohere2_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..476af7a3366964a87b9ae586ea38c516c6558f72 --- /dev/null +++ b/cohere2_moe.svg @@ -0,0 +1,229 @@ + + + + +cohere2_moe +sparse-moe · 30× sliding +MoE + 10× full +MoE + +Cohere2MoeModel · base model +40 × Cohere2MoeDecoderLayerCohere2MoeDecoderLayer× 40 +Cohere2MoeForCausalLM · task head +layers (idx) +Self-Attention · Cohere2MoeAttention (2 layer types — same modules, mask differs) +Sparse MoE · Cohere2MoeSparseMoeBlockMoE +experts · Cohere2MoeExperts (×8 · dim 22528) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +Cohere2MoeLayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPE θ=10,000rotary positions → Q, K +residual add+ +Cohere2MoeLayerNormpre-FFN [1, 6, 8192] +gate: Cohere2MoeTopKRouter top-2 of 8gate TopKRouter top-2 of 8 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +Cohere2MoeForCausalLMLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 +layer 36: sliding_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: full_attention39 + +model id +CohereLabs/command-a-plus-05-… +model_type +cohere2_moe +config +Cohere2MoeConfig +decoder +sparse-moe +layers +40 +hidden +8,192 +intermediate +22,528 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +sliding_window +4,096 +experts (top-k) +8 (top-2) +tie_embeddings +True +legend + +self-attention + +sliding + +full + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/cohere2_vision.diff.svg b/cohere2_vision.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..3ee117d1c7514598cc6f93f97fdb935c33769d87 --- /dev/null +++ b/cohere2_vision.diff.svg @@ -0,0 +1,251 @@ + + + + +cohere2_vision +diff vs aya_vision · 5 overridden · 12 added · 0 deleted · 3 new · 2 inherited-as-is + +Cohere2VisionModel · base model +40 × Cohere2DecoderLayerCohere2DecoderLayer× 40 +Cohere2VisionForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Cohere2Attention (2 layer types — same modules, mask differs) +Vision encoder · SiglipVisionMo…×27 +SiglipEncoderLayer×27 +MLP · Cohere2MLP +self_attn · SiglipAttention +Projector · Cohere2VisionMultiModalP… +mlp · SiglipMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +Cohere2LayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Cohere2LayerNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→22528]gate_proj [8192→22528] +up_proj: Linear [8192→22528]up_proj [8192→22528] +down_proj: Linear [22528→8192]down_proj [22528→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +Cohere2VisionForConditionalGenerationLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 +layer 36: sliding_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: full_attention39 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→3072]fc1 [1152→3072] +fc2: Linear [3072→1152]fc2 [3072→1152] +linear_1: Linear [4608→36864]linear_1 [4608→36864] +act: SiLUact SiLU +linear_2: Linear [18432→8192]linear_2 [18432→8192] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +CohereLabs/command-a-vision-07 +parent +aya_vision +classes +8 +overridden +5 +added +12 +new classes +3 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Cohere2VisionForConditionalGeneration +ovr forward,get_image_features + +Cohere2VisionModel +ovr forward,get_image_features + +Cohere2VisionPreTrainedModel +1 attr + +Cohere2VisionImageProcessor +6 attr + +Cohere2VisionImageProcessorKwargs +3 attr + +Cohere2VisionMultiModalProjector +add __init__,forward,pixel_shuffle + \ No newline at end of file diff --git a/cohere2_vision.svg b/cohere2_vision.svg new file mode 100644 index 0000000000000000000000000000000000000000..78601783def0d2198e60d7a07e2d34c9b27bbd83 --- /dev/null +++ b/cohere2_vision.svg @@ -0,0 +1,262 @@ + + + + +cohere2_vision +multimodal · vision → projector → LLM · dense + +Cohere2VisionModel · base model +40 × Cohere2DecoderLayerCohere2DecoderLayer× 40 +Cohere2VisionForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Cohere2Attention (2 layer types — same modules, mask differs) +Vision encoder · SiglipVisionMo…×27 +SiglipEncoderLayer×27 +MLP · Cohere2MLP +self_attn · SiglipAttention +Projector · Cohere2VisionMultiModalP… +mlp · SiglipMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 8192] → [1, 6, 8192] +Cohere2LayerNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→8192]k_proj [8192→8192] +v_proj: Linear [8192→8192]v_proj [8192→8192] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Cohere2LayerNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→22528]gate_proj [8192→22528] +up_proj: Linear [8192→22528]up_proj [8192→22528] +down_proj: Linear [22528→8192]down_proj [22528→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 8192] +Cohere2VisionForConditionalGenerationLM HeadLinear [8192→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 +layer 36: sliding_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: full_attention39 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→3072]fc1 [1152→3072] +fc2: Linear [3072→1152]fc2 [3072→1152] +linear_1: Linear [4608→36864]linear_1 [4608→36864] +act: SiLUact SiLU +linear_2: Linear [18432→8192]linear_2 [18432→8192] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +CohereLabs/command-a-vision-0… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +cohere2_vision +config +Cohere2VisionConfig +decoder +dense +layers +40 +hidden +8,192 +intermediate +22,528 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +sliding_window +4,096 +tie_embeddings +True +legend + +vision encoder + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/cohere_asr.diff.svg b/cohere_asr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..3e027cabb77579f8c0d666fe0f12d80582773b8f --- /dev/null +++ b/cohere_asr.diff.svg @@ -0,0 +1,182 @@ + + + + +cohere_asr +diff vs moonshine (+clip) · 8 overridden · 8 added · 0 deleted · 3 new · 1 inherited-as-is + +CohereAsrModel · base model +8 × ParakeetEncoderBlockParakeetEncoderBlock× 8 +Self-Attention · ParakeetEncoderAttention +MLP · ParakeetEncoderFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [16384 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +relative_k_proj: Linear [1280→1280]relative_k_proj [1280→1280] +scaled dot-product attention8 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +relu +down_proj +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→16384] +Softmax +logits[1, 6, 16384] + +model id +CohereLabs/cohere-transcribe-0 +parent +moonshine +classes +8 +overridden +8 +added +8 +new classes +3 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +CohereAsrDecoder +ovr __init__,forward; 1 attr + +CohereAsrModel +ovr __init__,forward + +CohereAsrCrossAttention +add __init__,forward + +CohereAsrDecoderLayer +add __init__,forward + +CohereAsrForConditionalGeneration +ovr __init__,forward; add prepare_inputs_for… + +CohereAsrPreTrainedModel +2 attr + +CohereAsrSelfAttention +add __init__,forward + \ No newline at end of file diff --git a/cohere_asr.svg b/cohere_asr.svg new file mode 100644 index 0000000000000000000000000000000000000000..cb04d391d41355a67bb3995d07c6e6963f1a8a67 --- /dev/null +++ b/cohere_asr.svg @@ -0,0 +1,176 @@ + + + + +cohere_asr +dense · 8× MHA + +CohereAsrModel · base model +8 × ParakeetEncoderBlockParakeetEncoderBlock× 8 +Self-Attention · ParakeetEncoderAttention +MLP · ParakeetEncoderFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [16384 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +relative_k_proj: Linear [1280→1280]relative_k_proj [1280→1280] +scaled dot-product attention8 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +relu +down_proj +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→16384] +Softmax +logits[1, 6, 16384] + +model id +CohereLabs/cohere-transcribe-… +model_type +cohere_asr +config +CohereAsrConfig +decoder +dense +layers +8 +hidden +1,024 +intermediate +4,096 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +16,384 +max_pos +1,024 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/colmodernvbert.diff.svg b/colmodernvbert.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e6c75c5737c99b831a28fa50ef1d43a85183b266 --- /dev/null +++ b/colmodernvbert.diff.svg @@ -0,0 +1,206 @@ + + + + +colmodernvbert +diff vs colpali · 3 overridden · 16 added · 0 deleted · 4 new · 0 inherited-as-is + +ColModernVBertForRetrieval · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +ColModernVBertForRetrieval · task head +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +MLP · ModernBertMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +Wqkv: Linear [768→2304]Wqkv [768→2304] +Wo: Linear [768→768]Wo [768→768] +out_drop: Identityout_drop Identity +scaled dot-product attention12 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +Wi: Linear [768→2304]Wi [768→2304] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [1152→768]Wo [1152→768] +residual add+ +Final LayerNorm[1, 6, 768] +ColModernVBertForRetrievalLM HeadLinear [768→50368] +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 + +model id +ModernVBERT/colmodernvbert-mer +parent +colpali +classes +6 +overridden +3 +added +16 +new classes +4 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ColModernVBertForRetrieval +ovr __init__,forward + +ColModernVBertPreTrainedModel +1 attr + +ColModernVBertConfig +add __post_init__; 5 attr + +ColModernVBertForRetrievalOutput +5 attr + +ColModernVBertProcessor +add __init__,process_images,process_queries,… + +ColModernVBertProcessorKwargs +1 attr + \ No newline at end of file diff --git a/colmodernvbert.svg b/colmodernvbert.svg new file mode 100644 index 0000000000000000000000000000000000000000..b0e5d206d57aa20d975ea7db0a75eb28094f38d0 --- /dev/null +++ b/colmodernvbert.svg @@ -0,0 +1,209 @@ + + + + +colmodernvbert +dense · 8× full + 14× sliding + +ColModernVBertForRetrieval · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +ColModernVBertForRetrieval · task head +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +MLP · ModernBertMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +Wqkv: Linear [768→2304]Wqkv [768→2304] +Wo: Linear [768→768]Wo [768→768] +out_drop: Identityout_drop Identity +scaled dot-product attention12 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +Wi: Linear [768→2304]Wi [768→2304] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [1152→768]Wo [1152→768] +residual add+ +Final LayerNorm[1, 6, 768] +ColModernVBertForRetrievalLM HeadLinear [768→50368] +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 + +model id +ModernVBERT/colmodernvbert-me… +model_type +colmodernvbert +config +ColModernVBertConfig +decoder +dense +layers +22 +hidden +768 +intermediate +1,152 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +50,368 +max_pos +8,192 +sliding_window +64 +tie_embeddings +None +legend + +self-attention + +full + +sliding + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/colpali.diff.svg b/colpali.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6b2bb61c71b2d2beadd8188e2675b56cc7ef7414 --- /dev/null +++ b/colpali.diff.svg @@ -0,0 +1,171 @@ + + + + +colpali +diff vs None · 0 overridden · 7 added · 0 deleted · 2 new · 0 inherited-as-is + +ColPaliForRetrieval · base model +18 × GemmaDecoderLayerGemmaDecoderLayer× 18 +ColPaliForRetrieval · task head +Self-Attention · GemmaAttention +MLP · GemmaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [257152 × 2048] → [1, 6, 2048] +GemmaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→256]k_proj [2048→256] +v_proj: Linear [2048→256]v_proj [2048→256] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:1 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GemmaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→16384]gate_proj [2048→16384] +up_proj: Linear [2048→16384]up_proj [2048→16384] +down_proj: Linear [16384→2048]down_proj [16384→2048] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2048] +ColPaliForRetrievalLM HeadLinear [2048→257152] +Softmax +logits[1, 6, 257152] + +model id +vidore/colpali-v1.2 +parent +— +classes +2 +overridden +0 +added +7 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ColPaliProcessor +add __call__,__init__,process_images,process… + +ColPaliProcessorKwargs +1 attr + \ No newline at end of file diff --git a/colpali.svg b/colpali.svg new file mode 100644 index 0000000000000000000000000000000000000000..183bc8fe18c133afabec56cde56267409b3ff858 --- /dev/null +++ b/colpali.svg @@ -0,0 +1,180 @@ + + + + +colpali +dense · 18× MQA + +ColPaliForRetrieval · base model +18 × GemmaDecoderLayerGemmaDecoderLayer× 18 +ColPaliForRetrieval · task head +Self-Attention · GemmaAttention +MLP · GemmaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [257152 × 2048] → [1, 6, 2048] +GemmaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→256]k_proj [2048→256] +v_proj: Linear [2048→256]v_proj [2048→256] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:1 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GemmaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→16384]gate_proj [2048→16384] +up_proj: Linear [2048→16384]up_proj [2048→16384] +down_proj: Linear [16384→2048]down_proj [16384→2048] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2048] +ColPaliForRetrievalLM HeadLinear [2048→257152] +Softmax +logits[1, 6, 257152] + +model id +vidore/colpali-v1.2 +model_type +colpali +config +ColPaliConfig +decoder +dense +layers +18 +hidden +2,048 +intermediate +16,384 +heads / kv +8 / 1 +attention +MQA +norm +RMSNorm +positional +RoPE +vocab +257,152 +max_pos +8,192 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/colqwen2.diff.svg b/colqwen2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..89b71c403d58c3c769c3882691295c2fe7850a6f --- /dev/null +++ b/colqwen2.diff.svg @@ -0,0 +1,177 @@ + + + + +colqwen2 +diff vs colpali · 2 overridden · 10 added · 0 deleted · 3 new · 1 inherited-as-is + +ColQwen2ForRetrieval · base model +80 × Qwen2VLDecoderLayerQwen2VLDecoderLayer× 80 +ColQwen2ForRetrieval · task head +Self-Attention · Qwen2VLAttention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 8192] → [1, 6, 8192] +Qwen2VLRMSNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→1024]k_proj [8192→1024] +v_proj: Linear [8192→1024]v_proj [8192→1024] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2VLRMSNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→29568]gate_proj [8192→29568] +up_proj: Linear [8192→29568]up_proj [8192→29568] +down_proj: Linear [29568→8192]down_proj [29568→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 8192] +ColQwen2ForRetrievalLM HeadLinear [8192→152064] +Softmax +logits[1, 6, 152064] + +model id +vidore/colqwen2-v1.0-hf +parent +colpali +classes +5 +overridden +2 +added +10 +new classes +3 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ColQwen2ForRetrieval +ovr __init__,forward + +ColQwen2ForRetrievalOutput +5 attr + +ColQwen2Processor +add __call__,__init__,_get_num_multimodal_to… + +ColQwen2ProcessorKwargs +1 attr + \ No newline at end of file diff --git a/colqwen2.svg b/colqwen2.svg new file mode 100644 index 0000000000000000000000000000000000000000..b06a889b3fe597e5fb7ff1fa8293d4d669ec00af --- /dev/null +++ b/colqwen2.svg @@ -0,0 +1,180 @@ + + + + +colqwen2 +dense · 80× full + +ColQwen2ForRetrieval · base model +80 × Qwen2VLDecoderLayerQwen2VLDecoderLayer× 80 +ColQwen2ForRetrieval · task head +Self-Attention · Qwen2VLAttention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 8192] → [1, 6, 8192] +Qwen2VLRMSNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→1024]k_proj [8192→1024] +v_proj: Linear [8192→1024]v_proj [8192→1024] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2VLRMSNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→29568]gate_proj [8192→29568] +up_proj: Linear [8192→29568]up_proj [8192→29568] +down_proj: Linear [29568→8192]down_proj [29568→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 8192] +ColQwen2ForRetrievalLM HeadLinear [8192→152064] +Softmax +logits[1, 6, 152064] + +model id +vidore/colqwen2-v1.0-hf +model_type +colqwen2 +config +ColQwen2Config +decoder +dense +layers +80 +hidden +8,192 +intermediate +29,568 +heads / kv +64 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +152,064 +max_pos +32,768 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/conditional_detr.diff.svg b/conditional_detr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b47241d763180cff39bdc7f76908b536ac7f761c --- /dev/null +++ b/conditional_detr.diff.svg @@ -0,0 +1,194 @@ + + + + +conditional_detr +diff vs detr · 7 overridden · 14 added · 0 deleted · 5 new · 11 inherited-as-is + +ConditionalDetrModel · base model +6 × ConditionalDetrEncoderLayerConditionalDetrEncoderLayer× 6 +Self-Attention · DetrSelfAttention ↩ inherited +MLP · DetrMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +microsoft/conditional-detr-res +parent +detr +classes +22 +overridden +7 +added +14 +new classes +5 +inherited as-is +11 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ConditionalDetrDecoderLayer +ovr __init__,forward + +ConditionalDetrModel +ovr __init__,forward + +ConditionalDetrPreTrainedModel +1 attr + +ConditionalDetrDecoder +add __init__,forward; 1 attr + +ConditionalDetrDecoderCrossAttention +add __init__,forward + +ConditionalDetrDecoderOutput +1 attr + +ConditionalDetrDecoderSelfAttention +add __init__,forward + +ConditionalDetrForObjectDetection +ovr __init__,forward; add _set_aux_loss + +ConditionalDetrImageProcessor +add post_process_object_detection,post_proce… + +ConditionalDetrImageProcessorPil +add post_process_object_detection,post_proce… + +ConditionalDetrModelOutput +1 attr + \ No newline at end of file diff --git a/conditional_detr.svg b/conditional_detr.svg new file mode 100644 index 0000000000000000000000000000000000000000..6b6aec0efd6e9f1498fbb0bb6148414f16c3b3d8 --- /dev/null +++ b/conditional_detr.svg @@ -0,0 +1,176 @@ + + + + +conditional_detr +dense · 6× MHA + +ConditionalDetrModel · base model +6 × ConditionalDetrEncoderLayerConditionalDetrEncoderLayer× 6 +Self-Attention · ConditionalDetrSelfAttention +MLP · ConditionalDetrMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +microsoft/conditional-detr-re… +model_type +conditional_detr +config +ConditionalDetrConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/convbert.svg b/convbert.svg new file mode 100644 index 0000000000000000000000000000000000000000..124be46042eb3574a9bb23ba6a9c8c1afdf6ff42 --- /dev/null +++ b/convbert.svg @@ -0,0 +1,182 @@ + + + + +convbert +dense · 12× MHA + +ConvBertModel · base model +12 × ConvBertLayerConvBertLayer× 12 +ConvBertForMaskedLM · task head +Self-Attention · ConvBertAttention +self · ConvBertSelfAttention +output · ConvBertSelfOutput +key_conv_attn_layer · SeparableConv1D + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→384]query [768→384] +key: Linear [768→384]key [768→384] +value: Linear [768→384]value [768→384] +depthwise: Conv1d 768×1×9depthwise Conv1d 768×1×9 +pointwise: Conv1d 384×768×1pointwise Conv1d 384×768×1 +conv_kernel_layer: Linear [384→54]conv_kernel_layer [384→54] +conv_out_layer: Linear [768→384]conv_out_layer [768→384] +unfold: Unfoldunfold Unfold +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +ConvBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +ConvBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +YituTech/conv-bert-base +model_type +convbert +config +ConvBertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/convnext.svg b/convnext.svg new file mode 100644 index 0000000000000000000000000000000000000000..9ca8289a71df684216c0ed58a5f1c37772d5edcc --- /dev/null +++ b/convnext.svg @@ -0,0 +1,154 @@ + + + + +convnext +⚠ no transformer block (conv backbone) — shown from config · dense · 9× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +ConvNextLayerLayerNorm → attentionLayerNorm → MLP×9 +Final LayerNorm +Pool + Classifier head→ class logits [1, 2] + +model id +facebook/convnext-tiny-224 +model_type +convnext +config +ConvNextConfig +decoder +dense +layers +9 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/convnextv2.svg b/convnextv2.svg new file mode 100644 index 0000000000000000000000000000000000000000..bc554b472b284552d427b95817aaa37595bca6e3 --- /dev/null +++ b/convnextv2.svg @@ -0,0 +1,154 @@ + + + + +convnextv2 +⚠ no transformer block (conv backbone) — shown from config · dense · 9× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +ConvNextV2LayerLayerNorm → attentionLayerNorm → MLP×9 +Final LayerNorm +Pool + Classifier head→ class logits [1, 2] + +model id +facebook/convnextv2-tiny-1k-2… +model_type +convnextv2 +config +ConvNextV2Config +decoder +dense +layers +9 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/cpmant.svg b/cpmant.svg new file mode 100644 index 0000000000000000000000000000000000000000..06d3404be69fb4e96dd46247626e3290be72388d --- /dev/null +++ b/cpmant.svg @@ -0,0 +1,186 @@ + + + + +cpmant +dense · 48× MHA + +CpmAntModel · base model +48 × CpmAntTransformerBlockCpmAntTransformerBlock× 48 +CpmAntForCausalLM · task head +Self-Attention · CpmAntSelfAttentionBlock +MLP · CpmAntFFNBlock +self_attention · CpmAntAttention +ffn · CpmAntFeedForward +w_in · CpmAntDenseGatedACT + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30720 × 4096] → [1, 6, 4096] +Normpre-attention [1, 6, 4096] +layernorm_before_attention: CpmAntLayerNorm 4096layernorm_before_attention LayerNorm 4096 +project_q: Linear [4096→4096]project_q [4096→4096] +project_k: Linear [4096→4096]project_k [4096→4096] +project_v: Linear [4096→4096]project_v [4096→4096] +attention_out: Linear [4096→4096]attention_out [4096→4096] +softmax: Softmaxsoftmax Softmax +dropout: Dropoutdropout Dropout +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 4096] +layernorm_before_ffn: CpmAntLayerNorm 4096layernorm_before_ffn LayerNorm 4096 +w_0: Linear [4096→10240]w_0 [4096→10240] +w_1: Linear [4096→10240]w_1 [4096→10240] +act: GELUact GELU +dropout: Dropoutdropout Dropout +w_out: Linear [10240→4096]w_out [10240→4096] +residual add+ +Final LayerNorm[1, 6, 4096] +CpmAntForCausalLMLM HeadLinear [4096→30720] · tied +Softmax +logits[1, 6, 30720] + +model id +openbmb/cpm-ant-10b +model_type +cpmant +config +CpmAntConfig +decoder +dense +layers +48 +hidden +4,096 +intermediate +— +heads / kv +32 / 32 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,720 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/csm.diff.svg b/csm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..23df3ae429887d72368d725f5db4d449698aa385 --- /dev/null +++ b/csm.diff.svg @@ -0,0 +1,188 @@ + + + + +csm +diff vs llama · 9 overridden · 38 added · 0 deleted · 5 new · 5 inherited-as-is + +CsmForConditionalGeneration · base model +16 × CsmDecoderLayerCsmDecoderLayer× 16 +Self-Attention · LlamaAttention ↩ inherited +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [2051 × 2048] → [1, 6, 2048] +CsmRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention32 heads · head_dim 64 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +CsmRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→8192]gate_proj [2048→8192] +up_proj: Linear [2048→8192]up_proj [2048→8192] +down_proj: Linear [8192→2048]down_proj [8192→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +LM HeadLinear [2048→2051] +Softmax +logits[1, 6, 2051] + +model id +sesame/csm-1b +parent +llama +classes +13 +overridden +9 +added +38 +new classes +5 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +CsmBackboneModel +ovr __init__,forward + +CsmBackboneModelEmbeddings +add __init__,forward + +CsmCodebooksHead +add __init__,forward + +CsmDepthDecoderForCausalLM +ovr __init__,forward; add prepare_inputs_for… + +CsmDepthDecoderModel +ovr __init__,forward; 1 attr + +CsmForConditionalGeneration +add __init__,_merge_input_ids_with_input_val… + +CsmOutputWithPast +11 attr + +CsmPreTrainedModel +add _init_weights; 11 attr + \ No newline at end of file diff --git a/csm.svg b/csm.svg new file mode 100644 index 0000000000000000000000000000000000000000..8b75d2202afafbaadb5303df94a8ad2614c316c2 --- /dev/null +++ b/csm.svg @@ -0,0 +1,179 @@ + + + + +csm +dense · 16× GQA + +CsmForConditionalGeneration · base model +16 × CsmDecoderLayerCsmDecoderLayer× 16 +Self-Attention · CsmAttention +MLP · CsmMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [2051 × 2048] → [1, 6, 2048] +CsmRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention32 heads · head_dim 64 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +CsmRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→8192]gate_proj [2048→8192] +up_proj: Linear [2048→8192]up_proj [2048→8192] +down_proj: Linear [8192→2048]down_proj [8192→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +LM HeadLinear [2048→2051] +Softmax +logits[1, 6, 2051] + +model id +sesame/csm-1b +model_type +csm +config +CsmConfig +decoder +dense +layers +16 +hidden +2,048 +intermediate +8,192 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +2,051 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ctrl.svg b/ctrl.svg new file mode 100644 index 0000000000000000000000000000000000000000..c9c6d16ce09fb5ee20129ef2f0757ffc7a8e1833 --- /dev/null +++ b/ctrl.svg @@ -0,0 +1,175 @@ + + + + +ctrl +dense · 48× MHA + +CTRLModel · base model +48 × EncoderLayerEncoderLayer× 48 +CTRLLMHeadModel · task head +Self-Attention · MultiHeadAttention +MLP · Sequential + + +input_idstokenize("Hey, how are you?") → [1, 4] +token 0: 'Hey,'Hey,0 +token 1: 'how'how1 +token 2: 'are'are2 +token 3: 'you?'you?3 +Token Embeddingweight [246534 × 1280] → [1, 4, 1280] +LayerNormpre-attention [1, 4, 1280] +Wq: Linear [1280→1280]Wq [1280→1280] +Wk: Linear [1280→1280]Wk [1280→1280] +Wv: Linear [1280→1280]Wv [1280→1280] +dense: Linear [1280→1280]dense [1280→1280] +scaled dot-product attention16 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 4, 1280] +0: Linear [1280→8192]0 [1280→8192] +1: ReLU1 ReLU +2: Linear [8192→1280]2 [8192→1280] +residual add+ +Final LayerNorm[1, 4, 1280] +CTRLLMHeadModelLM HeadLinear [1280→246534] · tied +Softmax +logits[1, 4, 246534] + +model id +Salesforce/ctrl +model_type +ctrl +config +CTRLConfig +decoder +dense +layers +48 +hidden +1,280 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +246,534 +max_pos +256 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/cvt.svg b/cvt.svg new file mode 100644 index 0000000000000000000000000000000000000000..94274fee29a3fcca67a7251ca15e06c2cb7f293e --- /dev/null +++ b/cvt.svg @@ -0,0 +1,178 @@ + + + + +cvt +dense · 3× MHA + +CvtModel · base model +3 × CvtLayerCvtLayer× 3 +CvtForImageClassification · task head +Self-Attention · CvtAttention +attention · CvtSelfAttention +convolution_projection_query · CvtSelfAttention… +convolution_projection_key · CvtSelfAttentionPr… +convolution_projection_value · CvtSelfAttention… +output · CvtSelfOutput + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +LayerNormpre-attention [1, 6, ?] +convolution_projection: CvtSelfAttentionConvProjectionconvolution_projectionSelfAttentionConvProjection +linear_projection: CvtSelfAttentionLinearProjectionlinear_projectionSelfAttentionLinearProjection +convolution_projection: CvtSelfAttentionConvProjectionconvolution_projectionSelfAttentionConvProjection +linear_projection: CvtSelfAttentionLinearProjectionlinear_projectionSelfAttentionLinearProjection +convolution_projection: CvtSelfAttentionConvProjectionconvolution_projectionSelfAttentionConvProjection +linear_projection: CvtSelfAttentionLinearProjectionlinear_projectionSelfAttentionLinearProjection +projection_query: Linear [64→64]projection_query [64→64] +projection_key: Linear [64→64]projection_key [64→64] +projection_value: Linear [64→64]projection_value [64→64] +dropout: Dropoutdropout Dropout +dense: Linear [64→64]dense [64→64] +dropout: Dropoutdropout Dropout +scaled dot-product attention(1, 3, 6) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, ?] +CvtForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +CvtForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/cvt-13 +model_type +cvt +config +CvtConfig +decoder +dense +layers +3 +hidden +— +intermediate +— +heads / kv +(1, 3, 6) / (1, 3, 6) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/cwm.diff.svg b/cwm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..bf984b77640e6c45d1f8bac7f150e083942496f8 --- /dev/null +++ b/cwm.diff.svg @@ -0,0 +1,246 @@ + + + + +cwm +diff vs llama (+qwen2) · 4 overridden · 27 added · 0 deleted · 2 new · 3 inherited-as-is + +CwmModel · base model +64 × CwmDecoderLayerCwmDecoderLayer× 64 +CwmForCausalLM · task head +layers (idx) +Self-Attention · CwmAttention (2 layer types — same modules, mask differs) +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 6144] → [1, 6, 6144] +CwmRMSNormpre-attention [1, 6, 6144] +q_proj: Linear [6144→6144]q_proj [6144→6144] +k_proj: Linear [6144→1024]k_proj [6144→1024] +v_proj: Linear [6144→1024]v_proj [6144→1024] +o_proj: Linear [6144→6144]o_proj [6144→6144] +scaled dot-product attention48 heads · head_dim 128 · GQA 48:8 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +CwmRMSNormpre-FFN [1, 6, 6144] +gate_proj: Linear [6144→21504]gate_proj [6144→21504] +up_proj: Linear [6144→21504]up_proj [6144→21504] +down_proj: Linear [21504→6144]down_proj [21504→6144] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 6144] +CwmForCausalLMLM HeadLinear [6144→128256] +Softmax +logits[1, 6, 128256] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: full_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: full_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: full_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: full_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: sliding_attention23 +layer 24: full_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: sliding_attention27 +layer 28: full_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: sliding_attention31 +layer 32: full_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: sliding_attention35 +layer 36: full_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: sliding_attention39 +layer 40: full_attention40 +layer 41: sliding_attention41 +layer 42: sliding_attention42 +layer 43: sliding_attention43 +layer 44: full_attention44 +layer 45: sliding_attention45 +layer 46: sliding_attention46 +layer 47: sliding_attention47 +layer 48: full_attention48 +layer 49: sliding_attention49 +layer 50: sliding_attention50 +layer 51: sliding_attention51 +layer 52: full_attention52 +layer 53: sliding_attention53 +layer 54: sliding_attention54 +layer 55: sliding_attention55 +layer 56: full_attention56 +layer 57: sliding_attention57 +layer 58: sliding_attention58 +layer 59: sliding_attention59 +layer 60: full_attention60 +layer 61: sliding_attention61 +layer 62: sliding_attention62 +layer 63: sliding_attention63 + +model id +facebook/cwm +parent +llama +classes +8 +overridden +4 +added +27 +new classes +2 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +CwmAttention +ovr __init__ + +CwmDecoderLayer +ovr __init__ + +CwmConfig +add __post_init__; 25 attr + +CwmModel +ovr __init__,forward; 1 attr + +CwmModelOutputWithPast +rename only + \ No newline at end of file diff --git a/cwm.svg b/cwm.svg new file mode 100644 index 0000000000000000000000000000000000000000..976be049cfd3b71578964199e7bfbe7a60c94a5e --- /dev/null +++ b/cwm.svg @@ -0,0 +1,252 @@ + + + + +cwm +dense · 16× full + 48× sliding + +CwmModel · base model +64 × CwmDecoderLayerCwmDecoderLayer× 64 +CwmForCausalLM · task head +layers (idx) +Self-Attention · CwmAttention (2 layer types — same modules, mask differs) +MLP · CwmMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 6144] → [1, 6, 6144] +CwmRMSNormpre-attention [1, 6, 6144] +q_proj: Linear [6144→6144]q_proj [6144→6144] +k_proj: Linear [6144→1024]k_proj [6144→1024] +v_proj: Linear [6144→1024]v_proj [6144→1024] +o_proj: Linear [6144→6144]o_proj [6144→6144] +scaled dot-product attention48 heads · head_dim 128 · GQA 48:8 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +CwmRMSNormpre-FFN [1, 6, 6144] +gate_proj: Linear [6144→21504]gate_proj [6144→21504] +up_proj: Linear [6144→21504]up_proj [6144→21504] +down_proj: Linear [21504→6144]down_proj [21504→6144] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 6144] +CwmForCausalLMLM HeadLinear [6144→128256] +Softmax +logits[1, 6, 128256] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: full_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: full_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: full_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: full_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: sliding_attention23 +layer 24: full_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: sliding_attention27 +layer 28: full_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: sliding_attention31 +layer 32: full_attention32 +layer 33: sliding_attention33 +layer 34: sliding_attention34 +layer 35: sliding_attention35 +layer 36: full_attention36 +layer 37: sliding_attention37 +layer 38: sliding_attention38 +layer 39: sliding_attention39 +layer 40: full_attention40 +layer 41: sliding_attention41 +layer 42: sliding_attention42 +layer 43: sliding_attention43 +layer 44: full_attention44 +layer 45: sliding_attention45 +layer 46: sliding_attention46 +layer 47: sliding_attention47 +layer 48: full_attention48 +layer 49: sliding_attention49 +layer 50: sliding_attention50 +layer 51: sliding_attention51 +layer 52: full_attention52 +layer 53: sliding_attention53 +layer 54: sliding_attention54 +layer 55: sliding_attention55 +layer 56: full_attention56 +layer 57: sliding_attention57 +layer 58: sliding_attention58 +layer 59: sliding_attention59 +layer 60: full_attention60 +layer 61: sliding_attention61 +layer 62: sliding_attention62 +layer 63: sliding_attention63 + +model id +facebook/cwm +model_type +cwm +config +CwmConfig +decoder +dense +layers +64 +hidden +6,144 +intermediate +21,504 +heads / kv +48 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +128,256 +max_pos +131,072 +sliding_window +8,192 +tie_embeddings +False +legend + +self-attention + +full + +sliding + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/d_fine.diff.svg b/d_fine.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6fc5296e4edd72f3a3cc92b6232a6c6dfe2348b8 --- /dev/null +++ b/d_fine.diff.svg @@ -0,0 +1,219 @@ + + + + +d_fine +diff vs rt_detr · 13 overridden · 88 added · 0 deleted · 9 new · 4 inherited-as-is + +DFineModel · base model +6 × DFineEncoderLayerDFineEncoderLayer× 6 +layers (idx) +Self-Attention · RTDetrSelfAttention ↩ inherited +MLP · DFineMLP +layers · ModuleList + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +0: Linear [256→1024]0 [256→1024] +1: Linear [1024→256]1 [1024→256] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +ustc-community/dfine-xlarge-co +parent +rt_detr +classes +22 +overridden +13 +added +88 +new classes +9 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DFineConvNormLayer +ovr __init__ + +DFineDecoder +ovr __init__,forward + +DFineDecoderLayer +ovr __init__,forward + +DFineEncoderLayer +ovr __init__ + +DFineHybridEncoder +ovr __init__ + +DFineModel +ovr __init__ + +DFinePreTrainedModel +ovr _init_weights + +DFineRepVggBlock +ovr __init__ + +DFineCSPRepLayer +add __init__,forward + +DFineConfig +add __post_init__,validate_architecture; 69 … + +DFineForObjectDetection +ovr __init__,forward; 2 attr + +DFineGate +add __init__,forward + +DFineIntegral +add __init__,forward + +DFineLQE +add __init__,forward + +DFineMLP +add __init__,forward + +DFineMultiscaleDeformableAttention +add __init__,forward + +DFineRepNCSPELAN4 +add __init__,forward + +DFineSCDown +add __init__,forward + \ No newline at end of file diff --git a/d_fine.svg b/d_fine.svg new file mode 100644 index 0000000000000000000000000000000000000000..5c053dbe67e1dde53634af58a4e8674429419202 --- /dev/null +++ b/d_fine.svg @@ -0,0 +1,184 @@ + + + + +d_fine +dense · 2× MHA + +DFineModel · base model +6 × DFineEncoderLayerDFineEncoderLayer× 6 +layers (idx) +Self-Attention · DFineSelfAttention +MLP · DFineMLP +layers · ModuleList + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +0: Linear [256→1024]0 [256→1024] +1: Linear [1024→256]1 [1024→256] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +ustc-community/dfine-xlarge-c… +model_type +d_fine +config +DFineConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +True +legend + +self-attention + +basic + +bottleneck + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dab_detr.svg b/dab_detr.svg new file mode 100644 index 0000000000000000000000000000000000000000..370b7cc60a19bee116d657cb40efd3e7f1997167 --- /dev/null +++ b/dab_detr.svg @@ -0,0 +1,169 @@ + + + + +dab_detr +dense · 6× MHA + +DabDetrModel · base model +6 × DabDetrEncoderLayerDabDetrEncoderLayer× 6 +Self-Attention · DetrAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +out_proj: Linear [256→256]out_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] + +model id +IDEA-Research/dab-detr-resnet… +model_type +dab-detr +config +DabDetrConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dac.svg b/dac.svg new file mode 100644 index 0000000000000000000000000000000000000000..80405316667d20527225eff56ef29dd8cb2aaefd --- /dev/null +++ b/dac.svg @@ -0,0 +1,154 @@ + + + + +dac +⚠ no transformer block (conv backbone) — shown from config · dense · 9× Attention + +input_ids[1, S] +Token Embedding[? × 1024] +DacVectorQuantizeNorm → attentionNorm → MLP×9 +Final Norm +LM Head→ logits [1, S, ?] + +model id +descript/dac_16khz +model_type +dac +config +DacConfig +decoder +dense +layers +9 +hidden +1,024 +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/data2vec.diff.svg b/data2vec.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0a8cf9d289d40a73721fe9c5635d27484d16c2b5 --- /dev/null +++ b/data2vec.diff.svg @@ -0,0 +1,185 @@ + + + + +data2vec +diff vs wav2vec2 · 15 overridden · 6 added · 5 deleted · 3 new · 7 inherited-as-is + +Data2VecTextModel · base model +12 × Data2VecTextLayerData2VecTextLayer× 12 +Data2VecTextForCausalLM · task head +Self-Attention · Wav2Vec2Attention ↩ inherited +output · Wav2Vec2SelfOutput ↩ inherited +self · Wav2Vec2SelfAttention ↩ inherited + +input_idstokenize("Hey, how are you?") → [1, 10] +token 0: 'H'H0 +token 1: '<unk>'<…1 +token 2: '<unk>'<…2 +token 3: '<unk>'<…3 +token 4: '|'|4 +token 5: '<unk>'<…5 +token 6: '<unk>'<…6 +token 7: '<unk>'<…7 +token 8: '|'|8 +token 9: '<unk>'<…9 +Token Embeddingweight [30522 × 768] → [1, 10, 768] +Normpre-attention [1, 10, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 10, 768] +Data2VecTextForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 10, 30522] + +model id +facebook/data2vec-audio-base-9 +parent +wav2vec2 +classes +14 +overridden +15 +added +6 +new classes +3 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Data2VecAudioForCTC +ovr __init__,forward; del freeze_base_model,… + +Data2VecAudioPreTrainedModel +ovr _init_weights; del _get_adapters,init_ad… + +Data2VecAudioFeatureEncoder +ovr __init__ + +Data2VecAudioModel +ovr __init__,forward,freeze_feature_encoder + +Data2VecAudioConvLayer +add __init__,forward + +Data2VecAudioPositionalConvEmbedding +add __init__,forward + +Data2VecAudioPositionalConvLayer +add __init__,forward + \ No newline at end of file diff --git a/data2vec.svg b/data2vec.svg new file mode 100644 index 0000000000000000000000000000000000000000..8716ead4692c970c1cb6c9b3c062db079c3f13ef --- /dev/null +++ b/data2vec.svg @@ -0,0 +1,179 @@ + + + + +data2vec +dense · 12× MHA + +Data2VecTextModel · base model +12 × Data2VecTextLayerData2VecTextLayer× 12 +Data2VecTextForCausalLM · task head +Self-Attention · Data2VecTextAttention +output · Data2VecTextSelfOutput +self · Data2VecTextSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 10] +token 0: 'H'H0 +token 1: '<unk>'<…1 +token 2: '<unk>'<…2 +token 3: '<unk>'<…3 +token 4: '|'|4 +token 5: '<unk>'<…5 +token 6: '<unk>'<…6 +token 7: '<unk>'<…7 +token 8: '|'|8 +token 9: '<unk>'<…9 +Token Embeddingweight [30522 × 768] → [1, 10, 768] +Normpre-attention [1, 10, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 10, 768] +Data2VecTextForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 10, 30522] + +model id +facebook/data2vec-audio-base-… +model_type +data2vec-text +config +Data2VecTextConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dbrx.diff.svg b/dbrx.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..28b2c4506fd6fa6d966ea7ee7986c48cbedfe079 --- /dev/null +++ b/dbrx.diff.svg @@ -0,0 +1,195 @@ + + + + +dbrx +diff vs llama · 0 overridden · 42 added · 0 deleted · 10 new · 1 inherited-as-is + +DbrxModel · base model +24 × DbrxBlockDbrxBlock× 24 +DbrxForCausalLM · task head +Self-Attention · attention +Sparse MoE · DbrxFFNMoE +experts · DbrxExperts (×? · dim ?) +attn · DbrxAttention +router · DbrxRouter (top-? of ?) +mlp · DbrxExpertGLU + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2048] → [1, 6, 2048] +DbrxNormAttentionNormpre-attention [1, 6, 2048] +norm_1: LayerNorm 2048norm_1 LayerNorm 2048 +Wqkv: Linear [2048→2304]Wqkv [2048→2304] +out_proj: Linear [2048→2048]out_proj [2048→2048] +norm_2: LayerNorm 2048norm_2 LayerNorm 2048 +scaled dot-product attention +causal attention mask (q↓ × k→)causal mask +residual add+ +DbrxNormAttentionNormpre-FFN [1, 6, 2048] +layer: Linear [3584→4]layer [3584→4] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final LayerNorm[1, 6, 2048] +DbrxForCausalLMLM HeadLinear [2048→32000] +Softmax +logits[1, 6, 32000] + +model id +transformers-community/dbrx-in +parent +llama +classes +11 +overridden +0 +added +42 +new classes +10 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DbrxAttention +add __init__,forward + +DbrxBlock +add __init__,forward + +DbrxExpertGLU +add __init__,forward + +DbrxExperts +add __init__,forward + +DbrxFFN +add __init__,forward,route_tokens_to_experts + +DbrxForCausalLM +add __init__,forward,get_decoder,get_input_e… + +DbrxModel +add __init__,forward,get_input_embeddings,se… + +DbrxNormAttentionNorm +add __init__,forward + +DbrxPreTrainedModel +add _init_weights; 11 attr + +DbrxRouter +add __init__,forward + \ No newline at end of file diff --git a/dbrx.svg b/dbrx.svg new file mode 100644 index 0000000000000000000000000000000000000000..01f839e652243ce51a5d6fb0d38c58740c121c0e --- /dev/null +++ b/dbrx.svg @@ -0,0 +1,182 @@ + + + + +dbrx +sparse-moe · 24× MQA +MoE + +DbrxModel · base model +24 × DbrxBlockDbrxBlock× 24 +DbrxForCausalLM · task head +Self-Attention · attention +Sparse MoE · DbrxFFNMoE +experts · DbrxExperts (×? · dim ?) +attn · DbrxAttention +router · DbrxRouter (top-? of ?) +mlp · DbrxExpertGLU + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2048] → [1, 6, 2048] +DbrxNormAttentionNormpre-attention [1, 6, 2048] +norm_1: LayerNorm 2048norm_1 LayerNorm 2048 +Wqkv: Linear [2048→2304]Wqkv [2048→2304] +out_proj: Linear [2048→2048]out_proj [2048→2048] +norm_2: LayerNorm 2048norm_2 LayerNorm 2048 +scaled dot-product attention +causal attention mask (q↓ × k→)causal mask +residual add+ +DbrxNormAttentionNormpre-FFN [1, 6, 2048] +layer: Linear [3584→4]layer [3584→4] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final LayerNorm[1, 6, 2048] +DbrxForCausalLMLM HeadLinear [2048→32000] +Softmax +logits[1, 6, 32000] + +model id +transformers-community/dbrx-i… +model_type +dbrx +config +DbrxConfig +decoder +sparse-moe +layers +24 +hidden +2,048 +intermediate +— +heads / kv +16 / 1 +attention +MQA +norm +LayerNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +experts (top-k) +None (top-None) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/deberta.svg b/deberta.svg new file mode 100644 index 0000000000000000000000000000000000000000..2522b5d8a4cf58e01f286e65252b37ea260066a6 --- /dev/null +++ b/deberta.svg @@ -0,0 +1,174 @@ + + + + +deberta +dense · 12× MHA + +DebertaModel · base model +12 × DebertaLayerDebertaLayer× 12 +DebertaForMaskedLM · task head +Self-Attention · DebertaAttention +output · DebertaSelfOutput +self · DisentangledSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +in_proj: Linear [768→2304]in_proj [768→2304] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: DebertaLayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +DebertaForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +DebertaForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/deberta-base +model_type +deberta +config +DebertaConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/deberta_v2.svg b/deberta_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..62db787a8358368bb40573b164a2f19e7cee7cf0 --- /dev/null +++ b/deberta_v2.svg @@ -0,0 +1,176 @@ + + + + +deberta_v2 +dense · 24× MHA + +DebertaV2Model · base model +24 × DebertaV2LayerDebertaV2Layer× 24 +DebertaV2ForMaskedLM · task head +Self-Attention · DebertaV2Attention +self · DisentangledSelfAttention +output · DebertaV2SelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128100 × 1536] → [1, 6, 1536] +Normpre-attention [1, 6, 1536] +query_proj: Linear [1536→1536]query_proj [1536→1536] +key_proj: Linear [1536→1536]key_proj [1536→1536] +value_proj: Linear [1536→1536]value_proj [1536→1536] +dropout: Dropoutdropout Dropout +dense: Linear [1536→1536]dense [1536→1536] +LayerNorm: LayerNorm 1536LayerNorm LayerNorm 1536 +dropout: Dropoutdropout Dropout +scaled dot-product attention24 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 1536] +DebertaV2ForMaskedLMPool (CLS / mean)[1, 6, 1536] → [1, 1536] +DebertaV2ForMaskedLMClassifier headLinear [1536→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/deberta-v2-xlarge +model_type +deberta-v2 +config +DebertaV2Config +decoder +dense +layers +24 +hidden +1,536 +intermediate +6,144 +heads / kv +24 / 24 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +128,100 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/decision_transformer.svg b/decision_transformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..f9fc722d43472307ac31968596f25083016bdcd7 --- /dev/null +++ b/decision_transformer.svg @@ -0,0 +1,177 @@ + + + + +decision_transformer +dense · 3× MQA + +DecisionTransformerModel · base model +3 × DecisionTransformerGPT2BlockDecisionTransformerGPT2Block× 3 +Self-Attention · DecisionTransformerGPT2Attention +MLP · DecisionTransformerGPT2MLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [1 × 128] → [1, 6, 128] +LayerNormpre-attention [1, 6, 128] +c_attn: Conv1D 128×384c_attn Conv1D 128×384 +c_proj: Conv1D 128×128c_proj Conv1D 128×128 +attn_dropout: Dropoutattn_dropout Dropout +resid_dropout: Dropoutresid_dropout Dropout +scaled dot-product attention1 heads · head_dim 128 · MQA +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 128] +c_fc: Conv1D 128×512c_fc Conv1D 128×512 +c_proj: Conv1D 512×128c_proj Conv1D 512×128 +act: ReLUact ReLU +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 128] +LM HeadLinear [128→1] +Softmax +logits[1, 6, 1] + +model id +decision_transformer +model_type +decision_transformer +config +DecisionTransformerConfig +decoder +dense +layers +3 +hidden +128 +intermediate +— +heads / kv +1 / 1 +attention +MQA +norm +LayerNorm +positional +n/a +vocab +1 +max_pos +1,024 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/deepseek_ocr2.diff.svg b/deepseek_ocr2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..136d48245e0cc2ed9f2d01c2fbcbbaf9ef7f6625 --- /dev/null +++ b/deepseek_ocr2.diff.svg @@ -0,0 +1,254 @@ + + + + +deepseek_ocr2 +diff vs qwen2 (+deepseek_v2,llava_next,sam,llama) · 18 overridden · 65 added · 0 deleted · 11 new · 15 inherited-as-is + +DeepseekOcr2Model · base model +32 × DeepseekOcr2TextDecoderLayerDeepseekOcr2TextDecoderLayer× 32 +DeepseekOcr2ForConditionalGeneration · task head +image ⊕ text attention +Sparse MoE · Qwen2TextMLP (2 FFN types ▼) ↩ inheritedMoE +Vision encoder · DeepseekOcr2VisionM… +DeepseekOcr2VisionEncoder…×32 +Self-Attention · Qwen2TextAttention ↩ inherited +shared_experts · Qwen2TextMLP (×64 · dim… +self_attn · Qwen2VisionAttention… +mlp · Qwen2VisionMLP ↩ inherit… +experts · Qwen2TextExperts (×64 · dim 140… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +DeepseekOcr2TextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DeepseekOcr2TextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: Linear top-? of 64gate top-? of 64 +gate_proj: Linear [4096→2814]gate_proj [4096→2814] +up_proj: Linear [4096→2814]up_proj [4096→2814] +down_proj: Linear [2814→4096]down_proj [2814→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekOcr2ForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +input_layernorm: DeepseekOcr2VisionRMSNorm 4096input_layernormVisionRMSNorm 4096 +post_attention_layernorm: DeepseekOcr2VisionRMSNorm 4096post_attention_layernormVisionRMSNorm 4096 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +deepseek-community/DeepSeek-OC +parent +qwen2 +classes +34 +overridden +18 +added +65 +new classes +11 +inherited as-is +15 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DeepseekOcr2ForConditionalGeneration +ovr forward,get_image_features,pack_image_fe… + +DeepseekOcr2Model +ovr __init__,forward,get_image_features,pack… + +DeepseekOcr2PreTrainedModel +ovr _init_weights; 2 attr + +DeepseekOcr2SamPatchEmbeddings +ovr forward + +DeepseekOcr2TextDecoderLayer +ovr __init__ + +DeepseekOcr2TextModel +ovr __init__ + +DeepseekOcr2Config +add __post_init__; 6 attr + +DeepseekOcr2ImageProcessor +add _preprocess,crop_image_to_patches,get_nu… + +DeepseekOcr2ImageProcessorKwargs +2 attr + +DeepseekOcr2ImageProcessorPil +add _preprocess,crop_image_to_patches,pad_to… + +DeepseekOcr2ModelOutputWithPooling +3 attr + +DeepseekOcr2SamVisionConfig +add __post_init__; 3 attr + +DeepseekOcr2SamVisionEncoder +ovr __init__,forward; add interpolate_pos_en… + +DeepseekOcr2SamVisionProj +add __init__,forward + +DeepseekOcr2TextConfig +add __post_init__; 10 attr + +DeepseekOcr2VisionConfig +add __post_init__; 5 attr + +DeepseekOcr2VisionEncoder +ovr __init__,forward; 1 attr + +DeepseekOcr2VisionEncoderConfig +1 attr + +DeepseekOcr2VisionModel +add __init__,forward + \ No newline at end of file diff --git a/deepseek_ocr2.svg b/deepseek_ocr2.svg new file mode 100644 index 0000000000000000000000000000000000000000..daaf4d8ed9023bcee632f874b66606299cd4718b --- /dev/null +++ b/deepseek_ocr2.svg @@ -0,0 +1,220 @@ + + + + +deepseek_ocr2 +multimodal · vision → projector → LLM · sparse-moe + +DeepseekOcr2Model · base model +32 × DeepseekOcr2TextDecoderLayerDeepseekOcr2TextDecoderLayer× 32 +DeepseekOcr2ForConditionalGeneration · task head +image ⊕ text attention +Sparse MoE · DeepseekOcr2TextMLP (2 FFN types ▼)MoE +Vision encoder · DeepseekOcr2VisionM… +DeepseekOcr2VisionEncoder…×32 +Self-Attention · DeepseekOcr2TextAttention +shared_experts · DeepseekOcr2TextMLP (×… +self_attn · DeepseekOcr2VisionAt… +mlp · DeepseekOcr2VisionMLP +experts · DeepseekOcr2TextExperts (×64 ·… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +DeepseekOcr2TextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DeepseekOcr2TextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: Linear top-? of 64gate top-? of 64 +gate_proj: Linear [4096→2814]gate_proj [4096→2814] +up_proj: Linear [4096→2814]up_proj [4096→2814] +down_proj: Linear [2814→4096]down_proj [2814→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekOcr2ForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +input_layernorm: DeepseekOcr2VisionRMSNorm 4096input_layernormVisionRMSNorm 4096 +post_attention_layernorm: DeepseekOcr2VisionRMSNorm 4096post_attention_layernormVisionRMSNorm 4096 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +deepseek-community/DeepSeek-O… +inputs +input_ids, pixel_values +model_type +deepseek_ocr2 +config +DeepseekOcr2Config +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +experts (top-k) +64 (top-None) +tie_embeddings +False +legend + +vision encoder + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/deepseek_v2.diff.svg b/deepseek_v2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6698a42e52ac768e8d05ae9944236ab403b00b6a --- /dev/null +++ b/deepseek_v2.diff.svg @@ -0,0 +1,196 @@ + + + + +deepseek_v2 +diff vs llama (+qwen2_moe) · 4 overridden · 44 added · 0 deleted · 3 new · 4 inherited-as-is + +DeepseekV2Model · base model +32 × DeepseekV2DecoderLayerDeepseekV2DecoderLayer× 32 +DeepseekV2ForCausalLM · task head +Self-Attention · DeepseekV2Attention +Sparse MoE · DeepseekV2MoeMoE +shared_experts · DeepseekV2MLP (×64 · dim 1… +experts · DeepseekV2Experts (×64 · dim 1407) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +DeepseekV2RMSNormpre-attention [1, 6, 4096] +q_a_proj: Linear [4096→1536]q_a_proj [4096→1536] +q_a_layernorm: DeepseekV2RMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→6144]q_b_proj [1536→6144] +kv_a_proj_with_mqa: Linear [4096→576]kv_a_proj_with_mqa [4096→576] +kv_a_layernorm: DeepseekV2RMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→8192]kv_b_proj [512→8192] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DeepseekV2RMSNormpre-FFN [1, 6, 4096] +act_fn: SiLUActivationact_fn SiLU +gate: Linear top-? of 64gate top-? of 64 +gate_proj: Linear [4096→2814]gate_proj [4096→2814] +up_proj: Linear [4096→2814]up_proj [4096→2814] +down_proj: Linear [2814→4096]down_proj [2814→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekV2ForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +deepseek-ai/DeepSeek-V2-Lite +parent +llama +classes +12 +overridden +4 +added +44 +new classes +3 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DeepseekV2DecoderLayer +ovr __init__ + +DeepseekV2Experts +ovr __init__ + +DeepseekV2MLP +ovr __init__ + +DeepseekV2RotaryEmbedding +ovr forward + +DeepseekV2Attention +add __init__,forward + +DeepseekV2Config +add __post_init__; 37 attr + +DeepseekV2Moe +add __init__,forward,route_tokens_to_experts + +DeepseekV2PreTrainedModel +add _init_weights + \ No newline at end of file diff --git a/deepseek_v2.svg b/deepseek_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..aae8a1f934983ec6e9c304318ed8d34d5139c6ba --- /dev/null +++ b/deepseek_v2.svg @@ -0,0 +1,189 @@ + + + + +deepseek_v2 +sparse-moe · 32× MLA +MoE + +DeepseekV2Model · base model +32 × DeepseekV2DecoderLayerDeepseekV2DecoderLayer× 32 +DeepseekV2ForCausalLM · task head +Self-Attention · DeepseekV2Attention +Sparse MoE · DeepseekV2MoeMoE +shared_experts · DeepseekV2MLP (×64 · dim 1… +experts · DeepseekV2Experts (×64 · dim 1407) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +DeepseekV2RMSNormpre-attention [1, 6, 4096] +q_a_proj: Linear [4096→1536]q_a_proj [4096→1536] +q_a_layernorm: DeepseekV2RMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→6144]q_b_proj [1536→6144] +kv_a_proj_with_mqa: Linear [4096→576]kv_a_proj_with_mqa [4096→576] +kv_a_layernorm: DeepseekV2RMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→8192]kv_b_proj [512→8192] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DeepseekV2RMSNormpre-FFN [1, 6, 4096] +act_fn: SiLUActivationact_fn SiLU +gate: Linear top-? of 64gate top-? of 64 +gate_proj: Linear [4096→2814]gate_proj [4096→2814] +up_proj: Linear [4096→2814]up_proj [4096→2814] +down_proj: Linear [2814→4096]down_proj [2814→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekV2ForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +deepseek-ai/DeepSeek-V2-Lite +model_type +deepseek_v2 +config +DeepseekV2Config +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MLA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +experts (top-k) +64 (top-None) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/deepseek_v3.diff.svg b/deepseek_v3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..822b3fe491e25c40dedf021c40dceb68a5ca9101 --- /dev/null +++ b/deepseek_v3.diff.svg @@ -0,0 +1,196 @@ + + + + +deepseek_v3 +diff vs llama (+mixtral,qwen2_moe) · 2 overridden · 10 added · 0 deleted · 5 new · 5 inherited-as-is + +DeepseekV3Model · base model +61 × DeepseekV3DecoderLayerDeepseekV3DecoderLayer× 61 +DeepseekV3ForCausalLM · task head +Self-Attention · DeepseekV3Attention +Sparse MoE · DeepseekV3MoEMoE +shared_experts · LlamaMLP (×256 · dim 2048)… +experts · DeepseekV3NaiveMoe (×256 · dim 20… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [129280 × 7168] → [1, 6, 7168] +DeepseekV3RMSNormpre-attention [1, 6, 7168] +q_a_proj: Linear [7168→1536]q_a_proj [7168→1536] +q_a_layernorm: DeepseekV3RMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→24576]q_b_proj [1536→24576] +kv_a_proj_with_mqa: Linear [7168→576]kv_a_proj_with_mqa [7168→576] +kv_a_layernorm: DeepseekV3RMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→32768]kv_b_proj [512→32768] +o_proj: Linear [16384→7168]o_proj [16384→7168] +scaled dot-product attention128 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DeepseekV3RMSNormpre-FFN [1, 6, 7168] +act_fn: SiLUActivationact_fn SiLU +gate: DeepseekV3TopkRouter top-8 of 256gate TopkRouter top-8 of 256 +gate_proj: Linear [7168→2048]gate_proj [7168→2048] +up_proj: Linear [7168→2048]up_proj [7168→2048] +down_proj: Linear [2048→7168]down_proj [2048→7168] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 7168] +DeepseekV3ForCausalLMLM HeadLinear [7168→129280] +Softmax +logits[1, 6, 129280] + +model id +bzantium/tiny-deepseek-v3 +parent +llama +classes +13 +overridden +2 +added +10 +new classes +5 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DeepseekV3DecoderLayer +ovr __init__ + +DeepseekV3NaiveMoe +ovr __init__ + +DeepseekV3Attention +add __init__,forward + +DeepseekV3ForSequenceClassification +rename only + +DeepseekV3ForTokenClassification +rename only + +DeepseekV3MoE +add __init__,forward,route_tokens_to_experts + +DeepseekV3PreTrainedModel +add _init_weights; 2 attr + +DeepseekV3TopkRouter +add __init__,forward + \ No newline at end of file diff --git a/deepseek_v3.svg b/deepseek_v3.svg new file mode 100644 index 0000000000000000000000000000000000000000..3992566a45376f844b9a41ddf2195527ee96c188 --- /dev/null +++ b/deepseek_v3.svg @@ -0,0 +1,189 @@ + + + + +deepseek_v3 +sparse-moe · 61× MLA +MoE + +DeepseekV3Model · base model +61 × DeepseekV3DecoderLayerDeepseekV3DecoderLayer× 61 +DeepseekV3ForCausalLM · task head +Self-Attention · DeepseekV3Attention +Sparse MoE · DeepseekV3MoEMoE +shared_experts · DeepseekV3MLP (×256 · dim… +experts · DeepseekV3NaiveMoe (×256 · dim 20… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [129280 × 7168] → [1, 6, 7168] +DeepseekV3RMSNormpre-attention [1, 6, 7168] +q_a_proj: Linear [7168→1536]q_a_proj [7168→1536] +q_a_layernorm: DeepseekV3RMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→24576]q_b_proj [1536→24576] +kv_a_proj_with_mqa: Linear [7168→576]kv_a_proj_with_mqa [7168→576] +kv_a_layernorm: DeepseekV3RMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→32768]kv_b_proj [512→32768] +o_proj: Linear [16384→7168]o_proj [16384→7168] +scaled dot-product attention128 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DeepseekV3RMSNormpre-FFN [1, 6, 7168] +act_fn: SiLUActivationact_fn SiLU +gate: DeepseekV3TopkRouter top-8 of 256gate TopkRouter top-8 of 256 +gate_proj: Linear [7168→2048]gate_proj [7168→2048] +up_proj: Linear [7168→2048]up_proj [7168→2048] +down_proj: Linear [2048→7168]down_proj [2048→7168] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 7168] +DeepseekV3ForCausalLMLM HeadLinear [7168→129280] +Softmax +logits[1, 6, 129280] + +model id +bzantium/tiny-deepseek-v3 +model_type +deepseek_v3 +config +DeepseekV3Config +decoder +sparse-moe +layers +61 +hidden +7,168 +intermediate +18,432 +heads / kv +128 / 128 +attention +MLA +norm +RMSNorm +positional +RoPE +vocab +129,280 +max_pos +4,096 +experts (top-k) +256 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/deepseek_v4.diff.svg b/deepseek_v4.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b5d96afe1afe209d5c3c76328d0edba70328a0b5 --- /dev/null +++ b/deepseek_v4.diff.svg @@ -0,0 +1,296 @@ + + + + +deepseek_v4 +diff vs mixtral (+llama,deepseek_v3,laguna) · 18 overridden · 36 added · 0 deleted · 12 new · 3 inherited-as-is + +DeepseekV4Model · base model +43 × DeepseekV4DecoderLayerDeepseekV4DecoderLayer× 43 +DeepseekV4ForCausalLM · task head +layers (idx) +Self-Attention · DeepseekV4Attention (2 layer types — modules differ ▼) +Sparse MoE · DeepseekV4SparseMoeBlock (2 FFN types ▼)MoE +compressor · DeepseekV4CSACompressor +indexer · DeepseekV4Indexer +shared_experts · MixtralMLP (×256 · dim 2048) ↩ inherited +compressor · DeepseekV4HCACompressor +experts · DeepseekV4Experts (×256 · dim 2048) +gate · DeepseekV4HashRouter (top-6 of 256) +gate · DeepseekV4TopKRouter (top-6 of 256) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [129280 × 4096] → [1, 6, 4096] +DeepseekV4RMSNormpre-attention [1, 6, 4096] +q_a_proj: Linear [4096→1024]q_a_proj [4096→1024] +q_a_norm: DeepseekV4RMSNorm 1024q_a_norm RMSNorm 1024 +q_b_proj: Linear [1024→32768]q_b_proj [1024→32768] +q_b_norm: DeepseekV4UnweightedRMSNormq_b_norm UnweightedRMSNorm +kv_proj: Linear [4096→512]kv_proj [4096→512] +kv_norm: DeepseekV4RMSNorm 512kv_norm RMSNorm 512 +o_a_proj: DeepseekV4GroupedLinear [4096→8192]o_a_proj GroupedLinear [4096→8192] +o_b_proj: Linear [8192→4096]o_b_proj [8192→4096] +▼ heavily-compressed +kv_proj: Linear [4096→512]kv_proj [4096→512] +gate_proj: Linear [4096→512]gate_proj [4096→512] +kv_norm: DeepseekV4RMSNorm 512kv_norm RMSNorm 512 +rotary_emb: DeepseekV4RotaryEmbeddingrotary_emb RotaryEmbedding +▼ compressed-sparse +kv_proj: Linear [4096→1024]kv_proj [4096→1024] +gate_proj: Linear [4096→1024]gate_proj [4096→1024] +kv_norm: DeepseekV4RMSNorm 512kv_norm RMSNorm 512 +rotary_emb: DeepseekV4RotaryEmbeddingrotary_emb RotaryEmbedding +kv_proj: Linear [4096→256]kv_proj [4096→256] +gate_proj: Linear [4096→256]gate_proj [4096→256] +kv_norm: DeepseekV4RMSNorm 128kv_norm RMSNorm 128 +q_b_proj: Linear [1024→8192]q_b_proj [1024→8192] +weights_proj: Linear [4096→64]weights_proj [4096→64] +rotary_emb: DeepseekV4RotaryEmbeddingrotary_emb RotaryEmbedding +scaled dot-product attention64 heads · head_dim 512 · GQA 64:1 +heavily_compressed_attention attention mask (q↓ × k→)heavily-compressed mask m=8·… +compressed_sparse_attention attention mask (q↓ × k→)compressed-sparse mask m=4·4c +RoPE θ=10,000rotary positions → Q, K +residual add+ +DeepseekV4RMSNormpre-FFN [1, 6, 4096] +▼ hash_moe +score_fn: SqrtSoftplusActivationscore_fn SqrtSoftplus +▼ moe +score_fn: SqrtSoftplusActivationscore_fn SqrtSoftplus +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [4096→2048]gate_proj [4096→2048] +up_proj: Linear [4096→2048]up_proj [4096→2048] +down_proj: Linear [2048→4096]down_proj [2048→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekV4ForCausalLMLM HeadLinear [4096→129280] +Softmax +logits[1, 6, 129280] +layer 0: heavily_compressed_attention0 +layer 1: heavily_compressed_attention1 +layer 2: heavily_compressed_attention2 +layer 3: compressed_sparse_attention3 +layer 4: heavily_compressed_attention4 +layer 5: compressed_sparse_attention5 +layer 6: heavily_compressed_attention6 +layer 7: compressed_sparse_attention7 +layer 8: heavily_compressed_attention8 +layer 9: compressed_sparse_attention9 +layer 10: heavily_compressed_attention10 +layer 11: compressed_sparse_attention11 +layer 12: heavily_compressed_attention12 +layer 13: compressed_sparse_attention13 +layer 14: heavily_compressed_attention14 +layer 15: compressed_sparse_attention15 +layer 16: heavily_compressed_attention16 +layer 17: compressed_sparse_attention17 +layer 18: heavily_compressed_attention18 +layer 19: compressed_sparse_attention19 +layer 20: heavily_compressed_attention20 +layer 21: compressed_sparse_attention21 +layer 22: heavily_compressed_attention22 +layer 23: compressed_sparse_attention23 +layer 24: heavily_compressed_attention24 +layer 25: compressed_sparse_attention25 +layer 26: heavily_compressed_attention26 +layer 27: compressed_sparse_attention27 +layer 28: heavily_compressed_attention28 +layer 29: compressed_sparse_attention29 +layer 30: heavily_compressed_attention30 +layer 31: compressed_sparse_attention31 +layer 32: heavily_compressed_attention32 +layer 33: compressed_sparse_attention33 +layer 34: heavily_compressed_attention34 +layer 35: compressed_sparse_attention35 +layer 36: heavily_compressed_attention36 +layer 37: compressed_sparse_attention37 +layer 38: heavily_compressed_attention38 +layer 39: compressed_sparse_attention39 +layer 40: heavily_compressed_attention40 +layer 41: compressed_sparse_attention41 +layer 42: heavily_compressed_attention42 + +model id +deepseek-ai/DeepSeek-V4-Flash- +parent +mixtral +classes +21 +overridden +18 +added +36 +new classes +12 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DeepseekV4HashRouter +ovr __init__,forward + +DeepseekV4Model +ovr __init__,forward + +DeepseekV4RotaryEmbedding +ovr __init__,forward + +DeepseekV4TopKRouter +ovr __init__,forward + +DeepseekV4Attention +add __init__,forward + +DeepseekV4CSACache +add __init__,update_overlap_state; 1 attr + +DeepseekV4CSACompressor +add __init__,forward; 1 attr + +DeepseekV4DecoderLayer +add __init__,forward + +DeepseekV4Experts +ovr __init__,forward; add _apply_gate + +DeepseekV4GroupedLinear +add __init__,forward + +DeepseekV4HCACache +add __init__,store_compression_weights,updat… + +DeepseekV4HCACompressor +add __init__,forward; 1 attr + +DeepseekV4HyperConnection +add __init__,forward + +DeepseekV4HyperHead +add __init__,forward + +DeepseekV4Indexer +add __init__,forward; 1 attr + +DeepseekV4PreTrainedModel +ovr _init_weights; 11 attr + +DeepseekV4SparseMoeBlock +add __init__,forward + +DeepseekV4UnweightedRMSNorm +add __init__,forward + \ No newline at end of file diff --git a/deepseek_v4.svg b/deepseek_v4.svg new file mode 100644 index 0000000000000000000000000000000000000000..9c2be894229e0f2bd0eea64208840e434a9978f3 --- /dev/null +++ b/deepseek_v4.svg @@ -0,0 +1,265 @@ + + + + +deepseek_v4 +sparse-moe · 23× heavily-compressed +MoE + 20× compressed-sparse +MoE + +DeepseekV4Model · base model +43 × DeepseekV4DecoderLayerDeepseekV4DecoderLayer× 43 +DeepseekV4ForCausalLM · task head +layers (idx) +Self-Attention · DeepseekV4Attention (2 layer types — modules differ ▼) +Sparse MoE · DeepseekV4SparseMoeBlock (2 FFN types ▼)MoE +compressor · DeepseekV4CSACompressor +indexer · DeepseekV4Indexer +shared_experts · DeepseekV4MLP (×256 · dim 2048) +compressor · DeepseekV4HCACompressor +experts · DeepseekV4Experts (×256 · dim 2048) +gate · DeepseekV4HashRouter (top-6 of 256) +gate · DeepseekV4TopKRouter (top-6 of 256) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [129280 × 4096] → [1, 6, 4096] +DeepseekV4RMSNormpre-attention [1, 6, 4096] +q_a_proj: Linear [4096→1024]q_a_proj [4096→1024] +q_a_norm: DeepseekV4RMSNorm 1024q_a_norm RMSNorm 1024 +q_b_proj: Linear [1024→32768]q_b_proj [1024→32768] +q_b_norm: DeepseekV4UnweightedRMSNormq_b_norm UnweightedRMSNorm +kv_proj: Linear [4096→512]kv_proj [4096→512] +kv_norm: DeepseekV4RMSNorm 512kv_norm RMSNorm 512 +o_a_proj: DeepseekV4GroupedLinear [4096→8192]o_a_proj GroupedLinear [4096→8192] +o_b_proj: Linear [8192→4096]o_b_proj [8192→4096] +▼ heavily-compressed +kv_proj: Linear [4096→512]kv_proj [4096→512] +gate_proj: Linear [4096→512]gate_proj [4096→512] +kv_norm: DeepseekV4RMSNorm 512kv_norm RMSNorm 512 +rotary_emb: DeepseekV4RotaryEmbeddingrotary_emb RotaryEmbedding +▼ compressed-sparse +kv_proj: Linear [4096→1024]kv_proj [4096→1024] +gate_proj: Linear [4096→1024]gate_proj [4096→1024] +kv_norm: DeepseekV4RMSNorm 512kv_norm RMSNorm 512 +rotary_emb: DeepseekV4RotaryEmbeddingrotary_emb RotaryEmbedding +kv_proj: Linear [4096→256]kv_proj [4096→256] +gate_proj: Linear [4096→256]gate_proj [4096→256] +kv_norm: DeepseekV4RMSNorm 128kv_norm RMSNorm 128 +q_b_proj: Linear [1024→8192]q_b_proj [1024→8192] +weights_proj: Linear [4096→64]weights_proj [4096→64] +rotary_emb: DeepseekV4RotaryEmbeddingrotary_emb RotaryEmbedding +scaled dot-product attention64 heads · head_dim 512 · GQA 64:1 +heavily_compressed_attention attention mask (q↓ × k→)heavily-compressed mask m=8·… +compressed_sparse_attention attention mask (q↓ × k→)compressed-sparse mask m=4·4c +RoPE θ=10,000rotary positions → Q, K +residual add+ +DeepseekV4RMSNormpre-FFN [1, 6, 4096] +▼ hash_moe +score_fn: SqrtSoftplusActivationscore_fn SqrtSoftplus +▼ moe +score_fn: SqrtSoftplusActivationscore_fn SqrtSoftplus +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [4096→2048]gate_proj [4096→2048] +up_proj: Linear [4096→2048]up_proj [4096→2048] +down_proj: Linear [2048→4096]down_proj [2048→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekV4ForCausalLMLM HeadLinear [4096→129280] +Softmax +logits[1, 6, 129280] +layer 0: heavily_compressed_attention0 +layer 1: heavily_compressed_attention1 +layer 2: heavily_compressed_attention2 +layer 3: compressed_sparse_attention3 +layer 4: heavily_compressed_attention4 +layer 5: compressed_sparse_attention5 +layer 6: heavily_compressed_attention6 +layer 7: compressed_sparse_attention7 +layer 8: heavily_compressed_attention8 +layer 9: compressed_sparse_attention9 +layer 10: heavily_compressed_attention10 +layer 11: compressed_sparse_attention11 +layer 12: heavily_compressed_attention12 +layer 13: compressed_sparse_attention13 +layer 14: heavily_compressed_attention14 +layer 15: compressed_sparse_attention15 +layer 16: heavily_compressed_attention16 +layer 17: compressed_sparse_attention17 +layer 18: heavily_compressed_attention18 +layer 19: compressed_sparse_attention19 +layer 20: heavily_compressed_attention20 +layer 21: compressed_sparse_attention21 +layer 22: heavily_compressed_attention22 +layer 23: compressed_sparse_attention23 +layer 24: heavily_compressed_attention24 +layer 25: compressed_sparse_attention25 +layer 26: heavily_compressed_attention26 +layer 27: compressed_sparse_attention27 +layer 28: heavily_compressed_attention28 +layer 29: compressed_sparse_attention29 +layer 30: heavily_compressed_attention30 +layer 31: compressed_sparse_attention31 +layer 32: heavily_compressed_attention32 +layer 33: compressed_sparse_attention33 +layer 34: heavily_compressed_attention34 +layer 35: compressed_sparse_attention35 +layer 36: heavily_compressed_attention36 +layer 37: compressed_sparse_attention37 +layer 38: heavily_compressed_attention38 +layer 39: compressed_sparse_attention39 +layer 40: heavily_compressed_attention40 +layer 41: compressed_sparse_attention41 +layer 42: heavily_compressed_attention42 + +model id +deepseek-ai/DeepSeek-V4-Flash… +model_type +deepseek_v4 +config +DeepseekV4Config +decoder +sparse-moe +layers +43 +hidden +4,096 +intermediate +2,048 +heads / kv +64 / 1 +attention +MLA +norm +RMSNorm +positional +RoPE +vocab +129,280 +max_pos +1,048,576 +sliding_window +128 +experts (top-k) +256 (top-6) +tie_embeddings +False +legend + +self-attention + +heavily-compressed + +compressed-sparse + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/deepseek_vl.diff.svg b/deepseek_vl.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..1290dadfa97e087a2f1e66a31d0501c615590313 --- /dev/null +++ b/deepseek_vl.diff.svg @@ -0,0 +1,218 @@ + + + + +deepseek_vl +diff vs janus (+idefics) · 3 overridden · 18 added · 4 deleted · 6 new · 2 inherited-as-is + +DeepseekVLModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +DeepseekVLForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · SiglipVisionMo…×12 +Self-Attention · LlamaAttention +SiglipEncoderLayer×12 +MLP · LlamaMLP +self_attn · SiglipAttention +Projector · DeepseekVLAligner +mlp · SiglipMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekVLForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +linear1: Linear [768→4096]linear1 [768→4096] +activation: GELUactivation GELU +linear2: Linear [4096→4096]linear2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +deepseek-community/deepseek-vl +parent +janus +classes +11 +overridden +3 +added +18 +new classes +6 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DeepseekVLForConditionalGeneration +del decode_image_tokens,generate,prepare_emb… + +DeepseekVLPreTrainedModel +del _init_weights; 1 attr + +DeepseekVLModel +ovr __init__ + +DeepseekVLAligner +add __init__,forward + +DeepseekVLConfig +add __post_init__; 6 attr + +DeepseekVLImageProcessor +add postprocess + +DeepseekVLImageProcessorPil +add postprocess,unnormalize + +DeepseekVLProcessor +add __call__,__init__,batch_decode,decode,mo… + +DeepseekVLProcessorKwargs +1 attr + \ No newline at end of file diff --git a/deepseek_vl.svg b/deepseek_vl.svg new file mode 100644 index 0000000000000000000000000000000000000000..6d6756ade5d66d5298f197288553e5a8228a0898 --- /dev/null +++ b/deepseek_vl.svg @@ -0,0 +1,214 @@ + + + + +deepseek_vl +multimodal · vision → projector → LLM · dense + +DeepseekVLModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +DeepseekVLForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · SiglipVisionMo…×12 +Self-Attention · LlamaAttention +SiglipEncoderLayer×12 +MLP · LlamaMLP +self_attn · SiglipAttention +Projector · DeepseekVLAligner +mlp · SiglipMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekVLForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +linear1: Linear [768→4096]linear1 [768→4096] +activation: GELUactivation GELU +linear2: Linear [4096→4096]linear2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +deepseek-community/deepseek-v… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +deepseek_vl +config +DeepseekVLConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/deepseek_vl_hybrid.diff.svg b/deepseek_vl_hybrid.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..77c1e1ebb78a41e7b9572f380980d697c4d0a5e5 --- /dev/null +++ b/deepseek_vl_hybrid.diff.svg @@ -0,0 +1,265 @@ + + + + +deepseek_vl_hybrid +diff vs deepseek_vl (+idefics,sam) · 6 overridden · 36 added · 0 deleted · 9 new · 3 inherited-as-is + +DeepseekVLHybridModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +DeepseekVLHybridForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · SiglipVisionMo…×12 +Self-Attention · LlamaAttention +Vision encoder · SamVisionMod…×12 +SiglipEncoderLayer×12 +SamVisionLayer×12 +MLP · LlamaMLP +Vision encoder · DeepseekVLSa…×12 +Projector · DeepseekVLHybridAligner +self_attn · SiglipAttention +mlp · SamMLPBlock +mlp · SiglipMLP +Vision encoder · DeepseekVLSa…×12 +attn · SamVisionSdpaAttention + + + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekVLHybridForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +example image +pixel_values[1, 3, 336, 336] +conv1: Conv2dconv1 Conv2d +layer_norm1: DeepseekVLHybridLayerNorm 256layer_norm1 LayerNorm 256 +conv2: Conv2dconv2 Conv2d +layer_norm2: DeepseekVLHybridLayerNorm 256layer_norm2 LayerNorm 256 +example image +pixel_values[1, 3, 336, 336] +conv1: Conv2dconv1 Conv2d +conv2: Conv2dconv2 Conv2d +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +vision_proj: Linear [768→2048]vision_proj [768→2048] +high_res_vision_proj: Linear [1024→2048]high_res_vision_proj [1024→2048] +act: GELUact GELU +proj: Linear [4096→4096]proj [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +deepseek-community/deepseek-vl +parent +deepseek_vl +classes +16 +overridden +6 +added +36 +new classes +9 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DeepseekVLHybridForConditionalGeneration +ovr forward,prepare_inputs_for_generation + +DeepseekVLSamVisionNeck +ovr __init__ + +BaseModelOutputWithHighResVisionEncodings +3 attr + +DeepseekVLHybridAligner +add __init__,forward + +DeepseekVLHybridConfig +add __post_init__; 3 attr + +DeepseekVLHybridImageProcessor +add __init__,_preprocess,_standardize_kwargs… + +DeepseekVLHybridImageProcessorKwargs +5 attr + +DeepseekVLHybridImageProcessorPil +add __init__,_preprocess,_standardize_kwargs… + +DeepseekVLHybridModel +ovr __init__,forward,get_image_features; add… + +DeepseekVLHybridPreTrainedModel +add _init_weights + +DeepseekVLHybridProcessor +add __call__ + +DeepseekVLHybridProcessorKwargs +rename only + +DeepseekVLSamVisionProj +add __init__,forward + \ No newline at end of file diff --git a/deepseek_vl_hybrid.svg b/deepseek_vl_hybrid.svg new file mode 100644 index 0000000000000000000000000000000000000000..5045aff246ca80b8414cf45b64cedcd9eb8ca4ba --- /dev/null +++ b/deepseek_vl_hybrid.svg @@ -0,0 +1,249 @@ + + + + +deepseek_vl_hybrid +multimodal · vision+vision+vision+vision → projector → LLM · dense + +DeepseekVLHybridModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +DeepseekVLHybridForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · SiglipVisionMo…×12 +Self-Attention · LlamaAttention +Vision encoder · SamVisionMod…×12 +SiglipEncoderLayer×12 +SamVisionLayer×12 +MLP · LlamaMLP +Vision encoder · DeepseekVLSa…×12 +Projector · DeepseekVLHybridAligner +self_attn · SiglipAttention +mlp · SamMLPBlock +mlp · SiglipMLP +Vision encoder · DeepseekVLSa…×12 +attn · SamVisionSdpaAttention + + + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +DeepseekVLHybridForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +example image +pixel_values[1, 3, 336, 336] +conv1: Conv2dconv1 Conv2d +layer_norm1: DeepseekVLHybridLayerNorm 256layer_norm1 LayerNorm 256 +conv2: Conv2dconv2 Conv2d +layer_norm2: DeepseekVLHybridLayerNorm 256layer_norm2 LayerNorm 256 +example image +pixel_values[1, 3, 336, 336] +conv1: Conv2dconv1 Conv2d +conv2: Conv2dconv2 Conv2d +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +vision_proj: Linear [768→2048]vision_proj [768→2048] +high_res_vision_proj: Linear [1024→2048]high_res_vision_proj [1024→2048] +act: GELUact GELU +proj: Linear [4096→4096]proj [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +deepseek-community/deepseek-v… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +deepseek_vl_hybrid +config +DeepseekVLHybridConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/deformable_detr.diff.svg b/deformable_detr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..88313560d3a214b574c7227166580a344aa385c7 --- /dev/null +++ b/deformable_detr.diff.svg @@ -0,0 +1,210 @@ + + + + +deformable_detr +diff vs detr · 8 overridden · 56 added · 0 deleted · 9 new · 4 inherited-as-is + +DeformableDetrModel · base model +6 × DeformableDetrEncoderLayerDeformableDetrEncoderLayer× 6 +Self-Attention · DeformableDetrMultiscaleDeformable… +MLP · DetrMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +attn: MultiScaleDeformableAttentionattn MultiScaleDeformableAttention +sampling_offsets: Linear [256→256]sampling_offsets [256→256] +attention_weights: Linear [256→128]attention_weights [256→128] +value_proj: Linear [256→256]value_proj [256→256] +output_proj: Linear [256→256]output_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] + +model id +SenseTime/deformable-detr +parent +detr +classes +20 +overridden +8 +added +56 +new classes +9 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DeformableDetrConvEncoder +ovr __init__ + +DeformableDetrDecoderLayer +ovr __init__,forward + +DeformableDetrEncoderLayer +ovr __init__,forward + +DeformableDetrSinePositionEmbedding +ovr build_sine_position_embedding + +DeformableDetrDecoder +add __init__,forward; 1 attr + +DeformableDetrDecoderOutput +1 attr + +DeformableDetrEncoder +ovr forward; add get_reference_points; 1 attr + +DeformableDetrForObjectDetection +add __init__,forward; 2 attr + +DeformableDetrImageProcessor +add post_process_instance_segmentation,post_… + +DeformableDetrImageProcessorPil +add post_process_instance_segmentation,post_… + +DeformableDetrModel +add __init__,forward,freeze_backbone,gen_enc… + +DeformableDetrModelOutput +12 attr + +DeformableDetrMultiscaleDeformableAttention +add __init__,forward + +DeformableDetrObjectDetectionOutput +5 attr + +DeformableDetrPreTrainedModel +add _init_weights; 11 attr + +MultiScaleDeformableAttention +add forward + \ No newline at end of file diff --git a/deformable_detr.svg b/deformable_detr.svg new file mode 100644 index 0000000000000000000000000000000000000000..0a8bce77fe9a5aea3963c2676190dc0e04b2acc0 --- /dev/null +++ b/deformable_detr.svg @@ -0,0 +1,177 @@ + + + + +deformable_detr +dense · 6× MHA + +DeformableDetrModel · base model +6 × DeformableDetrEncoderLayerDeformableDetrEncoderLayer× 6 +Self-Attention · DeformableDetrMultiscaleDeformable… +MLP · DeformableDetrMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +attn: MultiScaleDeformableAttentionattn MultiScaleDeformableAttention +sampling_offsets: Linear [256→256]sampling_offsets [256→256] +attention_weights: Linear [256→128]attention_weights [256→128] +value_proj: Linear [256→256]value_proj [256→256] +output_proj: Linear [256→256]output_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] + +model id +SenseTime/deformable-detr +model_type +deformable_detr +config +DeformableDetrConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/deimv2.diff.svg b/deimv2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b2bdcca0aed7ddc7c3dbfbc3c6e26f869bae8040 --- /dev/null +++ b/deimv2.diff.svg @@ -0,0 +1,213 @@ + + + + +deimv2 +diff vs d_fine (+llama) · 14 overridden · 29 added · 0 deleted · 8 new · 12 inherited-as-is + +Deimv2Model · base model +6 × Deimv2EncoderLayerDeimv2EncoderLayer× 6 +layers (idx) +Self-Attention · DFineSelfAttention ↩ inherited +MLP · DFineMLP ↩ inherited +layers · ModuleList + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +0: Linear [256→1024]0 [256→1024] +1: Linear [1024→256]1 [1024→256] +act: GELUActivationact GELU +residual add+ +Final RMSNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +Intellindust/DEIMv2_HGNetv2_N_ +parent +d_fine +classes +28 +overridden +14 +added +29 +new classes +8 +inherited as-is +12 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Deimv2Decoder +ovr __init__ + +Deimv2DecoderLayer +ovr __init__,forward + +Deimv2Gate +ovr __init__ + +Deimv2HybridEncoder +ovr __init__,forward + +Deimv2Model +ovr __init__,forward + +Deimv2PreTrainedModel +ovr _init_weights; 1 attr + +Deimv2SwiGLUFFN +ovr __init__ + +Deimv2CSPRepLayer +add __init__,forward + +Deimv2Config +12 attr + +Deimv2ConvEncoder +add __init__,forward + +Deimv2DINOv3ConvEncoder +add __init__,forward + +Deimv2EncoderOutput +3 attr + +Deimv2ForObjectDetection +ovr __init__,forward; add _tied_weights_keys… + +Deimv2LiteEncoder +add __init__,forward; 1 attr + +Deimv2RepNCSPELAN5 +add __init__,forward + +Deimv2SpatialTuningAdapter +add __init__,forward + \ No newline at end of file diff --git a/deimv2.svg b/deimv2.svg new file mode 100644 index 0000000000000000000000000000000000000000..00b0370bb84a3358771e3e844c2ac81617946dd2 --- /dev/null +++ b/deimv2.svg @@ -0,0 +1,184 @@ + + + + +deimv2 +dense · 2× MHA + +Deimv2Model · base model +6 × Deimv2EncoderLayerDeimv2EncoderLayer× 6 +layers (idx) +Self-Attention · Deimv2SelfAttention +MLP · Deimv2MLP +layers · ModuleList + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +0: Linear [256→1024]0 [256→1024] +1: Linear [1024→256]1 [1024→256] +act: GELUActivationact GELU +residual add+ +Final RMSNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +Intellindust/DEIMv2_HGNetv2_N… +model_type +deimv2 +config +Deimv2Config +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +RMSNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +True +legend + +self-attention + +basic + +bottleneck + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/deit.diff.svg b/deit.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..276f6270679727a79b7232d8e7813b980822db0d --- /dev/null +++ b/deit.diff.svg @@ -0,0 +1,172 @@ + + + + +deit +diff vs vit · 6 overridden · 7 added · 0 deleted · 2 new · 2 inherited-as-is + +DeiTModel · base model +12 × DeiTLayerDeiTLayer× 12 +DeiTForImageClassification · task head +Self-Attention · ViTAttention ↩ inherited +MLP · ViTMLP ↩ inherited + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +DeiTForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +DeiTForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/deit-base-distilled-p +parent +vit +classes +7 +overridden +6 +added +7 +new classes +2 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DeiTEmbeddings +ovr __init__,forward,interpolate_pos_encoding + +DeiTForMaskedImageModeling +ovr forward + +DeiTPreTrainedModel +ovr _init_weights; 1 attr + +DeiTForImageClassificationWithTeacher +add __init__,forward + +DeiTForImageClassificationWithTeacherOutput +5 attr + \ No newline at end of file diff --git a/deit.svg b/deit.svg new file mode 100644 index 0000000000000000000000000000000000000000..c58d742a9b98897ea899f9c0d8049318682c2209 --- /dev/null +++ b/deit.svg @@ -0,0 +1,172 @@ + + + + +deit +dense · 12× MHA + +DeiTModel · base model +12 × DeiTLayerDeiTLayer× 12 +DeiTForImageClassification · task head +Self-Attention · DeiTAttention +MLP · DeiTMLP + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +DeiTForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +DeiTForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/deit-base-distilled-… +model_type +deit +config +DeiTConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/depth_anything.svg b/depth_anything.svg new file mode 100644 index 0000000000000000000000000000000000000000..44f99b54cdd9d9219af8a918b1f347bf239973f5 --- /dev/null +++ b/depth_anything.svg @@ -0,0 +1,179 @@ + + + + +depth_anything +dense · 12× Attention + +DepthAnythingForDepthEstimation · base model +12 × Dinov2LayerDinov2Layer× 12 +Self-Attention · Dinov2Attention +MLP · Dinov2MLP +attention · Dinov2SelfAttention +output · Dinov2SelfOutput + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +query: Linear [384→384]query [384→384] +key: Linear [384→384]key [384→384] +value: Linear [384→384]value [384→384] +dense: Linear [384→384]dense [384→384] +dropout: Dropoutdropout Dropout +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +fc1: Linear [384→1536]fc1 [384→1536] +activation: GELUActivationactivation GELU +fc2: Linear [1536→384]fc2 [1536→384] +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +LiheYoung/depth-anything-smal… +model_type +depth_anything +config +DepthAnythingConfig +decoder +dense +layers +12 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/depth_pro.svg b/depth_pro.svg new file mode 100644 index 0000000000000000000000000000000000000000..4e70275400946288c18b2481c5e9b09e45274c76 --- /dev/null +++ b/depth_pro.svg @@ -0,0 +1,179 @@ + + + + +depth_pro +dense · 12× Attention + +DepthProModel · base model +12 × Dinov2LayerDinov2Layer× 12 +Self-Attention · Dinov2Attention +MLP · Dinov2MLP +attention · Dinov2SelfAttention +output · Dinov2SelfOutput + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +fc1: Linear [768→3072]fc1 [768→3072] +activation: GELUActivationactivation GELU +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +apple/DepthPro +model_type +depth_pro +config +DepthProConfig +decoder +dense +layers +12 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/detr.svg b/detr.svg new file mode 100644 index 0000000000000000000000000000000000000000..d828ea44c0fe6c1c5733721be434b986d8d6083a --- /dev/null +++ b/detr.svg @@ -0,0 +1,176 @@ + + + + +detr +dense · 6× MHA + +DetrModel · base model +6 × DetrEncoderLayerDetrEncoderLayer× 6 +Self-Attention · DetrSelfAttention +MLP · DetrMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +facebook/detr-resnet-50 +model_type +detr +config +DetrConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dia.diff.svg b/dia.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6f0f815eb4c489324ec8da2544bc478eaa474a4c --- /dev/null +++ b/dia.diff.svg @@ -0,0 +1,193 @@ + + + + +dia +diff vs llama (+phi3) · 1 overridden · 30 added · 0 deleted · 9 new · 3 inherited-as-is + +DiaModel · base model +18 × DiaDecoderLayerDiaDecoderLayer× 18 +Self-Attention · DiaCrossAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [1028 × 2048] → [1, 6, 2048] +DiaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DiaRMSNormpre-FFN [1, 6, 2048] +gate_up_proj: Linear [2048→16384]gate_up_proj [2048→16384] +down_proj: Linear [8192→2048]down_proj [8192→2048] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +LM HeadLinear [2048→1028] +Softmax +logits[1, 6, 1028] + +model id +nari-labs/Dia-1.6B +parent +llama +classes +13 +overridden +1 +added +30 +new classes +9 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DiaSelfAttention +ovr __init__ + +DiaCrossAttention +add __init__,forward + +DiaDecoder +add __init__,forward; 1 attr + +DiaDecoderLayer +add __init__,forward + +DiaEncoder +add __init__,forward; 1 attr + +DiaEncoderLayer +add __init__,forward + +DiaForConditionalGeneration +add __init__,forward; 2 attr + +DiaModel +add __init__,forward + +DiaMultiChannelEmbedding +add __init__,forward + +DiaPreTrainedModel +add _init_weights; 9 attr + \ No newline at end of file diff --git a/dia.svg b/dia.svg new file mode 100644 index 0000000000000000000000000000000000000000..63bd1b1f18cf59e8d85783d9dd1c95f1a01ec1c3 --- /dev/null +++ b/dia.svg @@ -0,0 +1,178 @@ + + + + +dia +dense · 18× GQA + +DiaModel · base model +18 × DiaDecoderLayerDiaDecoderLayer× 18 +Self-Attention · DiaCrossAttention +MLP · DiaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [1028 × 2048] → [1, 6, 2048] +DiaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DiaRMSNormpre-FFN [1, 6, 2048] +gate_up_proj: Linear [2048→16384]gate_up_proj [2048→16384] +down_proj: Linear [8192→2048]down_proj [8192→2048] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +LM HeadLinear [2048→1028] +Softmax +logits[1, 6, 1028] + +model id +nari-labs/Dia-1.6B +model_type +dia +config +DiaConfig +decoder +dense +layers +18 +hidden +2,048 +intermediate +8,192 +heads / kv +16 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +1,028 +max_pos +3,072 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/diffllama.diff.svg b/diffllama.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9217e46216be85c2cffb2812d62d01c1b1c99161 --- /dev/null +++ b/diffllama.diff.svg @@ -0,0 +1,181 @@ + + + + +diffllama +diff vs llama (+gemma,mistral) · 3 overridden · 6 added · 0 deleted · 3 new · 7 inherited-as-is + +DiffLlamaModel · base model +16 × DiffLlamaDecoderLayerDiffLlamaDecoderLayer× 16 +DiffLlamaForCausalLM · task head +Self-Attention · DiffLlamaSdpaAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2048] → [1, 6, 2048] +DiffLlamaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +groupnorm: RMSNormgroupnorm RMSNorm +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DiffLlamaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→8192]gate_proj [2048→8192] +up_proj: Linear [2048→8192]up_proj [2048→8192] +down_proj: Linear [8192→2048]down_proj [8192→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +DiffLlamaForCausalLMLM HeadLinear [2048→32000] +Softmax +logits[1, 6, 32000] + +model id +kajuma/DiffLlama-0.3B-handcut +parent +llama +classes +12 +overridden +3 +added +6 +new classes +3 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DiffLlamaDecoderLayer +ovr __init__ + +DiffLlamaAttention +add __init__,forward + +DiffLlamaFlashAttention2 +add __init__,forward + +DiffLlamaPreTrainedModel +add _init_weights; 2 attr + +DiffLlamaSdpaAttention +add forward + \ No newline at end of file diff --git a/diffllama.svg b/diffllama.svg new file mode 100644 index 0000000000000000000000000000000000000000..e781e9c37629c7c333d371ba34c126f3e8252386 --- /dev/null +++ b/diffllama.svg @@ -0,0 +1,181 @@ + + + + +diffllama +dense · 16× MHA + +DiffLlamaModel · base model +16 × DiffLlamaDecoderLayerDiffLlamaDecoderLayer× 16 +DiffLlamaForCausalLM · task head +Self-Attention · DiffLlamaSdpaAttention +MLP · DiffLlamaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2048] → [1, 6, 2048] +DiffLlamaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +groupnorm: RMSNormgroupnorm RMSNorm +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DiffLlamaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→8192]gate_proj [2048→8192] +up_proj: Linear [2048→8192]up_proj [2048→8192] +down_proj: Linear [8192→2048]down_proj [8192→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +DiffLlamaForCausalLMLM HeadLinear [2048→32000] +Softmax +logits[1, 6, 32000] + +model id +kajuma/DiffLlama-0.3B-handcut +model_type +diffllama +config +DiffLlamaConfig +decoder +dense +layers +16 +hidden +2,048 +intermediate +8,192 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dinat.svg b/dinat.svg new file mode 100644 index 0000000000000000000000000000000000000000..94b8ae34d95115863eddb80250cff248317fd731 --- /dev/null +++ b/dinat.svg @@ -0,0 +1,156 @@ + + + + +dinat +⚠ config-only — built from config (weights not instantiable on meta) · dense · 4× MHA + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, 512] +DinatDecoderLayerNorm → MHANorm → MLP×4 +Final Norm +Pool + Classifier head→ class logits [1, 2] + +model id +shi-labs/dinat-mini-in1k-224 +model_type +dinat +config +DinatConfig +decoder +dense +layers +4 +hidden +512 +intermediate +— +heads / kv +(2, 4, 8, 16) / (2, 4, 8, 16) +attention +MHA +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/dinov2.svg b/dinov2.svg new file mode 100644 index 0000000000000000000000000000000000000000..0d897f3cdbc161d71b0c418b671ea04bc2235983 --- /dev/null +++ b/dinov2.svg @@ -0,0 +1,175 @@ + + + + +dinov2 +dense · 12× MHA + +Dinov2Model · base model +12 × Dinov2LayerDinov2Layer× 12 +Dinov2ForImageClassification · task head +Self-Attention · Dinov2Attention +MLP · Dinov2MLP +attention · Dinov2SelfAttention +output · Dinov2SelfOutput + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +fc1: Linear [768→3072]fc1 [768→3072] +activation: GELUActivationactivation GELU +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +Dinov2ForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +Dinov2ForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/dinov2-base +model_type +dinov2 +config +Dinov2Config +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dinov2_with_registers.diff.svg b/dinov2_with_registers.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0b8ca0369b866be9154e59ee2c0097cede264cdb --- /dev/null +++ b/dinov2_with_registers.diff.svg @@ -0,0 +1,175 @@ + + + + +dinov2_with_registers +diff vs dinov2 · 5 overridden · 26 added · 0 deleted · 2 new · 3 inherited-as-is + +Dinov2WithRegistersModel · base model +12 × Dinov2WithRegistersLayerDinov2WithRegistersLayer× 12 +Dinov2WithRegistersForImageClassification · task head +Self-Attention · Dinov2Attention ↩ inherited +MLP · Dinov2MLP ↩ inherited +attention · Dinov2SelfAttention ↩ inherited +output · Dinov2SelfOutput ↩ inherited + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +fc1: Linear [768→3072]fc1 [768→3072] +activation: GELUActivationactivation GELU +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +Dinov2WithRegistersForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +Dinov2WithRegistersForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/dinov2-with-registers +parent +dinov2 +classes +8 +overridden +5 +added +26 +new classes +2 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Dinov2WithRegistersBackbone +ovr __init__,forward,get_input_embeddings + +Dinov2WithRegistersForImageClassification +ovr forward + +Dinov2WithRegistersPreTrainedModel +ovr _init_weights + +Dinov2WithRegistersConfig +add __post_init__; 22 attr + +Dinov2WithRegistersEmbeddings +add __init__,forward,interpolate_pos_encoding + \ No newline at end of file diff --git a/dinov2_with_registers.svg b/dinov2_with_registers.svg new file mode 100644 index 0000000000000000000000000000000000000000..952de7d2c65e7e97fe03d8688c91879cee6d13e4 --- /dev/null +++ b/dinov2_with_registers.svg @@ -0,0 +1,175 @@ + + + + +dinov2_with_registers +dense · 12× MHA + +Dinov2WithRegistersModel · base model +12 × Dinov2WithRegistersLayerDinov2WithRegistersLayer× 12 +Dinov2WithRegistersForImageClassification · task head +Self-Attention · Dinov2WithRegistersAttention +MLP · Dinov2WithRegistersMLP +attention · Dinov2WithRegistersSelfAttention +output · Dinov2WithRegistersSelfOutput + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +fc1: Linear [768→3072]fc1 [768→3072] +activation: GELUActivationactivation GELU +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +Dinov2WithRegistersForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +Dinov2WithRegistersForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/dinov2-with-register… +model_type +dinov2_with_registers +config +Dinov2WithRegistersConfig +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dinov3_convnext.svg b/dinov3_convnext.svg new file mode 100644 index 0000000000000000000000000000000000000000..21f5a72dc6101add44102335fea0443305341e1d --- /dev/null +++ b/dinov3_convnext.svg @@ -0,0 +1,154 @@ + + + + +dinov3_convnext +⚠ no transformer block (conv backbone) — shown from config · dense · 9× Attention + +input_ids[1, S] +Token Embedding[? × ?] +DINOv3ConvNextLayerLayerNorm → attentionLayerNorm → MLP×9 +Final LayerNorm +LM Head→ logits [1, S, ?] + +model id +facebook/dinov3-convnext-tiny… +model_type +dinov3_convnext +config +DINOv3ConvNextConfig +decoder +dense +layers +9 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/dinov3_vit.diff.svg b/dinov3_vit.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..89d3540aca9ba65b33cc039beff5eafdd19c0ea7 --- /dev/null +++ b/dinov3_vit.diff.svg @@ -0,0 +1,190 @@ + + + + +dinov3_vit +diff vs dinov2 (+arcee,llama,pixtral,swin) · 5 overridden · 16 added · 0 deleted · 7 new · 4 inherited-as-is + +DINOv3ViTModel · base model +12 × DINOv3ViTLayerDINOv3ViTLayer× 12 +Self-Attention · DINOv3ViTAttention +MLP · Dinov2MLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 384] → [1, 6, 384] +LayerNormpre-attention [1, 6, 384] +k_proj: Linear [384→384]k_proj [384→384] +v_proj: Linear [384→384]v_proj [384→384] +q_proj: Linear [384→384]q_proj [384→384] +o_proj: Linear [384→384]o_proj [384→384] +scaled dot-product attention6 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPE θ=100rotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 384] +up_proj: Linear [384→1536]up_proj [384→1536] +down_proj: Linear [1536→384]down_proj [1536→384] +act_fn: GELUActivationact_fn GELU +residual add+ +Final LayerNorm[1, 6, 384] +LM HeadLinear [384→?] +Softmax +logits[1, 6, ?] + +model id +facebook/dinov3-vits16-pretrai +parent +dinov2 +classes +13 +overridden +5 +added +16 +new classes +7 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DINOv3ViTAttention +ovr __init__,forward + +DINOv3ViTPreTrainedModel +ovr _init_weights; 2 attr + +DINOv3ViTBackbone +add __init__,forward,get_input_embeddings + +DINOv3ViTBackboneOutput +1 attr + +DINOv3ViTEmbeddings +add __init__,forward + +DINOv3ViTEncoder +add __init__,forward + +DINOv3ViTLayer +add __init__,forward + +DINOv3ViTModel +add __init__,forward,get_input_embeddings + +DINOv3ViTRopePositionEmbedding +add __init__,forward; 1 attr + \ No newline at end of file diff --git a/dinov3_vit.svg b/dinov3_vit.svg new file mode 100644 index 0000000000000000000000000000000000000000..87558b77a8d4105f8da5e65aa9eccc6463230efd --- /dev/null +++ b/dinov3_vit.svg @@ -0,0 +1,178 @@ + + + + +dinov3_vit +dense · 12× MHA + +DINOv3ViTModel · base model +12 × DINOv3ViTLayerDINOv3ViTLayer× 12 +Self-Attention · DINOv3ViTAttention +MLP · DINOv3ViTMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 384] → [1, 6, 384] +LayerNormpre-attention [1, 6, 384] +k_proj: Linear [384→384]k_proj [384→384] +v_proj: Linear [384→384]v_proj [384→384] +q_proj: Linear [384→384]q_proj [384→384] +o_proj: Linear [384→384]o_proj [384→384] +scaled dot-product attention6 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPE θ=100rotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 384] +up_proj: Linear [384→1536]up_proj [384→1536] +down_proj: Linear [1536→384]down_proj [1536→384] +act_fn: GELUActivationact_fn GELU +residual add+ +Final LayerNorm[1, 6, 384] +LM HeadLinear [384→?] +Softmax +logits[1, 6, ?] + +model id +facebook/dinov3-vits16-pretra… +model_type +dinov3_vit +config +DINOv3ViTConfig +decoder +dense +layers +12 +hidden +384 +intermediate +1,536 +heads / kv +6 / 6 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/distilbert.svg b/distilbert.svg new file mode 100644 index 0000000000000000000000000000000000000000..dda6a7ebef9d3eeae94afdad1242d768a053d3cd --- /dev/null +++ b/distilbert.svg @@ -0,0 +1,180 @@ + + + + +distilbert +dense · 6× MHA + +DistilBertModel · base model +6 × TransformerBlockTransformerBlock× 6 +DistilBertForMaskedLM · task head +Self-Attention · DistilBertSelfAttention +MLP · FFN + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_lin: Linear [768→768]q_lin [768→768] +k_lin: Linear [768→768]k_lin [768→768] +v_lin: Linear [768→768]v_lin [768→768] +out_lin: Linear [768→768]out_lin [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +dropout: Dropoutdropout Dropout +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +activation: GELUActivationactivation GELU +residual add+ +Final LayerNorm[1, 6, 768] +DistilBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +DistilBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +google/distilbert-base-uncased +model_type +distilbert +config +DistilBertConfig +decoder +dense +layers +6 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/doge.diff.svg b/doge.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ac69fc786ed340a31400e65d5c9c63d06fc99110 --- /dev/null +++ b/doge.diff.svg @@ -0,0 +1,186 @@ + + + + +doge +diff vs llama (+mixtral) · 5 overridden · 41 added · 0 deleted · 4 new · 5 inherited-as-is + +DogeModel · base model +32 × DogeDecoderLayerDogeDecoderLayer× 32 +DogeForCausalLM · task head +Self-Attention · DogeAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32768 × 1024] → [1, 6, 1024] +DogeRMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +dt_proj: Linear [1024→8]dt_proj [1024→8] +o_proj: Linear [1024→1024]o_proj [1024→1024] +q_norm: DogeRMSNorm 128q_norm RMSNorm 128 +k_norm: DogeRMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention8 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DogeRMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→2048]gate_proj [1024→2048] +up_proj: Linear [1024→2048]up_proj [1024→2048] +down_proj: Linear [2048→1024]down_proj [2048→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +DogeForCausalLMLM HeadLinear [1024→32768] +Softmax +logits[1, 6, 32768] + +model id +SmallDoge/Doge-320M +parent +llama +classes +11 +overridden +5 +added +41 +new classes +4 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DogeForCausalLM +ovr __init__,forward + +DogeAttention +add __init__,forward,prepare_dynamic_mask + +DogeCDMoE +add __init__,forward + +DogeConfig +add __post_init__; 32 attr + +DogeDecoderLayer +add __init__,forward + +DogePreTrainedModel +add _init_weights; 3 attr + \ No newline at end of file diff --git a/doge.svg b/doge.svg new file mode 100644 index 0000000000000000000000000000000000000000..70dac656e4b3b2702cbaf84119a414f59e52f432 --- /dev/null +++ b/doge.svg @@ -0,0 +1,185 @@ + + + + +doge +sparse-moe · 32× MHA +MoE + +DogeModel · base model +32 × DogeDecoderLayerDogeDecoderLayer× 32 +DogeForCausalLM · task head +Self-Attention · DogeAttention +MLP · DogeMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32768 × 1024] → [1, 6, 1024] +DogeRMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +dt_proj: Linear [1024→8]dt_proj [1024→8] +o_proj: Linear [1024→1024]o_proj [1024→1024] +q_norm: DogeRMSNorm 128q_norm RMSNorm 128 +k_norm: DogeRMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention8 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +DogeRMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→2048]gate_proj [1024→2048] +up_proj: Linear [1024→2048]up_proj [1024→2048] +down_proj: Linear [2048→1024]down_proj [2048→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +DogeForCausalLMLM HeadLinear [1024→32768] +Softmax +logits[1, 6, 32768] + +model id +SmallDoge/Doge-320M +model_type +doge +config +DogeConfig +decoder +sparse-moe +layers +32 +hidden +1,024 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,768 +max_pos +2,048 +experts (top-k) +16384 (top-64) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/donut.svg b/donut.svg new file mode 100644 index 0000000000000000000000000000000000000000..f0ee5baa193b333e1b87b747779d63be3f8e7ece --- /dev/null +++ b/donut.svg @@ -0,0 +1,169 @@ + + + + +donut +dense · 4× MHA + +DonutSwinModel · base model +4 × DonutSwinLayerDonutSwinLayer× 4 +DonutSwinForImageClassification · task head +Self-Attention · DonutSwinAttention +self · DonutSwinSelfAttention +output · DonutSwinSelfOutput + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +query: Linear [96→96]query [96→96] +key: Linear [96→96]key [96→96] +value: Linear [96→96]value [96→96] +dropout: Dropoutdropout Dropout +dense: Linear [96→96]dense [96→96] +dropout: Dropoutdropout Dropout +scaled dot-product attention(3, 6, 12, 24) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +DonutSwinForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +DonutSwinForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +naver-clova-ix/donut-base +model_type +donut-swin +config +DonutSwinConfig +decoder +dense +layers +4 +hidden +768 +intermediate +— +heads / kv +(3, 6, 12, 24) / (3, 6, 12, 24) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dots1.diff.svg b/dots1.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e1fc6d9707b9d0c9b7eec754f12684cb20cc16b1 --- /dev/null +++ b/dots1.diff.svg @@ -0,0 +1,180 @@ + + + + +dots1 +diff vs qwen3 (+deepseek_v3) · 2 overridden · 36 added · 0 deleted · 1 new · 8 inherited-as-is + +Dots1Model · base model +62 × Dots1DecoderLayerDots1DecoderLayer× 62 +Dots1ForCausalLM · task head +Self-Attention · Qwen3Attention ↩ inherited +Sparse MoE · Qwen3MoE ↩ inheritedMoE +shared_experts · Qwen3MLP (×128 · dim 1408)… +experts · Qwen3NaiveMoe (×128 · dim 1408) ↩… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 4608] → [1, 6, 4608] +Dots1RMSNormpre-attention [1, 6, 4608] +q_proj: Linear [4608→4608]q_proj [4608→4608] +k_proj: Linear [4608→4608]k_proj [4608→4608] +v_proj: Linear [4608→4608]v_proj [4608→4608] +o_proj: Linear [4608→4608]o_proj [4608→4608] +q_norm: Dots1RMSNorm 144q_norm RMSNorm 144 +k_norm: Dots1RMSNorm 144k_norm RMSNorm 144 +scaled dot-product attention32 heads · head_dim 144 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Dots1RMSNormpre-FFN [1, 6, 4608] +act_fn: SiLUActivationact_fn SiLU +gate: Dots1TopkRouter top-6 of 128gate TopkRouter top-6 of 128 +gate_proj: Linear [4608→2816]gate_proj [4608→2816] +up_proj: Linear [4608→2816]up_proj [4608→2816] +down_proj: Linear [2816→4608]down_proj [2816→4608] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4608] +Dots1ForCausalLMLM HeadLinear [4608→152064] +Softmax +logits[1, 6, 152064] + +model id +rednote-hilab/dots.llm1.base +parent +qwen3 +classes +11 +overridden +2 +added +36 +new classes +1 +inherited as-is +8 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Dots1ForCausalLM +ovr forward + +Dots1PreTrainedModel +1 attr + +Dots1Config +add __post_init__; 35 attr + \ No newline at end of file diff --git a/dots1.svg b/dots1.svg new file mode 100644 index 0000000000000000000000000000000000000000..4c7c5fb92b7d7c3bdd9121b61e09cff85c550ee5 --- /dev/null +++ b/dots1.svg @@ -0,0 +1,190 @@ + + + + +dots1 +sparse-moe · 62× full +MoE + +Dots1Model · base model +62 × Dots1DecoderLayerDots1DecoderLayer× 62 +Dots1ForCausalLM · task head +Self-Attention · Dots1Attention +Sparse MoE · Dots1MoEMoE +shared_experts · Dots1MLP (×128 · dim 1408) +experts · Dots1NaiveMoe (×128 · dim 1408) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 4608] → [1, 6, 4608] +Dots1RMSNormpre-attention [1, 6, 4608] +q_proj: Linear [4608→4608]q_proj [4608→4608] +k_proj: Linear [4608→4608]k_proj [4608→4608] +v_proj: Linear [4608→4608]v_proj [4608→4608] +o_proj: Linear [4608→4608]o_proj [4608→4608] +q_norm: Dots1RMSNorm 144q_norm RMSNorm 144 +k_norm: Dots1RMSNorm 144k_norm RMSNorm 144 +scaled dot-product attention32 heads · head_dim 144 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Dots1RMSNormpre-FFN [1, 6, 4608] +act_fn: SiLUActivationact_fn SiLU +gate: Dots1TopkRouter top-6 of 128gate TopkRouter top-6 of 128 +gate_proj: Linear [4608→2816]gate_proj [4608→2816] +up_proj: Linear [4608→2816]up_proj [4608→2816] +down_proj: Linear [2816→4608]down_proj [2816→4608] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4608] +Dots1ForCausalLMLM HeadLinear [4608→152064] +Softmax +logits[1, 6, 152064] + +model id +rednote-hilab/dots.llm1.base +model_type +dots1 +config +Dots1Config +decoder +sparse-moe +layers +62 +hidden +4,608 +intermediate +10,944 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +152,064 +max_pos +2,048 +sliding_window +4,096 +experts (top-k) +128 (top-6) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dpr.svg b/dpr.svg new file mode 100644 index 0000000000000000000000000000000000000000..f0515e9df75fc4307ec7dcfbfc59f3252ebd0e62 --- /dev/null +++ b/dpr.svg @@ -0,0 +1,174 @@ + + + + +dpr +dense · 12× MHA + +DPRQuestionEncoder · base model +12 × BertLayerBertLayer× 12 +Self-Attention · BertAttention +output · BertSelfOutput +self · BertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] + +model id +facebook/dpr-ctx_encoder-sing… +model_type +dpr +config +DPRConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/dpt.diff.svg b/dpt.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d0169530441d2be120899644aa20a8dee8069743 --- /dev/null +++ b/dpt.diff.svg @@ -0,0 +1,163 @@ + + + + +dpt +diff vs None · 0 overridden · 23 added · 0 deleted · 2 new · 0 inherited-as-is + +DPTModel · base model +12 × DPTViTLayerDPTViTLayer× 12 +Self-Attention · DPTViTAttention +attention · DPTSelfAttention +output · DPTViTSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +Intel/dpt-large +parent +— +classes +2 +overridden +0 +added +23 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +DPTImageProcessor +add _preprocess,pad_image,post_process_depth… + +DPTImageProcessorKwargs +4 attr + \ No newline at end of file diff --git a/dpt.svg b/dpt.svg new file mode 100644 index 0000000000000000000000000000000000000000..30e2d5b398678ad37f910dd100b207c46304a9c2 --- /dev/null +++ b/dpt.svg @@ -0,0 +1,172 @@ + + + + +dpt +dense · 12× MHA + +DPTModel · base model +12 × DPTViTLayerDPTViTLayer× 12 +Self-Attention · DPTViTAttention +attention · DPTSelfAttention +output · DPTViTSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +Intel/dpt-large +model_type +dpt +config +DPTConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/edgetam.diff.svg b/edgetam.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6b02b3514b6708e1c1bc77e85972cc2814b9e8f2 --- /dev/null +++ b/edgetam.diff.svg @@ -0,0 +1,192 @@ + + + + +edgetam +diff vs sam2 · 8 overridden · 17 added · 0 deleted · 4 new · 5 inherited-as-is + +EdgeTamModel · base model +4 × EdgeTamTwoWayTransformerEdgeTamTwoWayTransformer× 4 +image ⊕ text attention +Self-Attention · Sam2Attention ↩ inherited + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [256→128]q_proj [256→128] +k_proj: Linear [256→128]k_proj [256→128] +v_proj: Linear [256→128]v_proj [256→128] +o_proj: Linear [128→256]o_proj [128→256] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · EdgeTamPositionalEm…EdgeTamPositionalEmbedding · via AutoMo…edgetam_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +Vision encoder · EdgeTamVisionModelEdgeTamVisionModel · via AutoModeledgetam_vision_model · ? layers · h=? +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +yonigozlan/EdgeTAM-hf +parent +sam2 +classes +12 +overridden +8 +added +17 +new classes +4 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +EdgeTamPreTrainedModel +ovr _init_weights; 1 attr + +EdgeTamVisionModel +ovr forward,get_input_embeddings; 3 attr + +EdgeTamConfig +rename only + +EdgeTamMaskDecoderConfig +rename only + +EdgeTamModel +ovr get_input_embeddings; 1 attr + +EdgeTamPromptEncoderConfig +rename only + +EdgeTamVisionConfig +add __post_init__; 15 attr + \ No newline at end of file diff --git a/edgetam.svg b/edgetam.svg new file mode 100644 index 0000000000000000000000000000000000000000..a2bb2819a6500970649492a3c4601f30696b436c --- /dev/null +++ b/edgetam.svg @@ -0,0 +1,194 @@ + + + + +edgetam +multimodal · vision+vision → projector → LLM · dense + +EdgeTamModel · base model +4 × EdgeTamTwoWayTransformerEdgeTamTwoWayTransformer× 4 +image ⊕ text attention +Self-Attention · EdgeTamAttention + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [256→128]q_proj [256→128] +k_proj: Linear [256→128]k_proj [256→128] +v_proj: Linear [256→128]v_proj [256→128] +o_proj: Linear [128→256]o_proj [128→256] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · EdgeTamPositionalEm…EdgeTamPositionalEmbedding · via AutoMo…edgetam_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +Vision encoder · EdgeTamVisionModelEdgeTamVisionModel · via AutoModeledgetam_vision_model · ? layers · h=? +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +yonigozlan/EdgeTAM-hf +inputs +input_ids, pixel_values +built via +AutoModel +model_type +edgetam +config +EdgeTamConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/edgetam_video.diff.svg b/edgetam_video.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..95c2f9b879673ec9a82fcce308663a9a33ba838f --- /dev/null +++ b/edgetam_video.diff.svg @@ -0,0 +1,258 @@ + + + + +edgetam_video +diff vs sam2_video · 15 overridden · 72 added · 0 deleted · 11 new · 10 inherited-as-is + +EdgeTamVideoModel · base model +4 × EdgeTamVideoModelEdgeTamVideoModel× 4 +image ⊕ text attention +Self-Attention · EdgeTamVideoMemoryAttention +layers · ModuleList +Vision encoder · Sam2VisionModel +0 · EdgeTamVideoMemoryAttentionLayer +1 · EdgeTamVideoMemoryAttentionLayer +Sam2MultiScaleBlock×12 +MLP · Sam2VideoFeedForward ↩ inherited +mlp · Sam2FeedForward +attn · Sam2MultiScaleAttention + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +Normpre-attention [1, 6, ?] +self_attn: EdgeTamVideoRoPESelfAttentionself_attn RoPESelfAttention +cross_attn_image: EdgeTamVideoRoPECrossAttentioncross_attn_image RoPECrossAttention +mlp: EdgeTamVideoMemoryAttentionMLPmlp MemoryAttentionMLP +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +self_attn: EdgeTamVideoRoPESelfAttentionself_attn RoPESelfAttention +cross_attn_image: EdgeTamVideoRoPECrossAttentioncross_attn_image RoPECrossAttention +mlp: EdgeTamVideoMemoryAttentionMLPmlp MemoryAttentionMLP +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +rotary_emb: EdgeTamVideoVisionRotaryEmbeddingrotary_emb VisionRotaryEmbedding +rotary_emb_k: EdgeTamVideoVisionRotaryEmbeddingrotary_emb_k VisionRotaryEmbedding +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Normpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · EdgeTamVideoPositio…EdgeTamVideoPositionalEmbedding · via Au…sam2_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 96layer_norm1 LayerNorm 96 +qkv: Linear [96→288]qkv [96→288] +proj: Linear [96→96]proj [96→96] +layer_norm2: LayerNorm 96layer_norm2 LayerNorm 96 +activation: GELUActivationactivation GELU +proj_in: Linear [96→384]proj_in [96→384] +proj_out: Linear [384→96]proj_out [384→96] +layers: ModuleListlayers ModuleList +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +yonigozlan/EdgeTAM-hf +parent +sam2_video +classes +26 +overridden +15 +added +72 +new classes +11 +inherited as-is +10 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +EdgeTamVideoMemoryAttention +ovr __init__,forward + +EdgeTamVideoModel +ovr __init__,_batch_encode_memories,_build_m… + +EdgeTamVideoPositionEmbeddingSine +ovr build_sine_position_embedding + +EdgeTamVideoPreTrainedModel +ovr _init_weights + +EdgeTamVideoVisionRotaryEmbedding +ovr __init__ + +EdgeTamVideoConfig +add __post_init__; 53 attr + +EdgeTamVideoMaskDecoderConfig +rename only + +EdgeTamVideoMemoryAttentionLayer +add __init__,forward + +EdgeTamVideoMemoryAttentionMLP +add __init__,forward + +EdgeTamVideoPerceiverAttention +add __init__,forward + +EdgeTamVideoPerceiverEncoderLayer +add __init__,forward + +EdgeTamVideoPerceiverMLP +add __init__,forward + +EdgeTamVideoPerceiverResampler +add __init__,_forward_1d,_forward_2d,forward + +EdgeTamVideoPromptEncoderConfig +rename only + +EdgeTamVideoRoPECrossAttention +add __init__,forward + +EdgeTamVideoRoPESelfAttention +add __init__,forward + \ No newline at end of file diff --git a/edgetam_video.svg b/edgetam_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..83af946d4cb6b347183a24027ba33f1e74a0187d --- /dev/null +++ b/edgetam_video.svg @@ -0,0 +1,233 @@ + + + + +edgetam_video +multimodal · vision+vision → projector → LLM · dense + +EdgeTamVideoModel · base model +4 × EdgeTamVideoModelEdgeTamVideoModel× 4 +image ⊕ text attention +Self-Attention · EdgeTamVideoMemoryAttention +layers · ModuleList +Vision encoder · Sam2VisionModel +0 · EdgeTamVideoMemoryAttentionLayer +1 · EdgeTamVideoMemoryAttentionLayer +Sam2MultiScaleBlock×12 +MLP · EdgeTamVideoFeedForward +mlp · Sam2FeedForward +attn · Sam2MultiScaleAttention + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +Normpre-attention [1, 6, ?] +self_attn: EdgeTamVideoRoPESelfAttentionself_attn RoPESelfAttention +cross_attn_image: EdgeTamVideoRoPECrossAttentioncross_attn_image RoPECrossAttention +mlp: EdgeTamVideoMemoryAttentionMLPmlp MemoryAttentionMLP +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +self_attn: EdgeTamVideoRoPESelfAttentionself_attn RoPESelfAttention +cross_attn_image: EdgeTamVideoRoPECrossAttentioncross_attn_image RoPECrossAttention +mlp: EdgeTamVideoMemoryAttentionMLPmlp MemoryAttentionMLP +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +rotary_emb: EdgeTamVideoVisionRotaryEmbeddingrotary_emb VisionRotaryEmbedding +rotary_emb_k: EdgeTamVideoVisionRotaryEmbeddingrotary_emb_k VisionRotaryEmbedding +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Normpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · EdgeTamVideoPositio…EdgeTamVideoPositionalEmbedding · via Au…sam2_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 96layer_norm1 LayerNorm 96 +qkv: Linear [96→288]qkv [96→288] +proj: Linear [96→96]proj [96→96] +layer_norm2: LayerNorm 96layer_norm2 LayerNorm 96 +activation: GELUActivationactivation GELU +proj_in: Linear [96→384]proj_in [96→384] +proj_out: Linear [384→96]proj_out [384→96] +layers: ModuleListlayers ModuleList +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +yonigozlan/EdgeTAM-hf +inputs +input_ids, pixel_values +built via +AutoModel +model_type +edgetam_video +config +EdgeTamVideoConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/efficientloftr.diff.svg b/efficientloftr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e4c2775f63f653b4e120191f89e8f4232f608f30 --- /dev/null +++ b/efficientloftr.diff.svg @@ -0,0 +1,172 @@ + + + + +efficientloftr +diff vs None · 0 overridden · 2 added · 0 deleted · 2 new · 0 inherited-as-is + +EfficientLoFTRModel · base model +14 × EfficientLoFTRLocalFeatureTransformerLayerEfficientLoFTRLocalFeatureTransformerLayer× 14 +Self-Attention · EfficientLoFTRAggregatedAttention +mlp · EfficientLoFTRMLP +aggregation · EfficientLoFTRAggregationLayer +attention · EfficientLoFTRAttention + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +q_aggregation: Conv2dq_aggregation Conv2d +kv_aggregation: MaxPool2dkv_aggregation MaxPool2d +norm: LayerNorm 256norm LayerNorm 256 +q_proj: Linear [256→256]q_proj [256→256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +fc1: Linear [512→512]fc1 [512→512] +activation: LeakyReLUactivation LeakyReLU +fc2: Linear [512→256]fc2 [512→256] +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +zju-community/efficientloftr +parent +— +classes +2 +overridden +0 +added +2 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +EfficientLoFTRImageProcessor +add post_process_keypoint_matching + +EfficientLoFTRImageProcessorPil +add post_process_keypoint_matching + \ No newline at end of file diff --git a/efficientloftr.svg b/efficientloftr.svg new file mode 100644 index 0000000000000000000000000000000000000000..478b00a6bcdaf907832183d723cb4cef3be122b5 --- /dev/null +++ b/efficientloftr.svg @@ -0,0 +1,181 @@ + + + + +efficientloftr +dense · 14× MHA + +EfficientLoFTRModel · base model +14 × EfficientLoFTRLocalFeatureTransformerLayerEfficientLoFTRLocalFeatureTransformerLayer× 14 +Self-Attention · EfficientLoFTRAggregatedAttention +mlp · EfficientLoFTRMLP +aggregation · EfficientLoFTRAggregationLayer +attention · EfficientLoFTRAttention + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +q_aggregation: Conv2dq_aggregation Conv2d +kv_aggregation: MaxPool2dkv_aggregation MaxPool2d +norm: LayerNorm 256norm LayerNorm 256 +q_proj: Linear [256→256]q_proj [256→256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +fc1: Linear [512→512]fc1 [512→512] +activation: LeakyReLUactivation LeakyReLU +fc2: Linear [512→256]fc2 [512→256] +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +zju-community/efficientloftr +model_type +efficientloftr +config +EfficientLoFTRConfig +decoder +dense +layers +14 +hidden +256 +intermediate +512 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/efficientnet.svg b/efficientnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..1e67c49d98e33afc5fe6475d66ece3485428ede5 --- /dev/null +++ b/efficientnet.svg @@ -0,0 +1,154 @@ + + + + +efficientnet +⚠ no transformer block (conv backbone) — shown from config · dense · 55× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +EfficientNetBlockBatchNorm2d → attentionBatchNorm2d → MLP×55 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +google/efficientnet-b7 +model_type +efficientnet +config +EfficientNetConfig +decoder +dense +layers +64 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/electra.svg b/electra.svg new file mode 100644 index 0000000000000000000000000000000000000000..9c456a2be84b42a63e26a10c3961f5c45229c83f --- /dev/null +++ b/electra.svg @@ -0,0 +1,175 @@ + + + + +electra +dense · 12× MHA + +ElectraModel · base model +12 × ElectraLayerElectraLayer× 12 +ElectraForCausalLM · task head +Self-Attention · ElectraAttention +output · ElectraSelfOutput +self · ElectraSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +query: Linear [256→256]query [256→256] +key: Linear [256→256]key [256→256] +value: Linear [256→256]value [256→256] +dropout: Dropoutdropout Dropout +dense: Linear [256→256]dense [256→256] +LayerNorm: LayerNorm 256LayerNorm LayerNorm 256 +dropout: Dropoutdropout Dropout +scaled dot-product attention4 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 256] +ElectraForCausalLMLM HeadLinear [256→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +google/electra-small-discrimi… +model_type +electra +config +ElectraConfig +decoder +dense +layers +12 +hidden +256 +intermediate +1,024 +heads / kv +4 / 4 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/emu3.diff.svg b/emu3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..4fe5028738a3616a18d0281ceda90ba8904c76cd --- /dev/null +++ b/emu3.diff.svg @@ -0,0 +1,237 @@ + + + + +emu3 +diff vs llama (+chameleon,siglip) · 10 overridden · 71 added · 0 deleted · 19 new · 2 inherited-as-is + +Emu3Model · base model +32 × Emu3DecoderLayerEmu3DecoderLayer× 32 +Emu3ForConditionalGeneration · task head +Self-Attention · LlamaAttention ↩ inherited +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [184622 × 4096] → [1, 6, 4096] +Emu3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Emu3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Emu3ForConditionalGenerationLM HeadLinear [4096→184622] +Softmax +logits[1, 6, 184622] + +model id +Emu3-community/Emu3-Chat-hf +parent +llama +classes +26 +overridden +10 +added +71 +new classes +19 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Emu3DecoderLayer +ovr __init__,forward + +Emu3PreTrainedModel +4 attr + +Emu3VQVAEAttentionBlock +ovr __init__ + +Emu3ForCausalLM +ovr __init__,forward; 1 attr + +Emu3ForConditionalGeneration +add __init__,decode_image_tokens,forward,get… + +Emu3ImageVocabularyMapping +add __init__,bpe2img,bpe2img_mapping_tensor,… + +Emu3Model +add __init__,decode_image_tokens,forward,get… + +Emu3TextModel +ovr __init__; 1 attr + +Emu3VQVAE +add __init__,_init_weights,decode,encode; 10… + +Emu3VQVAEConv3d +add __init__,forward + +Emu3VQVAEDecoder +add __init__,forward + +Emu3VQVAEDownBlock +add __init__,forward + +Emu3VQVAEEncoder +add __init__,forward + +Emu3VQVAEEncoderConvUpsample +add __init__,forward + +Emu3VQVAEGroupNorm +add __init__,forward + +Emu3VQVAEMiddleBlock +add __init__,forward + +Emu3VQVAEModelOutput +1 attr + +Emu3VQVAEResnetBlock +add __init__,forward + +Emu3VQVAESpatialNorm +add __init__,forward + +Emu3VQVAETemporalDownsample +add __init__,forward + +Emu3VQVAETemporalResnetBlock +add __init__,forward + +Emu3VQVAETemporalUpsample +add __init__,forward + +Emu3VQVAEUpBlock +add __init__,forward + +Emu3VQVAEVectorQuantizer +add __init__,forward + \ No newline at end of file diff --git a/emu3.svg b/emu3.svg new file mode 100644 index 0000000000000000000000000000000000000000..c44f341fd9e49d30258d9f85a48310875fbb0f06 --- /dev/null +++ b/emu3.svg @@ -0,0 +1,180 @@ + + + + +emu3 +dense · 32× GQA + +Emu3Model · base model +32 × Emu3DecoderLayerEmu3DecoderLayer× 32 +Emu3ForConditionalGeneration · task head +Self-Attention · Emu3Attention +MLP · Emu3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [184622 × 4096] → [1, 6, 4096] +Emu3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Emu3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Emu3ForConditionalGenerationLM HeadLinear [4096→184622] +Softmax +logits[1, 6, 184622] + +model id +Emu3-community/Emu3-Chat-hf +model_type +emu3 +config +Emu3Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +184,622 +max_pos +9,216 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/encodec.svg b/encodec.svg new file mode 100644 index 0000000000000000000000000000000000000000..2166dc1fa777fa90ede2352ab5c34e6705e91f81 --- /dev/null +++ b/encodec.svg @@ -0,0 +1,154 @@ + + + + +encodec +⚠ no transformer block (conv backbone) — shown from config · dense · 32× Attention + +input_ids[1, S] +Token Embedding[? × 128] +EncodecVectorQuantization_WeightNorm → attention_WeightNorm → MLP×32 +Final _WeightNorm +LM Head→ logits [1, S, ?] + +model id +facebook/encodec_24khz +model_type +encodec +config +EncodecConfig +decoder +dense +layers +32 +hidden +128 +intermediate +— +heads / kv +None / None +attention +— +norm +_WeightNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/encoder_decoder.svg b/encoder_decoder.svg new file mode 100644 index 0000000000000000000000000000000000000000..a132b9ee5119458b7309b5748c275afb18b23783 --- /dev/null +++ b/encoder_decoder.svg @@ -0,0 +1,155 @@ + + + + +encoder_decoder +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +encoder_decoder +model_type +encoder-decoder +config +EncoderDecoderConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +— +vocab +— +max_pos +— +tie_embeddings +None +status +failed +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/eomt.diff.svg b/eomt.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..2cdd27277549232e5017ffa39477c7383de59a2f --- /dev/null +++ b/eomt.diff.svg @@ -0,0 +1,191 @@ + + + + +eomt +diff vs dinov2 (+mask2former,siglip) · 5 overridden · 61 added · 2 deleted · 7 new · 4 inherited-as-is + +EomtForUniversalSegmentation · base model +24 × EomtLayerEomtLayer× 24 +Self-Attention · Dinov2Attention ↩ inherited +MLP · Dinov2MLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +fc1: Linear [1024→4096]fc1 [1024→4096] +activation: GELUActivationactivation GELU +fc2: Linear [4096→1024]fc2 [4096→1024] +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +tue-mps/coco_panoptic_eomt_lar +parent +dinov2 +classes +14 +overridden +5 +added +61 +new classes +7 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +EomtEmbeddings +ovr __init__,forward; del interpolate_pos_en… + +EomtForUniversalSegmentation +ovr __init__,forward; add _disable_attention… + +EomtLayer +ovr forward + +EomtConfig +add __post_init__; 33 attr + +EomtForUniversalSegmentationOutput +7 attr + +EomtLayerNorm2d +add __init__,forward + +EomtMaskHead +add __init__,forward + +EomtPreTrainedModel +add _init_weights; 8 attr + +EomtScaleBlock +add __init__,forward + +EomtScaleLayer +add __init__,forward + \ No newline at end of file diff --git a/eomt.svg b/eomt.svg new file mode 100644 index 0000000000000000000000000000000000000000..647f41c3ca84c2d7cedcbafec54fc16d7df242a1 --- /dev/null +++ b/eomt.svg @@ -0,0 +1,176 @@ + + + + +eomt +dense · 24× MHA + +EomtForUniversalSegmentation · base model +24 × EomtLayerEomtLayer× 24 +Self-Attention · EomtAttention +MLP · EomtMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +fc1: Linear [1024→4096]fc1 [1024→4096] +activation: GELUActivationactivation GELU +fc2: Linear [4096→1024]fc2 [4096→1024] +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +tue-mps/coco_panoptic_eomt_la… +model_type +eomt +config +EomtConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/eomt_dinov3.diff.svg b/eomt_dinov3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..c02fbce4065592352866744154ee4c54a36e9037 --- /dev/null +++ b/eomt_dinov3.diff.svg @@ -0,0 +1,178 @@ + + + + +eomt_dinov3 +diff vs dinov3_vit (+eomt) · 9 overridden · 41 added · 0 deleted · 1 new · 5 inherited-as-is + +EomtDinov3ForUniversalSegmentation · base model +24 × EomtDinov3LayerEomtDinov3Layer× 24 +Self-Attention · DINOv3ViTAttention ↩ inherited +MLP · DINOv3ViTMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: GELUActivationact_fn GELU +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +tue-mps/coco_panoptic_eomt_lar +parent +dinov3_vit +classes +10 +overridden +9 +added +41 +new classes +1 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +EomtDinov3Embeddings +ovr __init__ + +EomtDinov3ForUniversalSegmentation +ovr __init__,forward + +EomtDinov3Config +39 attr + +EomtDinov3PreTrainedModel +ovr _init_weights; 4 attr + +EomtDinov3RotaryEmbedding +ovr __init__; add compute_default_rope_param… + \ No newline at end of file diff --git a/eomt_dinov3.svg b/eomt_dinov3.svg new file mode 100644 index 0000000000000000000000000000000000000000..c558571859d7616f2449e13de92b5532ad31a6ab --- /dev/null +++ b/eomt_dinov3.svg @@ -0,0 +1,178 @@ + + + + +eomt_dinov3 +dense · 24× MHA + +EomtDinov3ForUniversalSegmentation · base model +24 × EomtDinov3LayerEomtDinov3Layer× 24 +Self-Attention · EomtDinov3Attention +MLP · EomtDinov3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: GELUActivationact_fn GELU +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +tue-mps/coco_panoptic_eomt_la… +model_type +eomt_dinov3 +config +EomtDinov3Config +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ernie.diff.svg b/ernie.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9cd8b233c30a79080032ef75770fb8a263346742 --- /dev/null +++ b/ernie.diff.svg @@ -0,0 +1,193 @@ + + + + +ernie +diff vs bert · 15 overridden · 9 added · 0 deleted · 1 new · 7 inherited-as-is + +ErnieModel · base model +12 × ErnieLayerErnieLayer× 12 +ErnieForCausalLM · task head +Self-Attention · BertAttention ↩ inherited +output · BertSelfOutput ↩ inherited +self · BertSelfAttention ↩ inherited + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +ErnieForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +nghuyong/ernie-3.0-base-zh +parent +bert +classes +18 +overridden +15 +added +9 +new classes +1 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ErnieEmbeddings +ovr __init__,forward + +ErnieForCausalLM +ovr forward + +ErnieForMaskedLM +ovr forward; 1 attr + +ErnieForMultipleChoice +ovr forward + +ErnieForNextSentencePrediction +ovr forward + +ErnieForPreTraining +ovr forward; 1 attr + +ErnieForQuestionAnswering +ovr forward + +ErnieForSequenceClassification +ovr forward + +ErnieForTokenClassification +ovr forward + +ErnieModel +ovr __init__,forward; 1 attr + +ErniePreTrainedModel +add _init_weights; 8 attr + \ No newline at end of file diff --git a/ernie.svg b/ernie.svg new file mode 100644 index 0000000000000000000000000000000000000000..3b43e53b930d8c9d05f293d80cb244d0a17bfe6f --- /dev/null +++ b/ernie.svg @@ -0,0 +1,175 @@ + + + + +ernie +dense · 12× MHA + +ErnieModel · base model +12 × ErnieLayerErnieLayer× 12 +ErnieForCausalLM · task head +Self-Attention · ErnieAttention +output · ErnieSelfOutput +self · ErnieSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +ErnieForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +nghuyong/ernie-3.0-base-zh +model_type +ernie +config +ErnieConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ernie4_5.diff.svg b/ernie4_5.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e86ab8ec1216587169d8431e30e41821e97436d2 --- /dev/null +++ b/ernie4_5.diff.svg @@ -0,0 +1,177 @@ + + + + +ernie4_5 +diff vs llama (+olmo) · 4 overridden · 0 added · 0 deleted · 0 new · 0 inherited-as-is + +Ernie4_5Model · base model +18 × Ernie4_5DecoderLayerErnie4_5DecoderLayer× 18 +Ernie4_5ForCausalLM · task head +Self-Attention · Ernie4_5Attention +MLP · Ernie4_5MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [103424 × 1024] → [1, 6, 1024] +Ernie4_5RMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→2048]q_proj [1024→2048] +k_proj: Linear [1024→256]k_proj [1024→256] +v_proj: Linear [1024→256]v_proj [1024→256] +o_proj: Linear [2048→1024]o_proj [2048→1024] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Ernie4_5RMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→3072]gate_proj [1024→3072] +up_proj: Linear [1024→3072]up_proj [1024→3072] +down_proj: Linear [3072→1024]down_proj [3072→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +Ernie4_5ForCausalLMLM HeadLinear [1024→103424] · tied +Softmax +logits[1, 6, 103424] + +model id +baidu/ERNIE-4.5-0.3B-PT +parent +llama +classes +4 +overridden +4 +added +0 +new classes +0 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Ernie4_5Attention +ovr __init__ + +Ernie4_5ForCausalLM +ovr forward + +Ernie4_5MLP +ovr __init__ + +Ernie4_5RotaryEmbedding +ovr forward + \ No newline at end of file diff --git a/ernie4_5.svg b/ernie4_5.svg new file mode 100644 index 0000000000000000000000000000000000000000..0ea1f63cd33db2f60ea998dd4dd51dcce9489161 --- /dev/null +++ b/ernie4_5.svg @@ -0,0 +1,180 @@ + + + + +ernie4_5 +dense · 18× GQA + +Ernie4_5Model · base model +18 × Ernie4_5DecoderLayerErnie4_5DecoderLayer× 18 +Ernie4_5ForCausalLM · task head +Self-Attention · Ernie4_5Attention +MLP · Ernie4_5MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [103424 × 1024] → [1, 6, 1024] +Ernie4_5RMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→2048]q_proj [1024→2048] +k_proj: Linear [1024→256]k_proj [1024→256] +v_proj: Linear [1024→256]v_proj [1024→256] +o_proj: Linear [2048→1024]o_proj [2048→1024] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Ernie4_5RMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→3072]gate_proj [1024→3072] +up_proj: Linear [1024→3072]up_proj [1024→3072] +down_proj: Linear [3072→1024]down_proj [3072→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +Ernie4_5ForCausalLMLM HeadLinear [1024→103424] · tied +Softmax +logits[1, 6, 103424] + +model id +baidu/ERNIE-4.5-0.3B-PT +model_type +ernie4_5 +config +Ernie4_5Config +decoder +dense +layers +18 +hidden +1,024 +intermediate +3,072 +heads / kv +16 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +103,424 +max_pos +131,072 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ernie4_5_moe.diff.svg b/ernie4_5_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..25a814b055d112bba7b4cb85379faefa2be8185e --- /dev/null +++ b/ernie4_5_moe.diff.svg @@ -0,0 +1,198 @@ + + + + +ernie4_5_moe +diff vs mixtral (+llama,qwen3_moe,ernie4_5) · 11 overridden · 10 added · 0 deleted · 4 new · 1 inherited-as-is + +Ernie4_5_MoeModel · base model +28 × Ernie4_5_MoeDecoderLayerErnie4_5_MoeDecoderLayer× 28 +Ernie4_5_MoeForCausalLM · task head +Self-Attention · Ernie4_5_MoeAttention +Sparse MoE · Ernie4_5_MoeMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [103424 × 2560] → [1, 6, 2560] +Ernie4_5_MoeRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→512]k_proj [2560→512] +v_proj: Linear [2560→512]v_proj [2560→512] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention20 heads · head_dim 128 · GQA 20:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Ernie4_5_MoeRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→12288]gate_proj [2560→12288] +up_proj: Linear [2560→12288]up_proj [2560→12288] +down_proj: Linear [12288→2560]down_proj [12288→2560] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2560] +Ernie4_5_MoeForCausalLMLM HeadLinear [2560→103424] · tied +Softmax +logits[1, 6, 103424] + +model id +baidu/ERNIE-4.5-21B-A3B-PT +parent +mixtral +classes +12 +overridden +11 +added +10 +new classes +4 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Ernie4_5_MoeAttention +ovr __init__ + +Ernie4_5_MoeDecoderLayer +ovr __init__ + +Ernie4_5_MoeExperts +ovr __init__ + +Ernie4_5_MoeForCausalLM +ovr __init__,forward + +Ernie4_5_MoeMLP +ovr __init__ + +Ernie4_5_MoeRotaryEmbedding +ovr __init__ + +Ernie4_5_MoeModel +add __init__,forward + +Ernie4_5_MoePreTrainedModel +ovr _init_weights; 5 attr + +Ernie4_5_MoeSparseMoeBlock +add __init__,forward + +Ernie4_5_MoeStatics +add __init__,forward + +Ernie4_5_MoeTopKRouter +add __init__,forward + \ No newline at end of file diff --git a/ernie4_5_moe.svg b/ernie4_5_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..daf78947d9796c1bcf29b353d44814161bbf6848 --- /dev/null +++ b/ernie4_5_moe.svg @@ -0,0 +1,182 @@ + + + + +ernie4_5_moe +sparse-moe · 28× GQA +MoE + +Ernie4_5_MoeModel · base model +28 × Ernie4_5_MoeDecoderLayerErnie4_5_MoeDecoderLayer× 28 +Ernie4_5_MoeForCausalLM · task head +Self-Attention · Ernie4_5_MoeAttention +Sparse MoE · Ernie4_5_MoeMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [103424 × 2560] → [1, 6, 2560] +Ernie4_5_MoeRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→512]k_proj [2560→512] +v_proj: Linear [2560→512]v_proj [2560→512] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention20 heads · head_dim 128 · GQA 20:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Ernie4_5_MoeRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→12288]gate_proj [2560→12288] +up_proj: Linear [2560→12288]up_proj [2560→12288] +down_proj: Linear [12288→2560]down_proj [12288→2560] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2560] +Ernie4_5_MoeForCausalLMLM HeadLinear [2560→103424] · tied +Softmax +logits[1, 6, 103424] + +model id +baidu/ERNIE-4.5-21B-A3B-PT +model_type +ernie4_5_moe +config +Ernie4_5_MoeConfig +decoder +sparse-moe +layers +28 +hidden +2,560 +intermediate +12,288 +heads / kv +20 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +103,424 +max_pos +131,072 +experts (top-k) +64 (top-6) +tie_embeddings +True +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ernie4_5_vl_moe.diff.svg b/ernie4_5_vl_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..44251f1a0b42e0d3026bf8318aafc1a52d2bbb02 --- /dev/null +++ b/ernie4_5_vl_moe.diff.svg @@ -0,0 +1,297 @@ + + + + +ernie4_5_vl_moe +diff vs ernie4_5_moe (+qwen2_5_vl,qwen2_vl,glm4v) · 22 overridden · 75 added · 2 deleted · 23 new · 7 inherited-as-is + +Ernie4_5_VLMoeModel · base model +28 × Ernie4_5_VLMoeDecoderLayerErnie4_5_VLMoeDecoderLayer× 28 +Ernie4_5_VLMoeForConditionalGeneration · task head +image ⊕ text attention +Sparse MoE · Ernie4_5_MoeMLP (2 FFN types ▼) ↩ inheritedMoE +Self-Attention · Ernie4_5_MoeTextAttention ↩ inherit… +Vision encoder · Ernie4_5_VLM…×32 +Ernie4_5_VLMoeVisionBlock×32 +text_moe · Ernie4_5_VLMoeSparseMoeBlock +vision_moe · Ernie4_5_VLMoeSparseMoeBl… +shared_experts · Ernie4_5_MoeMLP (×64 ·… +mlp · Ernie4_5VLVisionMLP +attn · Ernie4_5_MoeVisionAttent… +gate · Ernie4_5_VLMoeMoeTopKRouter (… +experts · Ernie4_5_VLMoeMoeExperts +gate · Ernie4_5_VLMoeMoeTopKRouter (… +experts · Ernie4_5_VLMoeMoeExperts + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [103424 × 2560] → [1, 6, 2560] +Ernie4_5_VLMoeRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→512]k_proj [2560→512] +v_proj: Linear [2560→512]v_proj [2560→512] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention20 heads · head_dim 128 · GQA 20:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Ernie4_5_VLMoeRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→12288]gate_proj [2560→12288] +up_proj: Linear [2560→12288]up_proj [2560→12288] +down_proj: Linear [12288→2560]down_proj [12288→2560] +act_fn: SiLUActivationact_fn SiLU +moe_statics: Ernie4_5_VLMoeMoeStaticsmoe_statics MoeStatics +act_fn: SiLUActivationact_fn SiLU +moe_statics: Ernie4_5_VLMoeMoeStaticsmoe_statics MoeStatics +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [2560→3072]gate_proj [2560→3072] +up_proj: Linear [2560→3072]up_proj [2560→3072] +down_proj: Linear [3072→2560]down_proj [3072→2560] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2560] +Ernie4_5_VLMoeForConditionalGenerationLM HeadLinear [2560→103424] · tied +Softmax +logits[1, 6, 103424] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1280norm1 LayerNorm 1280 +norm2: LayerNorm 1280norm2 LayerNorm 1280 +qkv: Linear [1280→3840]qkv [1280→3840] +proj: Linear [1280→1280]proj [1280→1280] +fc1: Linear [1280→5120]fc1 [1280→5120] +act: QuickGELUActivationact QuickGELU +fc2: Linear [5120→1280]fc2 [5120→1280] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +baidu/ERNIE-4.5-VL-28B-A3B-PT +parent +ernie4_5_moe +classes +39 +overridden +22 +added +75 +new classes +23 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Ernie4_5_VLMoeVisionTransformerPretrainedModel +ovr __init__,forward; del get_device,get_dty… + +Ernie4_5_VLMoeForConditionalGeneration +ovr __init__,forward,get_image_features,get_… + +Ernie4_5_VLMoeMoeExperts +ovr __init__ + +Ernie4_5_VLMoeMoeTopKRouter +ovr __init__ + +Ernie4_5_VLMoePatchEmbed +ovr __init__,forward + +Ernie4_5_VLMoeVisionBlock +ovr __init__ + +Ernie4_5_VLMoeConfig +add __post_init__; 12 attr + +Ernie4_5_VLMoeDecoderLayer +add __init__,forward + +Ernie4_5_VLMoeImageProcessor +add _preprocess,get_number_of_image_patches;… + +Ernie4_5_VLMoeImageProcessorKwargs +rename only + +Ernie4_5_VLMoeImageProcessorPil +add _preprocess,get_number_of_image_patches;… + +Ernie4_5_VLMoeModel +ovr __init__,forward,get_image_features,get_… + +Ernie4_5_VLMoeMoeBlock +add __init__,forward + +Ernie4_5_VLMoePreTrainedModel +ovr _init_weights; 3 attr + +Ernie4_5_VLMoeSparseMoeBlock +add __init__,forward + +Ernie4_5_VLMoeTextConfig +add __post_init__; 12 attr + +Ernie4_5_VLMoeTextModel +ovr __init__,forward; 1 attr + +Ernie4_5_VLMoeTextRotaryEmbedding +add __init__,compute_default_rope_parameters… + +Ernie4_5_VLMoeVariableResolutionResamplerModel +add __init__,_temporal_slicing,forward + +Ernie4_5_VLMoeVisionConfig +9 attr + +Ernie4_5_VLMoeVisionMLP +add __init__,forward + +Ernie4_5_VL_MoeConfig +add __init__ + +Ernie4_5_VL_MoeForConditionalGeneration +add __init__ + +Ernie4_5_VL_MoeImageProcessor +add __init__ + +Ernie4_5_VL_MoeImageProcessorPil +add __init__ + +Ernie4_5_VL_MoeModel +add __init__ + +Ernie4_5_VL_MoePreTrainedModel +add post_init + +Ernie4_5_VL_MoeTextConfig +add __init__ + +Ernie4_5_VL_MoeTextModel +add __init__ + +Ernie4_5_VL_MoeVariableResolutionResamplerModel +add __init__ + +Ernie4_5_VL_MoeVisionConfig +add __init__ + +Ernie4_5_VL_MoeVisionTransformerPretrainedModel +add __init__ + \ No newline at end of file diff --git a/ernie4_5_vl_moe.svg b/ernie4_5_vl_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..9f5e3e51a4ee532145be025d62648318a8f5b274 --- /dev/null +++ b/ernie4_5_vl_moe.svg @@ -0,0 +1,224 @@ + + + + +ernie4_5_vl_moe +multimodal · vision → projector → LLM · sparse-moe + +Ernie4_5_VLMoeModel · base model +28 × Ernie4_5_VLMoeDecoderLayerErnie4_5_VLMoeDecoderLayer× 28 +Ernie4_5_VLMoeForConditionalGeneration · task head +image ⊕ text attention +Sparse MoE · Ernie4_5_VLMoeMLP (2 FFN types ▼)MoE +Self-Attention · Ernie4_5_VLMoeTextAttention +Vision encoder · Ernie4_5_VLM…×32 +Ernie4_5_VLMoeVisionBlock×32 +text_moe · Ernie4_5_VLMoeSparseMoeBlock +vision_moe · Ernie4_5_VLMoeSparseMoeBl… +shared_experts · Ernie4_5_VLMoeMLP (×6… +mlp · Ernie4_5VLVisionMLP +attn · Ernie4_5_VLMoeVisionAtt… +gate · Ernie4_5_VLMoeMoeTopKRouter (… +experts · Ernie4_5_VLMoeMoeExperts +gate · Ernie4_5_VLMoeMoeTopKRouter (… +experts · Ernie4_5_VLMoeMoeExperts + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [103424 × 2560] → [1, 6, 2560] +Ernie4_5_VLMoeRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→512]k_proj [2560→512] +v_proj: Linear [2560→512]v_proj [2560→512] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention20 heads · head_dim 128 · GQA 20:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Ernie4_5_VLMoeRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→12288]gate_proj [2560→12288] +up_proj: Linear [2560→12288]up_proj [2560→12288] +down_proj: Linear [12288→2560]down_proj [12288→2560] +act_fn: SiLUActivationact_fn SiLU +moe_statics: Ernie4_5_VLMoeMoeStaticsmoe_statics MoeStatics +act_fn: SiLUActivationact_fn SiLU +moe_statics: Ernie4_5_VLMoeMoeStaticsmoe_statics MoeStatics +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [2560→3072]gate_proj [2560→3072] +up_proj: Linear [2560→3072]up_proj [2560→3072] +down_proj: Linear [3072→2560]down_proj [3072→2560] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2560] +Ernie4_5_VLMoeForConditionalGenerationLM HeadLinear [2560→103424] · tied +Softmax +logits[1, 6, 103424] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1280norm1 LayerNorm 1280 +norm2: LayerNorm 1280norm2 LayerNorm 1280 +qkv: Linear [1280→3840]qkv [1280→3840] +proj: Linear [1280→1280]proj [1280→1280] +fc1: Linear [1280→5120]fc1 [1280→5120] +act: QuickGELUActivationact QuickGELU +fc2: Linear [5120→1280]fc2 [5120→1280] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +baidu/ERNIE-4.5-VL-28B-A3B-PT +inputs +input_ids, pixel_values +model_type +ernie4_5_vl_moe +config +Ernie4_5_VLMoeConfig +decoder +sparse-moe +layers +28 +hidden +2,560 +intermediate +12,288 +heads / kv +20 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +103,424 +max_pos +131,072 +experts (top-k) +64 (top-6) +tie_embeddings +True +legend + +vision encoder + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/esm.svg b/esm.svg new file mode 100644 index 0000000000000000000000000000000000000000..714a737b2a5538e09e038f6066f8da6288886588 --- /dev/null +++ b/esm.svg @@ -0,0 +1,177 @@ + + + + +esm +dense · 12× MHA + +EsmModel · base model +12 × EsmLayerEsmLayer× 12 +EsmForMaskedLM · task head +Self-Attention · EsmAttention +self · EsmSelfAttention +output · EsmSelfOutput + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [33 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +RoPE θ=10,000rotary positions → Q, K +residual add+ +Final LayerNorm[1, 6, 768] +EsmForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +EsmForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/esm-1b +model_type +esm +config +EsmConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +33 +max_pos +1,026 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/eurobert.diff.svg b/eurobert.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..82346d58399db0469bb671a85274e590209828f6 --- /dev/null +++ b/eurobert.diff.svg @@ -0,0 +1,187 @@ + + + + +eurobert +diff vs llama · 3 overridden · 35 added · 0 deleted · 4 new · 1 inherited-as-is + +EuroBertModel · base model +12 × EuroBertDecoderLayerEuroBertDecoderLayer× 12 +EuroBertForMaskedLM · task head +Self-Attention · EuroBertAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 768] → [1, 6, 768] +EuroBertRMSNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +RoPErotary positions → Q, K +residual add+ +EuroBertRMSNormpre-FFN [1, 6, 768] +gate_proj: Linear [768→3072]gate_proj [768→3072] +up_proj: Linear [768→3072]up_proj [768→3072] +down_proj: Linear [3072→768]down_proj [3072→768] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 768] +EuroBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +EuroBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +EuroBERT/EuroBERT-210m +parent +llama +classes +8 +overridden +3 +added +35 +new classes +4 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +EuroBertAttention +ovr __init__ + +EuroBertModel +ovr forward + +EuroBertRMSNorm +ovr __init__ + +EuroBertConfig +add __post_init__; 23 attr + +EuroBertForMaskedLM +add __init__,forward; 3 attr + +EuroBertForSequenceClassification +add __init__,forward + +EuroBertForTokenClassification +add __init__,forward,get_input_embeddings,se… + \ No newline at end of file diff --git a/eurobert.svg b/eurobert.svg new file mode 100644 index 0000000000000000000000000000000000000000..ee60946b831fedf3c1b3e884ce7dc7602a0e028c --- /dev/null +++ b/eurobert.svg @@ -0,0 +1,181 @@ + + + + +eurobert +dense · 12× MHA + +EuroBertModel · base model +12 × EuroBertDecoderLayerEuroBertDecoderLayer× 12 +EuroBertForMaskedLM · task head +Self-Attention · EuroBertAttention +MLP · EuroBertMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 768] → [1, 6, 768] +EuroBertRMSNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +RoPErotary positions → Q, K +residual add+ +EuroBertRMSNormpre-FFN [1, 6, 768] +gate_proj: Linear [768→3072]gate_proj [768→3072] +up_proj: Linear [768→3072]up_proj [768→3072] +down_proj: Linear [3072→768]down_proj [3072→768] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 768] +EuroBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +EuroBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +EuroBERT/EuroBERT-210m +model_type +eurobert +config +EuroBertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +128,256 +max_pos +8,192 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/evolla.diff.svg b/evolla.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..c98a971b61c5451ecd75a4b65481265344652ff6 --- /dev/null +++ b/evolla.diff.svg @@ -0,0 +1,177 @@ + + + + +evolla +diff vs esm (+llama) · 9 overridden · 36 added · 0 deleted · 10 new · 12 inherited-as-is + +input_ids[1, S] +Token Embedding[128256 × 4096] +EvollaDecoderLayerNorm → GQANorm → MLP×32 +Final Norm +LM Head→ logits [1, S, 128256] + +model id +westlake-repl/Evolla-10B-hf +parent +esm +classes +26 +overridden +9 +added +36 +new classes +10 +inherited as-is +12 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +EvollaDecoderLayer +ovr __init__,forward + +EvollaSaProtEmbeddings +ovr __init__ + +EvollaSaProtRotaryEmbedding +ovr __init__,compute_default_rope_parameters + +EvollaFeedForward +add __init__,forward + +EvollaForProteinText2Text +add __init__,forward,get_input_embeddings,se… + +EvollaModel +add __init__,forward,get_input_embeddings,se… + +EvollaPreTrainedModel +add _init_weights; 4 attr + +EvollaProteinEncoder +add __init__,forward + +EvollaProteinEncoderModelOutput +4 attr + +EvollaSaProtPreTrainedModel +add _init_weights; 7 attr + +EvollaSaProtProteinEncoder +add __init__,forward,get_input_embeddings,se… + +EvollaSequenceAlignerCrossAttention +add __init__,cross_attention,forward + +EvollaSequenceCompressorAttention +add __init__,forward + +EvollaSequenceCompressorResampler +add __init__,forward + \ No newline at end of file diff --git a/evolla.svg b/evolla.svg new file mode 100644 index 0000000000000000000000000000000000000000..b015493888c0b27436a40fd28363ff8fd3250fe8 --- /dev/null +++ b/evolla.svg @@ -0,0 +1,156 @@ + + + + +evolla +⚠ config-only — built from config (weights not instantiable on meta) · dense · 32× GQA + +input_ids[1, S] +Token Embedding[128256 × 4096] +EvollaDecoderLayerNorm → GQANorm → MLP×32 +Final Norm +LM Head→ logits [1, S, 128256] + +model id +westlake-repl/Evolla-10B-hf +model_type +evolla +config +EvollaConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +— +positional +RoPE +vocab +128,256 +max_pos +8,192 +tie_embeddings +False +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/exaone4.diff.svg b/exaone4.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ea8dfe5d33d1524c6673db32552978fb16960dc0 --- /dev/null +++ b/exaone4.diff.svg @@ -0,0 +1,216 @@ + + + + +exaone4 +diff vs llama (+olmo2,gemma2) · 4 overridden · 28 added · 0 deleted · 2 new · 7 inherited-as-is + +Exaone4Model · base model +32 × Exaone4DecoderLayerExaone4DecoderLayer× 32 +Exaone4ForCausalLM · task head +layers (idx) +Self-Attention · Exaone4Attention (2 layer types — same modules, mask differs) +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [102400 × 4096] → [1, 6, 4096] +Exaone4RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Exaone4RMSNorm 128q_norm RMSNorm 128 +k_norm: Exaone4RMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Exaone4RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→16384]gate_proj [4096→16384] +up_proj: Linear [4096→16384]up_proj [4096→16384] +down_proj: Linear [16384→4096]down_proj [16384→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Exaone4ForCausalLMLM HeadLinear [4096→102400] +Softmax +logits[1, 6, 102400] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 + +model id +LGAI-EXAONE/EXAONE-4.0-32B +parent +llama +classes +12 +overridden +4 +added +28 +new classes +2 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Exaone4ForCausalLM +ovr forward + +Exaone4Model +ovr __init__,forward + +Exaone4Attention +add __init__,forward + +Exaone4Config +add __post_init__; 24 attr + +Exaone4PreTrainedModel +2 attr + \ No newline at end of file diff --git a/exaone4.svg b/exaone4.svg new file mode 100644 index 0000000000000000000000000000000000000000..dbe2ea561992d282573cdfd83996a1084d40e97f --- /dev/null +++ b/exaone4.svg @@ -0,0 +1,222 @@ + + + + +exaone4 +dense · 24× sliding + 8× full + +Exaone4Model · base model +32 × Exaone4DecoderLayerExaone4DecoderLayer× 32 +Exaone4ForCausalLM · task head +layers (idx) +Self-Attention · Exaone4Attention (2 layer types — same modules, mask differs) +MLP · Exaone4MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [102400 × 4096] → [1, 6, 4096] +Exaone4RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Exaone4RMSNorm 128q_norm RMSNorm 128 +k_norm: Exaone4RMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Exaone4RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→16384]gate_proj [4096→16384] +up_proj: Linear [4096→16384]up_proj [4096→16384] +down_proj: Linear [16384→4096]down_proj [16384→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Exaone4ForCausalLMLM HeadLinear [4096→102400] +Softmax +logits[1, 6, 102400] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 + +model id +LGAI-EXAONE/EXAONE-4.0-32B +model_type +exaone4 +config +Exaone4Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +16,384 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +102,400 +max_pos +2,048 +sliding_window +4,096 +tie_embeddings +False +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/exaone4_5.diff.svg b/exaone4_5.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..8344104732af3daa1f64d8258fdec4e56fbcd883 --- /dev/null +++ b/exaone4_5.diff.svg @@ -0,0 +1,250 @@ + + + + +exaone4_5 +diff vs qwen2_5_vl (+exaone4) · 10 overridden · 16 added · 0 deleted · 4 new · 5 inherited-as-is + +Exaone4_5_Model · base model +32 × Exaone4DecoderLayerExaone4DecoderLayer× 32 +Exaone4_5_ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Exaone4Attention (2 layer types — same modules, mask differs) +Vision encoder · Exaone4_5_Vis…×32 +Qwen2_5_VLVisionBlock ↩ i…×32 +MLP · Exaone4MLP +mlp · Qwen2_5_VLMLP ↩ inheri… +attn · Exaone4_5_VisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [102400 × 4096] → [1, 6, 4096] +Exaone4RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Exaone4RMSNorm 128q_norm Exaone4RMSNorm 128 +k_norm: Exaone4RMSNorm 128k_norm Exaone4RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Exaone4RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→16384]gate_proj [4096→16384] +up_proj: Linear [4096→16384]up_proj [4096→16384] +down_proj: Linear [16384→4096]down_proj [16384→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Exaone4_5_ForConditionalGenerationLM HeadLinear [4096→102400] +Softmax +logits[1, 6, 102400] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +example image +pixel_values[1, 3, 336, 336] +norm1: Exaone4_5_RMSNorm 3584norm1 RMSNorm 3584 +norm2: Exaone4_5_RMSNorm 3584norm2 RMSNorm 3584 +proj: Linear [3584→3584]proj [3584→3584] +qkv: Linear [3584→7168]qkv [3584→7168] +gate_proj: Linear [3584→3420]gate_proj [3584→3420] +up_proj: Linear [3584→3420]up_proj [3584→3420] +down_proj: Linear [3420→3584]down_proj [3420→3584] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +LGAI-EXAONE/EXAONE-4.5-33B +parent +qwen2_5_vl +classes +14 +overridden +10 +added +16 +new classes +4 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Exaone4_5_ForConditionalGeneration +ovr _get_image_nums_and_video_nums,forward,p… + +Exaone4_5_Model +ovr __init__,forward + +Exaone4_5_VisionAttention +ovr __init__,forward + +Exaone4_5_Config +add __post_init__; 8 attr + +Exaone4_5_PreTrainedModel +add _init_weights; 3 attr + +Exaone4_5_Processor +rename only + +Exaone4_5_ProcessorKwargs +1 attr + +Exaone4_5_VisionConfig +3 attr + +Exaone4_5_VisionModel +ovr __init__; 1 attr + \ No newline at end of file diff --git a/exaone4_5.svg b/exaone4_5.svg new file mode 100644 index 0000000000000000000000000000000000000000..83b6404a62882e9874044af2c928c91f94bebe60 --- /dev/null +++ b/exaone4_5.svg @@ -0,0 +1,252 @@ + + + + +exaone4_5 +multimodal · vision → projector → LLM · dense + +Exaone4_5_Model · base model +32 × Exaone4DecoderLayerExaone4DecoderLayer× 32 +Exaone4_5_ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Exaone4Attention (2 layer types — same modules, mask differs) +Vision encoder · Exaone4_5_Vis…×32 +Exaone4_5_VisionBlock×32 +MLP · Exaone4MLP +mlp · Exaone4_5_MLP +attn · Exaone4_5_VisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [102400 × 4096] → [1, 6, 4096] +Exaone4RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Exaone4RMSNorm 128q_norm Exaone4RMSNorm 128 +k_norm: Exaone4RMSNorm 128k_norm Exaone4RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Exaone4RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→16384]gate_proj [4096→16384] +up_proj: Linear [4096→16384]up_proj [4096→16384] +down_proj: Linear [16384→4096]down_proj [16384→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Exaone4_5_ForConditionalGenerationLM HeadLinear [4096→102400] +Softmax +logits[1, 6, 102400] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +example image +pixel_values[1, 3, 336, 336] +norm1: Exaone4_5_RMSNorm 3584norm1 RMSNorm 3584 +norm2: Exaone4_5_RMSNorm 3584norm2 RMSNorm 3584 +proj: Linear [3584→3584]proj [3584→3584] +qkv: Linear [3584→7168]qkv [3584→7168] +gate_proj: Linear [3584→3420]gate_proj [3584→3420] +up_proj: Linear [3584→3420]up_proj [3584→3420] +down_proj: Linear [3420→3584]down_proj [3420→3584] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +LGAI-EXAONE/EXAONE-4.5-33B +inputs +input_ids, pixel_values +built via +AutoModel +model_type +exaone4_5 +config +Exaone4_5_Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +16,384 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +102,400 +max_pos +2,048 +sliding_window +4,096 +tie_embeddings +False +legend + +vision encoder + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/exaone_moe.diff.svg b/exaone_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..25da5e7a627826d3a5d11659c651012964862051 --- /dev/null +++ b/exaone_moe.diff.svg @@ -0,0 +1,230 @@ + + + + +exaone_moe +diff vs exaone4 (+deepseek_v3,olmoe,qwen2_moe) · 7 overridden · 34 added · 0 deleted · 1 new · 3 inherited-as-is + +ExaoneMoeModel · base model +32 × ExaoneMoeDecoderLayerExaoneMoeDecoderLayer× 32 +ExaoneMoeForCausalLM · task head +layers (idx) +Self-Attention · Exaone4Attention (2 layer types — same modules, mask differs) ↩ inherited +Sparse MoE · Exaone4MLP (2 FFN types ▼) ↩ inheritedMoE +shared_experts · Exaone4MLP (×64 · dim 1… +experts · ExaoneMoeExperts (×64 · dim 10… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [102400 × 4096] → [1, 6, 4096] +ExaoneMoeRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: ExaoneMoeRMSNorm 128q_norm RMSNorm 128 +k_norm: ExaoneMoeRMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +ExaoneMoeRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→16384]gate_proj [4096→16384] +up_proj: Linear [4096→16384]up_proj [4096→16384] +down_proj: Linear [16384→4096]down_proj [16384→4096] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: ExaoneMoeTopkRouter top-8 of 64gate TopkRouter top-8 of 64 +gate_proj: Linear [4096→1024]gate_proj [4096→1024] +up_proj: Linear [4096→1024]up_proj [4096→1024] +down_proj: Linear [1024→4096]down_proj [1024→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +ExaoneMoeForCausalLMLM HeadLinear [4096→102400] +Softmax +logits[1, 6, 102400] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 + +model id +LGAI-EXAONE/K-EXAONE-236B-A23B +parent +exaone4 +classes +10 +overridden +7 +added +34 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ExaoneMoeDecoderLayer +ovr __init__ + +ExaoneMoeExperts +ovr __init__ + +ExaoneMoeForCausalLM +ovr forward + +ExaoneMoeSparseMoEBlock +ovr __init__ + +ExaoneMoeTopkRouter +ovr __init__ + +ExaoneMoeConfig +add __post_init__; 30 attr + +ExaoneMoePreTrainedModel +add _init_weights; 4 attr + \ No newline at end of file diff --git a/exaone_moe.svg b/exaone_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..cc43adb76374ef32ca7d18c92be85c627b500f60 --- /dev/null +++ b/exaone_moe.svg @@ -0,0 +1,232 @@ + + + + +exaone_moe +sparse-moe · 24× sliding +MoE + 8× full +MoE + +ExaoneMoeModel · base model +32 × ExaoneMoeDecoderLayerExaoneMoeDecoderLayer× 32 +ExaoneMoeForCausalLM · task head +layers (idx) +Self-Attention · ExaoneMoeAttention (2 layer types — same modules, mask differs) +Sparse MoE · ExaoneMoeMLP (2 FFN types ▼)MoE +shared_experts · ExaoneMoeMLP (×64 · di… +experts · ExaoneMoeExperts (×64 · dim 10… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [102400 × 4096] → [1, 6, 4096] +ExaoneMoeRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: ExaoneMoeRMSNorm 128q_norm RMSNorm 128 +k_norm: ExaoneMoeRMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +ExaoneMoeRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→16384]gate_proj [4096→16384] +up_proj: Linear [4096→16384]up_proj [4096→16384] +down_proj: Linear [16384→4096]down_proj [16384→4096] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: ExaoneMoeTopkRouter top-8 of 64gate TopkRouter top-8 of 64 +gate_proj: Linear [4096→1024]gate_proj [4096→1024] +up_proj: Linear [4096→1024]up_proj [4096→1024] +down_proj: Linear [1024→4096]down_proj [1024→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +ExaoneMoeForCausalLMLM HeadLinear [4096→102400] +Softmax +logits[1, 6, 102400] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 + +model id +LGAI-EXAONE/K-EXAONE-236B-A23B +model_type +exaone_moe +config +ExaoneMoeConfig +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +16,384 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +102,400 +max_pos +2,048 +sliding_window +4,096 +experts (top-k) +64 (top-8) +tie_embeddings +False +legend + +self-attention + +sliding + +full + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/falcon.svg b/falcon.svg new file mode 100644 index 0000000000000000000000000000000000000000..474cf2b93da48f26e2869e83c63b72f6ec113a73 --- /dev/null +++ b/falcon.svg @@ -0,0 +1,178 @@ + + + + +falcon +dense · 32× MHA + +FalconModel · base model +32 × FalconDecoderLayerFalconDecoderLayer× 32 +FalconForCausalLM · task head +Self-Attention · FalconAttention +MLP · FalconMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65024 × 4544] → [1, 6, 4544] +LayerNormpre-attention [1, 6, 4544] +query_key_value: FalconLinear [4544→4672]query_key_value [4544→4672] +dense: FalconLinear [4544→4544]dense [4544→4544] +attention_dropout: Dropoutattention_dropout Dropout +scaled dot-product attention71 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 4544] +dense_h_to_4h: FalconLinear [4544→18176]dense_h_to_4h [4544→18176] +act: GELUActivationact GELU +dense_4h_to_h: FalconLinear [18176→4544]dense_4h_to_h [18176→4544] +residual add+ +Final LayerNorm[1, 6, 4544] +FalconForCausalLMLM HeadLinear [4544→65024] · tied +Softmax +logits[1, 6, 65024] + +model id +tiiuae/falcon-7b +model_type +falcon +config +FalconConfig +decoder +dense +layers +32 +hidden +4,544 +intermediate +— +heads / kv +71 / 71 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +65,024 +max_pos +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/falcon_h1.diff.svg b/falcon_h1.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b2b79b9996215317e029d8f669dd7253967cb50a --- /dev/null +++ b/falcon_h1.diff.svg @@ -0,0 +1,189 @@ + + + + +falcon_h1 +diff vs llama (+mamba2) · 7 overridden · 20 added · 0 deleted · 4 new · 2 inherited-as-is + +FalconH1Model · base model +32 × FalconH1DecoderLayerFalconH1DecoderLayer× 32 +FalconH1ForCausalLM · task head +Self-Attention · FalconH1Attention +MLP · FalconH1MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128000 × 4096] → [1, 6, 4096] +FalconH1RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +hybrid attention mask (q↓ × k→)hybrid mask +RoPErotary positions → Q, K +residual add+ +FalconH1RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +FalconH1ForCausalLMLM HeadLinear [4096→128000] +Softmax +logits[1, 6, 128000] + +model id +tiiuae/Falcon-H1-1.5B-Deep-Ins +parent +llama +classes +10 +overridden +7 +added +20 +new classes +4 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +FalconH1Attention +ovr __init__,forward + +FalconH1MLP +ovr __init__,forward + +FalconH1RMSNormGated +ovr __init__,forward + +FalconH1DecoderLayer +add __init__,forward + +FalconH1ForCausalLM +ovr forward; add prepare_inputs_for_generation + +FalconH1Mixer +add __init__,cuda_kernels_forward,forward,to… + +FalconH1Model +add __init__,_update_mamba_mask,forward + +FalconH1PreTrainedModel +add _init_weights; 9 attr + \ No newline at end of file diff --git a/falcon_h1.svg b/falcon_h1.svg new file mode 100644 index 0000000000000000000000000000000000000000..4574738f7a87b4d17ccfc9088a86183e6eb5474a --- /dev/null +++ b/falcon_h1.svg @@ -0,0 +1,180 @@ + + + + +falcon_h1 +dense · 32× GQA + +FalconH1Model · base model +32 × FalconH1DecoderLayerFalconH1DecoderLayer× 32 +FalconH1ForCausalLM · task head +Self-Attention · FalconH1Attention +MLP · FalconH1MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128000 × 4096] → [1, 6, 4096] +FalconH1RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +hybrid attention mask (q↓ × k→)hybrid mask +RoPErotary positions → Q, K +residual add+ +FalconH1RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +FalconH1ForCausalLMLM HeadLinear [4096→128000] +Softmax +logits[1, 6, 128000] + +model id +tiiuae/Falcon-H1-1.5B-Deep-In… +model_type +falcon_h1 +config +FalconH1Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +128,000 +max_pos +8,192 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/falcon_mamba.diff.svg b/falcon_mamba.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..551a87074853a04c009143ed075261d2df452abd --- /dev/null +++ b/falcon_mamba.diff.svg @@ -0,0 +1,169 @@ + + + + +falcon_mamba +diff vs mamba · 7 overridden · 5 added · 1 deleted · 1 new · 5 inherited-as-is + +FalconMambaModel · base model +32 × FalconMambaBlockFalconMambaBlock× 32 +FalconMambaForCausalLM · task head +Token Mixer (SSM) · FalconMambaMixer + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50280 × 768] → [1, 6, 768] +FalconMambaRMSNormpre-mixer [1, 6, 768] +conv1d: Conv1d 1536×1×4conv1d Conv1d 1536×1×4 +act: SiLUActivationact SiLU +in_proj: Linear [768→3072]in_proj [768→3072] +x_proj: Linear [1536→80]x_proj [1536→80] +dt_proj: Linear [48→1536]dt_proj [48→1536] +out_proj: Linear [1536→768]out_proj [1536→768] +selective state-space scan (SSM) +mamba attention mask (q↓ × k→)mamba mask +residual add+ +Final RMSNorm[1, 6, 768] +FalconMambaForCausalLMLM HeadLinear [768→50280] · tied +Softmax +logits[1, 6, 50280] + +model id +tiiuae/falcon-mamba-7b +parent +mamba +classes +9 +overridden +7 +added +5 +new classes +1 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +FalconMambaModel +ovr __init__; del load_hook + +FalconMambaRMSNorm +ovr forward + +FalconMambaConfig +add layer_types; 3 attr + +FalconMambaMixer +ovr __init__,cuda_kernels_forward,forward,sl… + \ No newline at end of file diff --git a/falcon_mamba.svg b/falcon_mamba.svg new file mode 100644 index 0000000000000000000000000000000000000000..e5b065662e2c8308ea0a828d7c5cbfd0482a2acb --- /dev/null +++ b/falcon_mamba.svg @@ -0,0 +1,172 @@ + + + + +falcon_mamba +ssm · 32× Mamba + +FalconMambaModel · base model +32 × FalconMambaBlockFalconMambaBlock× 32 +FalconMambaForCausalLM · task head +Token Mixer (SSM) · FalconMambaMixer + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50280 × 768] → [1, 6, 768] +FalconMambaRMSNormpre-mixer [1, 6, 768] +conv1d: Conv1d 1536×1×4conv1d Conv1d 1536×1×4 +act: SiLUActivationact SiLU +in_proj: Linear [768→3072]in_proj [768→3072] +x_proj: Linear [1536→80]x_proj [1536→80] +dt_proj: Linear [48→1536]dt_proj [48→1536] +out_proj: Linear [1536→768]out_proj [1536→768] +selective state-space scan (SSM) +mamba attention mask (q↓ × k→)mamba mask +residual add+ +Final RMSNorm[1, 6, 768] +FalconMambaForCausalLMLM HeadLinear [768→50280] · tied +Softmax +logits[1, 6, 50280] + +model id +tiiuae/falcon-mamba-7b +model_type +falcon_mamba +config +FalconMambaConfig +decoder +ssm +layers +32 +hidden +768 +intermediate +1,536 +heads / kv +None / None +attention +— +norm +RMSNorm +positional +n/a +vocab +50,280 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/fast_vlm.diff.svg b/fast_vlm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..855bdc542cd5d7927bef40cf97a6c15366c9cae4 --- /dev/null +++ b/fast_vlm.diff.svg @@ -0,0 +1,191 @@ + + + + +fast_vlm +diff vs llava · 5 overridden · 11 added · 0 deleted · 1 new · 3 inherited-as-is + +FastVlmModel · base model +28 × Qwen2DecoderLayerQwen2DecoderLayer× 28 +FastVlmForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +MLP · Qwen2MLP +Projector · FastVlmMultiModalProjector + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152128 × 3584] → [1, 6, 3584] +Qwen2RMSNormpre-attention [1, 6, 3584] +q_proj: Linear [3584→3584]q_proj [3584→3584] +k_proj: Linear [3584→512]k_proj [3584→512] +v_proj: Linear [3584→512]v_proj [3584→512] +o_proj: Linear [3584→3584]o_proj [3584→3584] +scaled dot-product attention28 heads · head_dim 128 · GQA 28:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 3584] +gate_proj: Linear [3584→18944]gate_proj [3584→18944] +up_proj: Linear [3584→18944]up_proj [3584→18944] +down_proj: Linear [18944→3584]down_proj [18944→3584] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3584] +FastVlmForConditionalGenerationLM HeadLinear [3584→152128] +Softmax +logits[1, 6, 152128] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · TimmWrapperModelTimmWrapperModel · via AutoModeltimm_wrapper · ? layers · h=3072 +linear_1: Linear [3072→3584]linear_1 [3072→3584] +act: GELUActivationact GELU +linear_2: Linear [3584→3584]linear_2 [3584→3584] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +KamilaMila/FastVLM-7B +parent +llava +classes +7 +overridden +5 +added +11 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +FastVlmForConditionalGeneration +ovr forward + +FastVlmModel +ovr __init__,forward,get_image_features + +FastVlmMultiModalProjector +ovr __init__ + +FastVlmConfig +add __post_init__,validate_architecture; 9 a… + \ No newline at end of file diff --git a/fast_vlm.svg b/fast_vlm.svg new file mode 100644 index 0000000000000000000000000000000000000000..2b80a43bb21dbdf137498a0ae8b2ce96fcd0473d --- /dev/null +++ b/fast_vlm.svg @@ -0,0 +1,202 @@ + + + + +fast_vlm +multimodal · vision → projector → LLM · dense + +FastVlmModel · base model +28 × Qwen2DecoderLayerQwen2DecoderLayer× 28 +FastVlmForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +MLP · Qwen2MLP +Projector · FastVlmMultiModalProjector + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152128 × 3584] → [1, 6, 3584] +Qwen2RMSNormpre-attention [1, 6, 3584] +q_proj: Linear [3584→3584]q_proj [3584→3584] +k_proj: Linear [3584→512]k_proj [3584→512] +v_proj: Linear [3584→512]v_proj [3584→512] +o_proj: Linear [3584→3584]o_proj [3584→3584] +scaled dot-product attention28 heads · head_dim 128 · GQA 28:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 3584] +gate_proj: Linear [3584→18944]gate_proj [3584→18944] +up_proj: Linear [3584→18944]up_proj [3584→18944] +down_proj: Linear [18944→3584]down_proj [18944→3584] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3584] +FastVlmForConditionalGenerationLM HeadLinear [3584→152128] +Softmax +logits[1, 6, 152128] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · TimmWrapperModelTimmWrapperModel · via AutoModeltimm_wrapper · ? layers · h=3072 +linear_1: Linear [3072→3584]linear_1 [3072→3584] +act: GELUActivationact GELU +linear_2: Linear [3584→3584]linear_2 [3584→3584] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +KamilaMila/FastVLM-7B +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForImageTextToText +model_type +fast_vlm +config +FastVlmConfig +decoder +dense +layers +28 +hidden +3,584 +intermediate +18,944 +heads / kv +28 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +152,128 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/fastspeech2_conformer.svg b/fastspeech2_conformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..12c424b298debe49bde15746f969a3d0384d0b2a --- /dev/null +++ b/fastspeech2_conformer.svg @@ -0,0 +1,178 @@ + + + + +fastspeech2_conformer +dense · 4× MHA + +FastSpeech2ConformerModel · base model +4 × FastSpeech2ConformerEncoderLayerFastSpeech2ConformerEncoderLayer× 4 +Self-Attention · FastSpeech2ConformerAttention +MLP · FastSpeech2ConformerMultiLayeredConv1d + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [78 × 384] → [1, 6, 384] +LayerNormpre-attention [1, 6, 384] +linear_q: Linear [384→384]linear_q [384→384] +linear_k: Linear [384→384]linear_k [384→384] +linear_v: Linear [384→384]linear_v [384→384] +linear_out: Linear [384→384]linear_out [384→384] +dropout: Dropoutdropout Dropout +linear_pos: Linear [384→384]linear_pos [384→384] +scaled dot-product attention2 heads · head_dim 192 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 384] +conv1: Conv1d 1536×384×3conv1 Conv1d 1536×384×3 +conv2: Conv1d 384×1536×3conv2 Conv1d 384×1536×3 +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 384] +LM HeadLinear [384→78] +Softmax +logits[1, 6, 78] + +model id +espnet/fastspeech2_conformer +model_type +fastspeech2_conformer +config +FastSpeech2ConformerConfig +decoder +dense +layers +4 +hidden +384 +intermediate +— +heads / kv +2 / 2 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +78 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/flaubert.svg b/flaubert.svg new file mode 100644 index 0000000000000000000000000000000000000000..202c167415390c9a571234cc18a6a381a7b7d60c --- /dev/null +++ b/flaubert.svg @@ -0,0 +1,171 @@ + + + + +flaubert +dense · 12× MHA + +FlaubertModel · base model +12 × ModuleListModuleList× 12 +FlaubertWithLMHeadModel · task head +Self-Attention · MultiHeadAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [30145 × 2048] → [1, 6, 2048] +Normpre-attention [1, 6, 2048] +q_lin: Linear [2048→2048]q_lin [2048→2048] +k_lin: Linear [2048→2048]k_lin [2048→2048] +v_lin: Linear [2048→2048]v_lin [2048→2048] +out_lin: Linear [2048→2048]out_lin [2048→2048] +scaled dot-product attention16 heads · head_dim 128 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 2048] +FlaubertWithLMHeadModelPool (CLS / mean)[1, 6, 2048] → [1, 2048] +FlaubertWithLMHeadModelClassifier headLinear [2048→2] +Softmax +class logits[1, 2] (2 classes) + +model id +flaubert/flaubert_base_uncased +model_type +flaubert +config +FlaubertConfig +decoder +dense +layers +12 +hidden +2,048 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,145 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/flava.svg b/flava.svg new file mode 100644 index 0000000000000000000000000000000000000000..a64f2a06a769315ab000c8e6a26e3ddbb31a0200 --- /dev/null +++ b/flava.svg @@ -0,0 +1,174 @@ + + + + +flava +dense · 12× MHA + +FlavaModel · base model +12 × FlavaLayerFlavaLayer× 12 +FlavaForPreTraining · task head +Self-Attention · FlavaAttention +attention · FlavaSelfAttention +output · FlavaSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +FlavaForPreTrainingLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +facebook/flava-full +model_type +flava +config +FlavaConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/flex_olmo.diff.svg b/flex_olmo.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..5d6db9d9a8e87d70a624987221252eafe0f2779d --- /dev/null +++ b/flex_olmo.diff.svg @@ -0,0 +1,178 @@ + + + + +flex_olmo +diff vs olmoe (+olmo2,mixtral) · 4 overridden · 30 added · 0 deleted · 1 new · 7 inherited-as-is + +FlexOlmoModel · base model +32 × FlexOlmoDecoderLayerFlexOlmoDecoderLayer× 32 +FlexOlmoForCausalLM · task head +Self-Attention · OlmoeAttention ↩ inherited +Sparse MoE · OlmoeSparseMoeBlock ↩ inheri…MoE +experts · OlmoeExperts (×7 · dim 11008) ↩ inh… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [100352 × 4096] → [1, 6, 4096] +FlexOlmoRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: FlexOlmoRMSNorm 4096q_norm RMSNorm 4096 +k_norm: FlexOlmoRMSNorm 4096k_norm RMSNorm 4096 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +FlexOlmoRMSNormpre-FFN [1, 6, 4096] +gate: FlexOlmoTopKRouter top-5 of 7gate TopKRouter top-5 of 7 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +FlexOlmoForCausalLMLM HeadLinear [4096→100352] +Softmax +logits[1, 6, 100352] + +model id +allenai/FlexOlmo-7x7B-1T +parent +olmoe +classes +11 +overridden +4 +added +30 +new classes +1 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +FlexOlmoDecoderLayer +ovr __init__,forward + +FlexOlmoModel +ovr forward + +FlexOlmoPreTrainedModel +1 attr + +FlexOlmoConfig +add __post_init__; 29 attr + \ No newline at end of file diff --git a/flex_olmo.svg b/flex_olmo.svg new file mode 100644 index 0000000000000000000000000000000000000000..f27f1d6781d0b2ae93d1d87fce57b8e66e606755 --- /dev/null +++ b/flex_olmo.svg @@ -0,0 +1,183 @@ + + + + +flex_olmo +sparse-moe · 32× MHA +MoE + +FlexOlmoModel · base model +32 × FlexOlmoDecoderLayerFlexOlmoDecoderLayer× 32 +FlexOlmoForCausalLM · task head +Self-Attention · FlexOlmoAttention +Sparse MoE · FlexOlmoSparseMoeBlockMoE +experts · FlexOlmoExperts (×7 · dim 11008) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [100352 × 4096] → [1, 6, 4096] +FlexOlmoRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: FlexOlmoRMSNorm 4096q_norm RMSNorm 4096 +k_norm: FlexOlmoRMSNorm 4096k_norm RMSNorm 4096 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +FlexOlmoRMSNormpre-FFN [1, 6, 4096] +gate: FlexOlmoTopKRouter top-5 of 7gate TopKRouter top-5 of 7 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +FlexOlmoForCausalLMLM HeadLinear [4096→100352] +Softmax +logits[1, 6, 100352] + +model id +allenai/FlexOlmo-7x7B-1T +model_type +flex_olmo +config +FlexOlmoConfig +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +100,352 +max_pos +4,096 +experts (top-k) +7 (top-5) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/florence2.diff.svg b/florence2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e90102592dc9377b3424f0004b618e4e3bbfc711 --- /dev/null +++ b/florence2.diff.svg @@ -0,0 +1,252 @@ + + + + +florence2 +diff vs llava (+llama4,swin) · 9 overridden · 82 added · 0 deleted · 18 new · 1 inherited-as-is + +Florence2Model · base model +12 × BartEncoderLayerBartEncoderLayer× 12 +Florence2ForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · Florence2VisionBackb… +Florence2VisionSpatialBlock×9 +Self-Attention · BartAttention +Projector · Florence2MultiModalProjec… +image_position_embed · Florence2… +ffn · Florence2VisionMLP +window_attn · Florence2VisionWi… + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +Florence2ForConditionalGenerationLM HeadLinear [1024→50265] · tied +Softmax +logits[1, 6, 50265] +example image +pixel_values[1, 3, 336, 336] +conv1: Conv2dconv1 Conv2d +norm1: LayerNorm 512norm1 LayerNorm 512 +qkv: Linear [512→1536]qkv [512→1536] +proj: Linear [512→512]proj [512→512] +drop_path1: Florence2DropPathdrop_path1 DropPath +conv2: Conv2dconv2 Conv2d +norm2: LayerNorm 512norm2 LayerNorm 512 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +drop_path2: Florence2DropPathdrop_path2 DropPath +image_projection: Linear [1024→1024]image_projection [1024→1024] +image_proj_norm: LayerNorm 1024image_proj_norm LayerNorm 1024 +row_embeddings: Embedding 50×512row_embeddingsEmbedding 50×512 +column_embeddings: Embedding 50×512column_embeddingsEmbedding 50×512 +visual_temporal_embed: Florence2VisionPositionalEmbeddingCosine1Dvisual_temporal_embedVisionPositionalEmbeddingCosine1D +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +florence-community/Florence-2- +parent +llava +classes +23 +overridden +9 +added +82 +new classes +18 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Florence2VisionMLP +ovr __init__ + +Florence2Config +add __post_init__; 7 attr + +Florence2ForConditionalGeneration +ovr forward,get_image_features; add _prepare… + +Florence2Model +ovr __init__,forward,get_image_features; add… + +Florence2MultiModalProjector +add __init__,forward + +Florence2PostProcessor +add __call__,__init__,_find_matched_token_in… + +Florence2PreTrainedModel +add _init_weights; 3 attr + +Florence2Processor +add __call__,__init__,_construct_prompts,_ge… + +Florence2ProcessorKwargs +rename only + +Florence2Seq2SeqLMOutput +1 attr + +Florence2Seq2SeqModelOutput +1 attr + +Florence2VisionBackbone +add __init__,forward + +Florence2VisionBlock +add __init__,forward + +Florence2VisionChannelAttention +add __init__,forward + +Florence2VisionChannelBlock +add __init__,forward + +Florence2VisionConfig +19 attr + +Florence2VisionConvEmbed +add __init__,forward + +Florence2VisionLearnedAbsolutePositionEmbedding2D +add __init__,forward + +Florence2VisionPositionalEmbeddingCosine1D +add __init__,forward,get_sinusoid_embeddings + +Florence2VisionPreTrainedModel +8 attr + +Florence2VisionSpatialBlock +add __init__,forward + +Florence2VisionWindowAttention +add __init__,forward + \ No newline at end of file diff --git a/florence2.svg b/florence2.svg new file mode 100644 index 0000000000000000000000000000000000000000..8424c5c6da90fa5fc07df96e1aef80b915c2380c --- /dev/null +++ b/florence2.svg @@ -0,0 +1,209 @@ + + + + +florence2 +multimodal · vision → projector → LLM · dense + +Florence2Model · base model +12 × BartEncoderLayerBartEncoderLayer× 12 +Florence2ForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · Florence2VisionBackb… +Florence2VisionSpatialBlock×9 +Self-Attention · BartAttention +Projector · Florence2MultiModalProjec… +image_position_embed · Florence2… +ffn · Florence2VisionMLP +window_attn · Florence2VisionWi… + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +Florence2ForConditionalGenerationLM HeadLinear [1024→50265] · tied +Softmax +logits[1, 6, 50265] +example image +pixel_values[1, 3, 336, 336] +conv1: Conv2dconv1 Conv2d +norm1: LayerNorm 512norm1 LayerNorm 512 +qkv: Linear [512→1536]qkv [512→1536] +proj: Linear [512→512]proj [512→512] +drop_path1: Florence2DropPathdrop_path1 DropPath +conv2: Conv2dconv2 Conv2d +norm2: LayerNorm 512norm2 LayerNorm 512 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +drop_path2: Florence2DropPathdrop_path2 DropPath +image_projection: Linear [1024→1024]image_projection [1024→1024] +image_proj_norm: LayerNorm 1024image_proj_norm LayerNorm 1024 +row_embeddings: Embedding 50×512row_embeddingsEmbedding 50×512 +column_embeddings: Embedding 50×512column_embeddingsEmbedding 50×512 +visual_temporal_embed: Florence2VisionPositionalEmbeddingCosine1Dvisual_temporal_embedVisionPositionalEmbeddingCosine1D +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +florence-community/Florence-2… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +florence2 +config +Florence2Config +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +1,024 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/fnet.svg b/fnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..dd412b719977fde473ee9accc49b97fceaef8ca8 --- /dev/null +++ b/fnet.svg @@ -0,0 +1,154 @@ + + + + +fnet +⚠ no transformer block (conv backbone) — shown from config · dense · 12× Attention + +input_ids[1, S] +Token Embedding[32000 × 768] +FNetLayerLayerNorm → attentionLayerNorm → MLP×12 +Final LayerNorm +Pool + Classifier head→ class logits [1, 2] + +model id +google/fnet-base +model_type +fnet +config +FNetConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +32,000 +max_pos +512 +tie_embeddings +True +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/focalnet.svg b/focalnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..836e635046de19442cd58bc76fc36aa1cfde731d --- /dev/null +++ b/focalnet.svg @@ -0,0 +1,167 @@ + + + + +focalnet +dense · 6× Attention + +FocalNetModel · base model +6 × FocalNetLayerFocalNetLayer× 6 +FocalNetForImageClassification · task head +MLP · FocalNetMlp + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +LayerNormpre-attention [1, 6, ?] +Token Mixing (linear-attention / SSM)FocalNetLayer +residual add+ +LayerNormpre-FFN [1, 6, ?] +fc1: Linear [384→1536]fc1 [384→1536] +activation: GELUActivationactivation GELU +fc2: Linear [1536→384]fc2 [1536→384] +drop: Dropoutdrop Dropout +residual add+ +Final LayerNorm[1, 6, ?] +FocalNetForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +FocalNetForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/focalnet-tiny +model_type +focalnet +config +FocalNetConfig +decoder +dense +layers +6 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/fsmt.svg b/fsmt.svg new file mode 100644 index 0000000000000000000000000000000000000000..5307a4b1efda145a297991684b67be2724adcbdc --- /dev/null +++ b/fsmt.svg @@ -0,0 +1,170 @@ + + + + +fsmt +dense · 12× MHA + +FSMTModel · base model +12 × EncoderLayerEncoderLayer× 12 +FSMTForConditionalGeneration · task head +Self-Attention · Attention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'везде</w>'везд…0 +token 1: '.</w>'.</w>1 +token 2: 'через</w>'чере…2 +token 3: 'от</w>'от</…3 +token 4: 'все</w>'все<…4 +token 5: 'ными</w>'ными…5 +Token Embeddingweight [42024 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +FSMTForConditionalGenerationLM HeadLinear [1024→42024] +Softmax +logits[1, 6, 42024] + +model id +facebook/wmt19-en-ru +model_type +fsmt +config +FSMTConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +42,024 +max_pos +1,024 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/funnel.svg b/funnel.svg new file mode 100644 index 0000000000000000000000000000000000000000..ca64bf6effce273eb37db593da348d7a64a2f34e --- /dev/null +++ b/funnel.svg @@ -0,0 +1,184 @@ + + + + +funnel +dense · 4× MHA + +FunnelForPreTraining · base model +12 × FunnelLayerFunnelLayer× 12 +FunnelForMaskedLM · task head +Self-Attention · FunnelRelMultiheadAttention +MLP · FunnelPositionwiseFFN + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +hidden_dropout: Dropouthidden_dropout Dropout +attention_dropout: Dropoutattention_dropout Dropout +q_head: Linear [768→768]q_head [768→768] +k_head: Linear [768→768]k_head [768→768] +v_head: Linear [768→768]v_head [768→768] +post_proj: Linear [768→768]post_proj [768→768] +layer_norm: LayerNorm 768layer_norm LayerNorm 768 +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Normpre-FFN [1, 6, 768] +linear_1: Linear [768→3072]linear_1 [768→3072] +activation_function: NewGELUActivationactivation_function NewGELU +activation_dropout: Dropoutactivation_dropout Dropout +linear_2: Linear [3072→768]linear_2 [3072→768] +dropout: Dropoutdropout Dropout +layer_norm: LayerNorm 768layer_norm LayerNorm 768 +residual add+ +Final LayerNorm[1, 6, 768] +FunnelForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +FunnelForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +funnel-transformer/small +model_type +funnel +config +FunnelConfig +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/fuyu.svg b/fuyu.svg new file mode 100644 index 0000000000000000000000000000000000000000..5fcf25f5f2594ad72ef4108ed757191905c88c95 --- /dev/null +++ b/fuyu.svg @@ -0,0 +1,180 @@ + + + + +fuyu +dense · 36× MHA + +FuyuModel · base model +36 × PersimmonDecoderLayerPersimmonDecoderLayer× 36 +FuyuForCausalLM · task head +Self-Attention · PersimmonAttention +MLP · PersimmonMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262144 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +query_key_value: Linear [4096→12288]query_key_value [4096→12288] +dense: Linear [4096→4096]dense [4096→4096] +q_layernorm: LayerNorm 64q_layernorm LayerNorm 64 +k_layernorm: LayerNorm 64k_layernorm LayerNorm 64 +attention_dropout: Dropoutattention_dropout Dropout +scaled dot-product attention64 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 4096] +dense_h_to_4h: Linear [4096→16384]dense_h_to_4h [4096→16384] +dense_4h_to_h: Linear [16384→4096]dense_4h_to_h [16384→4096] +act: ReLUSquaredActivationact ReLUSquared +residual add+ +Final LayerNorm[1, 6, 4096] +FuyuForCausalLMLM HeadLinear [4096→262144] +Softmax +logits[1, 6, 262144] + +model id +adept/fuyu-8b +model_type +fuyu +config +FuyuConfig +decoder +dense +layers +36 +hidden +4,096 +intermediate +16,384 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +262,144 +max_pos +16,384 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gemma.diff.svg b/gemma.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d59cced74b4a4c7e998765319184018b2eed20ae --- /dev/null +++ b/gemma.diff.svg @@ -0,0 +1,189 @@ + + + + +gemma +diff vs llama · 5 overridden · 31 added · 0 deleted · 3 new · 3 inherited-as-is + +GemmaModel · base model +28 × GemmaDecoderLayerGemmaDecoderLayer× 28 +GemmaForCausalLM · task head +Self-Attention · GemmaAttention +MLP · GemmaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 3072] → [1, 6, 3072] +GemmaRMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→4096]q_proj [3072→4096] +k_proj: Linear [3072→4096]k_proj [3072→4096] +v_proj: Linear [3072→4096]v_proj [3072→4096] +o_proj: Linear [4096→3072]o_proj [4096→3072] +scaled dot-product attention16 heads · head_dim 256 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GemmaRMSNormpre-FFN [1, 6, 3072] +gate_proj: Linear [3072→24576]gate_proj [3072→24576] +up_proj: Linear [3072→24576]up_proj [3072→24576] +down_proj: Linear [24576→3072]down_proj [24576→3072] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 3072] +GemmaForCausalLMLM HeadLinear [3072→256000] · tied +Softmax +logits[1, 6, 256000] + +model id +google/gemma-7b +parent +llama +classes +11 +overridden +5 +added +31 +new classes +3 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GemmaAttention +ovr __init__ + +GemmaForCausalLM +ovr forward + +GemmaMLP +ovr __init__ + +GemmaModel +ovr __init__,forward + +GemmaConfig +24 attr + +GemmaPreTrainedModel +add _init_weights + +GemmaRMSNorm +add __init__,_norm,extra_repr,forward + +GemmaTextScaledWordEmbedding +add __init__,forward + \ No newline at end of file diff --git a/gemma.svg b/gemma.svg new file mode 100644 index 0000000000000000000000000000000000000000..d98741ea673b42b4e1f66689bf080cd58af21534 --- /dev/null +++ b/gemma.svg @@ -0,0 +1,180 @@ + + + + +gemma +dense · 28× MHA + +GemmaModel · base model +28 × GemmaDecoderLayerGemmaDecoderLayer× 28 +GemmaForCausalLM · task head +Self-Attention · GemmaAttention +MLP · GemmaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 3072] → [1, 6, 3072] +GemmaRMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→4096]q_proj [3072→4096] +k_proj: Linear [3072→4096]k_proj [3072→4096] +v_proj: Linear [3072→4096]v_proj [3072→4096] +o_proj: Linear [4096→3072]o_proj [4096→3072] +scaled dot-product attention16 heads · head_dim 256 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GemmaRMSNormpre-FFN [1, 6, 3072] +gate_proj: Linear [3072→24576]gate_proj [3072→24576] +up_proj: Linear [3072→24576]up_proj [3072→24576] +down_proj: Linear [24576→3072]down_proj [24576→3072] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 3072] +GemmaForCausalLMLM HeadLinear [3072→256000] · tied +Softmax +logits[1, 6, 256000] + +model id +google/gemma-7b +model_type +gemma +config +GemmaConfig +decoder +dense +layers +28 +hidden +3,072 +intermediate +24,576 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gemma2.diff.svg b/gemma2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e637785db4317e5e56073dba627ece38ed23482a --- /dev/null +++ b/gemma2.diff.svg @@ -0,0 +1,214 @@ + + + + +gemma2 +diff vs gemma · 9 overridden · 33 added · 0 deleted · 2 new · 4 inherited-as-is + +Gemma2Model · base model +26 × Gemma2DecoderLayerGemma2DecoderLayer× 26 +Gemma2ForCausalLM · task head +layers (idx) +Self-Attention · Gemma2Attention (2 layer types — same modules, mask differs) +MLP · Gemma2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 2304] → [1, 6, 2304] +Gemma2RMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma2RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +Gemma2ForCausalLMLM HeadLinear [2304→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: full_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: full_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: full_attention25 + +model id +google/gemma2-7b +parent +gemma +classes +11 +overridden +9 +added +33 +new classes +2 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Gemma2Attention +ovr __init__,forward + +Gemma2ForCausalLM +ovr __init__,forward + +Gemma2MLP +ovr __init__ + +Gemma2Model +ovr __init__,forward + +Gemma2RotaryEmbedding +ovr __init__,forward + +Gemma2Config +add __post_init__,validate_architecture; 29 … + +Gemma2DecoderLayer +add __init__,forward + \ No newline at end of file diff --git a/gemma2.svg b/gemma2.svg new file mode 100644 index 0000000000000000000000000000000000000000..ccba06fa3a45f721a0f3af7a9ac413fb43ff3ba0 --- /dev/null +++ b/gemma2.svg @@ -0,0 +1,214 @@ + + + + +gemma2 +dense · 13× sliding + 13× full + +Gemma2Model · base model +26 × Gemma2DecoderLayerGemma2DecoderLayer× 26 +Gemma2ForCausalLM · task head +layers (idx) +Self-Attention · Gemma2Attention (2 layer types — same modules, mask differs) +MLP · Gemma2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 2304] → [1, 6, 2304] +Gemma2RMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma2RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +Gemma2ForCausalLMLM HeadLinear [2304→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: full_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: full_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: full_attention25 + +model id +google/gemma2-7b +model_type +gemma2 +config +Gemma2Config +decoder +dense +layers +26 +hidden +2,304 +intermediate +9,216 +heads / kv +8 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +sliding_window +4,096 +tie_embeddings +True +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gemma3.diff.svg b/gemma3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..1e4c661d107c7a5a99d50d9c3fd000635ec36f22 --- /dev/null +++ b/gemma3.diff.svg @@ -0,0 +1,268 @@ + + + + +gemma3 +diff vs gemma2 (+paligemma) · 20 overridden · 38 added · 0 deleted · 7 new · 2 inherited-as-is + +Gemma3Model · base model +26 × Gemma3DecoderLayerGemma3DecoderLayer× 26 +Gemma3ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Gemma3Attention (2 layer types — same modules, mask differs) +Vision encoder · SiglipVisionMo…×12 +SiglipEncoderLayer×12 +MLP · Gemma3MLP +self_attn · SiglipAttention +mlp · SiglipMLP +Projector · Gemma3MultiModalProject… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262208 × 2304] → [1, 6, 2304] +Gemma3RMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +q_norm: Gemma3RMSNorm 256q_norm RMSNorm 256 +k_norm: Gemma3RMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma3RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +Gemma3ForConditionalGenerationLM HeadLinear [2304→262208] · tied +Softmax +logits[1, 6, 262208] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +mm_soft_emb_norm: Gemma3RMSNorm 768mm_soft_emb_norm RMSNorm 768 +avg_pool: AvgPool2davg_pool AvgPool2d +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/gemma-3-4b-it +parent +gemma2 +classes +18 +overridden +20 +added +38 +new classes +7 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Gemma3Attention +ovr __init__,forward + +Gemma3MLP +ovr __init__ + +Gemma3Model +ovr __init__,forward,get_image_features; 1 a… + +Gemma3RMSNorm +ovr __init__ + +Gemma3RotaryEmbedding +ovr __init__,compute_default_rope_parameters… + +Gemma3Config +add __post_init__; 11 attr + +Gemma3DecoderLayer +add __init__,forward + +Gemma3ForCausalLM +ovr __init__; 1 attr + +Gemma3ForConditionalGeneration +ovr create_masks_for_generate,forward,prepar… + +Gemma3ForSequenceClassification +add forward + +Gemma3MultiModalProjector +add __init__,forward + +Gemma3PreTrainedModel +ovr _init_weights; 3 attr + +Gemma3TextConfig +add __post_init__,convert_rope_params_to_dic… + +Gemma3TextForSequenceClassification +2 attr + +Gemma3TextModel +ovr __init__,forward; 2 attr + +Gemma3TextScaledWordEmbedding +add __init__,forward + \ No newline at end of file diff --git a/gemma3.svg b/gemma3.svg new file mode 100644 index 0000000000000000000000000000000000000000..5f4aa3ca325f4a25c811f9c4e8e242372b88db73 --- /dev/null +++ b/gemma3.svg @@ -0,0 +1,249 @@ + + + + +gemma3 +multimodal · vision → projector → LLM · dense + +Gemma3Model · base model +26 × Gemma3DecoderLayerGemma3DecoderLayer× 26 +Gemma3ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Gemma3Attention (2 layer types — same modules, mask differs) +Vision encoder · SiglipVisionMo…×12 +SiglipEncoderLayer×12 +MLP · Gemma3MLP +self_attn · SiglipAttention +mlp · SiglipMLP +Projector · Gemma3MultiModalProject… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262208 × 2304] → [1, 6, 2304] +Gemma3RMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +q_norm: Gemma3RMSNorm 256q_norm RMSNorm 256 +k_norm: Gemma3RMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma3RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +Gemma3ForConditionalGenerationLM HeadLinear [2304→262208] · tied +Softmax +logits[1, 6, 262208] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +mm_soft_emb_norm: Gemma3RMSNorm 768mm_soft_emb_norm RMSNorm 768 +avg_pool: AvgPool2davg_pool AvgPool2d +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/gemma-3-4b-it +inputs +input_ids, pixel_values +built via +AutoModel +model_type +gemma3 +config +Gemma3Config +decoder +dense +layers +26 +hidden +2,304 +intermediate +9,216 +heads / kv +8 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +262,208 +max_pos +131,072 +sliding_window +4,096 +tie_embeddings +True +legend + +vision encoder + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/gemma3n.diff.svg b/gemma3n.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..741979d478acd972b69727e59d8fd6462ba0e8e0 --- /dev/null +++ b/gemma3n.diff.svg @@ -0,0 +1,351 @@ + + + + +gemma3n +diff vs gemma3 (+paligemma,gemma2) · 18 overridden · 132 added · 1 deleted · 20 new · 3 inherited-as-is + +Gemma3nModel · base model +35 × Gemma3nTextDecoderLayerGemma3nTextDecoderLayer× 35 +Gemma3nForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Gemma3nTextAttention (2 layer types — same modules, mask differs) +Audio encoder · Gemma3nAudioEncoder +Gemma3nAudioConformerBl…×12 +attention · Gemma3nAudioConfo… +Vision encoder · Gemma3nMultimodal… +Audio encoder · Gemma3nMultimodalE… +MLP · Gemma3nTextMLP +lconv1d · Gemma3nAudioConfor… +ffw_layer_start · Gemma3nAudio… +ffw_layer_end · Gemma3nAudioC… +attn · Gemma3nAudioAttention + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262400 × 2048] → [1, 6, 2048] +Gemma3nRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +q_norm: Gemma3nRMSNorm 256q_norm RMSNorm 256 +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +k_norm: Gemma3nRMSNorm 256k_norm RMSNorm 256 +v_norm: Gemma3nRMSNormv_norm RMSNorm +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:2 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma3nRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→16384]gate_proj [2048→16384] +up_proj: Linear [2048→16384]up_proj [2048→16384] +down_proj: Linear [16384→2048]down_proj [16384→2048] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2048] +Gemma3nForConditionalGenerationLM HeadLinear [2048→262400] · tied +Softmax +logits[1, 6, 262400] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: full_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: full_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: sliding_attention23 +layer 24: full_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: sliding_attention27 +layer 28: sliding_attention28 +layer 29: full_attention29 +layer 30: sliding_attention30 +layer 31: sliding_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: full_attention34 +example image +pixel_values[1, 3, 336, 336] +Vision encoder · TimmWrapperModelTimmWrapperModel · via AutoModelgemma3n_vision · ? layers · h=2048 +input_features[1, 128, 3000] +pre_layer_norm: Gemma3nRMSNorm 1536pre_layer_normRMSNorm 1536 +ffw_layer_1: Linear [1536→6144]ffw_layer_1 [1536→6144] +ffw_layer_2: Linear [6144→1536]ffw_layer_2 [6144→1536] +post_layer_norm: Gemma3nRMSNorm 1536post_layer_normRMSNorm 1536 +pre_attn_norm: Gemma3nRMSNorm 1536pre_attn_normRMSNorm 1536 +relative_position_embedding: Gemma3nAudioRelativePositionEmbeddingrelative_position_embeddingAudioRelativePositionEmbedding +q_proj: Linear [1536→1536]q_proj [1536→1536] +k_proj: Linear [1536→1536]k_proj [1536→1536] +v_proj: Linear [1536→1536]v_proj [1536→1536] +post: Linear [1536→1536]post [1536→1536] +post_norm: Gemma3nRMSNorm 1536post_norm RMSNorm 1536 +pre_layer_norm: Gemma3nRMSNorm 1536pre_layer_normRMSNorm 1536 +linear_start: Linear [1536→3072]linear_start [1536→3072] +depthwise_conv1d: Conv1d 1536×1×5depthwise_conv1dConv1d 1536×1×5 +conv_norm: Gemma3nRMSNorm 1536conv_norm RMSNorm 1536 +linear_end: Linear [1536→1536]linear_end [1536→1536] +pre_layer_norm: Gemma3nRMSNorm 1536pre_layer_normRMSNorm 1536 +ffw_layer_1: Linear [1536→6144]ffw_layer_1 [1536→6144] +ffw_layer_2: Linear [6144→1536]ffw_layer_2 [6144→1536] +post_layer_norm: Gemma3nRMSNorm 1536post_layer_normRMSNorm 1536 +norm: Gemma3nRMSNorm 1536norm RMSNorm 1536 +example image +pixel_values[1, 3, 336, 336] +embedding: Embedding 128×2048embedding Embedding 128×2048 +hard_embedding_norm: Gemma3nRMSNorm 2048hard_embedding_normRMSNorm 2048 +soft_embedding_norm: Gemma3nRMSNorm 2048soft_embedding_normRMSNorm 2048 +embedding_projection: Linear [2048→2048]embedding_projection [2048→2048] +embedding_post_projection_norm: Gemma3nRMSNormembedding_post_projection_normRMSNorm +input_features[1, 128, 3000] +embedding: Embedding 128×1536embedding Embedding 128×1536 +hard_embedding_norm: Gemma3nRMSNorm 1536hard_embedding_normRMSNorm 1536 +soft_embedding_norm: Gemma3nRMSNorm 1536soft_embedding_normRMSNorm 1536 +embedding_projection: Linear [1536→2048]embedding_projection [1536→2048] +embedding_post_projection_norm: Gemma3nRMSNormembedding_post_projection_normRMSNorm +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/gemma-3n-E4B +parent +gemma3 +classes +31 +overridden +18 +added +132 +new classes +20 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Gemma3nForConditionalGeneration +ovr forward,prepare_inputs_for_generation; a… + +Gemma3nTextDecoderLayer +ovr __init__,forward + +Gemma3nAudioAttention +add __init__,_convert_to_block,_extract_bloc… + +Gemma3nAudioConfig +20 attr + +Gemma3nAudioConformerAttention +add __init__,forward + +Gemma3nAudioConformerBlock +add __init__,forward + +Gemma3nAudioConformerFeedForward +add __init__,forward + +Gemma3nAudioConformerLightConv1d +add __init__,forward + +Gemma3nAudioCumulativeGroupNorm +add __init__,forward + +Gemma3nAudioEncoder +add __init__,forward; 3 attr + +Gemma3nAudioEncoderModelOutput +1 attr + +Gemma3nAudioRelativePositionEmbedding +add __init__,_get_timing_signal_1d_pos,_rela… + +Gemma3nAudioSSCPConvBlock +add __init__,forward + +Gemma3nAudioSubSampleConvProjection +add __init__,forward + +Gemma3nCausalLMOutputWithPast +1 attr + +Gemma3nConfig +add __post_init__; 15 attr + +Gemma3nModel +ovr __init__,forward,get_image_features,get_… + +Gemma3nModelOutputWithPast +1 attr + +Gemma3nMultimodalEmbedder +add __init__,forward + +Gemma3nPreTrainedModel +ovr _init_weights; add _resize_per_layer_emb… + +Gemma3nRMSNorm +add __init__,_norm,forward + +Gemma3nTextAltUp +add __init__,compute_router_modalities,corre… + +Gemma3nTextAttention +add __init__,forward + +Gemma3nTextConfig +add __post_init__,convert_rope_params_to_dic… + +Gemma3nTextLaurelBlock +add __init__,forward + +Gemma3nTextMLP +ovr __init__,forward; add _gaussian_topk + +Gemma3nTextModel +ovr __init__,forward; add get_per_layer_inpu… + +Gemma3nVisionConfig +9 attr + \ No newline at end of file diff --git a/gemma3n.svg b/gemma3n.svg new file mode 100644 index 0000000000000000000000000000000000000000..1ad11dd077accb4a47d2ae1784fb9164d41fe670 --- /dev/null +++ b/gemma3n.svg @@ -0,0 +1,298 @@ + + + + +gemma3n +multimodal · vision+audio+vision+audio → projector → LLM · dense + +Gemma3nModel · base model +35 × Gemma3nTextDecoderLayerGemma3nTextDecoderLayer× 35 +Gemma3nForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Gemma3nTextAttention (2 layer types — same modules, mask differs) +Audio encoder · Gemma3nAudioEncoder +Gemma3nAudioConformerBl…×12 +attention · Gemma3nAudioConfo… +Vision encoder · Gemma3nMultimodal… +Audio encoder · Gemma3nMultimodalE… +MLP · Gemma3nTextMLP +lconv1d · Gemma3nAudioConfor… +ffw_layer_start · Gemma3nAudio… +ffw_layer_end · Gemma3nAudioC… +attn · Gemma3nAudioAttention + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262400 × 2048] → [1, 6, 2048] +Gemma3nRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +q_norm: Gemma3nRMSNorm 256q_norm RMSNorm 256 +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +k_norm: Gemma3nRMSNorm 256k_norm RMSNorm 256 +v_norm: Gemma3nRMSNormv_norm RMSNorm +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:2 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma3nRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→16384]gate_proj [2048→16384] +up_proj: Linear [2048→16384]up_proj [2048→16384] +down_proj: Linear [16384→2048]down_proj [16384→2048] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2048] +Gemma3nForConditionalGenerationLM HeadLinear [2048→262400] · tied +Softmax +logits[1, 6, 262400] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: full_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: full_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: sliding_attention23 +layer 24: full_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: sliding_attention27 +layer 28: sliding_attention28 +layer 29: full_attention29 +layer 30: sliding_attention30 +layer 31: sliding_attention31 +layer 32: sliding_attention32 +layer 33: sliding_attention33 +layer 34: full_attention34 +example image +pixel_values[1, 3, 336, 336] +Vision encoder · TimmWrapperModelTimmWrapperModel · via AutoModelgemma3n_vision · ? layers · h=2048 +input_features[1, 128, 3000] +pre_layer_norm: Gemma3nRMSNorm 1536pre_layer_normRMSNorm 1536 +ffw_layer_1: Linear [1536→6144]ffw_layer_1 [1536→6144] +ffw_layer_2: Linear [6144→1536]ffw_layer_2 [6144→1536] +post_layer_norm: Gemma3nRMSNorm 1536post_layer_normRMSNorm 1536 +pre_attn_norm: Gemma3nRMSNorm 1536pre_attn_normRMSNorm 1536 +relative_position_embedding: Gemma3nAudioRelativePositionEmbeddingrelative_position_embeddingAudioRelativePositionEmbedding +q_proj: Linear [1536→1536]q_proj [1536→1536] +k_proj: Linear [1536→1536]k_proj [1536→1536] +v_proj: Linear [1536→1536]v_proj [1536→1536] +post: Linear [1536→1536]post [1536→1536] +post_norm: Gemma3nRMSNorm 1536post_norm RMSNorm 1536 +pre_layer_norm: Gemma3nRMSNorm 1536pre_layer_normRMSNorm 1536 +linear_start: Linear [1536→3072]linear_start [1536→3072] +depthwise_conv1d: Conv1d 1536×1×5depthwise_conv1dConv1d 1536×1×5 +conv_norm: Gemma3nRMSNorm 1536conv_norm RMSNorm 1536 +linear_end: Linear [1536→1536]linear_end [1536→1536] +pre_layer_norm: Gemma3nRMSNorm 1536pre_layer_normRMSNorm 1536 +ffw_layer_1: Linear [1536→6144]ffw_layer_1 [1536→6144] +ffw_layer_2: Linear [6144→1536]ffw_layer_2 [6144→1536] +post_layer_norm: Gemma3nRMSNorm 1536post_layer_normRMSNorm 1536 +norm: Gemma3nRMSNorm 1536norm RMSNorm 1536 +example image +pixel_values[1, 3, 336, 336] +embedding: Embedding 128×2048embedding Embedding 128×2048 +hard_embedding_norm: Gemma3nRMSNorm 2048hard_embedding_normRMSNorm 2048 +soft_embedding_norm: Gemma3nRMSNorm 2048soft_embedding_normRMSNorm 2048 +embedding_projection: Linear [2048→2048]embedding_projection [2048→2048] +embedding_post_projection_norm: Gemma3nRMSNormembedding_post_projection_normRMSNorm +input_features[1, 128, 3000] +embedding: Embedding 128×1536embedding Embedding 128×1536 +hard_embedding_norm: Gemma3nRMSNorm 1536hard_embedding_normRMSNorm 1536 +soft_embedding_norm: Gemma3nRMSNorm 1536soft_embedding_normRMSNorm 1536 +embedding_projection: Linear [1536→2048]embedding_projection [1536→2048] +embedding_post_projection_norm: Gemma3nRMSNormembedding_post_projection_normRMSNorm +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/gemma-3n-E4B +inputs +input_ids, pixel_values, input_features +built via +AutoModel +model_type +gemma3n +config +Gemma3nConfig +decoder +dense +layers +35 +hidden +2,048 +intermediate +[16,384]×35 +heads / kv +8 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +262,400 +max_pos +32,768 +sliding_window +512 +tie_embeddings +True +legend + +audio encoder + +vision encoder + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/gemma4.diff.svg b/gemma4.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..de5c425eebd1a362d3a06ba2407a566b39f070ef --- /dev/null +++ b/gemma4.diff.svg @@ -0,0 +1,320 @@ + + + + +gemma4 +diff vs gemma3 (+gemma3n,llama,mixtral) · 34 overridden · 56 added · 0 deleted · 18 new · 2 inherited-as-is + +Gemma4Model · base model +30 × Gemma4TextDecoderLayerGemma4TextDecoderLayer× 30 +Gemma4ForConditionalGeneration · task head +layers (idx) +Self-Attention · Gemma4TextAttention (2 layer types — modules differ ▼) +MLP · Gemma4TextMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262144 × 2304] → [1, 6, 2304] +Gemma4RMSNormpre-attention [1, 6, 2304] +▼ sliding +q_proj: Linear [2304→2048]q_proj [2304→2048] +▼ full +q_proj: Linear [2304→4096]q_proj [2304→4096] +▼ sliding +q_norm: Gemma4RMSNorm 256q_norm RMSNorm 256 +▼ full +q_norm: Gemma4RMSNorm 512q_norm RMSNorm 512 +▼ sliding +k_norm: Gemma4RMSNorm 256k_norm RMSNorm 256 +▼ full +k_norm: Gemma4RMSNorm 512k_norm RMSNorm 512 +v_norm: Gemma4RMSNormv_norm RMSNorm +▼ sliding +k_proj: Linear [2304→1024]k_proj [2304→1024] +▼ full +k_proj: Linear [2304→2048]k_proj [2304→2048] +▼ sliding +v_proj: Linear [2304→1024]v_proj [2304→1024] +▼ full +v_proj: Linear [2304→2048]v_proj [2304→2048] +▼ sliding +o_proj: Linear [2048→2304]o_proj [2048→2304] +▼ full +o_proj: Linear [4096→2304]o_proj [4096→2304] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma4RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +Gemma4ForConditionalGenerationLM HeadLinear [2304→262144] · tied +Softmax +logits[1, 6, 262144] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: sliding_attention27 +layer 28: sliding_attention28 +layer 29: full_attention29 + +model id +google/gemma-4-e2b-it +parent +gemma3 +classes +36 +overridden +34 +added +56 +new classes +18 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Gemma4MultimodalEmbedder +ovr __init__,forward + +Gemma4PreTrainedModel +ovr _init_weights; 3 attr + +Gemma4TextDecoderLayer +ovr __init__,forward + +Gemma4TextExperts +ovr __init__ + +Gemma4TextMLP +ovr __init__ + +Gemma4TextRotaryEmbedding +ovr __init__ + +Gemma4VisionAttention +ovr __init__,forward + +Gemma4VisionEncoderLayer +ovr __init__,forward + +Gemma4VisionMLP +ovr __init__ + +Gemma4VisionRotaryEmbedding +ovr compute_default_rope_parameters,forward + +Gemma4AudioAttention +add __init__,_convert_to_block,_extract_bloc… + +Gemma4AudioCausalConv1d +add forward,left_pad + +Gemma4AudioFeedForward +add __init__,forward + +Gemma4AudioLayer +add __init__,forward + +Gemma4AudioLightConv1d +add __init__,forward + +Gemma4AudioModel +add __init__,_convert_4d_mask_to_blocked_5d,… + +Gemma4AudioModelOutput +1 attr + +Gemma4AudioRelPositionalEncoding +add __init__,forward; 1 attr + +Gemma4AudioSubSampleConvProjection +add __init__,forward + +Gemma4AudioSubSampleConvProjectionLayer +add __init__,forward + +Gemma4CausalLMOutputWithPast +1 attr + +Gemma4ClippableLinear +add __init__,forward + +Gemma4ForCausalLM +ovr forward; 1 attr + +Gemma4ForConditionalGeneration +ovr forward,get_image_features,get_per_layer… + +Gemma4Model +ovr __init__,forward,get_audio_features,get_… + +Gemma4ModelOutputWithPast +1 attr + +Gemma4TextAttention +add __init__,forward + +Gemma4TextModel +ovr __init__,forward; add get_per_layer_inpu… + +Gemma4TextModelOutputWithPast +1 attr + +Gemma4TextRouter +add __init__,forward + +Gemma4VisionEncoder +add __init__,forward + +Gemma4VisionModel +add __init__,forward; 2 attr + +Gemma4VisionPatchEmbedder +add __init__,_position_embeddings,forward + +Gemma4VisionPooler +add __init__,_avg_pool_by_positions,forward + \ No newline at end of file diff --git a/gemma4.svg b/gemma4.svg new file mode 100644 index 0000000000000000000000000000000000000000..ae7be07bd7200550577b9fc771fb59a6a8f5c3ac --- /dev/null +++ b/gemma4.svg @@ -0,0 +1,239 @@ + + + + +gemma4 +dense · 25× sliding + 5× full + +Gemma4Model · base model +30 × Gemma4TextDecoderLayerGemma4TextDecoderLayer× 30 +Gemma4ForConditionalGeneration · task head +layers (idx) +Self-Attention · Gemma4TextAttention (2 layer types — modules differ ▼) +MLP · Gemma4TextMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262144 × 2304] → [1, 6, 2304] +Gemma4RMSNormpre-attention [1, 6, 2304] +▼ sliding +q_proj: Linear [2304→2048]q_proj [2304→2048] +▼ full +q_proj: Linear [2304→4096]q_proj [2304→4096] +▼ sliding +q_norm: Gemma4RMSNorm 256q_norm RMSNorm 256 +▼ full +q_norm: Gemma4RMSNorm 512q_norm RMSNorm 512 +▼ sliding +k_norm: Gemma4RMSNorm 256k_norm RMSNorm 256 +▼ full +k_norm: Gemma4RMSNorm 512k_norm RMSNorm 512 +v_norm: Gemma4RMSNormv_norm RMSNorm +▼ sliding +k_proj: Linear [2304→1024]k_proj [2304→1024] +▼ full +k_proj: Linear [2304→2048]k_proj [2304→2048] +▼ sliding +v_proj: Linear [2304→1024]v_proj [2304→1024] +▼ full +v_proj: Linear [2304→2048]v_proj [2304→2048] +▼ sliding +o_proj: Linear [2048→2304]o_proj [2048→2304] +▼ full +o_proj: Linear [4096→2304]o_proj [4096→2304] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma4RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +Gemma4ForConditionalGenerationLM HeadLinear [2304→262144] · tied +Softmax +logits[1, 6, 262144] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: sliding_attention27 +layer 28: sliding_attention28 +layer 29: full_attention29 + +model id +google/gemma-4-e2b-it +model_type +gemma4 +config +Gemma4Config +decoder +dense +layers +30 +hidden +2,304 +intermediate +9,216 +heads / kv +8 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +262,144 +max_pos +131,072 +sliding_window +512 +tie_embeddings +True +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gemma4_assistant.svg b/gemma4_assistant.svg new file mode 100644 index 0000000000000000000000000000000000000000..ccb63e9bc1587cd45e524b8d75fcf641256de930 --- /dev/null +++ b/gemma4_assistant.svg @@ -0,0 +1,155 @@ + + + + +gemma4_assistant +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +google/gemma-4-e2b-it +model_type +gemma4_assistant +config +Gemma4AssistantConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +True +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/git.svg b/git.svg new file mode 100644 index 0000000000000000000000000000000000000000..a41363e8d1f68b6dde19d11b385d8777598fb79d --- /dev/null +++ b/git.svg @@ -0,0 +1,215 @@ + + + + +git +multimodal · vision+vision → projector → LLM · dense + +GitModel · base model +6 × GitLayerGitLayer× 6 +GitForCausalLM · task head +image ⊕ text attention +Self-Attention · GitAttention +Vision encoder · GitVisionModel×12 +GitVisionEncoderLayer×12 +output · GitSelfOutput +Vision encoder · GitProjection×12 +self_attn · GitVisionAttention +self · GitSelfAttention +mlp · GitVisionMLP +visual_projection · Sequential + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +GitForCausalLMLM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +example image +pixel_values[1, 3, 336, 336] +0: Linear [768→768]0 [768→768] +1: LayerNorm 7681 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +microsoft/git-base +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForCausalLM +model_type +git +config +GitConfig +decoder +dense +layers +6 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +1,024 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/glm.diff.svg b/glm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..30d46f21b38a74486fd81da9a3d1d1a038eb8065 --- /dev/null +++ b/glm.diff.svg @@ -0,0 +1,170 @@ + + + + +glm +diff vs llama (+phi3) · 2 overridden · 0 added · 0 deleted · 0 new · 4 inherited-as-is + +GlmModel · base model +40 × GlmDecoderLayerGlmDecoderLayer× 40 +GlmForCausalLM · task head +Self-Attention · GlmAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +GlmRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GlmRMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +GlmForCausalLMLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] + +model id +THUDM/glm-4-9b-chat +parent +llama +classes +6 +overridden +2 +added +0 +new classes +0 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GlmAttention +ovr __init__ + +GlmRotaryEmbedding +ovr compute_default_rope_parameters + \ No newline at end of file diff --git a/glm.svg b/glm.svg new file mode 100644 index 0000000000000000000000000000000000000000..b47768348bfb71d6eac72175be52ae15d3c840f5 --- /dev/null +++ b/glm.svg @@ -0,0 +1,179 @@ + + + + +glm +dense · 40× GQA + +GlmModel · base model +40 × GlmDecoderLayerGlmDecoderLayer× 40 +GlmForCausalLM · task head +Self-Attention · GlmAttention +MLP · GlmMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +GlmRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GlmRMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +GlmForCausalLMLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] + +model id +THUDM/glm-4-9b-chat +model_type +glm +config +GlmConfig +decoder +dense +layers +40 +hidden +4,096 +intermediate +13,696 +heads / kv +32 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,552 +max_pos +131,072 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/glm4.diff.svg b/glm4.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ab8cc842d22724731970bb61f01c8c993549dc44 --- /dev/null +++ b/glm4.diff.svg @@ -0,0 +1,170 @@ + + + + +glm4 +diff vs glm (+phi3) · 1 overridden · 2 added · 0 deleted · 1 new · 4 inherited-as-is + +Glm4Model · base model +40 × Glm4DecoderLayerGlm4DecoderLayer× 40 +Glm4ForCausalLM · task head +Self-Attention · GlmAttention ↩ inherited +MLP · GlmMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4RMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm4ForCausalLMLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] + +model id +zai-org/GLM-OCR +parent +glm +classes +6 +overridden +1 +added +2 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Glm4ForCausalLM +ovr forward + +Glm4DecoderLayer +add __init__,forward + \ No newline at end of file diff --git a/glm4.svg b/glm4.svg new file mode 100644 index 0000000000000000000000000000000000000000..00e8d7b56bc3bf65a3e85d7190ea5b35832c2cd3 --- /dev/null +++ b/glm4.svg @@ -0,0 +1,179 @@ + + + + +glm4 +dense · 40× GQA + +Glm4Model · base model +40 × Glm4DecoderLayerGlm4DecoderLayer× 40 +Glm4ForCausalLM · task head +Self-Attention · Glm4Attention +MLP · Glm4MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4RMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm4ForCausalLMLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] + +model id +zai-org/GLM-OCR +model_type +glm4 +config +Glm4Config +decoder +dense +layers +40 +hidden +4,096 +intermediate +13,696 +heads / kv +32 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,552 +max_pos +131,072 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/glm46v.diff.svg b/glm46v.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..895dcdce27b90fd685da3cd7b47071adf8fc8398 --- /dev/null +++ b/glm46v.diff.svg @@ -0,0 +1,207 @@ + + + + +glm46v +diff vs glm4v · 3 overridden · 16 added · 1 deleted · 5 new · 1 inherited-as-is + +Glm46VModel · base model +40 × Glm4vTextDecoderLayerGlm4vTextDecoderLayer× 40 +Glm46VForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Glm4vTextAttention +Vision encoder · Glm4vVisionM…×24 +Glm4vVisionBlock×24 +MLP · Glm4vTextMLP +mlp · Glm4VisionMlp +attn · Glm4vVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4vRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4vRMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm46VForConditionalGenerationLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] +example image +pixel_values[1, 3, 336, 336] +norm1: Glm4vRMSNorm 1536norm1 Glm4vRMSNorm 1536 +norm2: Glm4vRMSNorm 1536norm2 Glm4vRMSNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-4.1V-9B-Thinking +parent +glm4v +classes +8 +overridden +3 +added +16 +new classes +5 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Glm46VPreTrainedModel +del _init_weights; 2 attr + +Glm46VModel +ovr __init__; 1 attr + +Glm46VConfig +add __post_init__; 12 attr + +Glm46VImageProcessor +rename only + +Glm46VImageProcessorPil +rename only + +Glm46VProcessor +add replace_frame_token_id + +Glm46VVideoProcessor +add sample_frames + \ No newline at end of file diff --git a/glm46v.svg b/glm46v.svg new file mode 100644 index 0000000000000000000000000000000000000000..1a876926228f823d6e6de62a49a2898b60b5a24d --- /dev/null +++ b/glm46v.svg @@ -0,0 +1,209 @@ + + + + +glm46v +multimodal · vision → projector → LLM · dense + +Glm46VModel · base model +40 × Glm4vTextDecoderLayerGlm4vTextDecoderLayer× 40 +Glm46VForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Glm4vTextAttention +Vision encoder · Glm4vVisionM…×24 +Glm4vVisionBlock×24 +MLP · Glm4vTextMLP +mlp · Glm4VisionMlp +attn · Glm4vVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4vRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4vRMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm46VForConditionalGenerationLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] +example image +pixel_values[1, 3, 336, 336] +norm1: Glm4vRMSNorm 1536norm1 Glm4vRMSNorm 1536 +norm2: Glm4vRMSNorm 1536norm2 Glm4vRMSNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-4.1V-9B-Thinking +inputs +input_ids, pixel_values +built via +AutoModel +model_type +glm46v +config +Glm46VConfig +decoder +dense +layers +40 +hidden +4,096 +intermediate +13,696 +heads / kv +32 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,552 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/glm4_moe.diff.svg b/glm4_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7b5b4d5491e8ccdb113fc78c5d295e5d02e10e40 --- /dev/null +++ b/glm4_moe.diff.svg @@ -0,0 +1,177 @@ + + + + +glm4_moe +diff vs deepseek_v3 (+cohere,glm) · 3 overridden · 34 added · 0 deleted · 1 new · 6 inherited-as-is + +Glm4MoeModel · base model +46 × Glm4MoeDecoderLayerGlm4MoeDecoderLayer× 46 +Glm4MoeForCausalLM · task head +Self-Attention · Glm4MoeAttention +Sparse MoE · DeepseekV3MLP ↩ inheritedMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4MoeRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4032]q_proj [4096→4032] +k_proj: Linear [4096→336]k_proj [4096→336] +v_proj: Linear [4096→336]v_proj [4096→336] +o_proj: Linear [4032→4096]o_proj [4032→4096] +scaled dot-product attention96 heads · head_dim 42 · GQA 96:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4MoeRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→10944]gate_proj [4096→10944] +up_proj: Linear [4096→10944]up_proj [4096→10944] +down_proj: Linear [10944→4096]down_proj [10944→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm4MoeForCausalLMLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] + +model id +zai-org/GLM-4.5 +parent +deepseek_v3 +classes +10 +overridden +3 +added +34 +new classes +1 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Glm4MoeAttention +ovr __init__ + +Glm4MoePreTrainedModel +1 attr + +Glm4MoeTopkRouter +ovr __init__ + +Glm4MoeConfig +add __post_init__; 33 attr + \ No newline at end of file diff --git a/glm4_moe.svg b/glm4_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..396705f7ccf50f7cebc4c860f7da94304722ccf9 --- /dev/null +++ b/glm4_moe.svg @@ -0,0 +1,182 @@ + + + + +glm4_moe +sparse-moe · 46× GQA +MoE + +Glm4MoeModel · base model +46 × Glm4MoeDecoderLayerGlm4MoeDecoderLayer× 46 +Glm4MoeForCausalLM · task head +Self-Attention · Glm4MoeAttention +Sparse MoE · Glm4MoeMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4MoeRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4032]q_proj [4096→4032] +k_proj: Linear [4096→336]k_proj [4096→336] +v_proj: Linear [4096→336]v_proj [4096→336] +o_proj: Linear [4032→4096]o_proj [4032→4096] +scaled dot-product attention96 heads · head_dim 42 · GQA 96:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4MoeRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→10944]gate_proj [4096→10944] +up_proj: Linear [4096→10944]up_proj [4096→10944] +down_proj: Linear [10944→4096]down_proj [10944→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm4MoeForCausalLMLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] + +model id +zai-org/GLM-4.5 +model_type +glm4_moe +config +Glm4MoeConfig +decoder +sparse-moe +layers +46 +hidden +4,096 +intermediate +10,944 +heads / kv +96 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,552 +max_pos +131,072 +experts (top-k) +128 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/glm4_moe_lite.diff.svg b/glm4_moe_lite.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..f573c5451978ad6c0db77428ddbbdc59942c9052 --- /dev/null +++ b/glm4_moe_lite.diff.svg @@ -0,0 +1,185 @@ + + + + +glm4_moe_lite +diff vs glm4_moe (+deepseek_v3) · 2 overridden · 40 added · 0 deleted · 1 new · 9 inherited-as-is + +Glm4MoeLiteModel · base model +47 × Glm4MoeLiteDecoderLayerGlm4MoeLiteDecoderLayer× 47 +Glm4MoeLiteForCausalLM · task head +Sparse MoE · Glm4MoeMLP (2 FFN types ▼) ↩ inheritedMoE +Self-Attention · Glm4MoeAttention ↩ inherited +shared_experts · Glm4MoeMLP (×64 · dim… +experts · Glm4MoeNaiveMoe (×64 · dim 15… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [154880 × 2048] → [1, 6, 2048] +Glm4MoeLiteRMSNormpre-attention [1, 6, 2048] +q_a_proj: Linear [2048→768]q_a_proj [2048→768] +q_a_layernorm: Glm4MoeLiteRMSNorm 768q_a_layernorm RMSNorm 768 +q_b_proj: Linear [768→5120]q_b_proj [768→5120] +kv_a_proj_with_mqa: Linear [2048→576]kv_a_proj_with_mqa [2048→576] +kv_a_layernorm: Glm4MoeLiteRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→8960]kv_b_proj [512→8960] +o_proj: Linear [5120→2048]o_proj [5120→2048] +scaled dot-product attention20 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4MoeLiteRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→10240]gate_proj [2048→10240] +up_proj: Linear [2048→10240]up_proj [2048→10240] +down_proj: Linear [10240→2048]down_proj [10240→2048] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: Glm4MoeLiteTopkRouter top-4 of 64gate TopkRouter top-4 of 64 +gate_proj: Linear [2048→1536]gate_proj [2048→1536] +up_proj: Linear [2048→1536]up_proj [2048→1536] +down_proj: Linear [1536→2048]down_proj [1536→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +Glm4MoeLiteForCausalLMLM HeadLinear [2048→154880] +Softmax +logits[1, 6, 154880] + +model id +zai-org/GLM-4.5 +parent +glm4_moe +classes +12 +overridden +2 +added +40 +new classes +1 +inherited as-is +9 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Glm4MoeLiteDecoderLayer +ovr __init__ + +Glm4MoeLitePreTrainedModel +1 attr + +Glm4MoeLiteConfig +add __post_init__; 39 attr + \ No newline at end of file diff --git a/glm4_moe_lite.svg b/glm4_moe_lite.svg new file mode 100644 index 0000000000000000000000000000000000000000..740cb1b0528bede9c725731324d156b44106e15a --- /dev/null +++ b/glm4_moe_lite.svg @@ -0,0 +1,193 @@ + + + + +glm4_moe_lite +sparse-moe · 47× MLA +MoE + +Glm4MoeLiteModel · base model +47 × Glm4MoeLiteDecoderLayerGlm4MoeLiteDecoderLayer× 47 +Glm4MoeLiteForCausalLM · task head +Sparse MoE · Glm4MoeLiteMLP (2 FFN types ▼)MoE +Self-Attention · Glm4MoeLiteAttention +shared_experts · Glm4MoeLiteMLP (×64 ·… +experts · Glm4MoeLiteNaiveMoe (×64 · di… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [154880 × 2048] → [1, 6, 2048] +Glm4MoeLiteRMSNormpre-attention [1, 6, 2048] +q_a_proj: Linear [2048→768]q_a_proj [2048→768] +q_a_layernorm: Glm4MoeLiteRMSNorm 768q_a_layernorm RMSNorm 768 +q_b_proj: Linear [768→5120]q_b_proj [768→5120] +kv_a_proj_with_mqa: Linear [2048→576]kv_a_proj_with_mqa [2048→576] +kv_a_layernorm: Glm4MoeLiteRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→8960]kv_b_proj [512→8960] +o_proj: Linear [5120→2048]o_proj [5120→2048] +scaled dot-product attention20 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4MoeLiteRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→10240]gate_proj [2048→10240] +up_proj: Linear [2048→10240]up_proj [2048→10240] +down_proj: Linear [10240→2048]down_proj [10240→2048] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: Glm4MoeLiteTopkRouter top-4 of 64gate TopkRouter top-4 of 64 +gate_proj: Linear [2048→1536]gate_proj [2048→1536] +up_proj: Linear [2048→1536]up_proj [2048→1536] +down_proj: Linear [1536→2048]down_proj [1536→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +Glm4MoeLiteForCausalLMLM HeadLinear [2048→154880] +Softmax +logits[1, 6, 154880] + +model id +zai-org/GLM-4.5 +model_type +glm4_moe_lite +config +Glm4MoeLiteConfig +decoder +sparse-moe +layers +47 +hidden +2,048 +intermediate +10,240 +heads / kv +20 / 20 +attention +MLA +norm +RMSNorm +positional +RoPE +vocab +154,880 +max_pos +202,752 +experts (top-k) +64 (top-4) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/glm4v.diff.svg b/glm4v.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..4bccc53b9d0922f25309ddaaa882e62ce6a2a9d8 --- /dev/null +++ b/glm4v.diff.svg @@ -0,0 +1,243 @@ + + + + +glm4v +diff vs qwen2_5_vl (+glm4,qwen2_vl) · 19 overridden · 73 added · 0 deleted · 10 new · 5 inherited-as-is + +Glm4vModel · base model +40 × Glm4vTextDecoderLayerGlm4vTextDecoderLayer× 40 +Glm4vForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Glm4vTextAttention +Vision encoder · Glm4vVisionM…×24 +Glm4vVisionBlock×24 +MLP · Qwen2_5_VLTextMLP ↩ inherited +mlp · Glm4VisionMlp +attn · Glm4vVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4vRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4vRMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm4vForConditionalGenerationLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] +example image +pixel_values[1, 3, 336, 336] +norm1: Glm4vRMSNorm 1536norm1 RMSNorm 1536 +norm2: Glm4vRMSNorm 1536norm2 RMSNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-4.1V-9B-Thinking +parent +qwen2_5_vl +classes +24 +overridden +19 +added +73 +new classes +10 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Glm4VisionMlp +ovr __init__ + +Glm4vForConditionalGeneration +ovr _get_image_nums_and_video_nums,forward,p… + +Glm4vPreTrainedModel +ovr _init_weights; 1 attr + +Glm4vTextModel +ovr __init__,forward; 1 attr + +Glm4vVisionAttention +ovr __init__ + +Glm4vVisionBlock +ovr __init__ + +Glm4vVisionPatchEmbed +ovr __init__ + +Glm4vConfig +add __post_init__; 12 attr + +Glm4vModel +ovr __init__,forward,get_placeholder_mask,ge… + +Glm4vProcessor +add __init__,create_mm_token_type_ids,replac… + +Glm4vProcessorKwargs +1 attr + +Glm4vTextAttention +add __init__,forward + +Glm4vTextConfig +add __post_init__; 20 attr + +Glm4vTextDecoderLayer +add __init__,forward + +Glm4vTextRotaryEmbedding +ovr __init__,forward; add apply_mrope + +Glm4vVisionConfig +17 attr + +Glm4vVisionEmbeddings +add __init__,forward + +Glm4vVisionModel +add __init__,forward,rot_pos_emb; 4 attr + +Glm4vVisionPatchMerger +add __init__,forward + \ No newline at end of file diff --git a/glm4v.svg b/glm4v.svg new file mode 100644 index 0000000000000000000000000000000000000000..bd82a57c970246f15d5223f5868f81b94c53c751 --- /dev/null +++ b/glm4v.svg @@ -0,0 +1,207 @@ + + + + +glm4v +multimodal · vision → projector → LLM · dense + +Glm4vModel · base model +40 × Glm4vTextDecoderLayerGlm4vTextDecoderLayer× 40 +Glm4vForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Glm4vTextAttention +Vision encoder · Glm4vVisionM…×24 +Glm4vVisionBlock×24 +MLP · Glm4vTextMLP +mlp · Glm4VisionMlp +attn · Glm4vVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4vRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4vRMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm4vForConditionalGenerationLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] +example image +pixel_values[1, 3, 336, 336] +norm1: Glm4vRMSNorm 1536norm1 RMSNorm 1536 +norm2: Glm4vRMSNorm 1536norm2 RMSNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-4.1V-9B-Thinking +inputs +input_ids, pixel_values +model_type +glm4v +config +Glm4vConfig +decoder +dense +layers +40 +hidden +4,096 +intermediate +13,696 +heads / kv +32 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,552 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/glm4v_moe.diff.svg b/glm4v_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..2c8916b7c0fa8e051f168e8a5b81b0711838b335 --- /dev/null +++ b/glm4v_moe.diff.svg @@ -0,0 +1,214 @@ + + + + +glm4v_moe +diff vs glm4_moe (+glm4v,qwen3_vl_moe,deepseek_v3,glm4) · 15 overridden · 15 added · 0 deleted · 2 new · 6 inherited-as-is + +Glm4vMoeModel · base model +46 × Glm4vMoeTextDecoderLayerGlm4vMoeTextDecoderLayer× 46 +Glm4vMoeForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Glm4vMoeTextAttention +Vision encoder · Glm4MoeVisio…×24 +Glm4MoeVisionBlock ↩ inhe…×24 +Sparse MoE · Glm4MoeTextMLP ↩ inheritedMoE +mlp · Glm4MoeisionMlp ↩ inher… +attn · Glm4MoeVisionAttention ↩… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151424 × 4096] → [1, 6, 4096] +Glm4vMoeTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4032]q_proj [4096→4032] +k_proj: Linear [4096→336]k_proj [4096→336] +v_proj: Linear [4096→336]v_proj [4096→336] +o_proj: Linear [4032→4096]o_proj [4032→4096] +scaled dot-product attention96 heads · head_dim 42 · GQA 96:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4vMoeTextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→10944]gate_proj [4096→10944] +up_proj: Linear [4096→10944]up_proj [4096→10944] +down_proj: Linear [10944→4096]down_proj [10944→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm4vMoeForConditionalGenerationLM HeadLinear [4096→151424] +Softmax +logits[1, 6, 151424] +example image +pixel_values[1, 3, 336, 336] +norm1: Glm4vMoeRMSNorm 1536norm1 RMSNorm 1536 +norm2: Glm4vMoeRMSNorm 1536norm2 RMSNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-4.5V +parent +glm4_moe +classes +15 +overridden +15 +added +15 +new classes +2 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Glm4vMoeForConditionalGeneration +ovr __init__,forward + +Glm4vMoeTextAttention +ovr __init__,forward + +Glm4vMoeTextDecoderLayer +ovr __init__ + +Glm4vMoeTextMoE +ovr __init__ + +Glm4vMoeTextModel +ovr forward; 1 attr + +Glm4vMoeTextTopkRouter +ovr __init__ + +Glm4vMoeConfig +2 attr + +Glm4vMoePreTrainedModel +ovr _init_weights; 6 attr + +Glm4vMoeTextConfig +add __post_init__; 11 attr + \ No newline at end of file diff --git a/glm4v_moe.svg b/glm4v_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..95a09b78eabd0516cdab52dd229ba59810159c94 --- /dev/null +++ b/glm4v_moe.svg @@ -0,0 +1,210 @@ + + + + +glm4v_moe +multimodal · vision → projector → LLM · sparse-moe + +Glm4vMoeModel · base model +46 × Glm4vMoeTextDecoderLayerGlm4vMoeTextDecoderLayer× 46 +Glm4vMoeForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Glm4vMoeTextAttention +Vision encoder · Glm4vMoeVisi…×24 +Glm4vMoeVisionBlock×24 +Sparse MoE · Glm4vMoeTextMLPMoE +mlp · Glm4vMoeisionMlp +attn · Glm4vMoeVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151424 × 4096] → [1, 6, 4096] +Glm4vMoeTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4032]q_proj [4096→4032] +k_proj: Linear [4096→336]k_proj [4096→336] +v_proj: Linear [4096→336]v_proj [4096→336] +o_proj: Linear [4032→4096]o_proj [4032→4096] +scaled dot-product attention96 heads · head_dim 42 · GQA 96:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4vMoeTextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→10944]gate_proj [4096→10944] +up_proj: Linear [4096→10944]up_proj [4096→10944] +down_proj: Linear [10944→4096]down_proj [10944→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm4vMoeForConditionalGenerationLM HeadLinear [4096→151424] +Softmax +logits[1, 6, 151424] +example image +pixel_values[1, 3, 336, 336] +norm1: Glm4vMoeRMSNorm 1536norm1 RMSNorm 1536 +norm2: Glm4vMoeRMSNorm 1536norm2 RMSNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-4.5V +inputs +input_ids, pixel_values +model_type +glm4v_moe +config +Glm4vMoeConfig +decoder +sparse-moe +layers +46 +hidden +4,096 +intermediate +10,944 +heads / kv +96 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,424 +max_pos +65,536 +experts (top-k) +128 (top-8) +tie_embeddings +False +legend + +vision encoder + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/glm_image.diff.svg b/glm_image.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7012bc11fc2d9597974930f5715ab8321a00e7f4 --- /dev/null +++ b/glm_image.diff.svg @@ -0,0 +1,269 @@ + + + + +glm_image +diff vs glm4v (+chameleon,glm4v_moe,siglip) · 27 overridden · 62 added · 1 deleted · 10 new · 6 inherited-as-is + +GlmImageModel · base model +40 × GlmImageVisionBlockGlmImageVisionBlock× 40 +image ⊕ text attention +Vision encoder · Glm4vTextMod…×40 +Glm4vTextDecoderLayer ↩ i…×40 +Self-Attention · GlmImageVisionAttention +Vision encoder · GlmImageVisio…×40 +GlmImageVisionBlock×40 +Vision encoder · GlmImageVQV…×40 +self_attn · Glm4vTextAttention ↩… +MLP · Glm4vVisionMLP ↩ inherited +mlp · Glm4vVisionMLP ↩ inherit… +mlp · Glm4vTextMLP ↩ inherited +attn · GlmImageVisionAttention +quantize · GlmImageVQVAEVectorQ… + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [168064 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 4096] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1536→6144]fc1 [1536→6144] +fc2: Linear [6144→1536]fc2 [6144→1536] +residual add+ +Final RMSNorm[1, 6, 4096] +LM HeadLinear [4096→168064] +Softmax +logits[1, 6, 168064] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1536norm1 LayerNorm 1536 +norm2: LayerNorm 1536norm2 LayerNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1536→6144]fc1 [1536→6144] +fc2: Linear [6144→1536]fc2 [6144→1536] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +input_layernorm: GlmImageRMSNorm 4096input_layernorm RMSNorm 4096 +post_attention_layernorm: GlmImageRMSNorm 4096post_attention_layernormRMSNorm 4096 +post_self_attn_layernorm: GlmImageRMSNorm 4096post_self_attn_layernormRMSNorm 4096 +post_mlp_layernorm: GlmImageRMSNorm 4096post_mlp_layernormRMSNorm 4096 +example image +pixel_values[1, 3, 336, 336] +embedding: Embedding 16384×2048embeddingEmbedding 16384×2048 +quant_conv: Conv2dquant_conv Conv2d +post_quant_conv: Conv2dpost_quant_conv Conv2d +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-Image +parent +glm4v +classes +25 +overridden +27 +added +62 +new classes +10 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GlmImageModel +ovr __init__,compute_3d_position_ids,forward… + +GlmImagePreTrainedModel +ovr _init_weights; 2 attr + +GlmImageVQVAE +ovr __init__,encode; 2 attr + +GlmImageVQVAEVectorQuantizer +ovr __init__,forward + +GlmImageVisionAttention +ovr __init__,forward + +GlmImageVisionBlock +ovr __init__,forward + +GlmImageVisionEmbeddings +ovr __init__ + +GlmImageVisionPatchEmbed +ovr __init__,forward + +GlmImageConfig +add __post_init__; 10 attr + +GlmImageForConditionalGeneration +add __init__,_expand_inputs_for_generation,_… + +GlmImageImageProcessor +1 attr + +GlmImageImageProcessorPil +1 attr + +GlmImageImagesKwargs +2 attr + +GlmImageProcessor +add __call__,__init__,_build_prompt_with_tar… + +GlmImageProcessorKwargs +2 attr + +GlmImageTextConfig +6 attr + +GlmImageVQVAEConfig +7 attr + +GlmImageVisionConfig +14 attr + +GlmImageVisionModel +ovr __init__,forward,rot_pos_emb; 3 attr + \ No newline at end of file diff --git a/glm_image.svg b/glm_image.svg new file mode 100644 index 0000000000000000000000000000000000000000..da64726ef6232eaf288b82e7c36986e0ad211423 --- /dev/null +++ b/glm_image.svg @@ -0,0 +1,233 @@ + + + + +glm_image +multimodal · vision+vision+vision → projector → LLM · dense + +GlmImageModel · base model +40 × GlmImageVisionBlockGlmImageVisionBlock× 40 +image ⊕ text attention +Vision encoder · GlmImageText…×40 +GlmImageTextDecoderLayer×40 +Self-Attention · GlmImageVisionAttention +Vision encoder · GlmImageVisio…×40 +GlmImageVisionBlock×40 +Vision encoder · GlmImageVQV…×40 +self_attn · GlmImageTextAttention +MLP · GlmImageVisionMLP +mlp · GlmImageVisionMLP +mlp · GlmImageTextMLP +attn · GlmImageVisionAttention +quantize · GlmImageVQVAEVectorQ… + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [168064 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 4096] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1536→6144]fc1 [1536→6144] +fc2: Linear [6144→1536]fc2 [6144→1536] +residual add+ +Final RMSNorm[1, 6, 4096] +LM HeadLinear [4096→168064] +Softmax +logits[1, 6, 168064] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1536norm1 LayerNorm 1536 +norm2: LayerNorm 1536norm2 LayerNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1536→6144]fc1 [1536→6144] +fc2: Linear [6144→1536]fc2 [6144→1536] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +input_layernorm: GlmImageRMSNorm 4096input_layernorm RMSNorm 4096 +post_attention_layernorm: GlmImageRMSNorm 4096post_attention_layernormRMSNorm 4096 +post_self_attn_layernorm: GlmImageRMSNorm 4096post_self_attn_layernormRMSNorm 4096 +post_mlp_layernorm: GlmImageRMSNorm 4096post_mlp_layernormRMSNorm 4096 +example image +pixel_values[1, 3, 336, 336] +embedding: Embedding 16384×2048embeddingEmbedding 16384×2048 +quant_conv: Conv2dquant_conv Conv2d +post_quant_conv: Conv2dpost_quant_conv Conv2d +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-Image +inputs +input_ids, pixel_values +model_type +glm_image +config +GlmImageConfig +decoder +dense +layers +40 +hidden +4,096 +intermediate +13,696 +heads / kv +32 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +168,064 +max_pos +131,072 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/glm_moe_dsa.diff.svg b/glm_moe_dsa.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..dbfe5aea91b64f66357b7ef190f1843ea31f482e --- /dev/null +++ b/glm_moe_dsa.diff.svg @@ -0,0 +1,202 @@ + + + + +glm_moe_dsa +diff vs glm4_moe (+glm4_moe_lite) · 8 overridden · 25 added · 0 deleted · 3 new · 2 inherited-as-is + +GlmMoeDsaModel · base model +78 × GlmMoeDsaDecoderLayerGlmMoeDsaDecoderLayer× 78 +GlmMoeDsaForCausalLM · task head +Self-Attention · GlmMoeDsaAttention +Sparse MoE · Glm4MoeMLP (2 FFN types ▼) ↩ inheritedMoE +indexer · GlmMoeDsaIndexer +shared_experts · Glm4MoeMLP (×256 · di… +experts · Glm4MoeNaiveMoe (×256 · dim 2… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [154880 × 6144] → [1, 6, 6144] +GlmMoeDsaRMSNormpre-attention [1, 6, 6144] +q_a_proj: Linear [6144→2048]q_a_proj [6144→2048] +q_a_layernorm: GlmMoeDsaRMSNorm 2048q_a_layernorm RMSNorm 2048 +q_b_proj: Linear [2048→16384]q_b_proj [2048→16384] +kv_a_proj_with_mqa: Linear [6144→576]kv_a_proj_with_mqa [6144→576] +kv_a_layernorm: GlmMoeDsaRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→28672]kv_b_proj [512→28672] +o_proj: Linear [16384→6144]o_proj [16384→6144] +wq_b: Linear [2048→4096]wq_b [2048→4096] +wk: Linear [6144→128]wk [6144→128] +k_norm: LayerNorm 128k_norm LayerNorm 128 +weights_proj: Linear [6144→32]weights_proj [6144→32] +scaled dot-product attention64 heads · head_dim 96 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GlmMoeDsaRMSNormpre-FFN [1, 6, 6144] +gate_proj: Linear [6144→12288]gate_proj [6144→12288] +up_proj: Linear [6144→12288]up_proj [6144→12288] +down_proj: Linear [12288→6144]down_proj [12288→6144] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: GlmMoeDsaTopkRouter top-8 of 256gate TopkRouter top-8 of 256 +gate_proj: Linear [6144→2048]gate_proj [6144→2048] +up_proj: Linear [6144→2048]up_proj [6144→2048] +down_proj: Linear [2048→6144]down_proj [2048→6144] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 6144] +GlmMoeDsaForCausalLMLM HeadLinear [6144→154880] +Softmax +logits[1, 6, 154880] + +model id +zai-org/GLM-5 +parent +glm4_moe +classes +9 +overridden +8 +added +25 +new classes +3 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GlmMoeDsaDecoderLayer +ovr forward + +GlmMoeDsaModel +ovr forward + +GlmMoeDsaRotaryEmbedding +ovr compute_default_rope_parameters + +GlmMoeDsaAttention +add __init__,forward + +GlmMoeDsaConfig +add __post_init__; 18 attr + +GlmMoeDsaIndexer +add __init__,forward + +GlmMoeDsaPreTrainedModel +7 attr + \ No newline at end of file diff --git a/glm_moe_dsa.svg b/glm_moe_dsa.svg new file mode 100644 index 0000000000000000000000000000000000000000..64f0ab9dd541933e6b22b4818fa09301265f7ea5 --- /dev/null +++ b/glm_moe_dsa.svg @@ -0,0 +1,198 @@ + + + + +glm_moe_dsa +sparse-moe · 78× MLA +MoE + +GlmMoeDsaModel · base model +78 × GlmMoeDsaDecoderLayerGlmMoeDsaDecoderLayer× 78 +GlmMoeDsaForCausalLM · task head +Self-Attention · GlmMoeDsaAttention +Sparse MoE · GlmMoeDsaMLP (2 FFN types ▼)MoE +indexer · GlmMoeDsaIndexer +shared_experts · GlmMoeDsaMLP (×256 · d… +experts · GlmMoeDsaNaiveMoe (×256 · dim… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [154880 × 6144] → [1, 6, 6144] +GlmMoeDsaRMSNormpre-attention [1, 6, 6144] +q_a_proj: Linear [6144→2048]q_a_proj [6144→2048] +q_a_layernorm: GlmMoeDsaRMSNorm 2048q_a_layernorm RMSNorm 2048 +q_b_proj: Linear [2048→16384]q_b_proj [2048→16384] +kv_a_proj_with_mqa: Linear [6144→576]kv_a_proj_with_mqa [6144→576] +kv_a_layernorm: GlmMoeDsaRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→28672]kv_b_proj [512→28672] +o_proj: Linear [16384→6144]o_proj [16384→6144] +wq_b: Linear [2048→4096]wq_b [2048→4096] +wk: Linear [6144→128]wk [6144→128] +k_norm: LayerNorm 128k_norm LayerNorm 128 +weights_proj: Linear [6144→32]weights_proj [6144→32] +scaled dot-product attention64 heads · head_dim 96 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GlmMoeDsaRMSNormpre-FFN [1, 6, 6144] +gate_proj: Linear [6144→12288]gate_proj [6144→12288] +up_proj: Linear [6144→12288]up_proj [6144→12288] +down_proj: Linear [12288→6144]down_proj [12288→6144] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: GlmMoeDsaTopkRouter top-8 of 256gate TopkRouter top-8 of 256 +gate_proj: Linear [6144→2048]gate_proj [6144→2048] +up_proj: Linear [6144→2048]up_proj [6144→2048] +down_proj: Linear [2048→6144]down_proj [2048→6144] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 6144] +GlmMoeDsaForCausalLMLM HeadLinear [6144→154880] +Softmax +logits[1, 6, 154880] + +model id +zai-org/GLM-5 +model_type +glm_moe_dsa +config +GlmMoeDsaConfig +decoder +sparse-moe +layers +78 +hidden +6,144 +intermediate +12,288 +heads / kv +64 / 64 +attention +MLA +norm +RMSNorm +positional +RoPE +vocab +154,880 +max_pos +202,752 +experts (top-k) +256 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/glm_ocr.diff.svg b/glm_ocr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..745c97bc78bf62c1103a8566ad80d7c051395e62 --- /dev/null +++ b/glm_ocr.diff.svg @@ -0,0 +1,218 @@ + + + + +glm_ocr +diff vs glm4v · 8 overridden · 19 added · 0 deleted · 3 new · 6 inherited-as-is + +GlmOcrModel · base model +16 × GlmOcrTextDecoderLayerGlmOcrTextDecoderLayer× 16 +GlmOcrForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · GlmOcrVision…×24 +Self-Attention · GlmOcrTextAttention +GlmOcrVisionBlock×24 +MLP · Glm4vTextMLP ↩ inherited +attn · GlmOcrVisionAttention +mlp · GlmOcrVisionMlp + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [59392 × 1024] → [1, 6, 1024] +GlmOcrRMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→512]k_proj [1024→512] +v_proj: Linear [1024→512]v_proj [1024→512] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 · GQA 16:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GlmOcrRMSNormpre-FFN [1, 6, 1024] +gate_up_proj: Linear [1024→8192]gate_up_proj [1024→8192] +down_proj: Linear [4096→1024]down_proj [4096→1024] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +GlmOcrForConditionalGenerationLM HeadLinear [1024→59392] +Softmax +logits[1, 6, 59392] +example image +pixel_values[1, 3, 336, 336] +norm1: GlmOcrRMSNorm 1024norm1 RMSNorm 1024 +norm2: GlmOcrRMSNorm 1024norm2 RMSNorm 1024 +qkv: Linear [1024→3072]qkv [1024→3072] +proj: Linear [1024→1024]proj [1024→1024] +q_norm: GlmOcrRMSNorm 64q_norm RMSNorm 64 +k_norm: GlmOcrRMSNorm 64k_norm RMSNorm 64 +gate_proj: Linear [1024→4096]gate_proj [1024→4096] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-OCR +parent +glm4v +classes +16 +overridden +8 +added +19 +new classes +3 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GlmOcrTextAttention +ovr __init__ + +GlmOcrTextModel +1 attr + +GlmOcrVisionAttention +ovr __init__,forward + +GlmOcrVisionBlock +ovr __init__ + +GlmOcrVisionMlp +ovr __init__ + +GlmOcrVisionModel +ovr __init__,forward + +GlmOcrConfig +6 attr + +GlmOcrPreTrainedModel +1 attr + +GlmOcrTextConfig +7 attr + +GlmOcrVisionConfig +5 attr + \ No newline at end of file diff --git a/glm_ocr.svg b/glm_ocr.svg new file mode 100644 index 0000000000000000000000000000000000000000..5d3b58fe830973992fecaf0955d293e6cf8cbada --- /dev/null +++ b/glm_ocr.svg @@ -0,0 +1,209 @@ + + + + +glm_ocr +multimodal · vision → projector → LLM · dense + +GlmOcrModel · base model +16 × GlmOcrTextDecoderLayerGlmOcrTextDecoderLayer× 16 +GlmOcrForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · GlmOcrVision…×24 +Self-Attention · GlmOcrTextAttention +GlmOcrVisionBlock×24 +MLP · GlmOcrTextMLP +attn · GlmOcrVisionAttention +mlp · GlmOcrVisionMlp + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [59392 × 1024] → [1, 6, 1024] +GlmOcrRMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→512]k_proj [1024→512] +v_proj: Linear [1024→512]v_proj [1024→512] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 · GQA 16:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GlmOcrRMSNormpre-FFN [1, 6, 1024] +gate_up_proj: Linear [1024→8192]gate_up_proj [1024→8192] +down_proj: Linear [4096→1024]down_proj [4096→1024] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +GlmOcrForConditionalGenerationLM HeadLinear [1024→59392] +Softmax +logits[1, 6, 59392] +example image +pixel_values[1, 3, 336, 336] +norm1: GlmOcrRMSNorm 1024norm1 RMSNorm 1024 +norm2: GlmOcrRMSNorm 1024norm2 RMSNorm 1024 +qkv: Linear [1024→3072]qkv [1024→3072] +proj: Linear [1024→1024]proj [1024→1024] +q_norm: GlmOcrRMSNorm 64q_norm RMSNorm 64 +k_norm: GlmOcrRMSNorm 64k_norm RMSNorm 64 +gate_proj: Linear [1024→4096]gate_proj [1024→4096] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +zai-org/GLM-OCR +inputs +input_ids, pixel_values +model_type +glm_ocr +config +GlmOcrConfig +decoder +dense +layers +16 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +59,392 +max_pos +131,072 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/glmasr.diff.svg b/glmasr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..08887c2d34862e6513791a31d8cf0e07747dd59c --- /dev/null +++ b/glmasr.diff.svg @@ -0,0 +1,214 @@ + + + + +glmasr +diff vs audioflamingo3 (+glm,llama) · 6 overridden · 14 added · 0 deleted · 5 new · 2 inherited-as-is + +GlmAsrModel · base model +28 × LlamaDecoderLayerLlamaDecoderLayer× 28 +GlmAsrForConditionalGeneration · task head +Audio encoder · GlmAsrEncoder×32 +Self-Attention · LlamaAttention +GlmAsrEncoderLayer×32 +MLP · LlamaMLP +self_attn · GlmAsrAttention +Projector · GlmAsrMultiModalProjector +mlp · GlmAsrMLP + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [59264 × 2048] → [1, 6, 2048] +LlamaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→6144]gate_proj [2048→6144] +up_proj: Linear [2048→6144]up_proj [2048→6144] +down_proj: Linear [6144→2048]down_proj [6144→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +GlmAsrForConditionalGenerationLM HeadLinear [2048→59264] · tied +Softmax +logits[1, 6, 59264] +input_features[1, 128, 3000] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +act_fn: GELUActivationact_fn GELU +input_layernorm: LayerNorm 1280input_layernormLayerNorm 1280 +post_attention_layernorm: LayerNorm 1280post_attention_layernormLayerNorm 1280 +linear_1: Linear [5120→4096]linear_1 [5120→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→2048]linear_2 [4096→2048] +merge at modality tokens + +model id +zai-org/GLM-ASR-Nano-2512 +parent +audioflamingo3 +classes +11 +overridden +6 +added +14 +new classes +5 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GlmAsrAttention +ovr __init__,forward + +GlmAsrForConditionalGeneration +ovr __init__,forward + +GlmAsrModel +ovr get_audio_features + +GlmAsrMultiModalProjector +ovr __init__ + +GlmAsrEncoder +add __init__,forward; 5 attr + +GlmAsrEncoderLayer +add __init__,forward + +GlmAsrMLP +add __init__,forward + +GlmAsrProcessor +add __init__,_get_audio_token_length,apply_t… + +GlmAsrProcessorKwargs +rename only + \ No newline at end of file diff --git a/glmasr.svg b/glmasr.svg new file mode 100644 index 0000000000000000000000000000000000000000..780a69cd5f8ce2995ecd00a14747441b40ad69cb --- /dev/null +++ b/glmasr.svg @@ -0,0 +1,210 @@ + + + + +glmasr +multimodal · audio → projector → LLM · dense + +GlmAsrModel · base model +28 × LlamaDecoderLayerLlamaDecoderLayer× 28 +GlmAsrForConditionalGeneration · task head +Audio encoder · GlmAsrEncoder×32 +Self-Attention · LlamaAttention +GlmAsrEncoderLayer×32 +MLP · LlamaMLP +self_attn · GlmAsrAttention +Projector · GlmAsrMultiModalProjector +mlp · GlmAsrMLP + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [59264 × 2048] → [1, 6, 2048] +LlamaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→6144]gate_proj [2048→6144] +up_proj: Linear [2048→6144]up_proj [2048→6144] +down_proj: Linear [6144→2048]down_proj [6144→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +GlmAsrForConditionalGenerationLM HeadLinear [2048→59264] · tied +Softmax +logits[1, 6, 59264] +input_features[1, 128, 3000] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +act_fn: GELUActivationact_fn GELU +input_layernorm: LayerNorm 1280input_layernormLayerNorm 1280 +post_attention_layernorm: LayerNorm 1280post_attention_layernormLayerNorm 1280 +linear_1: Linear [5120→4096]linear_1 [5120→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→2048]linear_2 [4096→2048] +merge at modality tokens + +model id +zai-org/GLM-ASR-Nano-2512 +inputs +input_ids, input_features +built via +AutoModel +model_type +glmasr +config +GlmAsrConfig +decoder +dense +layers +28 +hidden +2,048 +intermediate +6,144 +heads / kv +16 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +59,264 +max_pos +8,192 +tie_embeddings +True +legend + +audio encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/glmga.diff.svg b/glmga.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..80865fe6ca9f5ec2b3aae5bd30e274a08287e0fb --- /dev/null +++ b/glmga.diff.svg @@ -0,0 +1,204 @@ + + + + +glmga +diff vs None · 0 overridden · 22 added · 0 deleted · 6 new · 0 inherited-as-is + +Glm46VModel · base model +40 × Glm4vTextDecoderLayerGlm4vTextDecoderLayer× 40 +Glm46VForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Glm4vTextAttention +Vision encoder · Glm4vVisionM…×24 +Glm4vVisionBlock×24 +MLP · Glm4vTextMLP +mlp · Glm4VisionMlp +attn · Glm4vVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4vRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4vRMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm46VForConditionalGenerationLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] +example image +pixel_values[1, 3, 336, 336] +norm1: Glm4vRMSNorm 1536norm1 Glm4vRMSNorm 1536 +norm2: Glm4vRMSNorm 1536norm2 Glm4vRMSNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +zai-org/GLM-4.1V-9B-Thinking +parent +— +classes +6 +overridden +0 +added +22 +new classes +6 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GlmgaConfig +1 attr + +GlmgaImageProcessor +add _preprocess; 1 attr + +GlmgaImageProcessorKwargs +4 attr + +GlmgaImageProcessorPil +add _preprocess; 1 attr + +GlmgaVideoProcessor +add _preprocess,sample_frames; 5 attr + +GlmgaVideoProcessorInitKwargs +6 attr + \ No newline at end of file diff --git a/glmga.svg b/glmga.svg new file mode 100644 index 0000000000000000000000000000000000000000..d880ab182e50f374a729a3c66b63f77127b64866 --- /dev/null +++ b/glmga.svg @@ -0,0 +1,209 @@ + + + + +glmga +multimodal · vision → projector → LLM · dense + +Glm46VModel · base model +40 × Glm4vTextDecoderLayerGlm4vTextDecoderLayer× 40 +Glm46VForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Glm4vTextAttention +Vision encoder · Glm4vVisionM…×24 +Glm4vVisionBlock×24 +MLP · Glm4vTextMLP +mlp · Glm4VisionMlp +attn · Glm4vVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151552 × 4096] → [1, 6, 4096] +Glm4vRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→256]k_proj [4096→256] +v_proj: Linear [4096→256]v_proj [4096→256] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Glm4vRMSNormpre-FFN [1, 6, 4096] +gate_up_proj: Linear [4096→27392]gate_up_proj [4096→27392] +down_proj: Linear [13696→4096]down_proj [13696→4096] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Glm46VForConditionalGenerationLM HeadLinear [4096→151552] +Softmax +logits[1, 6, 151552] +example image +pixel_values[1, 3, 336, 336] +norm1: Glm4vRMSNorm 1536norm1 Glm4vRMSNorm 1536 +norm2: Glm4vRMSNorm 1536norm2 Glm4vRMSNorm 1536 +qkv: Linear [1536→4608]qkv [1536→4608] +proj: Linear [1536→1536]proj [1536→1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +zai-org/GLM-4.1V-9B-Thinking +inputs +input_ids, pixel_values +built via +AutoModelForImageTextToText +model_type +glmga +config +GlmgaConfig +decoder +dense +layers +40 +hidden +4,096 +intermediate +13,696 +heads / kv +32 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,552 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/glpn.svg b/glpn.svg new file mode 100644 index 0000000000000000000000000000000000000000..9f2641d59d9cad747a0d06b8c8660b7e4a594282 --- /dev/null +++ b/glpn.svg @@ -0,0 +1,185 @@ + + + + +glpn +dense · 4× MHA + +GLPNModel · base model +4 × GLPNLayerGLPNLayer× 4 +Self-Attention · GLPNAttention +MLP · GLPNMixFFN +self · GLPNEfficientSelfAttention +output · GLPNSelfOutput +dwconv · GLPNDepthWiseConv + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +query: Linear [32→32]query [32→32] +key: Linear [32→32]key [32→32] +value: Linear [32→32]value [32→32] +dropout: Dropoutdropout Dropout +sr: Conv2dsr Conv2d +layer_norm: LayerNorm 32layer_norm LayerNorm 32 +dense: Linear [32→32]dense [32→32] +dropout: Dropoutdropout Dropout +scaled dot-product attention(1, 2, 5, 8) heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +dense1: Linear [32→128]dense1 [32→128] +dwconv: Conv2ddwconv Conv2d +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense2: Linear [128→32]dense2 [128→32] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +vinvino02/glpn-kitti +model_type +glpn +config +GLPNConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +(1, 2, 5, 8) / (1, 2, 5, 8) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/got_ocr2.diff.svg b/got_ocr2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..3e9958fb2d40f1f5c054f0d11ad410309f90259f --- /dev/null +++ b/got_ocr2.diff.svg @@ -0,0 +1,213 @@ + + + + +got_ocr2 +diff vs llava (+sam) · 9 overridden · 31 added · 0 deleted · 3 new · 4 inherited-as-is + +GotOcr2Model · base model +24 × Qwen2DecoderLayerQwen2DecoderLayer× 24 +GotOcr2ForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +Vision encoder · GotOcr2VisionE…×12 +GotOcr2VisionLayer×12 +MLP · Qwen2MLP +Projector · GotOcr2MultiModalProjector +mlp · LlavaMLPBlock ↩ inherited +attn · LlavaVisionAttention ↩ inh… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151860 × 1024] → [1, 6, 1024] +Qwen2RMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→2816]gate_proj [1024→2816] +up_proj: Linear [1024→2816]up_proj [1024→2816] +down_proj: Linear [2816→1024]down_proj [2816→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +GotOcr2ForConditionalGenerationLM HeadLinear [1024→151860] · tied +Softmax +logits[1, 6, 151860] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +conv_upsampler1: Conv2dconv_upsampler1 Conv2d +conv_upsampler2: Conv2dconv_upsampler2 Conv2d +multimodal_projector: Linear [1024→1024]multimodal_projector [1024→1024] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam-vit-huge +parent +llava +classes +12 +overridden +9 +added +31 +new classes +3 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GotOcr2ForConditionalGeneration +ovr forward,get_image_features + +GotOcr2Model +ovr __init__,forward,get_image_features + +GotOcr2VisionLayer +ovr __init__ + +GotOcr2Config +add __post_init__; 8 attr + +GotOcr2MultiModalProjector +add __init__,forward + +GotOcr2PreTrainedModel +add _init_weights; 3 attr + +GotOcr2VisionConfig +18 attr + +GotOcr2VisionEncoder +1 attr + \ No newline at end of file diff --git a/got_ocr2.svg b/got_ocr2.svg new file mode 100644 index 0000000000000000000000000000000000000000..c1b5b6137af4a2256789417469876c2ce2ab9eec --- /dev/null +++ b/got_ocr2.svg @@ -0,0 +1,212 @@ + + + + +got_ocr2 +multimodal · vision → projector → LLM · dense + +GotOcr2Model · base model +24 × Qwen2DecoderLayerQwen2DecoderLayer× 24 +GotOcr2ForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +Vision encoder · GotOcr2VisionE…×12 +GotOcr2VisionLayer×12 +MLP · Qwen2MLP +Projector · GotOcr2MultiModalProjector +mlp · GotOcr2MLPBlock +attn · GotOcr2VisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151860 × 1024] → [1, 6, 1024] +Qwen2RMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→2816]gate_proj [1024→2816] +up_proj: Linear [1024→2816]up_proj [1024→2816] +down_proj: Linear [2816→1024]down_proj [2816→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +GotOcr2ForConditionalGenerationLM HeadLinear [1024→151860] · tied +Softmax +logits[1, 6, 151860] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +conv_upsampler1: Conv2dconv_upsampler1 Conv2d +conv_upsampler2: Conv2dconv_upsampler2 Conv2d +multimodal_projector: Linear [1024→1024]multimodal_projector [1024→1024] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam-vit-huge +inputs +input_ids, pixel_values +built via +AutoModel +model_type +got_ocr2 +config +GotOcr2Config +decoder +dense +layers +24 +hidden +1,024 +intermediate +2,816 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,860 +max_pos +32,768 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/gpt2.svg b/gpt2.svg new file mode 100644 index 0000000000000000000000000000000000000000..fabc0650ba7f738a6c62f536ea0d599d0d75a694 --- /dev/null +++ b/gpt2.svg @@ -0,0 +1,178 @@ + + + + +gpt2 +dense · 12× MHA + +GPT2Model · base model +12 × GPT2BlockGPT2Block× 12 +GPT2LMHeadModel · task head +Self-Attention · GPT2Attention +MLP · GPT2MLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50257 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +c_attn: Conv1D 768×2304c_attn Conv1D 768×2304 +c_proj: Conv1D 768×768c_proj Conv1D 768×768 +attn_dropout: Dropoutattn_dropout Dropout +resid_dropout: Dropoutresid_dropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +c_fc: Conv1D 768×3072c_fc Conv1D 768×3072 +c_proj: Conv1D 3072×768c_proj Conv1D 3072×768 +act: NewGELUActivationact NewGELU +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +GPT2LMHeadModelLM HeadLinear [768→50257] · tied +Softmax +logits[1, 6, 50257] + +model id +openai-community/gpt2 +model_type +gpt2 +config +GPT2Config +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,257 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gpt_bigcode.svg b/gpt_bigcode.svg new file mode 100644 index 0000000000000000000000000000000000000000..fe28fafbf60fb3b8dbff3e1a13fc02a36f04352e --- /dev/null +++ b/gpt_bigcode.svg @@ -0,0 +1,177 @@ + + + + +gpt_bigcode +dense · 12× MQA + +GPTBigCodeModel · base model +12 × GPTBigCodeBlockGPTBigCodeBlock× 12 +GPTBigCodeForCausalLM · task head +Self-Attention · GPTBigCodeAttention +MLP · GPTBigCodeMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50257 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +c_attn: Linear [768→896]c_attn [768→896] +c_proj: Linear [768→768]c_proj [768→768] +resid_dropout: Dropoutresid_dropout Dropout +scaled dot-product attention12 heads · head_dim 64 · GQA 12:1 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +c_fc: Linear [768→3072]c_fc [768→3072] +c_proj: Linear [3072→768]c_proj [3072→768] +act: GELUTanhact GELUTanh +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +GPTBigCodeForCausalLMLM HeadLinear [768→50257] · tied +Softmax +logits[1, 6, 50257] + +model id +google/gpt_bigcode +model_type +gpt_bigcode +config +GPTBigCodeConfig +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 1 +attention +MQA +norm +LayerNorm +positional +n/a +vocab +50,257 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gpt_neo.svg b/gpt_neo.svg new file mode 100644 index 0000000000000000000000000000000000000000..55ddd7ed5df6ad365eb8e5b8f1679ab6afbc1bc1 --- /dev/null +++ b/gpt_neo.svg @@ -0,0 +1,181 @@ + + + + +gpt_neo +dense · 24× MHA + +GPTNeoModel · base model +24 × GPTNeoBlockGPTNeoBlock× 24 +GPTNeoForCausalLM · task head +Self-Attention · GPTNeoAttention +attention · GPTNeoSelfAttention +MLP · GPTNeoMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50257 × 2048] → [1, 6, 2048] +LayerNormpre-attention [1, 6, 2048] +attn_dropout: Dropoutattn_dropout Dropout +resid_dropout: Dropoutresid_dropout Dropout +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +out_proj: Linear [2048→2048]out_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 2048] +c_fc: Linear [2048→8192]c_fc [2048→8192] +c_proj: Linear [8192→2048]c_proj [8192→2048] +act: NewGELUActivationact NewGELU +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 2048] +GPTNeoForCausalLMLM HeadLinear [2048→50257] · tied +Softmax +logits[1, 6, 50257] + +model id +EleutherAI/gpt-neo-1.3B +model_type +gpt_neo +config +GPTNeoConfig +decoder +dense +layers +24 +hidden +2,048 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,257 +max_pos +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gpt_neox.diff.svg b/gpt_neox.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0da189c2e1204277502ee4ff79841344c302923f --- /dev/null +++ b/gpt_neox.diff.svg @@ -0,0 +1,192 @@ + + + + +gpt_neox +diff vs llama · 6 overridden · 22 added · 0 deleted · 7 new · 0 inherited-as-is + +GPTNeoXModel · base model +44 × GPTNeoXLayerGPTNeoXLayer× 44 +GPTNeoXForCausalLM · task head +Self-Attention · GPTNeoXAttention +MLP · GPTNeoXMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50432 × 6144] → [1, 6, 6144] +LayerNormpre-attention [1, 6, 6144] +query_key_value: Linear [6144→18432]query_key_value [6144→18432] +dense: Linear [6144→6144]dense [6144→6144] +scaled dot-product attention64 heads · head_dim 96 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 6144] +dense_h_to_4h: Linear [6144→24576]dense_h_to_4h [6144→24576] +dense_4h_to_h: Linear [24576→6144]dense_4h_to_h [24576→6144] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 6144] +GPTNeoXForCausalLMLM HeadLinear [6144→50432] +Softmax +logits[1, 6, 50432] + +model id +EleutherAI/gpt-neox-20b +parent +llama +classes +10 +overridden +6 +added +22 +new classes +7 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GPTNeoXRotaryEmbedding +ovr compute_default_rope_parameters + +GPTNeoXAttention +add __init__,forward + +GPTNeoXForCausalLM +add __init__,forward,get_output_embeddings,s… + +GPTNeoXForQuestionAnswering +add __init__,forward + +GPTNeoXForSequenceClassification +add __init__,forward + +GPTNeoXForTokenClassification +add __init__,forward + +GPTNeoXLayer +add __init__,forward + +GPTNeoXMLP +add __init__,forward + +GPTNeoXModel +ovr __init__,forward; add get_input_embeddin… + +GPTNeoXPreTrainedModel +4 attr + \ No newline at end of file diff --git a/gpt_neox.svg b/gpt_neox.svg new file mode 100644 index 0000000000000000000000000000000000000000..9bd188de19155c9735f45b9673967e0610678582 --- /dev/null +++ b/gpt_neox.svg @@ -0,0 +1,177 @@ + + + + +gpt_neox +dense · 44× MHA + +GPTNeoXModel · base model +44 × GPTNeoXLayerGPTNeoXLayer× 44 +GPTNeoXForCausalLM · task head +Self-Attention · GPTNeoXAttention +MLP · GPTNeoXMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50432 × 6144] → [1, 6, 6144] +LayerNormpre-attention [1, 6, 6144] +query_key_value: Linear [6144→18432]query_key_value [6144→18432] +dense: Linear [6144→6144]dense [6144→6144] +scaled dot-product attention64 heads · head_dim 96 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 6144] +dense_h_to_4h: Linear [6144→24576]dense_h_to_4h [6144→24576] +dense_4h_to_h: Linear [24576→6144]dense_4h_to_h [24576→6144] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 6144] +GPTNeoXForCausalLMLM HeadLinear [6144→50432] +Softmax +logits[1, 6, 50432] + +model id +EleutherAI/gpt-neox-20b +model_type +gpt_neox +config +GPTNeoXConfig +decoder +dense +layers +44 +hidden +6,144 +intermediate +24,576 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +50,432 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gpt_neox_japanese.svg b/gpt_neox_japanese.svg new file mode 100644 index 0000000000000000000000000000000000000000..994cb1449b87f8f96e375ef1c908293ad6e99ae4 --- /dev/null +++ b/gpt_neox_japanese.svg @@ -0,0 +1,182 @@ + + + + +gpt_neox_japanese +dense · 32× MHA + +GPTNeoXJapaneseModel · base model +32 × GPTNeoXJapaneseLayerGPTNeoXJapaneseLayer× 32 +GPTNeoXJapaneseForCausalLM · task head +Self-Attention · GPTNeoXJapaneseAttention +MLP · GPTNeoXJapaneseMLP + + + +input_idstokenize("Hey, how are you?") → [1, 10] +token 0: 'H'H0 +token 1: 'e'e1 +token 2: 'y'y2 +token 3: ',',3 +token 4: ' ' 4 +token 5: 'h'h5 +token 6: 'o'o6 +token 7: 'w'w7 +token 8: ' ' 8 +token 9: 'a'a9 +Token Embeddingweight [32000 × 2560] → [1, 10, 2560] +LayerNormpre-attention [1, 10, 2560] +attention_dropout: Dropoutattention_dropout Dropout +query_key_value: Linear [2560→7680]query_key_value [2560→7680] +dense: Linear [2560→2560]dense [2560→2560] +scaled dot-product attention32 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 10, 2560] +dense_h_to_4h: Linear [2560→10240]dense_h_to_4h [2560→10240] +dense_4h_to_h: Linear [10240→2560]dense_4h_to_h [10240→2560] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 10, 2560] +GPTNeoXJapaneseForCausalLMLM HeadLinear [2560→32000] · tied +Softmax +logits[1, 10, 32000] + +model id +abeja/gpt-neox-japanese-2.7b +model_type +gpt_neox_japanese +config +GPTNeoXJapaneseConfig +decoder +dense +layers +32 +hidden +2,560 +intermediate +— +heads / kv +32 / 32 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gpt_oss.diff.svg b/gpt_oss.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..dcafd0b3c38309a38b36e85aa4c5f0ab27b00dc5 --- /dev/null +++ b/gpt_oss.diff.svg @@ -0,0 +1,228 @@ + + + + +gpt_oss +diff vs mixtral (+llama,qwen2) · 9 overridden · 10 added · 0 deleted · 3 new · 3 inherited-as-is + +GptOssModel · base model +36 × GptOssDecoderLayerGptOssDecoderLayer× 36 +GptOssForCausalLM · task head +layers (idx) +Self-Attention · GptOssAttention (2 layer types — same modules, mask differs) +Sparse MoE · GptOssMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [201088 × 2880] → [1, 6, 2880] +GptOssRMSNormpre-attention [1, 6, 2880] +q_proj: Linear [2880→4096]q_proj [2880→4096] +k_proj: Linear [2880→512]k_proj [2880→512] +v_proj: Linear [2880→512]v_proj [2880→512] +o_proj: Linear [4096→2880]o_proj [4096→2880] +scaled dot-product attention64 heads · head_dim 64 · GQA 64:8 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +GptOssRMSNormpre-FFN [1, 6, 2880] +router: GptOssTopKRouter top-4 of 128router TopKRouter top-4 of 128 +experts: GptOssExperts ×128 · dim 2880experts Experts ×128 · dim 2880 +residual add+ +Final RMSNorm[1, 6, 2880] +GptOssForCausalLMLM HeadLinear [2880→201088] +Softmax +logits[1, 6, 201088] +layer 0: sliding_attention0 +layer 1: full_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: full_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: full_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: full_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: full_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 + +model id +openai/gpt-oss-20b +parent +mixtral +classes +12 +overridden +9 +added +10 +new classes +3 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GptOssAttention +ovr __init__,forward + +GptOssDecoderLayer +ovr __init__,forward + +GptOssModel +ovr forward + +GptOssRMSNorm +ovr forward + +GptOssRotaryEmbedding +ovr forward + +GptOssExperts +add __init__,_apply_gate,forward + +GptOssMLP +add __init__,forward + +GptOssPreTrainedModel +add _init_weights; 4 attr + +GptOssTopKRouter +add __init__,forward + \ No newline at end of file diff --git a/gpt_oss.svg b/gpt_oss.svg new file mode 100644 index 0000000000000000000000000000000000000000..6a6893d4534a1c0bdc14ab61c580e8ebc03e70b3 --- /dev/null +++ b/gpt_oss.svg @@ -0,0 +1,224 @@ + + + + +gpt_oss +sparse-moe · 18× sliding +MoE + 18× full +MoE + +GptOssModel · base model +36 × GptOssDecoderLayerGptOssDecoderLayer× 36 +GptOssForCausalLM · task head +layers (idx) +Self-Attention · GptOssAttention (2 layer types — same modules, mask differs) +Sparse MoE · GptOssMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [201088 × 2880] → [1, 6, 2880] +GptOssRMSNormpre-attention [1, 6, 2880] +q_proj: Linear [2880→4096]q_proj [2880→4096] +k_proj: Linear [2880→512]k_proj [2880→512] +v_proj: Linear [2880→512]v_proj [2880→512] +o_proj: Linear [4096→2880]o_proj [4096→2880] +scaled dot-product attention64 heads · head_dim 64 · GQA 64:8 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +GptOssRMSNormpre-FFN [1, 6, 2880] +router: GptOssTopKRouter top-4 of 128router TopKRouter top-4 of 128 +experts: GptOssExperts ×128 · dim 2880experts Experts ×128 · dim 2880 +residual add+ +Final RMSNorm[1, 6, 2880] +GptOssForCausalLMLM HeadLinear [2880→201088] +Softmax +logits[1, 6, 201088] +layer 0: sliding_attention0 +layer 1: full_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: full_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: full_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: full_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 +layer 32: sliding_attention32 +layer 33: full_attention33 +layer 34: sliding_attention34 +layer 35: full_attention35 + +model id +openai/gpt-oss-20b +model_type +gpt_oss +config +GptOssConfig +decoder +sparse-moe +layers +36 +hidden +2,880 +intermediate +2,880 +heads / kv +64 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +201,088 +max_pos +131,072 +sliding_window +128 +experts (top-k) +128 (top-4) +tie_embeddings +False +legend + +self-attention + +sliding + +full + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/gptj.svg b/gptj.svg new file mode 100644 index 0000000000000000000000000000000000000000..cb75a23d39a76db25a10d063114cd99bf37b24b2 --- /dev/null +++ b/gptj.svg @@ -0,0 +1,180 @@ + + + + +gptj +dense · 28× MHA + +GPTJModel · base model +28 × GPTJBlockGPTJBlock× 28 +GPTJForCausalLM · task head +Self-Attention · GPTJAttention +MLP · GPTJMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50400 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +attn_dropout: Dropoutattn_dropout Dropout +resid_dropout: Dropoutresid_dropout Dropout +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +out_proj: Linear [4096→4096]out_proj [4096→4096] +scaled dot-product attention16 heads · head_dim 256 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 4096] +fc_in: Linear [4096→16384]fc_in [4096→16384] +fc_out: Linear [16384→4096]fc_out [16384→4096] +act: NewGELUActivationact NewGELU +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 4096] +GPTJForCausalLMLM HeadLinear [4096→50400] +Softmax +logits[1, 6, 50400] + +model id +EleutherAI/gpt-j-6B +model_type +gptj +config +GPTJConfig +decoder +dense +layers +28 +hidden +4,096 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,400 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/granite.diff.svg b/granite.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..53c998b438416a3d66d9d8ae47ba805fa2085708 --- /dev/null +++ b/granite.diff.svg @@ -0,0 +1,180 @@ + + + + +granite +diff vs llama · 7 overridden · 0 added · 0 deleted · 0 new · 0 inherited-as-is + +GraniteModel · base model +32 × GraniteDecoderLayerGraniteDecoderLayer× 32 +GraniteForCausalLM · task head +Self-Attention · GraniteAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-3.0-8b-bas +parent +llama +classes +5 +overridden +7 +added +0 +new classes +0 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GraniteAttention +ovr __init__ + +GraniteDecoderLayer +ovr __init__,forward + +GraniteForCausalLM +ovr forward + +GraniteModel +ovr __init__,forward + +GranitePreTrainedModel +1 attr + \ No newline at end of file diff --git a/granite.svg b/granite.svg new file mode 100644 index 0000000000000000000000000000000000000000..20315cfbe666526fc25119e3f422dc3703e3a21b --- /dev/null +++ b/granite.svg @@ -0,0 +1,180 @@ + + + + +granite +dense · 32× MHA + +GraniteModel · base model +32 × GraniteDecoderLayerGraniteDecoderLayer× 32 +GraniteForCausalLM · task head +Self-Attention · GraniteAttention +MLP · GraniteMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-3.0-8b-ba… +model_type +granite +config +GraniteConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/granite4_vision.diff.svg b/granite4_vision.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..03353ce37375c7947dcc580c0a3c886af260a7ca --- /dev/null +++ b/granite4_vision.diff.svg @@ -0,0 +1,240 @@ + + + + +granite4_vision +diff vs llava_next (+granite) · 9 overridden · 25 added · 0 deleted · 5 new · 3 inherited-as-is + +Granite4VisionModel · base model +32 × Granite4VisionTextDecoderLayerGranite4VisionTextDecoderLayer× 32 +Granite4VisionForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · Granite4Vision…×12 +Vision encoder · SiglipVisionMo…×12 +LlavaNextTextDecoderLayer…×32 +Self-Attention · LlavaNextTextAttention ↩ inherited +SiglipEncoderLayer×12 +MLP · LlavaNextTextMLP ↩ inherited +self_attn · SiglipAttention +self_attn · LlavaNextTextAttentio… +mlp · LlavaNextTextMLP ↩ inhe… +mlp · SiglipMLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +Granite4VisionTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Granite4VisionTextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Granite4VisionForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +input_layernorm: Granite4VisionTextRMSNorm 4096input_layernormTextRMSNorm 4096 +post_attention_layernorm: Granite4VisionTextRMSNorm 4096post_attention_layernormTextRMSNorm 4096 +Projector · ModuleListalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +ibm-granite4_vision_text/grani +parent +llava_next +classes +14 +overridden +9 +added +25 +new classes +5 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Granite4VisionForConditionalGeneration +ovr forward + +Granite4VisionCausalLMOutputWithPast +1 attr + +Granite4VisionConfig +add __post_init__; 10 attr + +Granite4VisionImageFeaturesOutput +1 attr + +Granite4VisionModel +ovr __init__,forward,get_image_features,pack… + +Granite4VisionModelOutputWithPast +1 attr + +Granite4VisionPreTrainedModel +ovr _init_weights; 2 attr + +Granite4VisionProcessor +add __init__,_get_number_of_features + +Granite4VisionTextConfig +2 attr + +Granite4VisionTextModel +ovr __init__,forward; 1 attr + +Granite4VisionWindowQFormerDownsampler +add __init__,_unwindowed_raster,_windowed_ra… + \ No newline at end of file diff --git a/granite4_vision.svg b/granite4_vision.svg new file mode 100644 index 0000000000000000000000000000000000000000..39729783d1ac5617815541d9af459c260132c553 --- /dev/null +++ b/granite4_vision.svg @@ -0,0 +1,230 @@ + + + + +granite4_vision +multimodal · vision+vision → projector → LLM · dense + +Granite4VisionModel · base model +32 × Granite4VisionTextDecoderLayerGranite4VisionTextDecoderLayer× 32 +Granite4VisionForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · Granite4Vision…×12 +Vision encoder · SiglipVisionMo…×12 +Granite4VisionTextDecoderL…×32 +Self-Attention · Granite4VisionTextAttention +SiglipEncoderLayer×12 +MLP · Granite4VisionTextMLP +self_attn · SiglipAttention +self_attn · Granite4VisionTextAtt… +mlp · Granite4VisionTextMLP +mlp · SiglipMLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +Granite4VisionTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Granite4VisionTextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Granite4VisionForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +input_layernorm: Granite4VisionTextRMSNorm 4096input_layernormTextRMSNorm 4096 +post_attention_layernorm: Granite4VisionTextRMSNorm 4096post_attention_layernormTextRMSNorm 4096 +Projector · ModuleListalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +ibm-granite4_vision_text/gran… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +granite4_vision +config +Granite4VisionConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/granite_speech.svg b/granite_speech.svg new file mode 100644 index 0000000000000000000000000000000000000000..fe124633b40b39c8a4285273c9a53587e9b9526c --- /dev/null +++ b/granite_speech.svg @@ -0,0 +1,180 @@ + + + + +granite_speech +dense · 32× MHA + +GraniteSpeechModel · base model +32 × GraniteDecoderLayerGraniteDecoderLayer× 32 +GraniteSpeechForConditionalGeneration · task head +Self-Attention · GraniteAttention +MLP · GraniteMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteSpeechForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-3.… +model_type +granite_speech +config +GraniteSpeechConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/granite_speech_plus.diff.svg b/granite_speech_plus.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b33685835cb1227de95329adb6992de6295471a2 --- /dev/null +++ b/granite_speech_plus.diff.svg @@ -0,0 +1,174 @@ + + + + +granite_speech_plus +diff vs granite_speech · 1 overridden · 2 added · 0 deleted · 2 new · 3 inherited-as-is + +GraniteSpeechPlusModel · base model +32 × GraniteDecoderLayerGraniteDecoderLayer× 32 +GraniteSpeechPlusForConditionalGeneration · task head +Self-Attention · GraniteAttention +MLP · GraniteMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteSpeechPlusForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-4.1 +parent +granite_speech +classes +6 +overridden +1 +added +2 +new classes +2 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GraniteSpeechPlusCTCEncoder +ovr forward + +GraniteSpeechPlusConfig +add __post_init__ + +GraniteSpeechPlusEncoderConfig +1 attr + \ No newline at end of file diff --git a/granite_speech_plus.svg b/granite_speech_plus.svg new file mode 100644 index 0000000000000000000000000000000000000000..efca90ee488015729c344c890c2725a3e3120dca --- /dev/null +++ b/granite_speech_plus.svg @@ -0,0 +1,180 @@ + + + + +granite_speech_plus +dense · 32× MHA + +GraniteSpeechPlusModel · base model +32 × GraniteDecoderLayerGraniteDecoderLayer× 32 +GraniteSpeechPlusForConditionalGeneration · task head +Self-Attention · GraniteAttention +MLP · GraniteMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteSpeechPlusForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-4.… +model_type +granite_speech_plus +config +GraniteSpeechPlusConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/granitemoe.diff.svg b/granitemoe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..290a9c67c0132a748e5886cd7163daa32fd057d7 --- /dev/null +++ b/granitemoe.diff.svg @@ -0,0 +1,184 @@ + + + + +granitemoe +diff vs mixtral (+granite,jetmoe,llama) · 15 overridden · 3 added · 0 deleted · 1 new · 4 inherited-as-is + +GraniteMoeModel · base model +32 × GraniteMoeDecoderLayerGraniteMoeDecoderLayer× 32 +GraniteMoeForCausalLM · task head +Self-Attention · GraniteMoeAttention +Sparse MoE · GraniteMoeMoEMoE +router · MixtralTopKGating (top-2 of 8) ↩ inherit… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteMoeRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteMoeRMSNormpre-FFN [1, 6, 4096] +activation: SiLUActivationactivation SiLU +input_linear: GraniteMoeParallelExperts 8×22016×4096input_linear ParallelExperts 8×22016×4096 +output_linear: GraniteMoeParallelExperts 8×4096×11008output_linear ParallelExperts 8×4096×11008 +layer: Linear [4096→8]layer [4096→8] +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteMoeForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-3.2 +parent +mixtral +classes +10 +overridden +15 +added +3 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GraniteMoeAttention +ovr __init__ + +GraniteMoeDecoderLayer +ovr __init__,forward + +GraniteMoeForCausalLM +ovr __init__,forward + +GraniteMoeModel +ovr __init__,forward + +GraniteMoeMoE +add __init__,forward + +GraniteMoePreTrainedModel +add _init_weights; 8 attr + \ No newline at end of file diff --git a/granitemoe.svg b/granitemoe.svg new file mode 100644 index 0000000000000000000000000000000000000000..5fdd540952416486f21c5893ab9de5565a7f3bd7 --- /dev/null +++ b/granitemoe.svg @@ -0,0 +1,183 @@ + + + + +granitemoe +sparse-moe · 32× MHA +MoE + +GraniteMoeModel · base model +32 × GraniteMoeDecoderLayerGraniteMoeDecoderLayer× 32 +GraniteMoeForCausalLM · task head +Self-Attention · GraniteMoeAttention +Sparse MoE · GraniteMoeMoEMoE +router · GraniteMoeTopKGating (top-2 of 8) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteMoeRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteMoeRMSNormpre-FFN [1, 6, 4096] +activation: SiLUActivationactivation SiLU +input_linear: GraniteMoeParallelExperts 8×22016×4096input_linear ParallelExperts 8×22016×4096 +output_linear: GraniteMoeParallelExperts 8×4096×11008output_linear ParallelExperts 8×4096×11008 +layer: Linear [4096→8]layer [4096→8] +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteMoeForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-3.… +model_type +granitemoe +config +GraniteMoeConfig +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +experts (top-k) +8 (top-2) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/granitemoehybrid.diff.svg b/granitemoehybrid.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..346954791229b9c84df862a54a3fef94a1889fc0 --- /dev/null +++ b/granitemoehybrid.diff.svg @@ -0,0 +1,189 @@ + + + + +granitemoehybrid +diff vs granitemoeshared (+bamba,gemma2) · 15 overridden · 2 added · 0 deleted · 0 new · 2 inherited-as-is + +GraniteMoeHybridModel · base model +32 × GraniteMoeHybridDecoderLayerGraniteMoeHybridDecoderLayer× 32 +GraniteMoeHybridForCausalLM · task head +Token Mixer (SSM) · GraniteMoeHybridMambaLayer +Sparse MoE · GraniteMoeSharedMoE ↩ inheri…MoE +router · GraniteMoeSharedTopKGating (top-2 of… + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteMoeHybridRMSNormpre-mixer [1, 6, 4096] +act: SiLUActivationact SiLU +conv1d: Conv1d 8704×1×4conv1d Conv1d 8704×1×4 +in_proj: Linear [4096→17024]in_proj [4096→17024] +norm: GraniteMoeHybridRMSNormGated 8192norm RMSNormGated 8192 +out_proj: Linear [8192→4096]out_proj [8192→4096] +selective state-space scan (SSM) +mamba attention mask (q↓ × k→)mamba mask +residual add+ +GraniteMoeHybridRMSNormpre-FFN [1, 6, 4096] +activation: SiLUActivationactivation SiLU +input_linear: GraniteMoeHybridParallelExperts 8×22016×4096input_linear ParallelExperts 8×22016×4096 +output_linear: GraniteMoeHybridParallelExperts 8×4096×11008output_linear ParallelExperts 8×4096×11008 +layer: Linear [4096→8]layer [4096→8] +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteMoeHybridForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-3.2 +parent +granitemoeshared +classes +10 +overridden +15 +added +2 +new classes +0 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GraniteMoeHybridAttention +ovr __init__,forward + +GraniteMoeHybridDecoderLayer +ovr __init__,forward + +GraniteMoeHybridForCausalLM +ovr __init__,forward; 1 attr + +GraniteMoeHybridMLP +ovr __init__ + +GraniteMoeHybridMambaLayer +ovr __init__ + +GraniteMoeHybridRMSNormGated +ovr __init__ + +GraniteMoeHybridModel +ovr __init__,forward; add _update_mamba_mask + +GraniteMoeHybridPreTrainedModel +ovr _init_weights; 3 attr + \ No newline at end of file diff --git a/granitemoehybrid.svg b/granitemoehybrid.svg new file mode 100644 index 0000000000000000000000000000000000000000..02ef880505f10df2553ea93e60b8cfddcd8e097f --- /dev/null +++ b/granitemoehybrid.svg @@ -0,0 +1,182 @@ + + + + +granitemoehybrid +ssm · 32× Mamba + +GraniteMoeHybridModel · base model +32 × GraniteMoeHybridDecoderLayerGraniteMoeHybridDecoderLayer× 32 +GraniteMoeHybridForCausalLM · task head +Token Mixer (SSM) · GraniteMoeHybridMambaLayer +Sparse MoE · GraniteMoeHybridMoEMoE +router · GraniteMoeHybridTopKGating (top-2 of 8) + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteMoeHybridRMSNormpre-mixer [1, 6, 4096] +act: SiLUActivationact SiLU +conv1d: Conv1d 8704×1×4conv1d Conv1d 8704×1×4 +in_proj: Linear [4096→17024]in_proj [4096→17024] +norm: GraniteMoeHybridRMSNormGated 8192norm RMSNormGated 8192 +out_proj: Linear [8192→4096]out_proj [8192→4096] +selective state-space scan (SSM) +mamba attention mask (q↓ × k→)mamba mask +residual add+ +GraniteMoeHybridRMSNormpre-FFN [1, 6, 4096] +activation: SiLUActivationactivation SiLU +input_linear: GraniteMoeHybridParallelExperts 8×22016×4096input_linear ParallelExperts 8×22016×4096 +output_linear: GraniteMoeHybridParallelExperts 8×4096×11008output_linear ParallelExperts 8×4096×11008 +layer: Linear [4096→8]layer [4096→8] +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteMoeHybridForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-3.… +model_type +granitemoehybrid +config +GraniteMoeHybridConfig +decoder +ssm +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +experts (top-k) +8 (top-2) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/granitemoeshared.diff.svg b/granitemoeshared.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..cbbeb48e2074900cf9caf640a17de118dfaafa0a --- /dev/null +++ b/granitemoeshared.diff.svg @@ -0,0 +1,184 @@ + + + + +granitemoeshared +diff vs granitemoe · 7 overridden · 7 added · 0 deleted · 2 new · 0 inherited-as-is + +GraniteMoeSharedModel · base model +32 × GraniteMoeSharedDecoderLayerGraniteMoeSharedDecoderLayer× 32 +GraniteMoeSharedForCausalLM · task head +Self-Attention · GraniteMoeAttention ↩ inherited +Sparse MoE · GraniteMoeMoE ↩ inheritedMoE +router · GraniteMoeTopKGating (top-2 of 8) ↩ in… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteMoeSharedRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteMoeSharedRMSNormpre-FFN [1, 6, 4096] +activation: SiLUActivationactivation SiLU +input_linear: GraniteMoeSharedParallelExperts 8×22016×4096input_linear ParallelExperts 8×22016×4096 +output_linear: GraniteMoeSharedParallelExperts 8×4096×11008output_linear ParallelExperts 8×4096×11008 +layer: Linear [4096→8]layer [4096→8] +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteMoeSharedForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-3.2 +parent +granitemoe +classes +6 +overridden +7 +added +7 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GraniteMoeSharedDecoderLayer +ovr __init__,forward + +GraniteMoeSharedForCausalLM +ovr __init__; 1 attr + +GraniteMoeSharedModel +ovr __init__ + +GraniteMoeSharedPreTrainedModel +2 attr + +GraniteFlashAttentionKwargs +5 attr + +GraniteMoeSharedMLP +add __init__,forward + \ No newline at end of file diff --git a/granitemoeshared.svg b/granitemoeshared.svg new file mode 100644 index 0000000000000000000000000000000000000000..4c120a7b84df6c72799dbbb58ecb0532d338cc22 --- /dev/null +++ b/granitemoeshared.svg @@ -0,0 +1,183 @@ + + + + +granitemoeshared +sparse-moe · 32× MHA +MoE + +GraniteMoeSharedModel · base model +32 × GraniteMoeSharedDecoderLayerGraniteMoeSharedDecoderLayer× 32 +GraniteMoeSharedForCausalLM · task head +Self-Attention · GraniteMoeSharedAttention +Sparse MoE · GraniteMoeSharedMoEMoE +router · GraniteMoeSharedTopKGating (top-2 of… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +GraniteMoeSharedRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GraniteMoeSharedRMSNormpre-FFN [1, 6, 4096] +activation: SiLUActivationactivation SiLU +input_linear: GraniteMoeSharedParallelExperts 8×22016×4096input_linear ParallelExperts 8×22016×4096 +output_linear: GraniteMoeSharedParallelExperts 8×4096×11008output_linear ParallelExperts 8×4096×11008 +layer: Linear [4096→8]layer [4096→8] +residual add+ +Final RMSNorm[1, 6, 4096] +GraniteMoeSharedForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +ibm-granite/granite-speech-3.… +model_type +granitemoeshared +config +GraniteMoeSharedConfig +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +experts (top-k) +8 (top-2) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/grounding_dino.diff.svg b/grounding_dino.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7a57780e70b87d99cd4e7f8722125f534f09c888 --- /dev/null +++ b/grounding_dino.diff.svg @@ -0,0 +1,165 @@ + + + + +grounding_dino +diff vs None · 0 overridden · 8 added · 0 deleted · 2 new · 0 inherited-as-is + +GroundingDinoModel · base model +12 × BertLayerBertLayer× 12 +Self-Attention · BertAttention +output · BertSelfOutput +self · BertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +IDEA-Research/grounding-dino-t +parent +— +classes +2 +overridden +0 +added +8 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +GroundingDinoImageProcessor +add post_process_instance_segmentation,post_… + +GroundingDinoImageProcessorPil +add post_process_instance_segmentation,post_… + \ No newline at end of file diff --git a/grounding_dino.svg b/grounding_dino.svg new file mode 100644 index 0000000000000000000000000000000000000000..e5b588513276f6d01b115bebad03a23ce307b78d --- /dev/null +++ b/grounding_dino.svg @@ -0,0 +1,174 @@ + + + + +grounding_dino +dense · 12× MHA + +GroundingDinoModel · base model +12 × BertLayerBertLayer× 12 +Self-Attention · BertAttention +output · BertSelfOutput +self · BertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +IDEA-Research/grounding-dino-… +model_type +grounding-dino +config +GroundingDinoConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/groupvit.svg b/groupvit.svg new file mode 100644 index 0000000000000000000000000000000000000000..b9cb568ea6e386b3d74690122652719a4b18eb1f --- /dev/null +++ b/groupvit.svg @@ -0,0 +1,233 @@ + + + + +groupvit +multimodal · vision+vision+vision → projector → LLM · dense + +GroupViTModel · base model +12 × GroupViTEncoderLayerGroupViTEncoderLayer× 12 +image ⊕ text attention +Vision encoder · GroupViTTextT…×12 +Vision encoder · GroupViTVision…×12 +Self-Attention · GroupViTAttention +GroupViTEncoderLayer×12 +GroupViTEncoderLayer×6 +MLP · GroupViTMLP +Vision encoder · Sequential×12 +self_attn · GroupViTAttention +self_attn · GroupViTAttention +mlp · GroupViTMLP +mlp · GroupViTMLP + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [49408 × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +out_proj: Linear [256→256]out_proj [256→256] +scaled dot-product attention4 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +out_proj: Linear [256→256]out_proj [256→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [384→384]k_proj [384→384] +v_proj: Linear [384→384]v_proj [384→384] +q_proj: Linear [384→384]q_proj [384→384] +out_proj: Linear [384→384]out_proj [384→384] +layer_norm1: LayerNorm 384layer_norm1 LayerNorm 384 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [384→1536]fc1 [384→1536] +fc2: Linear [1536→384]fc2 [1536→384] +layer_norm2: LayerNorm 384layer_norm2 LayerNorm 384 +example image +pixel_values[1, 3, 336, 336] +0: Linear [384→4096]0 [384→4096] +1: BatchNorm1d 40961 BatchNorm1d 4096 +2: ReLU2 ReLU +3: Linear [4096→256]3 [4096→256] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +nvidia/groupvit-gcc-yfcc +inputs +input_ids, pixel_values +model_type +groupvit +config +GroupViTConfig +decoder +dense +layers +12 +hidden +256 +intermediate +1,024 +heads / kv +4 / 4 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +49,408 +max_pos +77 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/helium.diff.svg b/helium.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9cf099e15a89cbd899f3700b6c981e0ee0283e2f --- /dev/null +++ b/helium.diff.svg @@ -0,0 +1,177 @@ + + + + +helium +diff vs llama (+gemma,granite) · 3 overridden · 3 added · 0 deleted · 1 new · 6 inherited-as-is + +HeliumModel · base model +24 × HeliumDecoderLayerHeliumDecoderLayer× 24 +HeliumForCausalLM · task head +Self-Attention · HeliumAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [48000 × 2560] → [1, 6, 2560] +HeliumRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→2560]k_proj [2560→2560] +v_proj: Linear [2560→2560]v_proj [2560→2560] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention20 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HeliumRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→7040]gate_proj [2560→7040] +up_proj: Linear [2560→7040]up_proj [2560→7040] +down_proj: Linear [7040→2560]down_proj [7040→2560] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2560] +HeliumForCausalLMLM HeadLinear [2560→48000] +Softmax +logits[1, 6, 48000] + +model id +kyutai/helium-1-preview +parent +llama +classes +10 +overridden +3 +added +3 +new classes +1 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HeliumAttention +ovr __init__ + +HeliumDecoderLayer +ovr __init__ + +HeliumModel +ovr __init__ + +HeliumRMSNorm +add __init__,extra_repr,forward + \ No newline at end of file diff --git a/helium.svg b/helium.svg new file mode 100644 index 0000000000000000000000000000000000000000..b1bafd7cf303926b88b3cede30e8d6805c096c3b --- /dev/null +++ b/helium.svg @@ -0,0 +1,180 @@ + + + + +helium +dense · 24× MHA + +HeliumModel · base model +24 × HeliumDecoderLayerHeliumDecoderLayer× 24 +HeliumForCausalLM · task head +Self-Attention · HeliumAttention +MLP · HeliumMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [48000 × 2560] → [1, 6, 2560] +HeliumRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→2560]k_proj [2560→2560] +v_proj: Linear [2560→2560]v_proj [2560→2560] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention20 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HeliumRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→7040]gate_proj [2560→7040] +up_proj: Linear [2560→7040]up_proj [2560→7040] +down_proj: Linear [7040→2560]down_proj [7040→2560] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2560] +HeliumForCausalLMLM HeadLinear [2560→48000] +Softmax +logits[1, 6, 48000] + +model id +kyutai/helium-1-preview +model_type +helium +config +HeliumConfig +decoder +dense +layers +24 +hidden +2,560 +intermediate +7,040 +heads / kv +20 / 20 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +48,000 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/hgnet_v2.diff.svg b/hgnet_v2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ce1a8b8819c5c24f82c4f1f11dfa243aab79619c --- /dev/null +++ b/hgnet_v2.diff.svg @@ -0,0 +1,168 @@ + + + + +hgnet_v2 +diff vs rt_detr · 2 overridden · 46 added · 0 deleted · 10 new · 0 inherited-as-is + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +HGNetV2ConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×6 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +ustc-community/dfine_x_coco +parent +rt_detr +classes +11 +overridden +2 +added +46 +new classes +10 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HGNetV2ConvLayer +ovr __init__,forward + +HGNetV2Backbone +add __init__,forward; 1 attr + +HGNetV2BasicLayer +add __init__,forward + +HGNetV2Config +add __post_init__,validate_architecture; 21 … + +HGNetV2ConvLayerLight +add __init__,forward + +HGNetV2Embeddings +add __init__,forward + +HGNetV2Encoder +add __init__,forward + +HGNetV2ForImageClassification +add __init__,forward + +HGNetV2LearnableAffineBlock +add __init__,forward + +HGNetV2PreTrainedModel +add _init_weights; 5 attr + +HGNetV2Stage +add __init__,forward + \ No newline at end of file diff --git a/hgnet_v2.svg b/hgnet_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..661ea18b30967cb2912e71259f2d55ced189c758 --- /dev/null +++ b/hgnet_v2.svg @@ -0,0 +1,154 @@ + + + + +hgnet_v2 +⚠ no transformer block (conv backbone) — shown from config · dense · 6× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +HGNetV2ConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×6 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +ustc-community/dfine_x_coco +model_type +hgnet_v2 +config +HGNetV2Config +decoder +dense +layers +6 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/hiera.svg b/hiera.svg new file mode 100644 index 0000000000000000000000000000000000000000..068215212722e709a9d085d06edaf739ad563f83 --- /dev/null +++ b/hiera.svg @@ -0,0 +1,170 @@ + + + + +hiera +dense · 16× MHA + +HieraModel · base model +16 × HieraLayerHieraLayer× 16 +HieraForImageClassification · task head +Self-Attention · HieraMaskUnitAttention +MLP · HieraMlp + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +qkv: Linear [192→1152]qkv [192→1152] +proj: Linear [384→384]proj [384→384] +scaled dot-product attention(1, 2, 4, 8) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [384→1536]fc1 [384→1536] +fc2: Linear [1536→384]fc2 [1536→384] +residual add+ +Final LayerNorm[1, 6, 768] +HieraForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +HieraForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/hiera-base-224 +model_type +hiera +config +HieraConfig +decoder +dense +layers +16 +hidden +768 +intermediate +— +heads / kv +(1, 2, 4, 8) / (1, 2, 4, 8) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/higgs_audio_v2.diff.svg b/higgs_audio_v2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b088cd7c85f9e9fcc90d3f29f1470df9ba36e238 --- /dev/null +++ b/higgs_audio_v2.diff.svg @@ -0,0 +1,182 @@ + + + + +higgs_audio_v2 +diff vs llama (+csm) · 5 overridden · 25 added · 0 deleted · 2 new · 2 inherited-as-is + +HiggsAudioV2ForConditionalGeneration · base model +28 × HiggsAudioV2DecoderLayerHiggsAudioV2DecoderLayer× 28 +Self-Attention · LlamaAttention ↩ inherited +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 3072] → [1, 6, 3072] +HiggsAudioV2RMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→3072]q_proj [3072→3072] +k_proj: Linear [3072→1024]k_proj [3072→1024] +v_proj: Linear [3072→1024]v_proj [3072→1024] +o_proj: Linear [3072→3072]o_proj [3072→3072] +scaled dot-product attention24 heads · head_dim 128 · GQA 24:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HiggsAudioV2RMSNormpre-FFN [1, 6, 3072] +gate_proj: Linear [3072→8192]gate_proj [3072→8192] +up_proj: Linear [3072→8192]up_proj [3072→8192] +down_proj: Linear [8192→3072]down_proj [8192→3072] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +LM HeadLinear [3072→128256] +Softmax +logits[1, 6, 128256] + +model id +bosonai/higgs-audio-v2-generat +parent +llama +classes +8 +overridden +5 +added +25 +new classes +2 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HiggsAudioV2DecoderLayer +ovr __init__,forward + +HiggsAudioV2Embeddings +ovr forward + +HiggsAudioV2Config +add __post_init__; 17 attr + +HiggsAudioV2ForConditionalGeneration +add __init__,forward,prepare_inputs_for_gene… + +HiggsAudioV2Model +ovr __init__,forward; add get_placeholder_mask + +HiggsAudioV2PreTrainedModel +add _init_weights + \ No newline at end of file diff --git a/higgs_audio_v2.svg b/higgs_audio_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..bb646205c88e9df7083e913cd516cd614c8d21b7 --- /dev/null +++ b/higgs_audio_v2.svg @@ -0,0 +1,179 @@ + + + + +higgs_audio_v2 +dense · 28× GQA + +HiggsAudioV2ForConditionalGeneration · base model +28 × HiggsAudioV2DecoderLayerHiggsAudioV2DecoderLayer× 28 +Self-Attention · HiggsAudioV2Attention +MLP · HiggsAudioV2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 3072] → [1, 6, 3072] +HiggsAudioV2RMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→3072]q_proj [3072→3072] +k_proj: Linear [3072→1024]k_proj [3072→1024] +v_proj: Linear [3072→1024]v_proj [3072→1024] +o_proj: Linear [3072→3072]o_proj [3072→3072] +scaled dot-product attention24 heads · head_dim 128 · GQA 24:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HiggsAudioV2RMSNormpre-FFN [1, 6, 3072] +gate_proj: Linear [3072→8192]gate_proj [3072→8192] +up_proj: Linear [3072→8192]up_proj [3072→8192] +down_proj: Linear [8192→3072]down_proj [8192→3072] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +LM HeadLinear [3072→128256] +Softmax +logits[1, 6, 128256] + +model id +bosonai/higgs-audio-v2-genera… +model_type +higgs_audio_v2 +config +HiggsAudioV2Config +decoder +dense +layers +28 +hidden +3,072 +intermediate +8,192 +heads / kv +24 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +128,256 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/higgs_audio_v2_tokenizer.diff.svg b/higgs_audio_v2_tokenizer.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..67cdd561b026632488ea242a951085593f8fc358 --- /dev/null +++ b/higgs_audio_v2_tokenizer.diff.svg @@ -0,0 +1,146 @@ + + + + +higgs_audio_v2_tokenizer +diff vs xcodec · 2 overridden · 11 added · 0 deleted · 2 new · 1 inherited-as-is + +input_ids[1, S] +Token Embedding[? × 1024] +Final Norm +LM Head→ logits [1, S, ?] + +model id +bosonai/higgs-audio-v2-tokeniz +parent +xcodec +classes +5 +overridden +2 +added +11 +new classes +2 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HiggsAudioV2TokenizerModel +ovr _extract_semantic_features + +HiggsAudioV2TokenizerConfig +add semantic_downsample_factor; 6 attr + +HiggsAudioV2TokenizerPreTrainedModel +2 attr + +HiggsAudioV2TokenizerVectorQuantization +add __init__,decode,encode + \ No newline at end of file diff --git a/higgs_audio_v2_tokenizer.svg b/higgs_audio_v2_tokenizer.svg new file mode 100644 index 0000000000000000000000000000000000000000..fa9e91438276f901d2a7f327c8505b386d6d2d53 --- /dev/null +++ b/higgs_audio_v2_tokenizer.svg @@ -0,0 +1,155 @@ + + + + +higgs_audio_v2_tokenizer +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × 1024] +Final Norm +LM Head→ logits [1, S, ?] + +model id +bosonai/higgs-audio-v2-tokeni… +model_type +higgs_audio_v2_tokenizer +config +HiggsAudioV2TokenizerConfig +decoder +dense +layers +— +hidden +1,024 +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/hrm_text.diff.svg b/hrm_text.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..c404b8628d5b32f3124c62a5c078bc39b61bbb00 --- /dev/null +++ b/hrm_text.diff.svg @@ -0,0 +1,187 @@ + + + + +hrm_text +diff vs llama (+nanochat) · 7 overridden · 25 added · 0 deleted · 2 new · 2 inherited-as-is + +HrmTextModel · base model +128 × HrmTextDecoderLayerHrmTextDecoderLayer× 128 +HrmTextForCausalLM · task head +Self-Attention · HrmTextAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151808 × 1536] → [1, 6, 1536] +HrmTextRMSNormpre-attention [1, 6, 1536] +q_proj: Linear [1536→1536]q_proj [1536→1536] +k_proj: Linear [1536→1536]k_proj [1536→1536] +v_proj: Linear [1536→1536]v_proj [1536→1536] +o_proj: Linear [1536→1536]o_proj [1536→1536] +gate_proj: Linear [1536→1536]gate_proj [1536→1536] +scaled dot-product attention12 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HrmTextRMSNormpre-FFN [1, 6, 1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1536] +HrmTextForCausalLMLM HeadLinear [1536→151808] +Softmax +logits[1, 6, 151808] + +model id +sapientinc/HRM-Text-1B +parent +llama +classes +9 +overridden +7 +added +25 +new classes +2 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HrmTextAttention +ovr __init__,forward + +HrmTextDecoderLayer +ovr __init__ + +HrmTextModel +ovr __init__,forward + +HrmTextConfig +add __post_init__,_attn_implementation; 18 a… + +HrmTextForCausalLM +ovr forward; add create_masks_for_generate + +HrmTextPreTrainedModel +add _check_and_adjust_attn_implementation,_i… + +HrmTextStack +add __init__,forward + \ No newline at end of file diff --git a/hrm_text.svg b/hrm_text.svg new file mode 100644 index 0000000000000000000000000000000000000000..0ad0d80a1e81bfe1ed8fd4b05b1d5e07bee0072f --- /dev/null +++ b/hrm_text.svg @@ -0,0 +1,181 @@ + + + + +hrm_text +dense · 16× MHA + +HrmTextModel · base model +128 × HrmTextDecoderLayerHrmTextDecoderLayer× 128 +HrmTextForCausalLM · task head +Self-Attention · HrmTextAttention +MLP · HrmTextMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151808 × 1536] → [1, 6, 1536] +HrmTextRMSNormpre-attention [1, 6, 1536] +q_proj: Linear [1536→1536]q_proj [1536→1536] +k_proj: Linear [1536→1536]k_proj [1536→1536] +v_proj: Linear [1536→1536]v_proj [1536→1536] +o_proj: Linear [1536→1536]o_proj [1536→1536] +gate_proj: Linear [1536→1536]gate_proj [1536→1536] +scaled dot-product attention12 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HrmTextRMSNormpre-FFN [1, 6, 1536] +gate_proj: Linear [1536→4096]gate_proj [1536→4096] +up_proj: Linear [1536→4096]up_proj [1536→4096] +down_proj: Linear [4096→1536]down_proj [4096→1536] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1536] +HrmTextForCausalLMLM HeadLinear [1536→151808] +Softmax +logits[1, 6, 151808] + +model id +sapientinc/HRM-Text-1B +model_type +hrm_text +config +HrmTextConfig +decoder +dense +layers +128 +hidden +1,536 +intermediate +4,096 +heads / kv +12 / 12 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,808 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/hubert.diff.svg b/hubert.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d4a9bc41168e74c37129c74235cbe35e2671b52a --- /dev/null +++ b/hubert.diff.svg @@ -0,0 +1,171 @@ + + + + +hubert +diff vs wav2vec2 · 2 overridden · 16 added · 1 deleted · 3 new · 6 inherited-as-is + +HubertModel · base model +12 × HubertEncoderLayerHubertEncoderLayer× 12 +HubertForSequenceClassification · task head +Self-Attention · Wav2Vec2Attention ↩ inherited +MLP · Wav2Vec2FeedForward ↩ inherited + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +HubertForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +HubertForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/hubert-base-ls960 +parent +wav2vec2 +classes +10 +overridden +2 +added +16 +new classes +3 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HubertModel +ovr __init__,forward; del freeze_feature_enc… + +HubertFeatureProjection +add __init__,forward + +HubertPositionalConvEmbedding +add __init__,forward + +HubertPreTrainedModel +add _get_feat_extract_output_lengths,_get_fe… + \ No newline at end of file diff --git a/hubert.svg b/hubert.svg new file mode 100644 index 0000000000000000000000000000000000000000..e36246eb13b879e1b4222bacfbcac0bfae87b8f9 --- /dev/null +++ b/hubert.svg @@ -0,0 +1,174 @@ + + + + +hubert +dense · 12× MHA + +HubertModel · base model +12 × HubertEncoderLayerHubertEncoderLayer× 12 +HubertForSequenceClassification · task head +Self-Attention · HubertAttention +MLP · HubertFeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +HubertForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +HubertForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/hubert-base-ls960 +model_type +hubert +config +HubertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/hunyuan_v1_dense.diff.svg b/hunyuan_v1_dense.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..49f032eea1077a9c1580cd5aae9e73cc716098af --- /dev/null +++ b/hunyuan_v1_dense.diff.svg @@ -0,0 +1,182 @@ + + + + +hunyuan_v1_dense +diff vs llama · 5 overridden · 1 added · 0 deleted · 0 new · 4 inherited-as-is + +HunYuanDenseV1Model · base model +32 × HunYuanDenseV1DecoderLayerHunYuanDenseV1DecoderLayer× 32 +HunYuanDenseV1ForCausalLM · task head +Self-Attention · HunYuanDenseV1Attention +MLP · HunYuanDenseV1MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [290943 × 4096] → [1, 6, 4096] +HunYuanDenseV1RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +query_layernorm: HunYuanDenseV1RMSNorm 128query_layernorm RMSNorm 128 +key_layernorm: HunYuanDenseV1RMSNorm 128key_layernorm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HunYuanDenseV1RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +HunYuanDenseV1ForCausalLMLM HeadLinear [4096→290943] +Softmax +logits[1, 6, 290943] + +model id +tencent/Hunyuan-7B-Instruct +parent +llama +classes +9 +overridden +5 +added +1 +new classes +0 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HunYuanDenseV1Attention +ovr __init__,forward + +HunYuanDenseV1DecoderLayer +ovr __init__ + +HunYuanDenseV1MLP +ovr __init__ + +HunYuanDenseV1RotaryEmbedding +ovr __init__ + +HunYuanDenseV1PreTrainedModel +add _init_weights + \ No newline at end of file diff --git a/hunyuan_v1_dense.svg b/hunyuan_v1_dense.svg new file mode 100644 index 0000000000000000000000000000000000000000..16d68ef5bc30f44fd14d8f05c4c79ab94c86e883 --- /dev/null +++ b/hunyuan_v1_dense.svg @@ -0,0 +1,182 @@ + + + + +hunyuan_v1_dense +dense · 32× MHA + +HunYuanDenseV1Model · base model +32 × HunYuanDenseV1DecoderLayerHunYuanDenseV1DecoderLayer× 32 +HunYuanDenseV1ForCausalLM · task head +Self-Attention · HunYuanDenseV1Attention +MLP · HunYuanDenseV1MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [290943 × 4096] → [1, 6, 4096] +HunYuanDenseV1RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +query_layernorm: HunYuanDenseV1RMSNorm 128query_layernorm RMSNorm 128 +key_layernorm: HunYuanDenseV1RMSNorm 128key_layernorm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HunYuanDenseV1RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +HunYuanDenseV1ForCausalLMLM HeadLinear [4096→290943] +Softmax +logits[1, 6, 290943] + +model id +tencent/Hunyuan-7B-Instruct +model_type +hunyuan_v1_dense +config +HunYuanDenseV1Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +290,943 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/hunyuan_v1_moe.diff.svg b/hunyuan_v1_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..325e7526a5c76166b8a6f01dd54e490dc1df97f9 --- /dev/null +++ b/hunyuan_v1_moe.diff.svg @@ -0,0 +1,190 @@ + + + + +hunyuan_v1_moe +diff vs llama (+hunyuan_v1_dense,mixtral) · 4 overridden · 6 added · 0 deleted · 2 new · 6 inherited-as-is + +HunYuanMoEV1Model · base model +32 × HunYuanMoEV1DecoderLayerHunYuanMoEV1DecoderLayer× 32 +HunYuanMoEV1ForCausalLM · task head +Self-Attention · HunYuanMoEV1Attention +Sparse MoE · HunYuanMoEV1MoeMoE +shared_mlp · HunYuanMoEV1MLP +gate · HunYuanMoEV1Gate (top-1 of 1) +experts · LlamaExperts (×1 · dim 11008) ↩ inh… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [290943 × 4096] → [1, 6, 4096] +HunYuanMoEV1RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +query_layernorm: HunYuanMoEV1RMSNorm 128query_layernorm RMSNorm 128 +key_layernorm: HunYuanMoEV1RMSNorm 128key_layernorm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HunYuanMoEV1RMSNormpre-FFN [1, 6, 4096] +wg: Linear [4096→1]wg [4096→1] +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +HunYuanMoEV1ForCausalLMLM HeadLinear [4096→290943] +Softmax +logits[1, 6, 290943] + +model id +tencent/Hunyuan-A13B-Instruct +parent +llama +classes +12 +overridden +4 +added +6 +new classes +2 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HunYuanMoEV1Attention +ovr __init__,forward + +HunYuanMoEV1DecoderLayer +ovr __init__ + +HunYuanMoEV1MLP +ovr __init__ + +HunYuanMoEV1Gate +add __init__,forward + +HunYuanMoEV1Moe +add __init__,forward,route_tokens_to_experts + +HunYuanMoEV1PreTrainedModel +add _init_weights + \ No newline at end of file diff --git a/hunyuan_v1_moe.svg b/hunyuan_v1_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..20b440c99c5bfb2a7a66ea64931285e25e875b67 --- /dev/null +++ b/hunyuan_v1_moe.svg @@ -0,0 +1,189 @@ + + + + +hunyuan_v1_moe +sparse-moe · 32× MHA +MoE + +HunYuanMoEV1Model · base model +32 × HunYuanMoEV1DecoderLayerHunYuanMoEV1DecoderLayer× 32 +HunYuanMoEV1ForCausalLM · task head +Self-Attention · HunYuanMoEV1Attention +Sparse MoE · HunYuanMoEV1MoeMoE +shared_mlp · HunYuanMoEV1MLP +gate · HunYuanMoEV1Gate (top-1 of 1) +experts · HunYuanMoEV1Experts (×1 · dim 110… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [290943 × 4096] → [1, 6, 4096] +HunYuanMoEV1RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +query_layernorm: HunYuanMoEV1RMSNorm 128query_layernorm RMSNorm 128 +key_layernorm: HunYuanMoEV1RMSNorm 128key_layernorm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HunYuanMoEV1RMSNormpre-FFN [1, 6, 4096] +wg: Linear [4096→1]wg [4096→1] +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +HunYuanMoEV1ForCausalLMLM HeadLinear [4096→290943] +Softmax +logits[1, 6, 290943] + +model id +tencent/Hunyuan-A13B-Instruct +model_type +hunyuan_v1_moe +config +HunYuanMoEV1Config +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +290,943 +max_pos +2,048 +experts (top-k) +1 (top-1) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/hy_v3.diff.svg b/hy_v3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d10b720cc1a50d1651d2c3fe0f9eea7fc52f7e31 --- /dev/null +++ b/hy_v3.diff.svg @@ -0,0 +1,199 @@ + + + + +hy_v3 +diff vs llama (+minimax_m2,apertus,deepseek_v3,mixtral,qwen3_moe) · 10 overridden · 38 added · 0 deleted · 1 new · 4 inherited-as-is + +HYV3Model · base model +80 × HYV3DecoderLayerHYV3DecoderLayer× 80 +HYV3ForCausalLM · task head +Sparse MoE · HYV3MLP (2 FFN types ▼)MoE +Self-Attention · LlamaAttention ↩ inherited +shared_experts · HYV3MLP (×192 · dim 15… +experts · LlamaExperts (×192 · dim 1536)… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [120832 × 4096] → [1, 6, 4096] +HYV3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→8192]q_proj [4096→8192] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [8192→4096]o_proj [8192→4096] +q_norm: HYV3RMSNorm 128q_norm RMSNorm 128 +k_norm: HYV3RMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HYV3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→13312]gate_proj [4096→13312] +up_proj: Linear [4096→13312]up_proj [4096→13312] +down_proj: Linear [13312→4096]down_proj [13312→4096] +act_fn: SiLUActivationact_fn SiLU +gate: HYV3TopKRouter top-8 of 192gate TopKRouter top-8 of 192 +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [4096→1536]gate_proj [4096→1536] +up_proj: Linear [4096→1536]up_proj [4096→1536] +down_proj: Linear [1536→4096]down_proj [1536→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +HYV3ForCausalLMLM HeadLinear [4096→120832] +Softmax +logits[1, 6, 120832] + +model id +tencent/Hy3-preview +parent +llama +classes +12 +overridden +10 +added +38 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HYV3DecoderLayer +ovr __init__ + +HYV3ForCausalLM +ovr __init__,forward + +HYV3MLP +ovr __init__ + +HYV3MoE +ovr __init__,forward + +HYV3Model +ovr __init__ + +HYV3TopKRouter +ovr __init__,forward + +HYV3Config +add __post_init__; 34 attr + +HYV3PreTrainedModel +add _init_weights; 3 attr + \ No newline at end of file diff --git a/hy_v3.svg b/hy_v3.svg new file mode 100644 index 0000000000000000000000000000000000000000..ecef12e71a9d13b470ac6a0b80c814af21e5af28 --- /dev/null +++ b/hy_v3.svg @@ -0,0 +1,192 @@ + + + + +hy_v3 +sparse-moe · 80× GQA +MoE + +HYV3Model · base model +80 × HYV3DecoderLayerHYV3DecoderLayer× 80 +HYV3ForCausalLM · task head +Sparse MoE · HYV3MLP (2 FFN types ▼)MoE +Self-Attention · HYV3Attention +shared_experts · HYV3MLP (×192 · dim 15… +experts · HYV3Experts (×192 · dim 1536) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [120832 × 4096] → [1, 6, 4096] +HYV3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→8192]q_proj [4096→8192] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [8192→4096]o_proj [8192→4096] +q_norm: HYV3RMSNorm 128q_norm RMSNorm 128 +k_norm: HYV3RMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HYV3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→13312]gate_proj [4096→13312] +up_proj: Linear [4096→13312]up_proj [4096→13312] +down_proj: Linear [13312→4096]down_proj [13312→4096] +act_fn: SiLUActivationact_fn SiLU +gate: HYV3TopKRouter top-8 of 192gate TopKRouter top-8 of 192 +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [4096→1536]gate_proj [4096→1536] +up_proj: Linear [4096→1536]up_proj [4096→1536] +down_proj: Linear [1536→4096]down_proj [1536→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +HYV3ForCausalLMLM HeadLinear [4096→120832] +Softmax +logits[1, 6, 120832] + +model id +tencent/Hy3-preview +model_type +hy_v3 +config +HYV3Config +decoder +sparse-moe +layers +80 +hidden +4,096 +intermediate +13,312 +heads / kv +64 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +120,832 +max_pos +131,072 +experts (top-k) +192 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/hyperclovax.diff.svg b/hyperclovax.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..caf9c8b76e8381c72e9ef0439de7ae8bd3cb3d05 --- /dev/null +++ b/hyperclovax.diff.svg @@ -0,0 +1,174 @@ + + + + +hyperclovax +diff vs granite · 3 overridden · 6 added · 0 deleted · 1 new · 5 inherited-as-is + +HyperCLOVAXModel · base model +32 × HyperCLOVAXDecoderLayerHyperCLOVAXDecoderLayer× 32 +HyperCLOVAXForCausalLM · task head +Self-Attention · GraniteAttention ↩ inherited +MLP · GraniteMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +HyperCLOVAXRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HyperCLOVAXRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +HyperCLOVAXForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +naver-hyperclovax/HyperCLOVAX- +parent +granite +classes +8 +overridden +3 +added +6 +new classes +1 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +HyperCLOVAXDecoderLayer +ovr __init__,forward + +HyperCLOVAXForCausalLM +ovr forward + +HyperCLOVAXConfig +add __post_init__,validate_architecture; 4 a… + \ No newline at end of file diff --git a/hyperclovax.svg b/hyperclovax.svg new file mode 100644 index 0000000000000000000000000000000000000000..4c9cd5bdb151b3e656951252ed11bc54c4347a7e --- /dev/null +++ b/hyperclovax.svg @@ -0,0 +1,180 @@ + + + + +hyperclovax +dense · 32× MHA + +HyperCLOVAXModel · base model +32 × HyperCLOVAXDecoderLayerHyperCLOVAXDecoderLayer× 32 +HyperCLOVAXForCausalLM · task head +Self-Attention · HyperCLOVAXAttention +MLP · HyperCLOVAXMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +HyperCLOVAXRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +HyperCLOVAXRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +HyperCLOVAXForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +naver-hyperclovax/HyperCLOVAX… +model_type +hyperclovax +config +HyperCLOVAXConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ibert.svg b/ibert.svg new file mode 100644 index 0000000000000000000000000000000000000000..433f7655c1736666c04bb0cbe8f89ee0a6f26ae5 --- /dev/null +++ b/ibert.svg @@ -0,0 +1,184 @@ + + + + +ibert +dense · 12× MHA + +IBertModel · base model +12 × IBertLayerIBertLayer× 12 +IBertForMaskedLM · task head +Self-Attention · IBertAttention +self · IBertSelfAttention +output · IBertSelfOutput +softmax · IntSoftmax + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: QuantLinear 768×768query QuantLinear 768×768 +key: QuantLinear 768×768key QuantLinear 768×768 +value: QuantLinear 768×768value QuantLinear 768×768 +query_activation: QuantActquery_activation QuantAct +key_activation: QuantActkey_activation QuantAct +value_activation: QuantActvalue_activation QuantAct +output_activation: QuantActoutput_activation QuantAct +dropout: Dropoutdropout Dropout +act: QuantActact QuantAct +dense: QuantLinear 768×768dense QuantLinear 768×768 +ln_input_act: QuantActln_input_act QuantAct +LayerNorm: IntLayerNorm 768LayerNorm IntLayerNorm 768 +output_activation: QuantActoutput_activation QuantAct +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +IBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +IBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +kssteven/ibert-roberta-base +model_type +ibert +config +IBertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/idefics.svg b/idefics.svg new file mode 100644 index 0000000000000000000000000000000000000000..c01b3b5d7d632eeb718b5767b9dc92c517d57d5e --- /dev/null +++ b/idefics.svg @@ -0,0 +1,206 @@ + + + + +idefics +multimodal · vision → projector → LLM · dense + +IdeficsModel · base model +32 × IdeficsVisionEncoderLayerIdeficsVisionEncoderLayer× 32 +IdeficsForVisionText2Text · task head +image ⊕ text attention +Vision encoder · IdeficsVisionTr…×32 +Self-Attention · IdeficsVisionAttention +IdeficsVisionEncoderLayer×32 +self_attn · IdeficsVisionAttention +MLP · IdeficsVisionMLP +mlp · IdeficsVisionMLP + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 4096] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→5120]fc1 [768→5120] +fc2: Linear [5120→768]fc2 [5120→768] +residual add+ +Final RMSNorm[1, 6, 4096] +IdeficsForVisionText2TextLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→5120]fc1 [768→5120] +fc2: Linear [5120→768]fc2 [5120→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +HuggingFaceM4/idefics-9b +inputs +input_ids, pixel_values +model_type +idefics +config +IdeficsConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +n/a +vocab +32,000 +max_pos +— +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/idefics2.svg b/idefics2.svg new file mode 100644 index 0000000000000000000000000000000000000000..5a98910a8664ff6cebbf0be8ecdd15e64efce5c0 --- /dev/null +++ b/idefics2.svg @@ -0,0 +1,224 @@ + + + + +idefics2 +multimodal · vision → projector → LLM · dense + +Idefics2Model · base model +32 × MistralDecoderLayerMistralDecoderLayer× 32 +Idefics2ForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · Idefics2VisionT…×12 +Self-Attention · MistralAttention +Projector · Idefics2Connector +Idefics2EncoderLayer×12 +MLP · MistralMLP +perceiver_resampler · Idefics2Perc… +modality_projection · Idefics2MLP +self_attn · Idefics2VisionAttention +mlp · Idefics2VisionMLP +layers · ModuleList + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MistralRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MistralRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Idefics2ForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +gate_proj: Linear [768→14336]gate_proj [768→14336] +up_proj: Linear [768→14336]up_proj [768→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +0: Idefics2PerceiverLayer0 PerceiverLayer +1: Idefics2PerceiverLayer1 PerceiverLayer +2: Idefics2PerceiverLayer2 PerceiverLayer +norm: Idefics2RMSNorm 4096norm RMSNorm 4096 +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +HuggingFaceM4/idefics2-8b +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForImageTextToText +model_type +idefics2 +config +Idefics2Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +32,768 +sliding_window +4,096 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/idefics3.svg b/idefics3.svg new file mode 100644 index 0000000000000000000000000000000000000000..9771069a687010dfdd17b25843e91fbb7b3f2585 --- /dev/null +++ b/idefics3.svg @@ -0,0 +1,213 @@ + + + + +idefics3 +multimodal · vision → projector → LLM · dense + +Idefics3Model · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +Idefics3ForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · Idefics3VisionT…×12 +Self-Attention · LlamaAttention +Idefics3EncoderLayer×12 +MLP · LlamaMLP +self_attn · Idefics3VisionAttention +mlp · Idefics3VisionMLP +Projector · Idefics3Connector +modality_projection · Idefics3Simpl… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128259 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Idefics3ForConditionalGenerationLM HeadLinear [4096→128259] +Softmax +logits[1, 6, 128259] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→3072]fc1 [1152→3072] +fc2: Linear [3072→1152]fc2 [3072→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +proj: Linear [4608→4096]proj [4608→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +HuggingFaceM4/Idefics3-8B-Lla… +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForImageTextToText +model_type +idefics3 +config +Idefics3Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +128,259 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/ijepa.diff.svg b/ijepa.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..bd23738bff70be48b582596836b5545d670f82d7 --- /dev/null +++ b/ijepa.diff.svg @@ -0,0 +1,169 @@ + + + + +ijepa +diff vs vit · 7 overridden · 0 added · 0 deleted · 0 new · 0 inherited-as-is + +IJepaModel · base model +12 × IJepaLayerIJepaLayer× 12 +IJepaForImageClassification · task head +Self-Attention · ViTAttention ↩ inherited +MLP · ViTMLP ↩ inherited + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +IJepaForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +IJepaForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/ijepa_vith14_1k +parent +vit +classes +4 +overridden +7 +added +0 +new classes +0 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +IJepaEmbeddings +ovr __init__,forward,interpolate_pos_encoding + +IJepaForImageClassification +ovr __init__,forward + +IJepaModel +ovr __init__ + +IJepaPreTrainedModel +ovr _init_weights + \ No newline at end of file diff --git a/ijepa.svg b/ijepa.svg new file mode 100644 index 0000000000000000000000000000000000000000..019cee01d588f64b3ad4d539331acdc594a99af7 --- /dev/null +++ b/ijepa.svg @@ -0,0 +1,172 @@ + + + + +ijepa +dense · 12× MHA + +IJepaModel · base model +12 × IJepaLayerIJepaLayer× 12 +IJepaForImageClassification · task head +Self-Attention · IJepaAttention +MLP · IJepaMLP + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +IJepaForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +IJepaForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/ijepa_vith14_1k +model_type +ijepa +config +IJepaConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/imagegpt.svg b/imagegpt.svg new file mode 100644 index 0000000000000000000000000000000000000000..5be34a565d7fb109ea787623e1ec92e26f73f942 --- /dev/null +++ b/imagegpt.svg @@ -0,0 +1,173 @@ + + + + +imagegpt +dense · 24× MHA + +ImageGPTModel · base model +24 × ImageGPTBlockImageGPTBlock× 24 +ImageGPTForImageClassification · task head +Self-Attention · ImageGPTAttention +MLP · ImageGPTMLP + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 512]+ position embeddings +ImageGPTLayerNormpre-attention [1, 6, 512] +c_attn: Conv1D 512×1536c_attn Conv1D 512×1536 +c_proj: Conv1D 512×512c_proj Conv1D 512×512 +attn_dropout: Dropoutattn_dropout Dropout +resid_dropout: Dropoutresid_dropout Dropout +scaled dot-product attention8 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +ImageGPTLayerNormpre-FFN [1, 6, 512] +c_fc: Conv1D 512×2048c_fc Conv1D 512×2048 +c_proj: Conv1D 2048×512c_proj Conv1D 2048×512 +act: QuickGELUActivationact QuickGELU +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 512] +ImageGPTForImageClassificationPool (CLS / mean)[1, 6, 512] → [1, 512] +ImageGPTForImageClassificationClassifier headLinear [512→2] +Softmax +class logits[1, 2] (2 classes) + +model id +openai/imagegpt-small +model_type +imagegpt +config +ImageGPTConfig +decoder +dense +layers +24 +hidden +512 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +513 +max_pos +1,024 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/index.html b/index.html index b0c4b3666032a737f3903db53e6a8a9272483e28..6c1d09299d6c7aa049d64d27e6b45c995be6ff1c 100644 --- a/index.html +++ b/index.html @@ -1,19 +1,31 @@ - - - - - My static Space - - - -
-

Welcome to your static Space!

-

You can modify this app directly by editing index.html in the Files and versions tab.

-

- Also don't forget to check the - Spaces documentation. -

-
- - + +transformers architecture gallery — both + + +

transformers architecture gallery

+
mode: both · ok 435 · config-only 13 · failed 8 · modular 251 · standalone 205
+

Largest diffs (least modular)

modelparentsizeovradddelnew
qwen2_5_omniqwen2_5_vl41923267043
qwen3_omni_moeqwen3_moe30940191026
gemma3ngemma321118132120
rt_detrdetr1970137020
lw_detrdeformable_detr17716110017
phi4_multimodalsiglip1742295019
sam2_videosam21725116017
ernie4_5_vl_moeernie4_5_moe1682275223
pp_doclayout_v2layoutlmv31491611506
januschameleon1471089016
florence2llava145982018
gemma4gemma31443456018
maskformerdetr143086019
emu3llama1381071019
ariallama1371778014
video_llama_3qwen2_vl1341870414
pp_doclayout_v3rt_detr133910008
sam2sam1311175015
d_finert_detr128138809
qwen3_vlqwen2_vl126267309
+ +
+
afmoe
↳ llama · ovr 7 / add 21 / del 0 / new 5
aimv2
↳ siglip · ovr 3 / add 62 / del 0 / new 9
albert
standalone
align
standalone
altclip
↳ clip · ovr 13 / add 31 / del 0 / new 5
apertus
↳ llama · ovr 6 / add 24 / del 0 / new 1
arcee
↳ llama · ovr 0 / add 23 / del 0 / new 1
aria
↳ llama · ovr 17 / add 78 / del 0 / new 14
audio_spectrogram_transformer
↳ vit · ovr 7 / add 12 / del 0 / new 5
audioflamingo3
↳ voxtral · ovr 10 / add 10 / del 0 / new 1
autoformer
standalone
aya_vision
↳ llava · ovr 4 / add 3 / del 0 / new 1
bamba
↳ llama · ovr 4 / add 23 / del 0 / new 4
bark
standalone
bart
standalone
beit
↳ vit · ovr 10 / add 30 / del 0 / new 14
bert
standalone
bert_generation
standalone
big_bird
standalone
bigbird_pegasus
standalone
biogpt
↳ bart · ovr 3 / add 21 / del 0 / new 5
bit
standalone
bitnet
↳ llama · ovr 8 / add 0 / del 0 / new 0
blenderbot
standalone
blenderbot_small
standalone
blip
standalone
blip_2
standalone
bloom
standalone
blt
↳ mllama · ovr 12 / add 27 / del 0 / new 6
bridgetower
standalone
bros
standalone
camembert
↳ roberta · ovr 15 / add 0 / del 0 / new 0
canine
standalone
chameleon
standalone
chinese_clip
↳ clip · ovr 12 / add 22 / del 0 / new 4
chmv2
↳ dpt · ovr 0 / add 55 / del 0 / new 10
clap
standalone
clip
standalone
clipseg
↳ clip · ovr 9 / add 26 / del 0 / new 7
clvp
standalone
codegen
standalone
cohere
↳ llama · ovr 7 / add 4 / del 0 / new 2
cohere2
↳ cohere · ovr 9 / add 26 / del 0 / new 1
cohere2_moe
↳ cohere2 · ovr 9 / add 5 / del 0 / new 2
cohere2_vision
↳ aya_vision · ovr 5 / add 12 / del 0 / new 3
cohere_asr
↳ moonshine · ovr 8 / add 8 / del 0 / new 3
colmodernvbert
↳ colpali · ovr 3 / add 16 / del 0 / new 4
colpali
↳ None · ovr 0 / add 7 / del 0 / new 2
colqwen2
↳ colpali · ovr 2 / add 10 / del 0 / new 3
conditional_detr
↳ detr · ovr 7 / add 14 / del 0 / new 5
convbert
standalone
convnext
standalone
convnextv2
standalone
cpmant
standalone
csm
↳ llama · ovr 9 / add 38 / del 0 / new 5
ctrl
standalone
cvt
standalone
cwm
↳ llama · ovr 4 / add 27 / del 0 / new 2
d_fine
↳ rt_detr · ovr 13 / add 88 / del 0 / new 9
dab_detr
standalone
dac
standalone
data2vec
↳ wav2vec2 · ovr 15 / add 6 / del 5 / new 3
dbrx
↳ llama · ovr 0 / add 42 / del 0 / new 10
deberta
standalone
deberta_v2
standalone
decision_transformer
standalone
deepseek_ocr2
↳ qwen2 · ovr 18 / add 65 / del 0 / new 11
deepseek_v2
↳ llama · ovr 4 / add 44 / del 0 / new 3
deepseek_v3
↳ llama · ovr 2 / add 10 / del 0 / new 5
deepseek_v4
↳ mixtral · ovr 18 / add 36 / del 0 / new 12
deepseek_vl
↳ janus · ovr 3 / add 18 / del 4 / new 6
deepseek_vl_hybrid
↳ deepseek_vl · ovr 6 / add 36 / del 0 / new 9
deformable_detr
↳ detr · ovr 8 / add 56 / del 0 / new 9
deimv2
↳ d_fine · ovr 14 / add 29 / del 0 / new 8
deit
↳ vit · ovr 6 / add 7 / del 0 / new 2
depth_anything
standalone
depth_pro
standalone
detr
standalone
dia
↳ llama · ovr 1 / add 30 / del 0 / new 9
diffllama
↳ llama · ovr 3 / add 6 / del 0 / new 3
dinat
standalone
dinov2
standalone
dinov2_with_registers
↳ dinov2 · ovr 5 / add 26 / del 0 / new 2
dinov3_convnext
standalone
dinov3_vit
↳ dinov2 · ovr 5 / add 16 / del 0 / new 7
distilbert
standalone
doge
↳ llama · ovr 5 / add 41 / del 0 / new 4
donut
standalone
dots1
↳ qwen3 · ovr 2 / add 36 / del 0 / new 1
dpr
standalone
dpt
↳ None · ovr 0 / add 23 / del 0 / new 2
edgetam
↳ sam2 · ovr 8 / add 17 / del 0 / new 4
edgetam_video
↳ sam2_video · ovr 15 / add 72 / del 0 / new 11
efficientloftr
↳ None · ovr 0 / add 2 / del 0 / new 2
efficientnet
standalone
electra
standalone
emu3
↳ llama · ovr 10 / add 71 / del 0 / new 19
encodec
standalone
encoder_decoder
standalone
eomt
↳ dinov2 · ovr 5 / add 61 / del 2 / new 7
eomt_dinov3
↳ dinov3_vit · ovr 9 / add 41 / del 0 / new 1
ernie
↳ bert · ovr 15 / add 9 / del 0 / new 1
ernie4_5
↳ llama · ovr 4 / add 0 / del 0 / new 0
ernie4_5_moe
↳ mixtral · ovr 11 / add 10 / del 0 / new 4
ernie4_5_vl_moe
↳ ernie4_5_moe · ovr 22 / add 75 / del 2 / new 23
esm
standalone
eurobert
↳ llama · ovr 3 / add 35 / del 0 / new 4
evolla
↳ esm · ovr 9 / add 36 / del 0 / new 10
exaone4
↳ llama · ovr 4 / add 28 / del 0 / new 2
exaone4_5
↳ qwen2_5_vl · ovr 10 / add 16 / del 0 / new 4
exaone_moe
↳ exaone4 · ovr 7 / add 34 / del 0 / new 1
falcon
standalone
falcon_h1
↳ llama · ovr 7 / add 20 / del 0 / new 4
falcon_mamba
↳ mamba · ovr 7 / add 5 / del 1 / new 1
fast_vlm
↳ llava · ovr 5 / add 11 / del 0 / new 1
fastspeech2_conformer
standalone
flaubert
standalone
flava
standalone
flex_olmo
↳ olmoe · ovr 4 / add 30 / del 0 / new 1
florence2
↳ llava · ovr 9 / add 82 / del 0 / new 18
fnet
standalone
focalnet
standalone
fsmt
standalone
funnel
standalone
fuyu
standalone
gemma
↳ llama · ovr 5 / add 31 / del 0 / new 3
gemma2
↳ gemma · ovr 9 / add 33 / del 0 / new 2
gemma3
↳ gemma2 · ovr 20 / add 38 / del 0 / new 7
gemma3n
↳ gemma3 · ovr 18 / add 132 / del 1 / new 20
gemma4
↳ gemma3 · ovr 34 / add 56 / del 0 / new 18
gemma4_assistant
standalone
git
standalone
glm
↳ llama · ovr 2 / add 0 / del 0 / new 0
glm4
↳ glm · ovr 1 / add 2 / del 0 / new 1
glm46v
↳ glm4v · ovr 3 / add 16 / del 1 / new 5
glm4_moe
↳ deepseek_v3 · ovr 3 / add 34 / del 0 / new 1
glm4_moe_lite
↳ glm4_moe · ovr 2 / add 40 / del 0 / new 1
glm4v
↳ qwen2_5_vl · ovr 19 / add 73 / del 0 / new 10
glm4v_moe
↳ glm4_moe · ovr 15 / add 15 / del 0 / new 2
glm_image
↳ glm4v · ovr 27 / add 62 / del 1 / new 10
glm_moe_dsa
↳ glm4_moe · ovr 8 / add 25 / del 0 / new 3
glm_ocr
↳ glm4v · ovr 8 / add 19 / del 0 / new 3
glmasr
↳ audioflamingo3 · ovr 6 / add 14 / del 0 / new 5
glmga
↳ None · ovr 0 / add 22 / del 0 / new 6
glpn
standalone
got_ocr2
↳ llava · ovr 9 / add 31 / del 0 / new 3
gpt2
standalone
gpt_bigcode
standalone
gpt_neo
standalone
gpt_neox
↳ llama · ovr 6 / add 22 / del 0 / new 7
gpt_neox_japanese
standalone
gpt_oss
↳ mixtral · ovr 9 / add 10 / del 0 / new 3
gptj
standalone
granite
↳ llama · ovr 7 / add 0 / del 0 / new 0
granite4_vision
↳ llava_next · ovr 9 / add 25 / del 0 / new 5
granite_speech
standalone
granite_speech_plus
↳ granite_speech · ovr 1 / add 2 / del 0 / new 2
granitemoe
↳ mixtral · ovr 15 / add 3 / del 0 / new 1
granitemoehybrid
↳ granitemoeshared · ovr 15 / add 2 / del 0 / new 0
granitemoeshared
↳ granitemoe · ovr 7 / add 7 / del 0 / new 2
grounding_dino
↳ None · ovr 0 / add 8 / del 0 / new 2
groupvit
standalone
helium
↳ llama · ovr 3 / add 3 / del 0 / new 1
hgnet_v2
↳ rt_detr · ovr 2 / add 46 / del 0 / new 10
hiera
standalone
higgs_audio_v2
↳ llama · ovr 5 / add 25 / del 0 / new 2
higgs_audio_v2_tokenizer
↳ xcodec · ovr 2 / add 11 / del 0 / new 2
hrm_text
↳ llama · ovr 7 / add 25 / del 0 / new 2
hubert
↳ wav2vec2 · ovr 2 / add 16 / del 1 / new 3
hunyuan_v1_dense
↳ llama · ovr 5 / add 1 / del 0 / new 0
hunyuan_v1_moe
↳ llama · ovr 4 / add 6 / del 0 / new 2
hy_v3
↳ llama · ovr 10 / add 38 / del 0 / new 1
hyperclovax
↳ granite · ovr 3 / add 6 / del 0 / new 1
ibert
standalone
idefics
standalone
idefics2
standalone
idefics3
standalone
ijepa
↳ vit · ovr 7 / add 0 / del 0 / new 0
imagegpt
standalone
informer
↳ time_series_transformer · ovr 11 / add 11 / del 0 / new 3
instructblip
standalone
instructblipvideo
↳ instructblip · ovr 6 / add 4 / del 1 / new 3
internvl
↳ llava · ovr 6 / add 27 / del 0 / new 8
jais2
↳ llama · ovr 3 / add 14 / del 0 / new 1
jamba
↳ llama · ovr 4 / add 24 / del 0 / new 7
janus
↳ chameleon · ovr 10 / add 89 / del 0 / new 16
jetmoe
↳ mixtral · ovr 14 / add 15 / del 0 / new 7
jina_embeddings_v3
↳ xlm_roberta · ovr 11 / add 13 / del 3 / new 1
kosmos2
standalone
kosmos2_5
standalone
kyutai_speech_to_text
↳ moshi · ovr 5 / add 12 / del 0 / new 2
laguna
↳ qwen2_moe · ovr 12 / add 29 / del 0 / new 1
lasr
↳ parakeet · ovr 9 / add 31 / del 0 / new 7
layoutlm
standalone
layoutlmv2
standalone
layoutlmv3
standalone
layoutxlm
↳ None · ovr 0 / add 0 / del 0 / new 1
led
standalone
levit
standalone
lfm2
↳ llama · ovr 5 / add 8 / del 0 / new 3
lfm2_moe
↳ lfm2 · ovr 6 / add 4 / del 0 / new 1
lfm2_vl
↳ llava · ovr 8 / add 3 / del 0 / new 1
lightglue
↳ llama · ovr 4 / add 53 / del 0 / new 11
lighton_ocr
↳ mistral3 · ovr 5 / add 14 / del 0 / new 3
lilt
standalone
llama
standalone
llama4
standalone
llava
standalone
llava_next
standalone
llava_next_video
↳ llava_next · ovr 7 / add 25 / del 0 / new 2
llava_onevision
↳ llava_next_video · ovr 8 / add 35 / del 0 / new 3
longcat_flash
↳ deepseek_v3 · ovr 8 / add 22 / del 0 / new 4
longformer
standalone
longt5
standalone
luke
standalone
lw_detr
↳ deformable_detr · ovr 16 / add 110 / del 0 / new 17
lxmert
standalone
m2m_100
standalone
mamba
standalone
mamba2
standalone
marian
standalone
markuplm
standalone
mask2former
↳ None · ovr 0 / add 6 / del 0 / new 2
maskformer
↳ detr · ovr 0 / add 86 / del 0 / new 19
mbart
standalone
megatron_bert
standalone
mellum
↳ qwen3_moe · ovr 3 / add 19 / del 0 / new 1
metaclip_2
↳ clip · ovr 10 / add 0 / del 0 / new 3
mgp_str
standalone
mimi
standalone
minicpmv4_6
↳ siglip · ovr 9 / add 52 / del 0 / new 9
minimax
↳ mixtral · ovr 7 / add 50 / del 0 / new 3
minimax_m2
↳ mixtral · ovr 6 / add 29 / del 0 / new 1
ministral
↳ qwen2 · ovr 3 / add 3 / del 0 / new 1
ministral3
↳ mistral · ovr 1 / add 0 / del 0 / new 3
mistral
↳ llama · ovr 6 / add 0 / del 0 / new 1
mistral3
↳ llava · ovr 4 / add 4 / del 0 / new 2
mistral4
↳ llama · ovr 4 / add 16 / del 0 / new 4
mixtral
↳ mistral · ovr 5 / add 9 / del 0 / new 4
mlcd
↳ clip · ovr 11 / add 26 / del 0 / new 2
mllama
standalone
mm_grounding_dino
↳ grounding_dino · ovr 6 / add 42 / del 0 / new 1
mobilebert
standalone
mobilenet_v1
standalone
mobilenet_v2
standalone
mobilevit
standalone
mobilevitv2
standalone
modernbert
↳ gemma3 · ovr 2 / add 77 / del 0 / new 13
modernbert_decoder
↳ modernbert · ovr 5 / add 51 / del 0 / new 6
modernvbert
↳ smolvlm · ovr 3 / add 36 / del 0 / new 7
moonshine
↳ glm · ovr 6 / add 59 / del 1 / new 8
moonshine_streaming
↳ moonshine · ovr 5 / add 19 / del 0 / new 10
moshi
standalone
mpnet
standalone
mpt
standalone
mra
standalone
mt5
standalone
musicflamingo
↳ audioflamingo3 · ovr 8 / add 16 / del 0 / new 2
musicgen
standalone
musicgen_melody
standalone
mvp
standalone
nanochat
↳ llama · ovr 8 / add 1 / del 0 / new 0
nemotron
standalone
nemotron_h
↳ deepseek_v3 · ovr 8 / add 23 / del 0 / new 4
nllb_moe
standalone
nomic_bert
↳ bert · ovr 11 / add 26 / del 0 / new 1
nougat
standalone
nystromformer
standalone
olmo
↳ llama · ovr 5 / add 2 / del 0 / new 1
olmo2
↳ olmo · ovr 6 / add 5 / del 0 / new 1
olmo3
↳ olmo2 · ovr 4 / add 7 / del 0 / new 1
olmo_hybrid
↳ olmo3 · ovr 12 / add 42 / del 0 / new 4
olmoe
↳ llama · ovr 9 / add 12 / del 0 / new 2
omdet_turbo
standalone
oneformer
standalone
openai
standalone
openai_privacy_filter
↳ gpt_oss · ovr 14 / add 18 / del 0 / new 3
opt
standalone
ovis2
↳ llava_next · ovr 12 / add 21 / del 0 / new 5
owlv2
↳ None · ovr 0 / add 29 / del 0 / new 2
owlvit
standalone
paddleocr_vl
↳ qwen2_vl · ovr 18 / add 56 / del 2 / new 12
paligemma
standalone
parakeet
↳ fastspeech2_conformer · ovr 3 / add 55 / del 0 / new 14
patchtsmixer
standalone
patchtst
standalone
pe_audio
↳ pe_audio_video · ovr 7 / add 17 / del 0 / new 5
pe_audio_video
↳ qwen3 · ovr 3 / add 72 / del 0 / new 12
pe_video
↳ pe_audio_video · ovr 6 / add 13 / del 0 / new 3
pegasus
standalone
pegasus_x
standalone
perceiver
standalone
perception_lm
↳ llava · ovr 7 / add 6 / del 1 / new 2
persimmon
standalone
phi
↳ llama · ovr 7 / add 2 / del 0 / new 1
phi3
↳ mistral · ovr 2 / add 6 / del 0 / new 2
phi4_multimodal
↳ siglip · ovr 22 / add 95 / del 0 / new 19
phimoe
↳ mixtral · ovr 6 / add 7 / del 0 / new 4
pi0
↳ None · ovr 0 / add 50 / del 0 / new 9
pix2struct
standalone
pixio
↳ vit · ovr 2 / add 17 / del 0 / new 4
pixtral
standalone
plbart
↳ bart · ovr 2 / add 21 / del 0 / new 3
poolformer
standalone
pop2piano
standalone
pp_chart2table
↳ None · ovr 0 / add 17 / del 0 / new 4
pp_doclayout_v2
↳ layoutlmv3 · ovr 16 / add 115 / del 0 / new 6
pp_doclayout_v3
↳ rt_detr · ovr 9 / add 100 / del 0 / new 8
pp_formulanet
↳ slanext · ovr 7 / add 39 / del 3 / new 8
pp_lcnet
↳ resnet · ovr 1 / add 52 / del 0 / new 10
pp_lcnet_v3
↳ pp_lcnet · ovr 2 / add 10 / del 0 / new 3
pp_lcnet_v4
↳ pp_lcnet · ovr 1 / add 19 / del 0 / new 4
pp_ocrv5_mobile_det
↳ pp_ocrv5_server_det · ovr 1 / add 17 / del 0 / new 5
pp_ocrv5_mobile_rec
↳ pp_ocrv5_server_rec · ovr 1 / add 1 / del 0 / new 1
pp_ocrv5_server_det
↳ None · ovr 0 / add 57 / del 0 / new 12
pp_ocrv5_server_rec
↳ clip · ovr 6 / add 44 / del 1 / new 8
pp_ocrv6_medium_det
↳ pp_ocrv5_server_det · ovr 1 / add 2 / del 0 / new 1
pp_ocrv6_small_det
↳ pp_ocrv5_mobile_det · ovr 3 / add 2 / del 0 / new 1
pp_ocrv6_small_rec
↳ pp_ocrv5_server_rec · ovr 3 / add 3 / del 0 / new 2
pp_ocrv6_tiny_rec
↳ pp_ocrv6_small_rec · ovr 4 / add 12 / del 0 / new 2
prompt_depth_anything
↳ depth_anything · ovr 6 / add 9 / del 0 / new 4
prophetnet
standalone
pvt
standalone
pvt_v2
standalone
qianfan_ocr
↳ internvl · ovr 9 / add 13 / del 0 / new 4
qwen2
↳ llama · ovr 5 / add 0 / del 0 / new 0
qwen2_5_omni
↳ qwen2_5_vl · ovr 23 / add 267 / del 0 / new 43
qwen2_5_vl
↳ qwen2_vl · ovr 11 / add 34 / del 0 / new 8
qwen2_audio
standalone
qwen2_moe
↳ mixtral · ovr 11 / add 4 / del 0 / new 5
qwen2_vl
standalone
qwen3
↳ qwen2 · ovr 3 / add 0 / del 0 / new 0
qwen3_5
↳ qwen3_vl · ovr 22 / add 33 / del 1 / new 7
qwen3_5_moe
↳ qwen3_5 · ovr 8 / add 21 / del 0 / new 3
qwen3_moe
↳ qwen2_moe · ovr 4 / add 2 / del 0 / new 1
qwen3_next
↳ qwen3_moe · ovr 7 / add 19 / del 0 / new 4
qwen3_omni_moe
↳ qwen3_moe · ovr 40 / add 191 / del 0 / new 26
qwen3_vl
↳ qwen2_vl · ovr 26 / add 73 / del 0 / new 9
qwen3_vl_moe
↳ qwen3_vl · ovr 6 / add 30 / del 0 / new 4
rag
standalone
recurrent_gemma
standalone
reformer
standalone
regnet
standalone
rembert
standalone
resnet
standalone
rf_detr
↳ lw_detr · ovr 16 / add 66 / del 0 / new 8
roberta
↳ bert · ovr 3 / add 33 / del 0 / new 9
roberta_prelayernorm
standalone
roc_bert
standalone
roformer
standalone
rt_detr
↳ detr · ovr 0 / add 137 / del 0 / new 20
rt_detr_v2
↳ rt_detr · ovr 5 / add 63 / del 0 / new 2
rwkv
standalone
sam
standalone
sam2
↳ sam · ovr 11 / add 75 / del 0 / new 15
sam2_video
↳ sam2 · ovr 5 / add 116 / del 0 / new 17
sam3
↳ None · ovr 0 / add 7 / del 0 / new 1
sam3_lite_text
↳ siglip · ovr 6 / add 47 / del 0 / new 15
sam3_tracker
↳ sam2 · ovr 2 / add 6 / del 0 / new 4
sam3_tracker_video
↳ sam2_video · ovr 4 / add 47 / del 0 / new 4
sam3_video
standalone
sam_hq
↳ sam · ovr 5 / add 7 / del 0 / new 6
seamless_m4t
standalone
seamless_m4t_v2
standalone
seed_oss
↳ llama · ovr 1 / add 4 / del 0 / new 2
segformer
↳ vit · ovr 5 / add 52 / del 0 / new 14
seggpt
standalone
sew
↳ wav2vec2 · ovr 0 / add 20 / del 0 / new 5
sew_d
standalone
shieldgemma2
standalone
siglip
standalone
siglip2
↳ siglip · ovr 9 / add 6 / del 0 / new 5
slanet
↳ slanext · ovr 4 / add 21 / del 0 / new 6
slanext
↳ got_ocr2 · ovr 0 / add 45 / del 0 / new 10
smollm3
↳ llama · ovr 2 / add 30 / del 0 / new 1
smolvlm
↳ idefics3 · ovr 6 / add 2 / del 0 / new 4
solar_open
↳ glm4_moe · ovr 3 / add 13 / del 0 / new 1
speech_encoder_decoder
standalone
speech_to_text
standalone
speecht5
standalone
splinter
standalone
squeezebert
standalone
stablelm
standalone
starcoder2
↳ mistral · ovr 5 / add 2 / del 0 / new 1
superglue
standalone
superpoint
standalone
swiftformer
standalone
swin
↳ vit · ovr 11 / add 53 / del 0 / new 15
swin2sr
standalone
swinv2
standalone
switch_transformers
↳ t5 · ovr 0 / add 37 / del 0 / new 10
t5
standalone
t5gemma
↳ gemma2 · ovr 11 / add 54 / del 0 / new 13
t5gemma2
↳ gemma3 · ovr 20 / add 69 / del 0 / new 11
table_transformer
standalone
tapas
standalone
textnet
standalone
time_series_transformer
standalone
timesfm
↳ llama · ovr 0 / add 36 / del 0 / new 10
timesfm2_5
↳ timesfm · ovr 12 / add 29 / del 0 / new 2
timesformer
standalone
timm_backbone
standalone
timm_wrapper
standalone
trocr
standalone
tvp
standalone
udop
standalone
umt5
standalone
unispeech
↳ wav2vec2 · ovr 4 / add 22 / del 1 / new 3
unispeech_sat
↳ wav2vec2 · ovr 5 / add 23 / del 1 / new 3
univnet
standalone
upernet
standalone
uvdoc
↳ pp_lcnet · ovr 1 / add 46 / del 0 / new 12
vaultgemma
↳ gemma2 · ovr 3 / add 1 / del 0 / new 1
vibevoice_acoustic_tokenizer
↳ llama · ovr 0 / add 38 / del 0 / new 15
vibevoice_asr
↳ qwen2 · ovr 4 / add 36 / del 0 / new 6
video_llama_3
↳ qwen2_vl · ovr 18 / add 70 / del 4 / new 14
video_llava
standalone
videomae
standalone
videomt
↳ eomt · ovr 9 / add 7 / del 1 / new 2
vilt
standalone
vipllava
↳ llava · ovr 4 / add 2 / del 0 / new 1
vision_encoder_decoder
standalone
vision_text_dual_encoder
standalone
visual_bert
standalone
vit
standalone
vit_mae
↳ vit · ovr 7 / add 24 / del 0 / new 5
vit_msn
↳ vit · ovr 5 / add 2 / del 0 / new 1
vitdet
standalone
vitmatte
standalone
vitpose
standalone
vitpose_backbone
standalone
vits
standalone
vivit
↳ vit · ovr 10 / add 4 / del 0 / new 2
vjepa2
standalone
voxtral
↳ qwen2_audio · ovr 3 / add 17 / del 0 / new 4
voxtral_realtime
↳ mistral · ovr 7 / add 48 / del 0 / new 13
wav2vec2
standalone
wav2vec2_bert
↳ wav2vec2_conformer · ovr 15 / add 21 / del 5 / new 7
wav2vec2_conformer
↳ wav2vec2 · ovr 6 / add 31 / del 2 / new 8
wavlm
↳ wav2vec2 · ovr 9 / add 16 / del 3 / new 6
whisper
standalone
x_clip
↳ clip · ovr 26 / add 11 / del 3 / new 3
xcodec
standalone
xglm
standalone
xlm
standalone
xlm_roberta
↳ roberta · ovr 15 / add 0 / del 0 / new 0
xlm_roberta_xl
↳ bert · ovr 7 / add 26 / del 0 / new 10
xlnet
standalone
xlstm
standalone
xmod
standalone
yolos
↳ None · ovr 0 / add 10 / del 0 / new 2
yoso
standalone
youtu
↳ llama · ovr 0 / add 28 / del 0 / new 1
zamba
standalone
zamba2
↳ zamba · ovr 12 / add 20 / del 0 / new 4
zoedepth
standalone
+
+ \ No newline at end of file diff --git a/informer.diff.svg b/informer.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..282190a0c64efdec0ac7d8f436de5075db09ea15 --- /dev/null +++ b/informer.diff.svg @@ -0,0 +1,181 @@ + + + + +informer +diff vs time_series_transformer (+bart) · 11 overridden · 11 added · 0 deleted · 3 new · 7 inherited-as-is + +InformerModel · base model +2 × InformerEncoderLayerInformerEncoderLayer× 2 +Self-Attention · InformerProbSparseAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 64] → [1, 6, 64] +LayerNormpre-attention [1, 6, 64] +k_proj: Linear [64→64]k_proj [64→64] +v_proj: Linear [64→64]v_proj [64→64] +q_proj: Linear [64→64]q_proj [64→64] +out_proj: Linear [64→64]out_proj [64→64] +scaled dot-product attention2 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 64] +LM HeadLinear [64→?] +Softmax +logits[1, 6, ?] + +model id +huggingface/informer-tourism-m +parent +time_series_transformer +classes +16 +overridden +11 +added +11 +new classes +3 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +InformerDecoder +ovr __init__; 1 attr + +InformerDecoderLayer +ovr __init__ + +InformerEncoder +ovr __init__,forward; 1 attr + +InformerEncoderLayer +ovr __init__ + +InformerForPrediction +ovr __init__,forward + +InformerModel +ovr __init__,forward + +InformerConvLayer +add __init__,forward + +InformerPreTrainedModel +add _init_weights; 5 attr + +InformerProbSparseAttention +add __init__,_shape,forward + \ No newline at end of file diff --git a/informer.svg b/informer.svg new file mode 100644 index 0000000000000000000000000000000000000000..2d9c60ef0246673a950857323d00c0a27e270ab8 --- /dev/null +++ b/informer.svg @@ -0,0 +1,169 @@ + + + + +informer +dense · 2× MHA + +InformerModel · base model +2 × InformerEncoderLayerInformerEncoderLayer× 2 +Self-Attention · InformerProbSparseAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 64] → [1, 6, 64] +LayerNormpre-attention [1, 6, 64] +k_proj: Linear [64→64]k_proj [64→64] +v_proj: Linear [64→64]v_proj [64→64] +q_proj: Linear [64→64]q_proj [64→64] +out_proj: Linear [64→64]out_proj [64→64] +scaled dot-product attention2 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 64] +LM HeadLinear [64→?] +Softmax +logits[1, 6, ?] + +model id +huggingface/informer-tourism-… +model_type +informer +config +InformerConfig +decoder +dense +layers +2 +hidden +64 +intermediate +— +heads / kv +2 / 2 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/instructblip.svg b/instructblip.svg new file mode 100644 index 0000000000000000000000000000000000000000..c00b5188422cdabd81cd16c1b63154355288c765 --- /dev/null +++ b/instructblip.svg @@ -0,0 +1,199 @@ + + + + +instructblip +multimodal · vision → projector → LLM · dense + +InstructBlipModel · base model +12 × OPTDecoderLayerOPTDecoderLayer× 12 +InstructBlipForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · OPTAttention +Vision encoder · InstructBlipVisi…×39 +InstructBlipEncoderLayer×39 +mlp · InstructBlipMLP +self_attn · InstructBlipAttention + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50272 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +InstructBlipForConditionalGenerationLM HeadLinear [768→50272] +Softmax +logits[1, 6, 50272] +example image +pixel_values[1, 3, 336, 336] +qkv: Linear [1408→4224]qkv [1408→4224] +projection: Linear [1408→1408]projection [1408→1408] +layer_norm1: LayerNorm 1408layer_norm1 LayerNorm 1408 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1408→6144]fc1 [1408→6144] +fc2: Linear [6144→1408]fc2 [6144→1408] +layer_norm2: LayerNorm 1408layer_norm2 LayerNorm 1408 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Salesforce/instructblip-flan-… +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForCausalLM +model_type +instructblip +config +InstructBlipConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,272 +max_pos +2,048 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/instructblipvideo.diff.svg b/instructblipvideo.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6eb821466f5d1a66147a6aceed70d6617400a7b1 --- /dev/null +++ b/instructblipvideo.diff.svg @@ -0,0 +1,197 @@ + + + + +instructblipvideo +diff vs instructblip · 6 overridden · 4 added · 1 deleted · 3 new · 2 inherited-as-is + +InstructBlipVideoModel · base model +12 × OPTDecoderLayerOPTDecoderLayer× 12 +InstructBlipVideoForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · OPTAttention +Vision encoder · InstructBlipVid…×39 +InstructBlipEncoderLayer ↩…×39 +mlp · InstructBlipMLP ↩ inherited +self_attn · InstructBlipAttention ↩… + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50272 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +InstructBlipVideoForConditionalGenerationLM HeadLinear [768→50272] +Softmax +logits[1, 6, 50272] +example image +pixel_values[1, 3, 336, 336] +qkv: Linear [1408→4224]qkv [1408→4224] +projection: Linear [1408→1408]projection [1408→1408] +layer_norm1: LayerNorm 1408layer_norm1 LayerNorm 1408 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1408→6144]fc1 [1408→6144] +fc2: Linear [6144→1408]fc2 [6144→1408] +layer_norm2: LayerNorm 1408layer_norm2 LayerNorm 1408 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Salesforce/instructblip-flan-t +parent +instructblip +classes +9 +overridden +6 +added +4 +new classes +3 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +InstructBlipVideoForConditionalGeneration +ovr forward,generate,get_placeholder_mask; a… + +InstructBlipVideoModel +ovr forward + +InstructBlipVideoPreTrainedModel +1 attr + +InstructBlipVideoVisionModel +1 attr + +InstructBlipVideoConfig +3 attr + +InstructBlipVideoQFormerConfig +rename only + +InstructBlipVideoVisionConfig +rename only + \ No newline at end of file diff --git a/instructblipvideo.svg b/instructblipvideo.svg new file mode 100644 index 0000000000000000000000000000000000000000..f229be6263f5f3687e7472cf416b51ab994a2597 --- /dev/null +++ b/instructblipvideo.svg @@ -0,0 +1,199 @@ + + + + +instructblipvideo +multimodal · vision → projector → LLM · dense + +InstructBlipVideoModel · base model +12 × OPTDecoderLayerOPTDecoderLayer× 12 +InstructBlipVideoForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · OPTAttention +Vision encoder · InstructBlipVid…×39 +InstructBlipVideoEncoderLay…×39 +mlp · InstructBlipVideoMLP +self_attn · InstructBlipVideoAtten… + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50272 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +InstructBlipVideoForConditionalGenerationLM HeadLinear [768→50272] +Softmax +logits[1, 6, 50272] +example image +pixel_values[1, 3, 336, 336] +qkv: Linear [1408→4224]qkv [1408→4224] +projection: Linear [1408→1408]projection [1408→1408] +layer_norm1: LayerNorm 1408layer_norm1 LayerNorm 1408 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1408→6144]fc1 [1408→6144] +fc2: Linear [6144→1408]fc2 [6144→1408] +layer_norm2: LayerNorm 1408layer_norm2 LayerNorm 1408 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Salesforce/instructblip-flan-… +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForCausalLM +model_type +instructblipvideo +config +InstructBlipVideoConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,272 +max_pos +2,048 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/internvl.diff.svg b/internvl.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ad59411b2eab066a2c51e0368b7ca1c2fb364ffe --- /dev/null +++ b/internvl.diff.svg @@ -0,0 +1,232 @@ + + + + +internvl +diff vs llava (+clip,janus,llama) · 6 overridden · 27 added · 0 deleted · 8 new · 4 inherited-as-is + +InternVLModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +InternVLForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · InternVLVision…×24 +Self-Attention · Qwen2Attention +InternVLVisionLayer×24 +MLP · Qwen2MLP +attention · InternVLVisionAttention +Projector · InternVLMultiModalProject… +mlp · LlavaVisionMLP ↩ inherit… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +InternVLForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +projection_layer: Linear [1024→1024]projection_layer [1024→1024] +projection_dropout: Identityprojection_dropout Identity +q_norm: Identityq_norm Identity +k_norm: Identityk_norm Identity +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layernorm_before: LayerNorm 1024layernorm_beforeLayerNorm 1024 +layernorm_after: LayerNorm 1024layernorm_afterLayerNorm 1024 +dropout: Dropoutdropout Dropout +layer_norm: LayerNorm 4096layer_norm LayerNorm 4096 +linear_1: Linear [4096→4096]linear_1 [4096→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +OpenGVLab/InternVL3-1B-hf +parent +llava +classes +16 +overridden +6 +added +27 +new classes +8 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +InternVLForConditionalGeneration +ovr forward + +InternVLPreTrainedModel +1 attr + +InternVLVisionAttention +ovr __init__,forward + +InternVLModel +ovr forward,get_image_features; add pixel_sh… + +InternVLMultiModalProjector +add __init__,forward + +InternVLVisionEmbeddings +add __init__,forward,interpolate_pos_encoding + +InternVLVisionEncoder +add __init__,forward + +InternVLVisionLayer +add __init__,forward + +InternVLVisionModel +add __init__,forward,get_input_embeddings + +InternVLVisionModelOutputWithPooling +rename only + +InternVLVisionPatchEmbeddings +add __init__,forward + +InternVLVisionPreTrainedModel +add _init_weights; 11 attr + \ No newline at end of file diff --git a/internvl.svg b/internvl.svg new file mode 100644 index 0000000000000000000000000000000000000000..af6d285406a1743929c55c3cb3713509a2333c06 --- /dev/null +++ b/internvl.svg @@ -0,0 +1,219 @@ + + + + +internvl +multimodal · vision → projector → LLM · dense + +InternVLModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +InternVLForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · InternVLVision…×24 +Self-Attention · Qwen2Attention +InternVLVisionLayer×24 +MLP · Qwen2MLP +attention · InternVLVisionAttention +Projector · InternVLMultiModalProject… +mlp · InternVLVisionMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +InternVLForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +projection_layer: Linear [1024→1024]projection_layer [1024→1024] +projection_dropout: Identityprojection_dropout Identity +q_norm: Identityq_norm Identity +k_norm: Identityk_norm Identity +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layernorm_before: LayerNorm 1024layernorm_beforeLayerNorm 1024 +layernorm_after: LayerNorm 1024layernorm_afterLayerNorm 1024 +dropout: Dropoutdropout Dropout +layer_norm: LayerNorm 4096layer_norm LayerNorm 4096 +linear_1: Linear [4096→4096]linear_1 [4096→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +OpenGVLab/InternVL3-1B-hf +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForImageTextToText +model_type +internvl +config +InternVLConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/jais2.diff.svg b/jais2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9b7efc7cfc78b1b8226142960995b33a503d225d --- /dev/null +++ b/jais2.diff.svg @@ -0,0 +1,176 @@ + + + + +jais2 +diff vs llama (+nemotron) · 3 overridden · 14 added · 0 deleted · 1 new · 2 inherited-as-is + +Jais2Model · base model +32 × Jais2DecoderLayerJais2DecoderLayer× 32 +Jais2ForCausalLM · task head +Self-Attention · LlamaAttention ↩ inherited +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [150272 × 3328] → [1, 6, 3328] +LayerNormpre-attention [1, 6, 3328] +q_proj: Linear [3328→3328]q_proj [3328→3328] +k_proj: Linear [3328→3328]k_proj [3328→3328] +v_proj: Linear [3328→3328]v_proj [3328→3328] +o_proj: Linear [3328→3328]o_proj [3328→3328] +scaled dot-product attention26 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 3328] +up_proj: Linear [3328→26624]up_proj [3328→26624] +down_proj: Linear [26624→3328]down_proj [26624→3328] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +residual add+ +Final LayerNorm[1, 6, 3328] +Jais2ForCausalLMLM HeadLinear [3328→150272] +Softmax +logits[1, 6, 150272] + +model id +inceptionai/Jais-2-8B-Chat +parent +llama +classes +6 +overridden +3 +added +14 +new classes +1 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Jais2DecoderLayer +ovr __init__ + +Jais2ForCausalLM +ovr forward + +Jais2Model +ovr __init__ + +Jais2Config +14 attr + \ No newline at end of file diff --git a/jais2.svg b/jais2.svg new file mode 100644 index 0000000000000000000000000000000000000000..9553751561099c1ac84837dd4d563ce1286f1c23 --- /dev/null +++ b/jais2.svg @@ -0,0 +1,179 @@ + + + + +jais2 +dense · 32× MHA + +Jais2Model · base model +32 × Jais2DecoderLayerJais2DecoderLayer× 32 +Jais2ForCausalLM · task head +Self-Attention · Jais2Attention +MLP · Jais2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [150272 × 3328] → [1, 6, 3328] +LayerNormpre-attention [1, 6, 3328] +q_proj: Linear [3328→3328]q_proj [3328→3328] +k_proj: Linear [3328→3328]k_proj [3328→3328] +v_proj: Linear [3328→3328]v_proj [3328→3328] +o_proj: Linear [3328→3328]o_proj [3328→3328] +scaled dot-product attention26 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 3328] +up_proj: Linear [3328→26624]up_proj [3328→26624] +down_proj: Linear [26624→3328]down_proj [26624→3328] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +residual add+ +Final LayerNorm[1, 6, 3328] +Jais2ForCausalLMLM HeadLinear [3328→150272] +Softmax +logits[1, 6, 150272] + +model id +inceptionai/Jais-2-8B-Chat +model_type +jais2 +config +Jais2Config +decoder +dense +layers +32 +hidden +3,328 +intermediate +26,624 +heads / kv +26 / 26 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +150,272 +max_pos +8,192 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/jamba.diff.svg b/jamba.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..deb91c63510592e35fa407e64c07fdecd78d7b54 --- /dev/null +++ b/jamba.diff.svg @@ -0,0 +1,233 @@ + + + + +jamba +diff vs llama (+mixtral,mistral) · 4 overridden · 24 added · 0 deleted · 7 new · 3 inherited-as-is + +JambaModel · base model +32 × JambaAttentionDecoderLayerJambaAttentionDecoderLayer× 32 +JambaForCausalLM · task head +layers (idx) +Self-Attention · JambaAttention (2 layer types — modules differ ▼) +MLP · LlamaMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 4096] → [1, 6, 4096] +JambaRMSNormpre-attention [1, 6, 4096] +conv1d: Conv1d 8192×1×4conv1d Conv1d 8192×1×4 +act: SiLUActivationact SiLU +in_proj: Linear [4096→16384]in_proj [4096→16384] +x_proj: Linear [8192→288]x_proj [8192→288] +dt_proj: Linear [256→8192]dt_proj [256→8192] +out_proj: Linear [8192→4096]out_proj [8192→4096] +dt_layernorm: JambaRMSNorm 256dt_layernorm RMSNorm 256 +b_layernorm: JambaRMSNorm 16b_layernorm RMSNorm 16 +c_layernorm: JambaRMSNorm 16c_layernorm RMSNorm 16 +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +mamba attention mask (q↓ × k→)mamba mask +full_attention attention mask (q↓ × k→)full mask +residual add+ +JambaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +JambaForCausalLMLM HeadLinear [4096→65536] +Softmax +logits[1, 6, 65536] +layer 0: mamba0 +layer 1: mamba1 +layer 2: mamba2 +layer 3: mamba3 +layer 4: full_attention4 +layer 5: mamba5 +layer 6: mamba6 +layer 7: mamba7 +layer 8: mamba8 +layer 9: mamba9 +layer 10: mamba10 +layer 11: mamba11 +layer 12: full_attention12 +layer 13: mamba13 +layer 14: mamba14 +layer 15: mamba15 +layer 16: mamba16 +layer 17: mamba17 +layer 18: mamba18 +layer 19: mamba19 +layer 20: full_attention20 +layer 21: mamba21 +layer 22: mamba22 +layer 23: mamba23 +layer 24: mamba24 +layer 25: mamba25 +layer 26: mamba26 +layer 27: mamba27 +layer 28: full_attention28 +layer 29: mamba29 +layer 30: mamba30 +layer 31: mamba31 + +model id +ai21labs/Jamba-v0.1 +parent +llama +classes +12 +overridden +4 +added +24 +new classes +7 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +JambaAttention +ovr __init__,forward + +JambaForCausalLM +ovr __init__,forward + +JambaAttentionDecoderLayer +add __init__,forward + +JambaForSequenceClassification +rename only + +JambaMambaDecoderLayer +add __init__,forward + +JambaMambaMixer +add __init__,cuda_kernels_forward,forward,sl… + +JambaModel +add __init__,_update_mamba_mask,forward + +JambaPreTrainedModel +add _init_weights; 9 attr + +JambaSparseMoeBlock +add __init__,forward,route_tokens_to_experts + \ No newline at end of file diff --git a/jamba.svg b/jamba.svg new file mode 100644 index 0000000000000000000000000000000000000000..d104cdd88a9b543e462d4e0b53ba0150b9fd7cdc --- /dev/null +++ b/jamba.svg @@ -0,0 +1,227 @@ + + + + +jamba +hybrid · 28× Mamba + 4× full +MoE + +JambaModel · base model +32 × JambaAttentionDecoderLayerJambaAttentionDecoderLayer× 32 +JambaForCausalLM · task head +layers (idx) +Self-Attention · JambaAttention (2 layer types — modules differ ▼) +MLP · JambaMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 4096] → [1, 6, 4096] +JambaRMSNormpre-attention [1, 6, 4096] +conv1d: Conv1d 8192×1×4conv1d Conv1d 8192×1×4 +act: SiLUActivationact SiLU +in_proj: Linear [4096→16384]in_proj [4096→16384] +x_proj: Linear [8192→288]x_proj [8192→288] +dt_proj: Linear [256→8192]dt_proj [256→8192] +out_proj: Linear [8192→4096]out_proj [8192→4096] +dt_layernorm: JambaRMSNorm 256dt_layernorm RMSNorm 256 +b_layernorm: JambaRMSNorm 16b_layernorm RMSNorm 16 +c_layernorm: JambaRMSNorm 16c_layernorm RMSNorm 16 +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +mamba attention mask (q↓ × k→)mamba mask +full_attention attention mask (q↓ × k→)full mask +residual add+ +JambaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +JambaForCausalLMLM HeadLinear [4096→65536] +Softmax +logits[1, 6, 65536] +layer 0: mamba0 +layer 1: mamba1 +layer 2: mamba2 +layer 3: mamba3 +layer 4: full_attention4 +layer 5: mamba5 +layer 6: mamba6 +layer 7: mamba7 +layer 8: mamba8 +layer 9: mamba9 +layer 10: mamba10 +layer 11: mamba11 +layer 12: full_attention12 +layer 13: mamba13 +layer 14: mamba14 +layer 15: mamba15 +layer 16: mamba16 +layer 17: mamba17 +layer 18: mamba18 +layer 19: mamba19 +layer 20: full_attention20 +layer 21: mamba21 +layer 22: mamba22 +layer 23: mamba23 +layer 24: mamba24 +layer 25: mamba25 +layer 26: mamba26 +layer 27: mamba27 +layer 28: full_attention28 +layer 29: mamba29 +layer 30: mamba30 +layer 31: mamba31 + +model id +ai21labs/Jamba-v0.1 +model_type +jamba +config +JambaConfig +decoder +hybrid +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +n/a +vocab +65,536 +max_pos +262,144 +experts (top-k) +16 (top-2) +tie_embeddings +False +legend + +self-attention + +mamba + +full + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/janus.diff.svg b/janus.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..fc34fa89e47e4e6505ced817ec75c52c2427aee3 --- /dev/null +++ b/janus.diff.svg @@ -0,0 +1,263 @@ + + + + +janus +diff vs chameleon (+siglip,idefics,blip_2) · 10 overridden · 89 added · 0 deleted · 16 new · 5 inherited-as-is + +JanusModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +JanusForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · JanusVisionMo…×24 +JanusVisionEncoderLayer×24 +Self-Attention · LlamaAttention +MLP · LlamaMLP +self_attn · JanusVisionAttention +Projector · JanusVisionAlignerMLP +mlp · JanusVisionMLP +hidden_layers · ModuleList + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +JanusForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +projection_layer: Linear [1024→1024]projection_layer [1024→1024] +projection_dropout: Identityprojection_dropout Identity +q_norm: Identityq_norm Identity +k_norm: Identityk_norm Identity +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +fc1: Linear [1024→2048]fc1 [1024→2048] +0: Linear [2048→2048]0 [2048→2048] +activation_fn: GELUActivationactivation_fn GELU +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +deepseek-community/Janus-Pro-1 +parent +chameleon +classes +27 +overridden +10 +added +89 +new classes +16 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +JanusVisionEmbeddings +ovr forward + +JanusVisionEncoder +ovr __init__ + +JanusVisionEncoderLayer +ovr __init__ + +JanusVisionModel +ovr __init__,forward; 1 attr + +JanusConfig +add __post_init__; 7 attr + +JanusForConditionalGeneration +add __init__,decode_image_tokens,forward,gen… + +JanusModel +add __init__,forward,get_image_features,get_… + +JanusPreTrainedModel +add _init_weights; 9 attr + +JanusVQVAE +ovr __init__; add decode,forward; 3 attr + +JanusVQVAEAlignerMLP +add __init__,forward + +JanusVQVAEConfig +19 attr + +JanusVQVAEConvUpsample +add __init__,forward + +JanusVQVAEDecoder +add __init__,forward + +JanusVQVAEEncoder +add __init__,forward + +JanusVQVAEHead +add __init__,forward + +JanusVQVAEMidBlock +add __init__,forward + +JanusVQVAEOutput +2 attr + +JanusVQVAEVectorQuantizer +ovr __init__; add get_codebook_entry + +JanusVisionAlignerMLP +add __init__,forward + +JanusVisionAttention +add __init__,forward + +JanusVisionConfig +15 attr + +JanusVisionMLP +add __init__,forward + \ No newline at end of file diff --git a/janus.svg b/janus.svg new file mode 100644 index 0000000000000000000000000000000000000000..567eb39f0b57f3366b1a2df5ce1bc6240fc9370f --- /dev/null +++ b/janus.svg @@ -0,0 +1,220 @@ + + + + +janus +multimodal · vision → projector → LLM · dense + +JanusModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +JanusForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · JanusVisionMo…×24 +JanusVisionEncoderLayer×24 +Self-Attention · LlamaAttention +MLP · LlamaMLP +self_attn · JanusVisionAttention +Projector · JanusVisionAlignerMLP +mlp · JanusVisionMLP +hidden_layers · ModuleList + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +JanusForConditionalGenerationLM HeadLinear [4096→32000] · tied +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +projection_layer: Linear [1024→1024]projection_layer [1024→1024] +projection_dropout: Identityprojection_dropout Identity +q_norm: Identityq_norm Identity +k_norm: Identityk_norm Identity +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +fc1: Linear [1024→2048]fc1 [1024→2048] +0: Linear [2048→2048]0 [2048→2048] +activation_fn: GELUActivationactivation_fn GELU +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +deepseek-community/Janus-Pro-… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +janus +config +JanusConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/jetmoe.diff.svg b/jetmoe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..5d6df0cf23c02d43062d5a2cc8c760b1ab26e882 --- /dev/null +++ b/jetmoe.diff.svg @@ -0,0 +1,198 @@ + + + + +jetmoe +diff vs mixtral (+llama) · 14 overridden · 15 added · 0 deleted · 7 new · 2 inherited-as-is + +JetMoeModel · base model +12 × JetMoeDecoderLayerJetMoeDecoderLayer× 12 +JetMoeForCausalLM · task head +Self-Attention · JetMoeAttention +Sparse MoE · JetMoeMoEMoE +experts · JetMoeMoA +router · JetMoeTopKGating (top-2 of 8) +router · JetMoeTopKGating + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2048] → [1, 6, 2048] +JetMoeRMSNormpre-attention [1, 6, 2048] +input_linear: JetMoeParallelExperts 8×2048×2048input_linear ParallelExperts 8×2048×2048 +output_linear: JetMoeParallelExperts 8×2048×2048output_linear ParallelExperts 8×2048×2048 +layer: Linear [2048→8]layer [2048→8] +kv_proj: Linear [2048→4096]kv_proj [2048→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:16 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +JetMoeRMSNormpre-FFN [1, 6, 2048] +activation: SiLUActivationactivation SiLU +input_linear: JetMoeParallelExperts 8×11264×2048input_linear ParallelExperts 8×11264×2048 +output_linear: JetMoeParallelExperts 8×2048×5632output_linear ParallelExperts 8×2048×5632 +layer: Linear [2048→8]layer [2048→8] +residual add+ +Final RMSNorm[1, 6, 2048] +JetMoeForCausalLMLM HeadLinear [2048→32000] · tied +Softmax +logits[1, 6, 32000] + +model id +jetmoe/jetmoe-8b +parent +mixtral +classes +12 +overridden +14 +added +15 +new classes +7 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +JetMoeDecoderLayer +ovr __init__,forward + +JetMoeModel +ovr __init__,forward + +JetMoePreTrainedModel +ovr _init_weights; 9 attr + +JetMoeAttention +add __init__,forward + +JetMoeForCausalLM +add __init__,forward; 1 attr + +JetMoeForSequenceClassification +rename only + +JetMoeMoA +add __init__,forward,map,reduce + +JetMoeMoE +add __init__,forward + +JetMoeParallelExperts +add __init__,forward + +JetMoeTopKGating +add __init__,forward + \ No newline at end of file diff --git a/jetmoe.svg b/jetmoe.svg new file mode 100644 index 0000000000000000000000000000000000000000..2b1a5d83ea269950e5734666661534fa417b8fbd --- /dev/null +++ b/jetmoe.svg @@ -0,0 +1,185 @@ + + + + +jetmoe +sparse-moe · 12× GQA +MoE + +JetMoeModel · base model +12 × JetMoeDecoderLayerJetMoeDecoderLayer× 12 +JetMoeForCausalLM · task head +Self-Attention · JetMoeAttention +Sparse MoE · JetMoeMoEMoE +experts · JetMoeMoA +router · JetMoeTopKGating (top-2 of 8) +router · JetMoeTopKGating + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2048] → [1, 6, 2048] +JetMoeRMSNormpre-attention [1, 6, 2048] +input_linear: JetMoeParallelExperts 8×2048×2048input_linear ParallelExperts 8×2048×2048 +output_linear: JetMoeParallelExperts 8×2048×2048output_linear ParallelExperts 8×2048×2048 +layer: Linear [2048→8]layer [2048→8] +kv_proj: Linear [2048→4096]kv_proj [2048→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:16 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +JetMoeRMSNormpre-FFN [1, 6, 2048] +activation: SiLUActivationactivation SiLU +input_linear: JetMoeParallelExperts 8×11264×2048input_linear ParallelExperts 8×11264×2048 +output_linear: JetMoeParallelExperts 8×2048×5632output_linear ParallelExperts 8×2048×5632 +layer: Linear [2048→8]layer [2048→8] +residual add+ +Final RMSNorm[1, 6, 2048] +JetMoeForCausalLMLM HeadLinear [2048→32000] · tied +Softmax +logits[1, 6, 32000] + +model id +jetmoe/jetmoe-8b +model_type +jetmoe +config +JetMoeConfig +decoder +sparse-moe +layers +12 +hidden +2,048 +intermediate +5,632 +heads / kv +32 / 16 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +4,096 +experts (top-k) +8 (top-2) +tie_embeddings +True +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/jina_embeddings_v3.diff.svg b/jina_embeddings_v3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6d5db56f07d8baf4f96beab515507f59d9b2d6f0 --- /dev/null +++ b/jina_embeddings_v3.diff.svg @@ -0,0 +1,186 @@ + + + + +jina_embeddings_v3 +diff vs xlm_roberta (+llama,clip,gpt_neox) · 11 overridden · 13 added · 3 deleted · 1 new · 7 inherited-as-is + +JinaEmbeddingsV3Model · base model +24 × JinaEmbeddingsV3LayerJinaEmbeddingsV3Layer× 24 +JinaEmbeddingsV3ForMaskedLM · task head +Self-Attention · JinaEmbeddingsV3Attention +MLP · XLMRobertaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250002 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +residual add+ +Final LayerNorm[1, 6, 1024] +JinaEmbeddingsV3ForMaskedLMPool (CLS / mean)[1, 6, 1024] → [1, 1024] +JinaEmbeddingsV3ForMaskedLMClassifier headLinear [1024→2] +Softmax +class logits[1, 2] (2 classes) + +model id +jinaai/jina-embeddings-v3-hf +parent +xlm_roberta +classes +14 +overridden +11 +added +13 +new classes +1 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +JinaEmbeddingsV3Embeddings +ovr __init__,forward; del create_position_id… + +JinaEmbeddingsV3Model +ovr __init__,forward; del _create_attention_… + +JinaEmbeddingsV3Attention +ovr __init__,forward + +JinaEmbeddingsV3ForMaskedLM +ovr __init__,forward + +JinaEmbeddingsV3Layer +ovr __init__,forward + +JinaEmbeddingsV3PreTrainedModel +1 attr + +JinaEmbeddingsV3Config +13 attr + \ No newline at end of file diff --git a/jina_embeddings_v3.svg b/jina_embeddings_v3.svg new file mode 100644 index 0000000000000000000000000000000000000000..29dbdbc5896298bf6a8b64015b0f8dd32114a212 --- /dev/null +++ b/jina_embeddings_v3.svg @@ -0,0 +1,180 @@ + + + + +jina_embeddings_v3 +dense · 24× MHA + +JinaEmbeddingsV3Model · base model +24 × JinaEmbeddingsV3LayerJinaEmbeddingsV3Layer× 24 +JinaEmbeddingsV3ForMaskedLM · task head +Self-Attention · JinaEmbeddingsV3Attention +MLP · JinaEmbeddingsV3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250002 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +residual add+ +Final LayerNorm[1, 6, 1024] +JinaEmbeddingsV3ForMaskedLMPool (CLS / mean)[1, 6, 1024] → [1, 1024] +JinaEmbeddingsV3ForMaskedLMClassifier headLinear [1024→2] +Softmax +class logits[1, 2] (2 classes) + +model id +jinaai/jina-embeddings-v3-hf +model_type +jina_embeddings_v3 +config +JinaEmbeddingsV3Config +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +250,002 +max_pos +8,194 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/kosmos2.svg b/kosmos2.svg new file mode 100644 index 0000000000000000000000000000000000000000..9ee71fc5ed121c448af730c60bf3882e2a76e2eb --- /dev/null +++ b/kosmos2.svg @@ -0,0 +1,220 @@ + + + + +kosmos2 +multimodal · vision+vision → projector → LLM · dense + +Kosmos2Model · base model +24 × Kosmos2TextBlockKosmos2TextBlock× 24 +Kosmos2ForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · KosmosTextAttention +Vision encoder · Kosmos2Vision…×24 +Kosmos2VisionEncoderLayer×24 +Vision encoder · Kosmos2Image…×24 +MLP · Kosmos2TextFFN +x_attn · KosmosTextAttention +self_attn · Kosmos2VisionAttenti… +mlp · Kosmos2VisionMLP + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65037 × 2048] → [1, 6, 2048] +LayerNormpre-attention [1, 6, 2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +out_proj: Linear [2048→2048]out_proj [2048→2048] +inner_attn_ln: LayerNorm 2048inner_attn_ln LayerNorm 2048 +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 2048] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [2048→8192]fc1 [2048→8192] +fc2: Linear [8192→2048]fc2 [8192→2048] +ffn_layernorm: LayerNorm 8192ffn_layernorm LayerNorm 8192 +residual add+ +Final LayerNorm[1, 6, 2048] +Kosmos2ForConditionalGenerationLM HeadLinear [2048→65037] · tied +Softmax +logits[1, 6, 65037] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +example image +pixel_values[1, 3, 336, 336] +dense: Linear [1024→2048]dense [1024→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +out_proj: Linear [2048→2048]out_proj [2048→2048] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +microsoft/kosmos-2-patch14-224 +inputs +input_ids, pixel_values +model_type +kosmos-2 +config +Kosmos2Config +decoder +dense +layers +24 +hidden +2,048 +intermediate +8,192 +heads / kv +32 / 32 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +65,037 +max_pos +2,048 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/kosmos2_5.svg b/kosmos2_5.svg new file mode 100644 index 0000000000000000000000000000000000000000..8975046e8d949a4f78fa3d4d277b11e2d1720770 --- /dev/null +++ b/kosmos2_5.svg @@ -0,0 +1,156 @@ + + + + +kosmos2_5 +⚠ config-only — built from config (weights not instantiable on meta) · dense · 24× MHA + +input_ids[1, S] +Token Embedding[108481 × 1536] +Kosmos2_5TextDecoderLayerNorm → MHANorm → MLP×24 +Final Norm +LM Head→ logits [1, S, 108481] + +model id +microsoft/kosmos-2.5 +model_type +kosmos_2_5_text_model +config +Kosmos2_5TextConfig +decoder +dense +layers +24 +hidden +1,536 +intermediate +6,144 +heads / kv +16 / 16 +attention +MHA +norm +— +positional +n/a +vocab +108,481 +max_pos +4,096 +tie_embeddings +True +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/kyutai_speech_to_text.diff.svg b/kyutai_speech_to_text.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b7b284fdd55564c27f8cb782ab03f2e080a14dbf --- /dev/null +++ b/kyutai_speech_to_text.diff.svg @@ -0,0 +1,183 @@ + + + + +kyutai_speech_to_text +diff vs moshi (+llama,mimi) · 5 overridden · 12 added · 0 deleted · 2 new · 1 inherited-as-is + +KyutaiSpeechToTextModel · base model +48 × KyutaiSpeechToTextDecoderLayerKyutaiSpeechToTextDecoderLayer× 48 +Self-Attention · MoshiSdpaAttention ↩ inherited +MLP · MoshiGatingMLP ↩ inherited +q_proj · MoshiLinear ↩ inherited +k_proj · MoshiLinear ↩ inherited +v_proj · MoshiLinear ↩ inherited +o_proj · MoshiLinear ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [4001 × 2048] → [1, 6, 2048] +KyutaiSpeechToTextRMSNormpre-attention [1, 6, 2048] +linear: Linear [2048→2048]linear [2048→2048] +linear: Linear [2048→2048]linear [2048→2048] +linear: Linear [2048→2048]linear [2048→2048] +linear: Linear [2048→2048]linear [2048→2048] +rotary_emb: KyutaiSpeechToTextRotaryEmbeddingrotary_emb RotaryEmbedding +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +KyutaiSpeechToTextRMSNormpre-FFN [1, 6, 2048] +activation_fn: SiLUActivationactivation_fn SiLU +fc1: Linear [2048→11264]fc1 [2048→11264] +fc2: Linear [5632→2048]fc2 [5632→2048] +residual add+ +Final RMSNorm[1, 6, 2048] +LM HeadLinear [2048→4001] +Softmax +logits[1, 6, 4001] + +model id +kyutai/stt-2.6b-en-trfs +parent +moshi +classes +6 +overridden +5 +added +12 +new classes +2 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +KyutaiSpeechToTextModel +ovr __init__ + +KyutaiSpeechToTextPreTrainedModel +ovr _init_weights + +KyutaiSpeechToTextEmbeddings +add __init__,forward + +KyutaiSpeechToTextFeatureExtractor +add __call__,__init__ + +KyutaiSpeechToTextForConditionalGeneration +ovr __init__,forward; add _prepare_generatio… + \ No newline at end of file diff --git a/kyutai_speech_to_text.svg b/kyutai_speech_to_text.svg new file mode 100644 index 0000000000000000000000000000000000000000..9ee65d7874ca07e86ac0181109ec339384dad4ee --- /dev/null +++ b/kyutai_speech_to_text.svg @@ -0,0 +1,185 @@ + + + + +kyutai_speech_to_text +dense · 48× MHA + +KyutaiSpeechToTextModel · base model +48 × KyutaiSpeechToTextDecoderLayerKyutaiSpeechToTextDecoderLayer× 48 +Self-Attention · KyutaiSpeechToTextSdpaAttention +MLP · KyutaiSpeechToTextGatingMLP +q_proj · KyutaiSpeechToTextLinear +k_proj · KyutaiSpeechToTextLinear +v_proj · KyutaiSpeechToTextLinear +o_proj · KyutaiSpeechToTextLinear + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [4001 × 2048] → [1, 6, 2048] +KyutaiSpeechToTextRMSNormpre-attention [1, 6, 2048] +linear: Linear [2048→2048]linear [2048→2048] +linear: Linear [2048→2048]linear [2048→2048] +linear: Linear [2048→2048]linear [2048→2048] +linear: Linear [2048→2048]linear [2048→2048] +rotary_emb: KyutaiSpeechToTextRotaryEmbeddingrotary_emb RotaryEmbedding +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +KyutaiSpeechToTextRMSNormpre-FFN [1, 6, 2048] +activation_fn: SiLUActivationactivation_fn SiLU +fc1: Linear [2048→11264]fc1 [2048→11264] +fc2: Linear [5632→2048]fc2 [5632→2048] +residual add+ +Final RMSNorm[1, 6, 2048] +LM HeadLinear [2048→4001] +Softmax +logits[1, 6, 4001] + +model id +kyutai/stt-2.6b-en-trfs +model_type +kyutai_speech_to_text +config +KyutaiSpeechToTextConfig +decoder +dense +layers +48 +hidden +2,048 +intermediate +11,264 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +4,001 +max_pos +750 +sliding_window +375 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/laguna.diff.svg b/laguna.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..bb2b26c8c36d2a7880591eaeeebc2668a496a424 --- /dev/null +++ b/laguna.diff.svg @@ -0,0 +1,203 @@ + + + + +laguna +diff vs qwen2_moe (+qwen3_moe,afmoe,gemma3,glm4_moe_lite,llama,qwen3_5_moe) · 12 overridden · 29 added · 0 deleted · 1 new · 3 inherited-as-is + +LagunaModel · base model +40 × LagunaDecoderLayerLagunaDecoderLayer× 40 +LagunaForCausalLM · task head +Self-Attention · LagunaAttention +Sparse MoE · Qwen2MoeMLP (2 FFN types ▼) ↩ inheritedMoE +shared_experts · Qwen2MoeMLP (×256 · di… +experts · Qwen2MoeExperts (×256 · dim 51… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [100352 × 2048] → [1, 6, 2048] +LagunaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→6144]q_proj [2048→6144] +k_proj: Linear [2048→1024]k_proj [2048→1024] +v_proj: Linear [2048→1024]v_proj [2048→1024] +o_proj: Linear [6144→2048]o_proj [6144→2048] +q_norm: LagunaRMSNorm 128q_norm RMSNorm 128 +k_norm: LagunaRMSNorm 128k_norm RMSNorm 128 +g_proj: Linear [2048→48]g_proj [2048→48] +scaled dot-product attention48 heads · head_dim 128 · GQA 48:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +LagunaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→8192]gate_proj [2048→8192] +up_proj: Linear [2048→8192]up_proj [2048→8192] +down_proj: Linear [8192→2048]down_proj [8192→2048] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: LagunaTopKRouter top-8 of 256gate TopKRouter top-8 of 256 +gate_proj: Linear [2048→512]gate_proj [2048→512] +up_proj: Linear [2048→512]up_proj [2048→512] +down_proj: Linear [512→2048]down_proj [512→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +LagunaForCausalLMLM HeadLinear [2048→100352] +Softmax +logits[1, 6, 100352] + +model id +poolside/laguna-XS.2 +parent +qwen2_moe +classes +12 +overridden +12 +added +29 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LagunaAttention +ovr __init__,forward + +LagunaDecoderLayer +ovr __init__ + +LagunaForCausalLM +ovr forward + +LagunaModel +ovr forward + +LagunaPreTrainedModel +ovr _init_weights + +LagunaRotaryEmbedding +ovr __init__,compute_default_rope_parameters + +LagunaSparseMoeBlock +ovr __init__,forward + +LagunaTopKRouter +ovr __init__,forward + +LagunaConfig +add __post_init__,convert_rope_params_to_dic… + \ No newline at end of file diff --git a/laguna.svg b/laguna.svg new file mode 100644 index 0000000000000000000000000000000000000000..bf9cbf9a35fa26e728d0a25fc81765f3a8c620ee --- /dev/null +++ b/laguna.svg @@ -0,0 +1,195 @@ + + + + +laguna +sparse-moe · 40× full +MoE + +LagunaModel · base model +40 × LagunaDecoderLayerLagunaDecoderLayer× 40 +LagunaForCausalLM · task head +Self-Attention · LagunaAttention +Sparse MoE · LagunaMLP (2 FFN types ▼)MoE +shared_experts · LagunaMLP (×256 · dim 5… +experts · LagunaExperts (×256 · dim 512) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [100352 × 2048] → [1, 6, 2048] +LagunaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→6144]q_proj [2048→6144] +k_proj: Linear [2048→1024]k_proj [2048→1024] +v_proj: Linear [2048→1024]v_proj [2048→1024] +o_proj: Linear [6144→2048]o_proj [6144→2048] +q_norm: LagunaRMSNorm 128q_norm RMSNorm 128 +k_norm: LagunaRMSNorm 128k_norm RMSNorm 128 +g_proj: Linear [2048→48]g_proj [2048→48] +scaled dot-product attention48 heads · head_dim 128 · GQA 48:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +LagunaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→8192]gate_proj [2048→8192] +up_proj: Linear [2048→8192]up_proj [2048→8192] +down_proj: Linear [8192→2048]down_proj [8192→2048] +act_fn: SiLUActivationact_fn SiLU +act_fn: SiLUActivationact_fn SiLU +gate: LagunaTopKRouter top-8 of 256gate TopKRouter top-8 of 256 +gate_proj: Linear [2048→512]gate_proj [2048→512] +up_proj: Linear [2048→512]up_proj [2048→512] +down_proj: Linear [512→2048]down_proj [512→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +LagunaForCausalLMLM HeadLinear [2048→100352] +Softmax +logits[1, 6, 100352] + +model id +poolside/laguna-XS.2 +model_type +laguna +config +LagunaConfig +decoder +sparse-moe +layers +40 +hidden +2,048 +intermediate +8,192 +heads / kv +48 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +100,352 +max_pos +131,072 +sliding_window +512 +experts (top-k) +256 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/lasr.diff.svg b/lasr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7825ef5ebc7c28c8ba834f3276330b76fc57bd96 --- /dev/null +++ b/lasr.diff.svg @@ -0,0 +1,198 @@ + + + + +lasr +diff vs parakeet (+llama) · 9 overridden · 31 added · 0 deleted · 7 new · 2 inherited-as-is + +LasrForCTC · base model +17 × LasrEncoderBlockLasrEncoderBlock× 17 +Self-Attention · LasrEncoderAttention +MLP · LasrEncoderFeedForward + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [512 × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [512→512]q_proj [512→512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +o_proj: Linear [512→512]o_proj [512→512] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→512] +Softmax +logits[1, 6, 512] + +model id +google/medasr +parent +parakeet +classes +14 +overridden +9 +added +31 +new classes +7 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LasrEncoderAttention +ovr __init__,forward + +LasrEncoderBlock +ovr __init__,forward + +LasrEncoderConvolutionModule +ovr __init__ + +LasrForCTC +ovr generate + +LasrPreTrainedModel +ovr _get_subsampling_output_length,_init_wei… + +LasrCTCConfig +add inputs_to_logits_ratio; 2 attr + +LasrEncoder +add __init__,forward; 2 attr + +LasrEncoderConfig +16 attr + +LasrEncoderSubsampling +add __init__,forward + +LasrProcessor +add __call__,__init__,model_input_names + +LasrProcessorKwargs +1 attr + +LasrTokenizer +add __init__,_decode + \ No newline at end of file diff --git a/lasr.svg b/lasr.svg new file mode 100644 index 0000000000000000000000000000000000000000..07ef1fcb8e8536ae988887a03324ad2895e497f9 --- /dev/null +++ b/lasr.svg @@ -0,0 +1,177 @@ + + + + +lasr +dense · 17× Attention + +LasrForCTC · base model +17 × LasrEncoderBlockLasrEncoderBlock× 17 +Self-Attention · LasrEncoderAttention +MLP · LasrEncoderFeedForward + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [512 × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [512→512]q_proj [512→512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +o_proj: Linear [512→512]o_proj [512→512] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→512] +Softmax +logits[1, 6, 512] + +model id +google/medasr +model_type +lasr_ctc +config +LasrCTCConfig +decoder +dense +layers +17 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +RoPE +vocab +512 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/layoutlm.svg b/layoutlm.svg new file mode 100644 index 0000000000000000000000000000000000000000..49773a74b89a751f5a2e7335bd315c9e1550d2be --- /dev/null +++ b/layoutlm.svg @@ -0,0 +1,176 @@ + + + + +layoutlm +dense · 12× MHA + +LayoutLMModel · base model +12 × LayoutLMLayerLayoutLMLayer× 12 +LayoutLMForMaskedLM · task head +Self-Attention · LayoutLMAttention +output · LayoutLMSelfOutput +self · LayoutLMSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +LayoutLMForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +LayoutLMForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/layoutlm-base-uncas… +model_type +layoutlm +config +LayoutLMConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/layoutlmv2.svg b/layoutlmv2.svg new file mode 100644 index 0000000000000000000000000000000000000000..7d51203507d0da18c3122e6f9b5e1e6b4828b89d --- /dev/null +++ b/layoutlmv2.svg @@ -0,0 +1,156 @@ + + + + +layoutlmv2 +⚠ config-only — built from config (weights not instantiable on meta) · dense · 12× MHA + +input_ids[1, S] +Token Embedding[30522 × 768] +LayoutLMv2DecoderLayerNorm → MHANorm → MLP×12 +Final Norm +LM Head→ logits [1, S, 30522] + +model id +microsoft/layoutlmv2-base-unc… +model_type +layoutlmv2 +config +LayoutLMv2Config +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +— +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/layoutlmv3.svg b/layoutlmv3.svg new file mode 100644 index 0000000000000000000000000000000000000000..d0581cbea0b6e0c35b11ef59cc8c2edc319ed505 --- /dev/null +++ b/layoutlmv3.svg @@ -0,0 +1,175 @@ + + + + +layoutlmv3 +dense · 12× MHA + +LayoutLMv3Model · base model +12 × LayoutLMv3LayerLayoutLMv3Layer× 12 +LayoutLMv3ForSequenceClassification · task head +Self-Attention · LayoutLMv3Attention +output · LayoutLMv3SelfOutput +self · LayoutLMv3SelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LayoutLMv3ForSequenceClassificationLM HeadLinear [768→50265] +Softmax +logits[1, 6, 50265] + +model id +microsoft/layoutlmv3-base +model_type +layoutlmv3 +config +LayoutLMv3Config +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +512 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/layoutxlm.diff.svg b/layoutxlm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..043cd080b08fc3dd0f8c37233ab5a1454a00c581 --- /dev/null +++ b/layoutxlm.diff.svg @@ -0,0 +1,138 @@ + + + + +layoutxlm +diff vs None · 0 overridden · 0 added · 0 deleted · 1 new · 0 inherited-as-is + +input_ids[1, S] +Token Embedding[30522 × 768] +LayoutXLMDecoderLayerNorm → MHANorm → MLP×12 +Final Norm +LM Head→ logits [1, S, 30522] + +model id +microsoft/layoutxlm-base +parent +— +classes +1 +overridden +0 +added +0 +new classes +1 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LayoutXLMConfig +rename only + \ No newline at end of file diff --git a/layoutxlm.svg b/layoutxlm.svg new file mode 100644 index 0000000000000000000000000000000000000000..b25a5665d79dcb1d34bbcbc2eab34a08a4a3ee1a --- /dev/null +++ b/layoutxlm.svg @@ -0,0 +1,156 @@ + + + + +layoutxlm +⚠ config-only — built from config (weights not instantiable on meta) · dense · 12× MHA + +input_ids[1, S] +Token Embedding[30522 × 768] +LayoutXLMDecoderLayerNorm → MHANorm → MLP×12 +Final Norm +LM Head→ logits [1, S, 30522] + +model id +microsoft/layoutxlm-base +model_type +layoutxlm +config +LayoutXLMConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +— +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/led.svg b/led.svg new file mode 100644 index 0000000000000000000000000000000000000000..69bb373af658a8c4f326655272832a28c6758e41 --- /dev/null +++ b/led.svg @@ -0,0 +1,174 @@ + + + + +led +dense · 12× MHA + +LEDModel · base model +12 × LEDEncoderLayerLEDEncoderLayer× 12 +LEDForConditionalGeneration · task head +Self-Attention · LEDEncoderAttention +longformer_self_attn · LEDEncoderSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +query_global: Linear [1024→1024]query_global [1024→1024] +key_global: Linear [1024→1024]key_global [1024→1024] +value_global: Linear [1024→1024]value_global [1024→1024] +output: Linear [1024→1024]output [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +LEDForConditionalGenerationLM HeadLinear [1024→50265] · tied +Softmax +logits[1, 6, 50265] + +model id +allenai/led-base-16384 +model_type +led +config +LEDConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/levit.svg b/levit.svg new file mode 100644 index 0000000000000000000000000000000000000000..f35b778760c9a908abcab54258435db205ad8380 --- /dev/null +++ b/levit.svg @@ -0,0 +1,168 @@ + + + + +levit +dense · 10× MHA + +LevitModel · base model +10 × LevitResidualLayerLevitResidualLayer× 10 +LevitForImageClassification · task head +Self-Attention · LevitAttention +queries_keys_values · MLPLayerWithBN +projection · MLPLayerWithBN + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +Normpre-attention [1, 6, ?] +linear: Linear [128→256]linear [128→256] +batch_norm: BatchNorm1d 256batch_norm BatchNorm1d 256 +activation: Hardswishactivation Hardswish +linear: Linear [128→128]linear [128→128] +batch_norm: BatchNorm1d 128batch_norm BatchNorm1d 128 +scaled dot-product attention(4, 8, 12) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final BatchNorm1d[1, 6, ?] +LevitForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +LevitForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/levit-128S +model_type +levit +config +LevitConfig +decoder +dense +layers +10 +hidden +— +intermediate +— +heads / kv +(4, 8, 12) / (4, 8, 12) +attention +MHA +norm +BatchNorm1d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/lfm2.diff.svg b/lfm2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9570b4575f010e025f35c1186b11a35d4a25e81d --- /dev/null +++ b/lfm2.diff.svg @@ -0,0 +1,184 @@ + + + + +lfm2 +diff vs llama (+gemma2) · 5 overridden · 8 added · 0 deleted · 3 new · 3 inherited-as-is + +Lfm2Model · base model +32 × Lfm2DecoderLayerLfm2DecoderLayer× 32 +Lfm2ForCausalLM · task head +Self-Attention · Lfm2Attention +MLP · Lfm2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 2560] → [1, 6, 2560] +Lfm2RMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→640]k_proj [2560→640] +v_proj: Linear [2560→640]v_proj [2560→640] +out_proj: Linear [2560→2560]out_proj [2560→2560] +q_layernorm: Lfm2RMSNorm 80q_layernorm RMSNorm 80 +k_layernorm: Lfm2RMSNorm 80k_layernorm RMSNorm 80 +scaled dot-product attention32 heads · head_dim 80 · GQA 32:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Lfm2RMSNormpre-FFN [1, 6, 2560] +w1: Linear [2560→8192]w1 [2560→8192] +w3: Linear [2560→8192]w3 [2560→8192] +w2: Linear [8192→2560]w2 [8192→2560] +residual add+ +Final RMSNorm[1, 6, 2560] +Lfm2ForCausalLMLM HeadLinear [2560→65536] · tied +Softmax +logits[1, 6, 65536] + +model id +LiquidAI/LFM2-1.2B +parent +llama +classes +9 +overridden +5 +added +8 +new classes +3 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Lfm2Attention +ovr __init__,forward + +Lfm2Model +ovr __init__,forward + +Lfm2PreTrainedModel +1 attr + +Lfm2DecoderLayer +add __init__,forward + +Lfm2MLP +add __init__,forward + +Lfm2ShortConv +add __init__,cuda_kernels_forward,forward,sl… + \ No newline at end of file diff --git a/lfm2.svg b/lfm2.svg new file mode 100644 index 0000000000000000000000000000000000000000..8c546d9c0adba811180104d0c5466660f748df48 --- /dev/null +++ b/lfm2.svg @@ -0,0 +1,181 @@ + + + + +lfm2 +dense · 32× full + +Lfm2Model · base model +32 × Lfm2DecoderLayerLfm2DecoderLayer× 32 +Lfm2ForCausalLM · task head +Self-Attention · Lfm2Attention +MLP · Lfm2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 2560] → [1, 6, 2560] +Lfm2RMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→640]k_proj [2560→640] +v_proj: Linear [2560→640]v_proj [2560→640] +out_proj: Linear [2560→2560]out_proj [2560→2560] +q_layernorm: Lfm2RMSNorm 80q_layernorm RMSNorm 80 +k_layernorm: Lfm2RMSNorm 80k_layernorm RMSNorm 80 +scaled dot-product attention32 heads · head_dim 80 · GQA 32:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Lfm2RMSNormpre-FFN [1, 6, 2560] +w1: Linear [2560→8192]w1 [2560→8192] +w3: Linear [2560→8192]w3 [2560→8192] +w2: Linear [8192→2560]w2 [8192→2560] +residual add+ +Final RMSNorm[1, 6, 2560] +Lfm2ForCausalLMLM HeadLinear [2560→65536] · tied +Softmax +logits[1, 6, 65536] + +model id +LiquidAI/LFM2-1.2B +model_type +lfm2 +config +Lfm2Config +decoder +dense +layers +32 +hidden +2,560 +intermediate +12,288 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +65,536 +max_pos +128,000 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/lfm2_moe.diff.svg b/lfm2_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..003a4f5e6d1b0537d02bd9b68e8a552d15143a41 --- /dev/null +++ b/lfm2_moe.diff.svg @@ -0,0 +1,184 @@ + + + + +lfm2_moe +diff vs lfm2 (+llama,mixtral,qwen2_moe) · 6 overridden · 4 added · 0 deleted · 1 new · 5 inherited-as-is + +Lfm2MoeModel · base model +32 × Lfm2MoeDecoderLayerLfm2MoeDecoderLayer× 32 +Lfm2MoeForCausalLM · task head +Self-Attention · Lfm2Attention ↩ inherited +Sparse MoE · Lfm2MoeMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 2048] → [1, 6, 2048] +Lfm2MoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +out_proj: Linear [2048→2048]out_proj [2048→2048] +q_layernorm: Lfm2MoeRMSNorm 64q_layernorm RMSNorm 64 +k_layernorm: Lfm2MoeRMSNorm 64k_layernorm RMSNorm 64 +scaled dot-product attention32 heads · head_dim 64 · GQA 32:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Lfm2MoeRMSNormpre-FFN [1, 6, 2048] +w1: Linear [2048→7168]w1 [2048→7168] +w3: Linear [2048→7168]w3 [2048→7168] +w2: Linear [7168→2048]w2 [7168→2048] +residual add+ +Final RMSNorm[1, 6, 2048] +Lfm2MoeForCausalLMLM HeadLinear [2048→65536] · tied +Softmax +logits[1, 6, 65536] + +model id +LiquidAI/LFM2-8B-A1B +parent +lfm2 +classes +11 +overridden +6 +added +4 +new classes +1 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Lfm2MoeDecoderLayer +ovr __init__ + +Lfm2MoeExperts +ovr __init__ + +Lfm2MoeMLP +ovr __init__ + +Lfm2MoeModel +ovr __init__,forward + +Lfm2MoePreTrainedModel +add _init_weights; 1 attr + +Lfm2MoeSparseMoeBlock +add __init__,forward,route_tokens_to_experts + \ No newline at end of file diff --git a/lfm2_moe.svg b/lfm2_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..80d6da1443ced503dbd10ec15519ee2d6d8bbfe0 --- /dev/null +++ b/lfm2_moe.svg @@ -0,0 +1,183 @@ + + + + +lfm2_moe +sparse-moe · 32× full +MoE + +Lfm2MoeModel · base model +32 × Lfm2MoeDecoderLayerLfm2MoeDecoderLayer× 32 +Lfm2MoeForCausalLM · task head +Self-Attention · Lfm2MoeAttention +Sparse MoE · Lfm2MoeMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 2048] → [1, 6, 2048] +Lfm2MoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +out_proj: Linear [2048→2048]out_proj [2048→2048] +q_layernorm: Lfm2MoeRMSNorm 64q_layernorm RMSNorm 64 +k_layernorm: Lfm2MoeRMSNorm 64k_layernorm RMSNorm 64 +scaled dot-product attention32 heads · head_dim 64 · GQA 32:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Lfm2MoeRMSNormpre-FFN [1, 6, 2048] +w1: Linear [2048→7168]w1 [2048→7168] +w3: Linear [2048→7168]w3 [2048→7168] +w2: Linear [7168→2048]w2 [7168→2048] +residual add+ +Final RMSNorm[1, 6, 2048] +Lfm2MoeForCausalLMLM HeadLinear [2048→65536] · tied +Softmax +logits[1, 6, 65536] + +model id +LiquidAI/LFM2-8B-A1B +model_type +lfm2_moe +config +Lfm2MoeConfig +decoder +sparse-moe +layers +32 +hidden +2,048 +intermediate +7,168 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +65,536 +max_pos +128,000 +experts (top-k) +32 (top-4) +tie_embeddings +True +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/lfm2_vl.diff.svg b/lfm2_vl.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..2babcc600995d1046230f7495dd31715cd883bfe --- /dev/null +++ b/lfm2_vl.diff.svg @@ -0,0 +1,205 @@ + + + + +lfm2_vl +diff vs llava · 8 overridden · 3 added · 0 deleted · 1 new · 2 inherited-as-is + +Lfm2VlModel · base model +32 × Lfm2DecoderLayerLfm2DecoderLayer× 32 +Lfm2VlForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Lfm2Attention +Vision encoder · Siglip2VisionM…×12 +Siglip2EncoderLayer×12 +Projector · Lfm2VlMultiModalProjector +self_attn · Siglip2Attention +MLP · Lfm2MLP +mlp · Siglip2MLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 2560] → [1, 6, 2560] +Lfm2RMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→640]k_proj [2560→640] +v_proj: Linear [2560→640]v_proj [2560→640] +out_proj: Linear [2560→2560]out_proj [2560→2560] +q_layernorm: Lfm2RMSNorm 80q_layernorm Lfm2RMSNorm 80 +k_layernorm: Lfm2RMSNorm 80k_layernorm Lfm2RMSNorm 80 +scaled dot-product attention32 heads · head_dim 80 · GQA 32:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Lfm2RMSNormpre-FFN [1, 6, 2560] +w1: Linear [2560→8192]w1 [2560→8192] +w3: Linear [2560→8192]w3 [2560→8192] +w2: Linear [8192→2560]w2 [8192→2560] +residual add+ +Final RMSNorm[1, 6, 2560] +Lfm2VlForConditionalGenerationLM HeadLinear [2560→65536] · tied +Softmax +logits[1, 6, 65536] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm: LayerNorm 3072layer_norm LayerNorm 3072 +linear_1: Linear [3072→2560]linear_1 [3072→2560] +act: GELUActivationact GELU +linear_2: Linear [2560→2560]linear_2 [2560→2560] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +LiquidAI/LFM2-VL-1.6B +parent +llava +classes +6 +overridden +8 +added +3 +new classes +1 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Lfm2VlForConditionalGeneration +ovr forward,get_image_features + +Lfm2VlModel +ovr __init__,forward,get_image_features,get_… + +Lfm2VlPreTrainedModel +2 attr + +Lfm2VlMultiModalProjector +add __init__,forward,pixel_unshuffle + \ No newline at end of file diff --git a/lfm2_vl.svg b/lfm2_vl.svg new file mode 100644 index 0000000000000000000000000000000000000000..a831b50e8771f7cb0e7a5538316874d17aed6655 --- /dev/null +++ b/lfm2_vl.svg @@ -0,0 +1,216 @@ + + + + +lfm2_vl +multimodal · vision → projector → LLM · dense + +Lfm2VlModel · base model +32 × Lfm2DecoderLayerLfm2DecoderLayer× 32 +Lfm2VlForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Lfm2Attention +Vision encoder · Siglip2VisionM…×12 +Siglip2EncoderLayer×12 +Projector · Lfm2VlMultiModalProjector +self_attn · Siglip2Attention +MLP · Lfm2MLP +mlp · Siglip2MLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [65536 × 2560] → [1, 6, 2560] +Lfm2RMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→640]k_proj [2560→640] +v_proj: Linear [2560→640]v_proj [2560→640] +out_proj: Linear [2560→2560]out_proj [2560→2560] +q_layernorm: Lfm2RMSNorm 80q_layernorm Lfm2RMSNorm 80 +k_layernorm: Lfm2RMSNorm 80k_layernorm Lfm2RMSNorm 80 +scaled dot-product attention32 heads · head_dim 80 · GQA 32:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Lfm2RMSNormpre-FFN [1, 6, 2560] +w1: Linear [2560→8192]w1 [2560→8192] +w3: Linear [2560→8192]w3 [2560→8192] +w2: Linear [8192→2560]w2 [8192→2560] +residual add+ +Final RMSNorm[1, 6, 2560] +Lfm2VlForConditionalGenerationLM HeadLinear [2560→65536] · tied +Softmax +logits[1, 6, 65536] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm: LayerNorm 3072layer_norm LayerNorm 3072 +linear_1: Linear [3072→2560]linear_1 [3072→2560] +act: GELUActivationact GELU +linear_2: Linear [2560→2560]linear_2 [2560→2560] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +LiquidAI/LFM2-VL-1.6B +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForImageTextToText +model_type +lfm2_vl +config +Lfm2VlConfig +decoder +dense +layers +32 +hidden +2,560 +intermediate +12,288 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +65,536 +max_pos +128,000 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/lightglue.diff.svg b/lightglue.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..c858491c344317d9b033336d7f8d25fcbe6f8699 --- /dev/null +++ b/lightglue.diff.svg @@ -0,0 +1,201 @@ + + + + +lightglue +diff vs llama (+clip) · 4 overridden · 53 added · 0 deleted · 11 new · 0 inherited-as-is + +LightGlueForKeypointMatching · base model +9 × LightGlueTransformerLayerLightGlueTransformerLayer× 9 +Self-Attention · LightGlueAttention +MLP · LightGlueMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +q_proj: Linear [256→256]q_proj [256→256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention4 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 256] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [512→512]fc1 [512→512] +fc2: Linear [512→256]fc2 [512→256] +layer_norm: LayerNorm 512layer_norm LayerNorm 512 +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +ETH-CVG/lightglue_superpoint +parent +llama +classes +13 +overridden +4 +added +53 +new classes +11 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LightGlueAttention +ovr __init__,forward + +LightGlueMLP +ovr __init__,forward + +LightGlueConfig +add __post_init__,validate_architecture; 14 … + +LightGlueForKeypointMatching +add __init__,_concat_early_stopped_outputs,_… + +LightGlueImageProcessor +add post_process_keypoint_matching + +LightGlueImageProcessorKwargs +rename only + +LightGlueImageProcessorPil +add post_process_keypoint_matching + +LightGlueKeypointMatchingOutput +8 attr + +LightGlueMatchAssignmentLayer +add __init__,forward,get_matchability + +LightGluePositionalEncoder +add __init__,forward + +LightGluePreTrainedModel +7 attr + +LightGlueTokenConfidenceLayer +add __init__,forward + +LightGlueTransformerLayer +add __init__,forward + \ No newline at end of file diff --git a/lightglue.svg b/lightglue.svg new file mode 100644 index 0000000000000000000000000000000000000000..97891ee4a123524e034be16847cec19513e5ed20 --- /dev/null +++ b/lightglue.svg @@ -0,0 +1,177 @@ + + + + +lightglue +dense · 9× MHA + +LightGlueForKeypointMatching · base model +9 × LightGlueTransformerLayerLightGlueTransformerLayer× 9 +Self-Attention · LightGlueAttention +MLP · LightGlueMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +q_proj: Linear [256→256]q_proj [256→256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention4 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 256] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [512→512]fc1 [512→512] +fc2: Linear [512→256]fc2 [512→256] +layer_norm: LayerNorm 512layer_norm LayerNorm 512 +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +ETH-CVG/lightglue_superpoint +model_type +lightglue +config +LightGlueConfig +decoder +dense +layers +9 +hidden +256 +intermediate +512 +heads / kv +4 / 4 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/lighton_ocr.diff.svg b/lighton_ocr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0640b8503c5d2c3be30e9ebfb1e201dee2f6440e --- /dev/null +++ b/lighton_ocr.diff.svg @@ -0,0 +1,215 @@ + + + + +lighton_ocr +diff vs mistral3 · 5 overridden · 14 added · 0 deleted · 3 new · 1 inherited-as-is + +LightOnOcrModel · base model +28 × Qwen3DecoderLayerQwen3DecoderLayer× 28 +LightOnOcrForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen3Attention +Vision encoder · PixtralVisionM…×24 +PixtralAttentionLayer×24 +Projector · LightOnOcrMultiModalProje… +MLP · Qwen3MLP +feed_forward · PixtralMLP +attention · PixtralAttention +patch_merger · Mistral3PatchMerg… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 1024] → [1, 6, 1024] +Qwen3RMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→2048]q_proj [1024→2048] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [2048→1024]o_proj [2048→1024] +q_norm: Qwen3RMSNorm 128q_norm Qwen3RMSNorm 128 +k_norm: Qwen3RMSNorm 128k_norm Qwen3RMSNorm 128 +scaled dot-product attention16 heads · head_dim 128 · GQA 16:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3RMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→3072]gate_proj [1024→3072] +up_proj: Linear [1024→3072]up_proj [1024→3072] +down_proj: Linear [3072→1024]down_proj [3072→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +LightOnOcrForConditionalGenerationLM HeadLinear [1024→151936] · tied +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +attention_norm: PixtralRMSNorm 1024attention_normPixtralRMSNorm 1024 +gate_proj: Linear [1024→4096]gate_proj [1024→4096] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: SiLUActivationact_fn SiLU +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +ffn_norm: PixtralRMSNorm 1024ffn_norm PixtralRMSNorm 1024 +norm: LightOnOcrRMSNorm 1024norm RMSNorm 1024 +merging_layer: Linear [4096→1024]merging_layer [4096→1024] +linear_1: Linear [1024→1024]linear_1 [1024→1024] +act: GELUact GELU +linear_2: Linear [1024→1024]linear_2 [1024→1024] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +lightonai/LightOnOCR-1B-1025 +parent +mistral3 +classes +7 +overridden +5 +added +14 +new classes +3 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LightOnOcrForConditionalGeneration +ovr get_image_features + +LightOnOcrMultiModalProjector +ovr __init__ + +LightOnOcrConfig +add __post_init__; 7 attr + +LightOnOcrModel +ovr __init__,forward,get_image_features; 1 a… + +LightOnOcrProcessor +add __call__,__init__,_get_num_multimodal_to… + +LightOnOcrProcessorKwargs +1 attr + \ No newline at end of file diff --git a/lighton_ocr.svg b/lighton_ocr.svg new file mode 100644 index 0000000000000000000000000000000000000000..1782cb0b0624197865c72db2a23cc6a1157a01f1 --- /dev/null +++ b/lighton_ocr.svg @@ -0,0 +1,220 @@ + + + + +lighton_ocr +multimodal · vision → projector → LLM · dense + +LightOnOcrModel · base model +28 × Qwen3DecoderLayerQwen3DecoderLayer× 28 +LightOnOcrForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen3Attention +Vision encoder · PixtralVisionM…×24 +PixtralAttentionLayer×24 +Projector · LightOnOcrMultiModalProje… +MLP · Qwen3MLP +feed_forward · PixtralMLP +attention · PixtralAttention +patch_merger · LightOnOcrPatchMe… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 1024] → [1, 6, 1024] +Qwen3RMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→2048]q_proj [1024→2048] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [2048→1024]o_proj [2048→1024] +q_norm: Qwen3RMSNorm 128q_norm Qwen3RMSNorm 128 +k_norm: Qwen3RMSNorm 128k_norm Qwen3RMSNorm 128 +scaled dot-product attention16 heads · head_dim 128 · GQA 16:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3RMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→3072]gate_proj [1024→3072] +up_proj: Linear [1024→3072]up_proj [1024→3072] +down_proj: Linear [3072→1024]down_proj [3072→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +LightOnOcrForConditionalGenerationLM HeadLinear [1024→151936] · tied +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +attention_norm: PixtralRMSNorm 1024attention_normPixtralRMSNorm 1024 +gate_proj: Linear [1024→4096]gate_proj [1024→4096] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: SiLUActivationact_fn SiLU +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +ffn_norm: PixtralRMSNorm 1024ffn_norm PixtralRMSNorm 1024 +norm: LightOnOcrRMSNorm 1024norm RMSNorm 1024 +merging_layer: Linear [4096→1024]merging_layer [4096→1024] +linear_1: Linear [1024→1024]linear_1 [1024→1024] +act: GELUact GELU +linear_2: Linear [1024→1024]linear_2 [1024→1024] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +lightonai/LightOnOCR-1B-1025 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +lighton_ocr +config +LightOnOcrConfig +decoder +dense +layers +28 +hidden +1,024 +intermediate +3,072 +heads / kv +16 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +40,960 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/lilt.svg b/lilt.svg new file mode 100644 index 0000000000000000000000000000000000000000..94cac4c70313ebc36599f826464010535e022539 --- /dev/null +++ b/lilt.svg @@ -0,0 +1,182 @@ + + + + +lilt +dense · 12× MHA + +LiltModel · base model +12 × LiltLayerLiltLayer× 12 +LiltForSequenceClassification · task head +Self-Attention · LiltAttention +self · LiltSelfAttention +output · LiltSelfOutput +layout_output · LiltSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +layout_query: Linear [192→192]layout_query [192→192] +layout_key: Linear [192→192]layout_key [192→192] +layout_value: Linear [192→192]layout_value [192→192] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +dense: Linear [192→192]dense [192→192] +LayerNorm: LayerNorm 192LayerNorm LayerNorm 192 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LiltForSequenceClassificationLM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] + +model id +SCUT-DLVCLab/lilt-roberta-en-… +model_type +lilt +config +LiltConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/llama.svg b/llama.svg new file mode 100644 index 0000000000000000000000000000000000000000..8a604674a0d2e40a0f1e315b55476d68c71062bb --- /dev/null +++ b/llama.svg @@ -0,0 +1,180 @@ + + + + +llama +dense · 32× MHA + +LlamaModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +LlamaForCausalLM · task head +Self-Attention · LlamaAttention +MLP · LlamaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +LlamaForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +meta-llama/Llama-2-7b-hf +model_type +llama +config +LlamaConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/llama4.svg b/llama4.svg new file mode 100644 index 0000000000000000000000000000000000000000..c233e37175741ebb6838f1c2d57f7833d81d49dd --- /dev/null +++ b/llama4.svg @@ -0,0 +1,275 @@ + + + + +llama4 +multimodal · vision → projector → LLM · sparse-moe + +Llama4ForConditionalGeneration · base model +48 × Llama4TextDecoderLayerLlama4TextDecoderLayer× 48 +Llama4ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Llama4TextAttention (2 layer types — modules differ ▼) +Vision encoder · Llama4Vision…×34 +Sparse MoE · Llama4TextMoeMoE +Llama4VisionEncoderLayer×34 +shared_expert · Llama4TextMLP (×16 · dim 81… +self_attn · Llama4VisionAttention +mlp · Llama4VisionMLP +experts · Llama4TextExperts (×16 · dim 8192) +Projector · Llama4MultiModalProjector + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [202048 × 5120] → [1, 6, 5120] +Llama4TextRMSNormpre-attention [1, 6, 5120] +q_proj: Linear [5120→5120]q_proj [5120→5120] +k_proj: Linear [5120→1024]k_proj [5120→1024] +v_proj: Linear [5120→1024]v_proj [5120→1024] +o_proj: Linear [5120→5120]o_proj [5120→5120] +qk_norm: Llama4TextL2Normqk_norm TextL2Norm +q_proj: Linear [5120→5120]q_proj [5120→5120] +k_proj: Linear [5120→1024]k_proj [5120→1024] +v_proj: Linear [5120→1024]v_proj [5120→1024] +o_proj: Linear [5120→5120]o_proj [5120→5120] +scaled dot-product attention40 heads · head_dim 128 · GQA 40:8 +chunked_attention attention mask (q↓ × k→)chunked mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Llama4TextRMSNormpre-FFN [1, 6, 5120] +act_fn: SiLUActivationact_fn SiLU +router: Llama4Router top-1 of 16router Router top-1 of 16 +gate_proj: Linear [5120→8192]gate_proj [5120→8192] +up_proj: Linear [5120→8192]up_proj [5120→8192] +down_proj: Linear [8192→5120]down_proj [8192→5120] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 5120] +Llama4ForConditionalGenerationLM HeadLinear [5120→202048] +Softmax +logits[1, 6, 202048] +layer 0: chunked_attention0 +layer 1: chunked_attention1 +layer 2: chunked_attention2 +layer 3: full_attention3 +layer 4: chunked_attention4 +layer 5: chunked_attention5 +layer 6: chunked_attention6 +layer 7: full_attention7 +layer 8: chunked_attention8 +layer 9: chunked_attention9 +layer 10: chunked_attention10 +layer 11: full_attention11 +layer 12: chunked_attention12 +layer 13: chunked_attention13 +layer 14: chunked_attention14 +layer 15: full_attention15 +layer 16: chunked_attention16 +layer 17: chunked_attention17 +layer 18: chunked_attention18 +layer 19: full_attention19 +layer 20: chunked_attention20 +layer 21: chunked_attention21 +layer 22: chunked_attention22 +layer 23: full_attention23 +layer 24: chunked_attention24 +layer 25: chunked_attention25 +layer 26: chunked_attention26 +layer 27: full_attention27 +layer 28: chunked_attention28 +layer 29: chunked_attention29 +layer 30: chunked_attention30 +layer 31: full_attention31 +layer 32: chunked_attention32 +layer 33: chunked_attention33 +layer 34: chunked_attention34 +layer 35: full_attention35 +layer 36: chunked_attention36 +layer 37: chunked_attention37 +layer 38: chunked_attention38 +layer 39: full_attention39 +layer 40: chunked_attention40 +layer 41: chunked_attention41 +layer 42: chunked_attention42 +layer 43: full_attention43 +layer 44: chunked_attention44 +layer 45: chunked_attention45 +layer 46: chunked_attention46 +layer 47: full_attention47 +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +activation_fn: GELUactivation_fn GELU +fc1: Linear [768→5632]fc1 [768→5632] +fc2: Linear [5632→768]fc2 [5632→768] +input_layernorm: LayerNorm 768input_layernorm LayerNorm 768 +post_attention_layernorm: LayerNorm 768post_attention_layernormLayerNorm 768 +linear_1: Linear [7680→5120]linear_1 [7680→5120] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +meta-llama/Llama-4-Scout-17B-… +inputs +input_ids, pixel_values +model_type +llama4 +config +Llama4Config +decoder +sparse-moe +layers +48 +hidden +5,120 +intermediate +8,192 +heads / kv +40 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +202,048 +max_pos +131,072 +experts (top-k) +16 (top-1) +tie_embeddings +False +legend + +vision encoder + +self-attention + +chunked + +full + +MoE / experts + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/llava.svg b/llava.svg new file mode 100644 index 0000000000000000000000000000000000000000..4be663c4c9a3c039e1c94415eee4df72a0338034 --- /dev/null +++ b/llava.svg @@ -0,0 +1,214 @@ + + + + +llava +multimodal · vision → projector → LLM · dense + +LlavaModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +LlavaForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · CLIPVisionMod…×24 +Self-Attention · LlamaAttention +CLIPEncoderLayer×24 +MLP · LlamaMLP +self_attn · CLIPAttention +Projector · LlavaMultiModalProjector +mlp · CLIPMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +LlavaForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +linear_1: Linear [1024→4096]linear_1 [1024→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +llava-hf/llava-1.5-7b-hf +inputs +input_ids, pixel_values +built via +AutoModel +model_type +llava +config +LlavaConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/llava_next.svg b/llava_next.svg new file mode 100644 index 0000000000000000000000000000000000000000..ea4947d166dff5ba940ca72e66909c918e9aa6e3 --- /dev/null +++ b/llava_next.svg @@ -0,0 +1,214 @@ + + + + +llava_next +multimodal · vision → projector → LLM · dense + +LlavaNextModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +LlavaNextForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · CLIPVisionMod…×24 +Self-Attention · LlamaAttention +CLIPEncoderLayer×24 +MLP · LlamaMLP +self_attn · CLIPAttention +Projector · LlavaNextMultiModalProjec… +mlp · CLIPMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +LlavaNextForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +linear_1: Linear [1024→4096]linear_1 [1024→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +llava-hf/llava-v1.6-mistral-7… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +llava_next +config +LlavaNextConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/llava_next_video.diff.svg b/llava_next_video.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b191f56f9d835db86cd54422dcbc440bc6553018 --- /dev/null +++ b/llava_next_video.diff.svg @@ -0,0 +1,219 @@ + + + + +llava_next_video +diff vs llava_next · 7 overridden · 25 added · 0 deleted · 2 new · 1 inherited-as-is + +LlavaNextVideoModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +LlavaNextVideoForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · CLIPVisionMod…×24 +Self-Attention · LlamaAttention +CLIPEncoderLayer×24 +MLP · LlamaMLP +self_attn · CLIPAttention +Projector · LlavaNextMultiModalProjec… +mlp · CLIPMLP +Vision encoder · LlavaNextVideo…×24 + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +LlavaNextVideoForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +example image +pixel_values[1, 3, 336, 336] +pool: AvgPool2dpool AvgPool2d +linear_1: Linear [1024→4096]linear_1 [1024→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +llava-hf/LLaVA-NeXT-Video-7B-h +parent +llava_next +classes +8 +overridden +7 +added +25 +new classes +2 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LlavaNextVideoCausalLMOutputWithPast +1 attr + +LlavaNextVideoConfig +add __post_init__; 17 attr + +LlavaNextVideoForConditionalGeneration +ovr forward,prepare_inputs_for_generation; a… + +LlavaNextVideoModel +ovr __init__,forward,get_image_features,get_… + +LlavaNextVideoModelOutputWithPast +1 attr + +LlavaNextVideoPooler +add __init__,forward + +LlavaNextVideoPreTrainedModel +2 attr + \ No newline at end of file diff --git a/llava_next_video.svg b/llava_next_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..22e741995f89aa467928edb2b325e275790c8220 --- /dev/null +++ b/llava_next_video.svg @@ -0,0 +1,221 @@ + + + + +llava_next_video +multimodal · vision+vision → projector → LLM · dense + +LlavaNextVideoModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +LlavaNextVideoForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · CLIPVisionMod…×24 +Self-Attention · LlamaAttention +CLIPEncoderLayer×24 +MLP · LlamaMLP +self_attn · CLIPAttention +Projector · LlavaNextVideoMultiModal… +mlp · CLIPMLP +Vision encoder · LlavaNextVideo…×24 + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +LlavaNextVideoForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +example image +pixel_values[1, 3, 336, 336] +pool: AvgPool2dpool AvgPool2d +linear_1: Linear [1024→4096]linear_1 [1024→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +llava-hf/LLaVA-NeXT-Video-7B-… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +llava_next_video +config +LlavaNextVideoConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/llava_onevision.diff.svg b/llava_onevision.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7227303888236bf230d3b3c5a0184a8fdc326bef --- /dev/null +++ b/llava_onevision.diff.svg @@ -0,0 +1,206 @@ + + + + +llava_onevision +diff vs llava_next_video · 8 overridden · 35 added · 0 deleted · 3 new · 3 inherited-as-is + +LlavaOnevisionModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +LlavaOnevisionForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +Vision encoder · SiglipVisionMo…×26 +SiglipEncoderLayer×26 +MLP · Qwen2MLP +self_attn · SiglipAttention +Projector · LlavaNextVideoMultiModal… +mlp · SiglipMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +LlavaOnevisionForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→4304]fc1 [1152→4304] +fc2: Linear [4304→1152]fc2 [4304→1152] +linear_1: Linear [1152→4096]linear_1 [1152→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +llava-hf/llava-onevision-qwen2 +parent +llava_next_video +classes +8 +overridden +8 +added +35 +new classes +3 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LlavaOnevisionForConditionalGeneration +ovr forward,get_image_features,prepare_input… + +LlavaOnevisionImageProcessor +add _preprocess,pad_to_square,preprocess; 14… + +LlavaOnevisionImageProcessorKwargs +rename only + +LlavaOnevisionImageProcessorPil +add _preprocess,pad_to_square,preprocess; 14… + +LlavaOnevisionModel +ovr __init__,forward,get_image_features,get_… + \ No newline at end of file diff --git a/llava_onevision.svg b/llava_onevision.svg new file mode 100644 index 0000000000000000000000000000000000000000..a1cfeb64eaffcd940bf389a75a0c4a16ad6c4501 --- /dev/null +++ b/llava_onevision.svg @@ -0,0 +1,214 @@ + + + + +llava_onevision +multimodal · vision → projector → LLM · dense + +LlavaOnevisionModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +LlavaOnevisionForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +Vision encoder · SiglipVisionMo…×26 +SiglipEncoderLayer×26 +MLP · Qwen2MLP +self_attn · SiglipAttention +Projector · LlavaOnevisionMultiModalP… +mlp · SiglipMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +LlavaOnevisionForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→4304]fc1 [1152→4304] +fc2: Linear [4304→1152]fc2 [4304→1152] +linear_1: Linear [1152→4096]linear_1 [1152→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +llava-hf/llava-onevision-qwen… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +llava_onevision +config +LlavaOnevisionConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/longcat_flash.diff.svg b/longcat_flash.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ea1e4854dbf0cccf4eeea5022866bacfa9e7041e --- /dev/null +++ b/longcat_flash.diff.svg @@ -0,0 +1,205 @@ + + + + +longcat_flash +diff vs deepseek_v3 · 8 overridden · 22 added · 0 deleted · 4 new · 2 inherited-as-is + +LongcatFlashModel · base model +56 × LongcatFlashDecoderLayerLongcatFlashDecoderLayer× 56 +LongcatFlashForCausalLM · task head +Self-Attention · ModuleList +0 · LongcatFlashMLA +1 · LongcatFlashMLA +Sparse MoE · LongcatFlashMoEMoE +experts · LongcatFlashExperts (×512 · dim ?) +router · LongcatFlashTopkRouter (top-12 of 512) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 6144] → [1, 6, 6144] +Normpre-attention [1, 6, 6144] +q_a_proj: Linear [6144→1536]q_a_proj [6144→1536] +q_a_layernorm: LongcatFlashRMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→12288]q_b_proj [1536→12288] +kv_a_proj_with_mqa: Linear [6144→576]kv_a_proj_with_mqa [6144→576] +kv_a_layernorm: LongcatFlashRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→16384]kv_b_proj [512→16384] +o_proj: Linear [8192→6144]o_proj [8192→6144] +q_a_proj: Linear [6144→1536]q_a_proj [6144→1536] +q_a_layernorm: LongcatFlashRMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→12288]q_b_proj [1536→12288] +kv_a_proj_with_mqa: Linear [6144→576]kv_a_proj_with_mqa [6144→576] +kv_a_layernorm: LongcatFlashRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→16384]kv_b_proj [512→16384] +o_proj: Linear [8192→6144]o_proj [8192→6144] +scaled dot-product attention64 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Normpre-FFN [1, 6, 6144] +act_fn: SiLUActivationact_fn SiLU +identity_expert: Identityidentity_expert Identity +classifier: Linear [6144→768]classifier [6144→768] +residual add+ +Final RMSNorm[1, 6, 6144] +LongcatFlashForCausalLMLM HeadLinear [6144→131072] +Softmax +logits[1, 6, 131072] + +model id +meituan-longcat/LongCat-Flash- +parent +deepseek_v3 +classes +11 +overridden +8 +added +22 +new classes +4 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LongcatFlashMLA +ovr __init__,forward + +LongcatFlashMLP +ovr __init__ + +LongcatFlashModel +ovr __init__,forward + +LongcatFlashDecoderLayer +add __init__,forward + +LongcatFlashExperts +add __init__,forward + +LongcatFlashForCausalLM +ovr __init__; 1 attr + +LongcatFlashMoE +add __init__,forward + +LongcatFlashPreTrainedModel +add _init_weights; 13 attr + +LongcatFlashTopkRouter +ovr __init__,forward; add get_topk_indices + \ No newline at end of file diff --git a/longcat_flash.svg b/longcat_flash.svg new file mode 100644 index 0000000000000000000000000000000000000000..9e6616ead0d7c658dfaa8ef43d8d4c6acc78b20a --- /dev/null +++ b/longcat_flash.svg @@ -0,0 +1,195 @@ + + + + +longcat_flash +sparse-moe · 28× MLA +MoE + +LongcatFlashModel · base model +56 × LongcatFlashDecoderLayerLongcatFlashDecoderLayer× 56 +LongcatFlashForCausalLM · task head +Self-Attention · ModuleList +0 · LongcatFlashMLA +1 · LongcatFlashMLA +Sparse MoE · LongcatFlashMoEMoE +experts · LongcatFlashExperts (×512 · dim ?) +router · LongcatFlashTopkRouter (top-12 of 512) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 6144] → [1, 6, 6144] +Normpre-attention [1, 6, 6144] +q_a_proj: Linear [6144→1536]q_a_proj [6144→1536] +q_a_layernorm: LongcatFlashRMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→12288]q_b_proj [1536→12288] +kv_a_proj_with_mqa: Linear [6144→576]kv_a_proj_with_mqa [6144→576] +kv_a_layernorm: LongcatFlashRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→16384]kv_b_proj [512→16384] +o_proj: Linear [8192→6144]o_proj [8192→6144] +q_a_proj: Linear [6144→1536]q_a_proj [6144→1536] +q_a_layernorm: LongcatFlashRMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→12288]q_b_proj [1536→12288] +kv_a_proj_with_mqa: Linear [6144→576]kv_a_proj_with_mqa [6144→576] +kv_a_layernorm: LongcatFlashRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→16384]kv_b_proj [512→16384] +o_proj: Linear [8192→6144]o_proj [8192→6144] +scaled dot-product attention64 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Normpre-FFN [1, 6, 6144] +act_fn: SiLUActivationact_fn SiLU +identity_expert: Identityidentity_expert Identity +classifier: Linear [6144→768]classifier [6144→768] +residual add+ +Final RMSNorm[1, 6, 6144] +LongcatFlashForCausalLMLM HeadLinear [6144→131072] +Softmax +logits[1, 6, 131072] + +model id +meituan-longcat/LongCat-Flash… +model_type +longcat_flash +config +LongcatFlashConfig +decoder +sparse-moe +layers +56 +hidden +6,144 +intermediate +— +heads / kv +64 / 64 +attention +MLA +norm +RMSNorm +positional +RoPE +vocab +131,072 +max_pos +131,072 +experts (top-k) +512 (top-12) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/longformer.svg b/longformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..72bfeb067c2a87caeac4ab9c5bce83ae6cceba91 --- /dev/null +++ b/longformer.svg @@ -0,0 +1,178 @@ + + + + +longformer +dense · 12× MHA + +LongformerModel · base model +12 × LongformerLayerLongformerLayer× 12 +LongformerForMaskedLM · task head +Self-Attention · LongformerAttention +self · LongformerSelfAttention +output · LongformerSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +query_global: Linear [768→768]query_global [768→768] +key_global: Linear [768→768]key_global [768→768] +value_global: Linear [768→768]value_global [768→768] +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +LongformerForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +LongformerForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +allenai/longformer-base-4096 +model_type +longformer +config +LongformerConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/longt5.svg b/longt5.svg new file mode 100644 index 0000000000000000000000000000000000000000..1f5527f03cedc360d6ec1e9168be0967e08fdde6 --- /dev/null +++ b/longt5.svg @@ -0,0 +1,174 @@ + + + + +longt5 +dense · 6× MHA + +LongT5Model · base model +6 × ModuleListModuleList× 6 +LongT5ForConditionalGeneration · task head +Self-Attention · LongT5LayerLocalSelfAttention +LocalSelfAttention · LongT5LocalAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32128 × 512] → [1, 6, 512] +Normpre-attention [1, 6, 512] +q: Linear [512→512]q [512→512] +k: Linear [512→512]k [512→512] +v: Linear [512→512]v [512→512] +o: Linear [512→512]o [512→512] +relative_attention_bias: Embedding 32×8relative_attention_bias Embedding 32×8 +layer_norm: LongT5LayerNorm 512layer_norm LayerNorm 512 +dropout: Dropoutdropout Dropout +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 512] +LongT5ForConditionalGenerationLM HeadLinear [512→32128] · tied +Softmax +logits[1, 6, 32128] + +model id +google/long-t5-local-base +model_type +longt5 +config +LongT5Config +decoder +dense +layers +6 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32,128 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/luke.svg b/luke.svg new file mode 100644 index 0000000000000000000000000000000000000000..1879fcaa3499c5bb3cc30bed44ae58b119674c4d --- /dev/null +++ b/luke.svg @@ -0,0 +1,179 @@ + + + + +luke +dense · 12× MHA + +LukeModel · base model +12 × LukeLayerLukeLayer× 12 +LukeForMaskedLM · task head +Self-Attention · LukeAttention +self · LukeSelfAttention +output · LukeSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50267 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +w2e_query: Linear [768→768]w2e_query [768→768] +e2w_query: Linear [768→768]e2w_query [768→768] +e2e_query: Linear [768→768]e2e_query [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +LukeForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +LukeForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +studio-ousia/luke-base +model_type +luke +config +LukeConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,267 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/lw_detr.diff.svg b/lw_detr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7a2a822988e198297897f9d912e6f270fb0948a2 --- /dev/null +++ b/lw_detr.diff.svg @@ -0,0 +1,231 @@ + + + + +lw_detr +diff vs deformable_detr (+vitdet,convnext,rt_detr,vit) · 16 overridden · 110 added · 0 deleted · 17 new · 6 inherited-as-is + +LwDetrModel · base model +13 × LwDetrViTLayerLwDetrViTLayer× 13 +Self-Attention · LwDetrViTAttention +MLP · DeformableDetrViTMlp ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +q_proj: Linear [192→192]q_proj [192→192] +k_proj: Linear [192→192]k_proj [192→192] +v_proj: Linear [192→192]v_proj [192→192] +o_proj: Linear [192→192]o_proj [192→192] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [192→768]fc1 [192→768] +act: GELUActivationact GELU +fc2: Linear [768→192]fc2 [768→192] +drop: Dropoutdrop Dropout +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +AnnaZhang/lwdetr_small_60e_coc +parent +deformable_detr +classes +29 +overridden +16 +added +110 +new classes +17 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +LwDetrConvNormLayer +ovr __init__ + +LwDetrForObjectDetection +ovr __init__,forward; 1 attr + +LwDetrModel +ovr __init__,forward,gen_encoder_output_prop… + +LwDetrViTAttention +ovr __init__ + +LwDetrViTBackbone +ovr forward + +LwDetrAttention +add __init__,forward + +LwDetrC2FLayer +add __init__,forward + +LwDetrConfig +add __post_init__,validate_architecture; 33 … + +LwDetrConvEncoder +add __init__,forward + +LwDetrDecoder +add __init__,forward,get_reference; 1 attr + +LwDetrDecoderLayer +add __init__,forward + +LwDetrMLP +add __init__,forward + +LwDetrModelOutput +9 attr + +LwDetrMultiScaleProjector +add __init__,forward + +LwDetrObjectDetectionOutput +14 attr + +LwDetrPreTrainedModel +add _init_weights; 10 attr + +LwDetrRepVggBlock +add __init__,forward + +LwDetrSamplingLayer +add __init__,forward + +LwDetrScaleProjector +add __init__,forward + +LwDetrViTConfig +add __post_init__,validate_architecture; 8 a… + +LwDetrViTEncoder +add __init__,forward + +LwDetrViTLayer +add __init__,forward + +LwDetrViTPreTrainedModel +ovr _init_weights; 10 attr + \ No newline at end of file diff --git a/lw_detr.svg b/lw_detr.svg new file mode 100644 index 0000000000000000000000000000000000000000..eff924ab15c66d17e349716fd5ef3df817cb034b --- /dev/null +++ b/lw_detr.svg @@ -0,0 +1,177 @@ + + + + +lw_detr +dense · 13× Attention + +LwDetrModel · base model +13 × LwDetrViTLayerLwDetrViTLayer× 13 +Self-Attention · LwDetrViTAttention +MLP · LwDetrViTMlp + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +q_proj: Linear [192→192]q_proj [192→192] +k_proj: Linear [192→192]k_proj [192→192] +v_proj: Linear [192→192]v_proj [192→192] +o_proj: Linear [192→192]o_proj [192→192] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [192→768]fc1 [192→768] +act: GELUActivationact GELU +fc2: Linear [768→192]fc2 [768→192] +drop: Dropoutdrop Dropout +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +AnnaZhang/lwdetr_small_60e_co… +model_type +lw_detr +config +LwDetrConfig +decoder +dense +layers +13 +hidden +256 +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/lxmert.svg b/lxmert.svg new file mode 100644 index 0000000000000000000000000000000000000000..5165df91b5ce8817802fe6feb1c4fb012e535154 --- /dev/null +++ b/lxmert.svg @@ -0,0 +1,175 @@ + + + + +lxmert +dense · 9× MHA + +LxmertModel · base model +{'vision': 5, 'cross_encoder': 5, 'language': 9} × LxmertLayerLxmertLayer× {'vision': 5, 'cross_encoder': 5, 'language': 9} +LxmertForPreTraining · task head +Self-Attention · LxmertSelfAttentionLayer +output · LxmertAttentionOutput +self · LxmertAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LxmertForPreTrainingLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +unc-nlp/lxmert-base-uncased +model_type +lxmert +config +LxmertConfig +decoder +dense +layers +{'vision': 5, 'cross_encoder': 5, 'language': 9} +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/m2m_100.svg b/m2m_100.svg new file mode 100644 index 0000000000000000000000000000000000000000..075eec4d9ff88d2d5c9ae581a3546d0dd3bce659 --- /dev/null +++ b/m2m_100.svg @@ -0,0 +1,170 @@ + + + + +m2m_100 +dense · 12× MHA + +M2M100Model · base model +12 × M2M100EncoderLayerM2M100EncoderLayer× 12 +M2M100ForConditionalGeneration · task head +Self-Attention · M2M100Attention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128112 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +M2M100ForConditionalGenerationLM HeadLinear [1024→128112] · tied +Softmax +logits[1, 6, 128112] + +model id +facebook/m2m100_418M +model_type +m2m_100 +config +M2M100Config +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +128,112 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mamba.svg b/mamba.svg new file mode 100644 index 0000000000000000000000000000000000000000..7f3b66a10ea2a3f6bbba34de1c49b2e26812e2ed --- /dev/null +++ b/mamba.svg @@ -0,0 +1,172 @@ + + + + +mamba +ssm · 32× Mamba + +MambaModel · base model +32 × MambaBlockMambaBlock× 32 +MambaForCausalLM · task head +Token Mixer (SSM) · MambaMixer + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50280 × 768] → [1, 6, 768] +MambaRMSNormpre-mixer [1, 6, 768] +conv1d: Conv1d 1536×1×4conv1d Conv1d 1536×1×4 +act: SiLUActivationact SiLU +in_proj: Linear [768→3072]in_proj [768→3072] +x_proj: Linear [1536→80]x_proj [1536→80] +dt_proj: Linear [48→1536]dt_proj [48→1536] +out_proj: Linear [1536→768]out_proj [1536→768] +selective state-space scan (SSM) +mamba attention mask (q↓ × k→)mamba mask +residual add+ +Final RMSNorm[1, 6, 768] +MambaForCausalLMLM HeadLinear [768→50280] · tied +Softmax +logits[1, 6, 50280] + +model id +state-spaces/mamba-2.8b +model_type +mamba +config +MambaConfig +decoder +ssm +layers +32 +hidden +768 +intermediate +1,536 +heads / kv +None / None +attention +— +norm +RMSNorm +positional +n/a +vocab +50,280 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mamba2.svg b/mamba2.svg new file mode 100644 index 0000000000000000000000000000000000000000..793f4bf012155613f2487dae2c5d41d1835c3b50 --- /dev/null +++ b/mamba2.svg @@ -0,0 +1,171 @@ + + + + +mamba2 +ssm · 64× Mamba + +Mamba2Model · base model +64 × Mamba2BlockMamba2Block× 64 +Mamba2ForCausalLM · task head +Token Mixer (SSM) · Mamba2Mixer + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32768 × 4096] → [1, 6, 4096] +Mamba2RMSNormpre-mixer [1, 6, 4096] +act: SiLUActivationact SiLU +conv1d: Conv1d 10240×1×4conv1d Conv1d 10240×1×4 +in_proj: Linear [4096→18560]in_proj [4096→18560] +norm: MambaRMSNormGated 8192norm MambaRMSNormGated 8192 +out_proj: Linear [8192→4096]out_proj [8192→4096] +selective state-space scan (SSM) +mamba attention mask (q↓ × k→)mamba mask +residual add+ +Final RMSNorm[1, 6, 4096] +Mamba2ForCausalLMLM HeadLinear [4096→32768] +Softmax +logits[1, 6, 32768] + +model id +state-spaces/mamba2-2.8b +model_type +mamba2 +config +Mamba2Config +decoder +ssm +layers +64 +hidden +4,096 +intermediate +— +heads / kv +128 / 128 +attention +MHA +norm +RMSNorm +positional +n/a +vocab +32,768 +max_pos +— +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/marian.svg b/marian.svg new file mode 100644 index 0000000000000000000000000000000000000000..087fdad45b6f855e97dd8f0c9f3e3920b4c6cde8 --- /dev/null +++ b/marian.svg @@ -0,0 +1,170 @@ + + + + +marian +dense · 12× MHA + +MarianModel · base model +12 × MarianEncoderLayerMarianEncoderLayer× 12 +MarianMTModel · task head +Self-Attention · MarianAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [58101 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +MarianMTModelLM HeadLinear [1024→58101] · tied +Softmax +logits[1, 6, 58101] + +model id +Helsinki-NLP/opus-mt-en-de +model_type +marian +config +MarianConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +58,101 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/markuplm.svg b/markuplm.svg new file mode 100644 index 0000000000000000000000000000000000000000..69570fec938e07113087418f4debc3cde0a11ad6 --- /dev/null +++ b/markuplm.svg @@ -0,0 +1,175 @@ + + + + +markuplm +dense · 12× MHA + +MarkupLMModel · base model +12 × MarkupLMLayerMarkupLMLayer× 12 +MarkupLMForSequenceClassification · task head +Self-Attention · MarkupLMAttention +output · MarkupLMSelfOutput +self · MarkupLMSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +MarkupLMForSequenceClassificationLM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] + +model id +microsoft/markuplm-base +model_type +markuplm +config +MarkupLMConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mask2former.diff.svg b/mask2former.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..36e6cd257ef8a709056f8eae31146e21b37231ac --- /dev/null +++ b/mask2former.diff.svg @@ -0,0 +1,168 @@ + + + + +mask2former +diff vs None · 0 overridden · 6 added · 0 deleted · 2 new · 0 inherited-as-is + +Mask2FormerModel · base model +10 × SwinLayerSwinLayer× 10 +Self-Attention · SwinAttention +MLP · SwinMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +q_proj: Linear [384→384]q_proj [384→384] +k_proj: Linear [384→384]k_proj [384→384] +v_proj: Linear [384→384]v_proj [384→384] +o_proj: Linear [384→384]o_proj [384→384] +relative_position_bias: SwinRelativePositionBiasrelative_position_bias SwinRelativePositionBias +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [384→1536]fc1 [384→1536] +fc2: Linear [1536→384]fc2 [1536→384] +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +facebook/mask2former-swin-smal +parent +— +classes +2 +overridden +0 +added +6 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Mask2FormerImageProcessor +add post_process_instance_segmentation,post_… + +Mask2FormerImageProcessorPil +add post_process_instance_segmentation,post_… + \ No newline at end of file diff --git a/mask2former.svg b/mask2former.svg new file mode 100644 index 0000000000000000000000000000000000000000..26e0c0b603d30351eb32da72caedb8229456d7ce --- /dev/null +++ b/mask2former.svg @@ -0,0 +1,177 @@ + + + + +mask2former +dense · 18× MHA + +Mask2FormerModel · base model +10 × SwinLayerSwinLayer× 10 +Self-Attention · SwinAttention +MLP · SwinMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +q_proj: Linear [384→384]q_proj [384→384] +k_proj: Linear [384→384]k_proj [384→384] +v_proj: Linear [384→384]v_proj [384→384] +o_proj: Linear [384→384]o_proj [384→384] +relative_position_bias: SwinRelativePositionBiasrelative_position_bias SwinRelativePositionBias +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [384→1536]fc1 [384→1536] +fc2: Linear [1536→384]fc2 [1536→384] +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +facebook/mask2former-swin-sma… +model_type +mask2former +config +Mask2FormerConfig +decoder +dense +layers +10 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/maskformer.diff.svg b/maskformer.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..3c01418832e1e7026c21ed56a2691be5953e53fc --- /dev/null +++ b/maskformer.diff.svg @@ -0,0 +1,218 @@ + + + + +maskformer +diff vs detr · 0 overridden · 86 added · 0 deleted · 19 new · 3 inherited-as-is + +MaskFormerModel · base model +6 × MaskFormerDetrDecoderLayerMaskFormerDetrDecoderLayer× 6 +Self-Attention · DetrDetrCrossAttention ↩ inherited +MLP · DetrDetrMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +facebook/maskformer-swin-base- +parent +detr +classes +22 +overridden +0 +added +86 +new classes +19 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MaskFormerConfig +add __post_init__; 17 attr + +MaskFormerDetrConfig +1 attr + +MaskFormerFPNConvLayer +add __init__,forward + +MaskFormerFPNLayer +add __init__,forward + +MaskFormerFPNModel +add __init__,forward + +MaskFormerForInstanceSegmentation +add __init__,forward,get_logits,get_loss,get… + +MaskFormerForInstanceSegmentationOutput +12 attr + +MaskFormerHungarianMatcher +add __init__,__repr__,forward + +MaskFormerLoss +add __init__,_get_predictions_permutation_in… + +MaskFormerModel +add __init__,forward + +MaskFormerModelOutput +8 attr + +MaskFormerPixelDecoder +add __init__,forward + +MaskFormerPixelDecoderOutput +3 attr + +MaskFormerPixelLevelModule +add __init__,forward + +MaskFormerPixelLevelModuleOutput +4 attr + +MaskFormerPreTrainedModel +add _init_weights; 4 attr + +MaskFormerTransformerModule +add __init__,forward + +MaskformerMLPPredictionHead +add __init__,forward + +PredictionBlock +add __init__,forward + \ No newline at end of file diff --git a/maskformer.svg b/maskformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..fcccbafe44b2e62566085d3c1fa7c8caf4d4b616 --- /dev/null +++ b/maskformer.svg @@ -0,0 +1,176 @@ + + + + +maskformer +dense · 6× MHA + +MaskFormerModel · base model +6 × MaskFormerDetrDecoderLayerMaskFormerDetrDecoderLayer× 6 +Self-Attention · MaskFormerDetrCrossAttention +MLP · MaskFormerDetrMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +facebook/maskformer-swin-base… +model_type +maskformer +config +MaskFormerConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mbart.svg b/mbart.svg new file mode 100644 index 0000000000000000000000000000000000000000..a613231eacdc15b7e154d14d145eb51dd243fd13 --- /dev/null +++ b/mbart.svg @@ -0,0 +1,170 @@ + + + + +mbart +dense · 12× MHA + +MBartModel · base model +12 × MBartEncoderLayerMBartEncoderLayer× 12 +MBartForConditionalGeneration · task head +Self-Attention · MBartAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +MBartForConditionalGenerationLM HeadLinear [1024→50265] · tied +Softmax +logits[1, 6, 50265] + +model id +facebook/mbart-large-cc25 +model_type +mbart +config +MBartConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/megatron_bert.svg b/megatron_bert.svg new file mode 100644 index 0000000000000000000000000000000000000000..614d4a8a630c17626aeaba0411b7ff5286d1deff --- /dev/null +++ b/megatron_bert.svg @@ -0,0 +1,175 @@ + + + + +megatron_bert +dense · 24× MHA + +MegatronBertModel · base model +24 × MegatronBertLayerMegatronBertLayer× 24 +MegatronBertForCausalLM · task head +Self-Attention · MegatronBertAttention +self · MegatronBertSelfAttention +output · MegatronBertSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [29056 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +ln: LayerNorm 1024ln LayerNorm 1024 +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +dropout: Dropoutdropout Dropout +dense: Linear [1024→1024]dense [1024→1024] +dropout: Dropoutdropout Dropout +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +MegatronBertForCausalLMLM HeadLinear [1024→29056] · tied +Softmax +logits[1, 6, 29056] + +model id +nvidia/megatron-bert-uncased-… +model_type +megatron-bert +config +MegatronBertConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +29,056 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mellum.diff.svg b/mellum.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..293468c0a528d1bb99e6b3ff758a2f710e940001 --- /dev/null +++ b/mellum.diff.svg @@ -0,0 +1,178 @@ + + + + +mellum +diff vs qwen3_moe (+laguna) · 3 overridden · 19 added · 0 deleted · 1 new · 4 inherited-as-is + +MellumModel · base model +28 × MellumDecoderLayerMellumDecoderLayer× 28 +MellumForCausalLM · task head +Self-Attention · MellumAttention +Sparse MoE · Qwen3MoeSparseMoeBlock ↩ in…MoE +experts · Qwen3MoeExperts (×64 · dim 896) ↩ i… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [98304 × 2304] → [1, 6, 2304] +MellumRMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→4096]q_proj [2304→4096] +k_proj: Linear [2304→512]k_proj [2304→512] +v_proj: Linear [2304→512]v_proj [2304→512] +o_proj: Linear [4096→2304]o_proj [4096→2304] +q_norm: MellumRMSNorm 128q_norm RMSNorm 128 +k_norm: MellumRMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 · GQA 32:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +MellumRMSNormpre-FFN [1, 6, 2304] +act_fn: SiLUActivationact_fn SiLU +gate: MellumTopKRouter top-8 of 64gate TopKRouter top-8 of 64 +residual add+ +Final RMSNorm[1, 6, 2304] +MellumForCausalLMLM HeadLinear [2304→98304] +Softmax +logits[1, 6, 98304] + +model id +JetBrains/Mellum2-12B-A2.5B-Ba +parent +qwen3_moe +classes +8 +overridden +3 +added +19 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MellumAttention +ovr __init__ + +MellumDecoderLayer +ovr __init__ + +MellumPreTrainedModel +ovr _init_weights + +MellumConfig +add __post_init__,convert_rope_params_to_dic… + \ No newline at end of file diff --git a/mellum.svg b/mellum.svg new file mode 100644 index 0000000000000000000000000000000000000000..f867c6d0ecd27faa34fbfec63b374ae4dc31f93e --- /dev/null +++ b/mellum.svg @@ -0,0 +1,185 @@ + + + + +mellum +sparse-moe · 28× full +MoE + +MellumModel · base model +28 × MellumDecoderLayerMellumDecoderLayer× 28 +MellumForCausalLM · task head +Self-Attention · MellumAttention +Sparse MoE · MellumSparseMoeBlockMoE +experts · MellumExperts (×64 · dim 896) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [98304 × 2304] → [1, 6, 2304] +MellumRMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→4096]q_proj [2304→4096] +k_proj: Linear [2304→512]k_proj [2304→512] +v_proj: Linear [2304→512]v_proj [2304→512] +o_proj: Linear [4096→2304]o_proj [4096→2304] +q_norm: MellumRMSNorm 128q_norm RMSNorm 128 +k_norm: MellumRMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 · GQA 32:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +MellumRMSNormpre-FFN [1, 6, 2304] +act_fn: SiLUActivationact_fn SiLU +gate: MellumTopKRouter top-8 of 64gate TopKRouter top-8 of 64 +residual add+ +Final RMSNorm[1, 6, 2304] +MellumForCausalLMLM HeadLinear [2304→98304] +Softmax +logits[1, 6, 98304] + +model id +JetBrains/Mellum2-12B-A2.5B-B… +model_type +mellum +config +MellumConfig +decoder +sparse-moe +layers +28 +hidden +2,304 +intermediate +7,168 +heads / kv +32 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +98,304 +max_pos +131,072 +sliding_window +1,024 +experts (top-k) +64 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/metaclip_2.diff.svg b/metaclip_2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..533046331325912cfd70f65c2e453f92cfc352f3 --- /dev/null +++ b/metaclip_2.diff.svg @@ -0,0 +1,224 @@ + + + + +metaclip_2 +diff vs clip · 10 overridden · 0 added · 0 deleted · 3 new · 5 inherited-as-is + +MetaClip2Model · base model +12 × MetaClip2EncoderLayerMetaClip2EncoderLayer× 12 +MetaClip2ForImageClassification · task head +image ⊕ text attention +Vision encoder · MetaClip2Text…×12 +Vision encoder · MetaClip2Visio…×12 +Self-Attention · CLIPAttention ↩ inherited +CLIPEncoderLayer ↩ inherit…×12 +CLIPEncoderLayer ↩ inherit…×12 +MLP · CLIPMLP ↩ inherited +self_attn · CLIPAttention ↩ inheri… +self_attn · CLIPAttention ↩ inheri… +mlp · CLIPMLP ↩ inherited +mlp · CLIPMLP ↩ inherited + + + + + + + + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 512]+ position embeddings +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +MetaClip2ForImageClassificationLM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/metaclip-2-worldwide- +parent +clip +classes +14 +overridden +10 +added +0 +new classes +3 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MetaClip2Model +ovr __init__,forward,get_image_features,get_… + +MetaClip2PreTrainedModel +ovr _init_weights; 1 attr + +MetaClip2TextModel +ovr forward + +MetaClip2TextModelWithProjection +ovr forward + +MetaClip2VisionModel +ovr forward + +MetaClip2VisionModelWithProjection +ovr forward + +MetaClip2Config +rename only + +MetaClip2TextConfig +rename only + +MetaClip2VisionConfig +rename only + \ No newline at end of file diff --git a/metaclip_2.svg b/metaclip_2.svg new file mode 100644 index 0000000000000000000000000000000000000000..a559bfbf0e27eafb7bc0639bc7358c3adcd9a640 --- /dev/null +++ b/metaclip_2.svg @@ -0,0 +1,218 @@ + + + + +metaclip_2 +multimodal · vision+vision → projector → LLM · dense + +MetaClip2Model · base model +12 × MetaClip2EncoderLayerMetaClip2EncoderLayer× 12 +MetaClip2ForImageClassification · task head +image ⊕ text attention +Vision encoder · MetaClip2Text…×12 +Vision encoder · MetaClip2Visio…×12 +Self-Attention · MetaClip2Attention +MetaClip2EncoderLayer×12 +MetaClip2EncoderLayer×12 +MLP · MetaClip2MLP +self_attn · MetaClip2Attention +self_attn · MetaClip2Attention +mlp · MetaClip2MLP +mlp · MetaClip2MLP + + + + + + + + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 512]+ position embeddings +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +MetaClip2ForImageClassificationLM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/metaclip-2-worldwide… +inputs +input_ids, pixel_values +model_type +metaclip_2 +config +MetaClip2Config +decoder +dense +layers +12 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +49,408 +max_pos +77 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/mgp_str.svg b/mgp_str.svg new file mode 100644 index 0000000000000000000000000000000000000000..b2137c84c1d129d030ac2a55f5eccb5853fd3e53 --- /dev/null +++ b/mgp_str.svg @@ -0,0 +1,154 @@ + + + + +mgp_str +⚠ no transformer block (conv backbone) — shown from config · dense · 12× MHA + +input_ids[1, S] +Token Embedding[? × 768] +MgpstrDecoderLayerLayerNorm → MHALayerNorm → MLP×12 +Final LayerNorm +LM Head→ logits [1, S, ?] + +model id +alibaba-damo/mgp-str-base +model_type +mgp-str +config +MgpstrConfig +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/mimi.svg b/mimi.svg new file mode 100644 index 0000000000000000000000000000000000000000..24679b1240d8855eba35893f81b84734ff514adb --- /dev/null +++ b/mimi.svg @@ -0,0 +1,181 @@ + + + + +mimi +dense · 8× MHA + +MimiModel · base model +8 × MimiTransformerLayerMimiTransformerLayer× 8 +Self-Attention · MimiSdpaAttention +MLP · MimiMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +q_proj: Linear [512→512]q_proj [512→512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +o_proj: Linear [512→512]o_proj [512→512] +rotary_emb: MimiRotaryEmbeddingrotary_emb RotaryEmbedding +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→?] · tied +Softmax +logits[1, 6, ?] + +model id +kyutai/mimi +model_type +mimi +config +MimiConfig +decoder +dense +layers +8 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +8,000 +sliding_window +250 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/minicpmv4_6.diff.svg b/minicpmv4_6.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..f0e5cddd4b9b1189fcf76b1fc301a14ecd1dc9dc --- /dev/null +++ b/minicpmv4_6.diff.svg @@ -0,0 +1,271 @@ + + + + +minicpmv4_6 +diff vs siglip (+idefics3,lfm2_vl,qwen2_vl) · 9 overridden · 52 added · 0 deleted · 9 new · 1 inherited-as-is + +MiniCPMV4_6Model · base model +32 × Qwen3_5DecoderLayerQwen3_5DecoderLayer× 32 +MiniCPMV4_6ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Qwen3_5Attention +Vision encoder · MiniCPMV4_6…×12 +MiniCPMV4_6VisionEncoder…×12 +Projector · MiniCPMV4_6Merger +MLP · Qwen3_5MLP +mlp · ModuleList +self_attn · MiniCPMV4_6VisionA… +0 · MiniCPMV4_6DownsampleM… +mlp · SiglipVisionMLP ↩ inherit… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [248320 × 4096] → [1, 6, 4096] +Qwen3_5RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→8192]q_proj [4096→8192] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3_5RMSNorm 256q_norm Qwen3_5RMSNorm 256 +k_norm: Qwen3_5RMSNorm 256k_norm Qwen3_5RMSNorm 256 +scaled dot-product attention16 heads · head_dim 256 · GQA 16:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3_5RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→12288]gate_proj [4096→12288] +up_proj: Linear [4096→12288]up_proj [4096→12288] +down_proj: Linear [12288→4096]down_proj [12288→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MiniCPMV4_6ForConditionalGenerationLM HeadLinear [4096→248320] +Softmax +logits[1, 6, 248320] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +pre_norm: LayerNorm 3072pre_norm LayerNorm 3072 +linear_1: Linear [3072→3072]linear_1 [3072→3072] +act: GELUact GELU +linear_2: Linear [3072→4096]linear_2 [3072→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +openbmb/MiniCPM-V-4.6 +parent +siglip +classes +15 +overridden +9 +added +52 +new classes +9 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MiniCPMV4_6VisionAttention +ovr __init__,forward + +MiniCPMV4_6VisionEmbeddings +ovr forward + +MiniCPMV4_6VisionEncoder +ovr __init__ + +MiniCPMV4_6VisionEncoderLayer +ovr __init__ + +MiniCPMV4_6Config +add __post_init__; 13 attr + +MiniCPMV4_6DownsampleMLP +add __init__,forward + +MiniCPMV4_6ForConditionalGeneration +add __init__,_expand_inputs_for_generation,f… + +MiniCPMV4_6Merger +add __init__,forward + +MiniCPMV4_6Model +ovr __init__,forward,get_image_features,get_… + +MiniCPMV4_6PreTrainedModel +7 attr + +MiniCPMV4_6ViTWindowAttentionMerger +add __init__,_init_weights,forward,get_windo… + +MiniCPMV4_6VisionConfig +add window_hidden_size,window_intermediate_s… + +MiniCPMV4_6VisionModel +add __init__,forward,get_downsampled_inputs + +MiniCPMV4_6VisionPreTrainedModel +7 attr + \ No newline at end of file diff --git a/minicpmv4_6.svg b/minicpmv4_6.svg new file mode 100644 index 0000000000000000000000000000000000000000..9eadc9b8412328e4757868a08d09279d5e7a54df --- /dev/null +++ b/minicpmv4_6.svg @@ -0,0 +1,256 @@ + + + + +minicpmv4_6 +multimodal · vision → projector → LLM · hybrid + +MiniCPMV4_6Model · base model +32 × Qwen3_5DecoderLayerQwen3_5DecoderLayer× 32 +MiniCPMV4_6ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Qwen3_5Attention +Vision encoder · MiniCPMV4_6…×12 +MiniCPMV4_6VisionEncoder…×12 +Projector · MiniCPMV4_6Merger +MLP · Qwen3_5MLP +mlp · ModuleList +self_attn · MiniCPMV4_6VisionA… +0 · MiniCPMV4_6DownsampleM… +mlp · MiniCPMV4_6VisionMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [248320 × 4096] → [1, 6, 4096] +Qwen3_5RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→8192]q_proj [4096→8192] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3_5RMSNorm 256q_norm Qwen3_5RMSNorm 256 +k_norm: Qwen3_5RMSNorm 256k_norm Qwen3_5RMSNorm 256 +scaled dot-product attention16 heads · head_dim 256 · GQA 16:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3_5RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→12288]gate_proj [4096→12288] +up_proj: Linear [4096→12288]up_proj [4096→12288] +down_proj: Linear [12288→4096]down_proj [12288→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MiniCPMV4_6ForConditionalGenerationLM HeadLinear [4096→248320] +Softmax +logits[1, 6, 248320] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +pre_norm: LayerNorm 3072pre_norm LayerNorm 3072 +linear_1: Linear [3072→3072]linear_1 [3072→3072] +act: GELUact GELU +linear_2: Linear [3072→4096]linear_2 [3072→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +openbmb/MiniCPM-V-4.6 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +minicpmv4_6 +config +MiniCPMV4_6Config +decoder +hybrid +layers +32 +hidden +4,096 +intermediate +12,288 +heads / kv +16 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +248,320 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +linear + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/minimax.diff.svg b/minimax.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..744bcdd818a4aa3cae87873e914db77d7a374ff9 --- /dev/null +++ b/minimax.diff.svg @@ -0,0 +1,224 @@ + + + + +minimax +diff vs mixtral (+gemma2) · 7 overridden · 50 added · 0 deleted · 3 new · 8 inherited-as-is + +MiniMaxModel · base model +32 × MiniMaxDecoderLayerMiniMaxDecoderLayer× 32 +MiniMaxForCausalLM · task head +layers (idx) +Self-Attention · MixtralAttention (2 layer types — modules differ ▼) ↩ inherited +Sparse MoE · MixtralSparseMoeBlock ↩ inher…MoE +experts · MixtralExperts (×8 · dim 14336) ↩ inh… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MiniMaxRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +act_fn: SiLUActivationact_fn SiLU +norm: MiniMaxRMSNorm 4096norm RMSNorm 4096 +qkv_proj: Linear [4096→12288]qkv_proj [4096→12288] +out_proj: Linear [4096→4096]out_proj [4096→4096] +output_gate: Linear [4096→4096]output_gate [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +full_attention attention mask (q↓ × k→)full mask +linear_attention attention mask (q↓ × k→)linear mask +RoPErotary positions → Q, K +residual add+ +MiniMaxRMSNormpre-FFN [1, 6, 4096] +gate: MiniMaxTopKRouter top-2 of 8gate TopKRouter top-2 of 8 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MiniMaxForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +layer 0: full_attention0 +layer 1: linear_attention1 +layer 2: full_attention2 +layer 3: linear_attention3 +layer 4: full_attention4 +layer 5: linear_attention5 +layer 6: full_attention6 +layer 7: linear_attention7 +layer 8: full_attention8 +layer 9: linear_attention9 +layer 10: full_attention10 +layer 11: linear_attention11 +layer 12: full_attention12 +layer 13: linear_attention13 +layer 14: full_attention14 +layer 15: linear_attention15 +layer 16: full_attention16 +layer 17: linear_attention17 +layer 18: full_attention18 +layer 19: linear_attention19 +layer 20: full_attention20 +layer 21: linear_attention21 +layer 22: full_attention22 +layer 23: linear_attention23 +layer 24: full_attention24 +layer 25: linear_attention25 +layer 26: full_attention26 +layer 27: linear_attention27 +layer 28: full_attention28 +layer 29: linear_attention29 +layer 30: full_attention30 +layer 31: linear_attention31 + +model id +MiniMaxAI/MiniMax-Text-01-hf +parent +mixtral +classes +15 +overridden +7 +added +50 +new classes +3 +inherited as-is +8 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MiniMaxDecoderLayer +ovr __init__,forward + +MiniMaxForCausalLM +ovr forward + +MiniMaxModel +ovr forward + +MiniMaxPreTrainedModel +ovr _init_weights; 2 attr + +MiniMaxCache +add __init__,__len__,batch_repeat_interleave… + +MiniMaxConfig +add __post_init__; 38 attr + +MiniMaxLightningAttention +add __init__,decay_factors,forward,get_slope… + \ No newline at end of file diff --git a/minimax.svg b/minimax.svg new file mode 100644 index 0000000000000000000000000000000000000000..7ce60ee688675bf988ca92f200deba382abb1989 --- /dev/null +++ b/minimax.svg @@ -0,0 +1,224 @@ + + + + +minimax +hybrid · 16× full +MoE + 16× linear +MoE + +MiniMaxModel · base model +32 × MiniMaxDecoderLayerMiniMaxDecoderLayer× 32 +MiniMaxForCausalLM · task head +layers (idx) +Self-Attention · MiniMaxAttention (2 layer types — modules differ ▼) +Sparse MoE · MiniMaxSparseMoeBlockMoE +experts · MiniMaxExperts (×8 · dim 14336) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MiniMaxRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +act_fn: SiLUActivationact_fn SiLU +norm: MiniMaxRMSNorm 4096norm RMSNorm 4096 +qkv_proj: Linear [4096→12288]qkv_proj [4096→12288] +out_proj: Linear [4096→4096]out_proj [4096→4096] +output_gate: Linear [4096→4096]output_gate [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +full_attention attention mask (q↓ × k→)full mask +linear_attention attention mask (q↓ × k→)linear mask +RoPErotary positions → Q, K +residual add+ +MiniMaxRMSNormpre-FFN [1, 6, 4096] +gate: MiniMaxTopKRouter top-2 of 8gate TopKRouter top-2 of 8 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MiniMaxForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +layer 0: full_attention0 +layer 1: linear_attention1 +layer 2: full_attention2 +layer 3: linear_attention3 +layer 4: full_attention4 +layer 5: linear_attention5 +layer 6: full_attention6 +layer 7: linear_attention7 +layer 8: full_attention8 +layer 9: linear_attention9 +layer 10: full_attention10 +layer 11: linear_attention11 +layer 12: full_attention12 +layer 13: linear_attention13 +layer 14: full_attention14 +layer 15: linear_attention15 +layer 16: full_attention16 +layer 17: linear_attention17 +layer 18: full_attention18 +layer 19: linear_attention19 +layer 20: full_attention20 +layer 21: linear_attention21 +layer 22: full_attention22 +layer 23: linear_attention23 +layer 24: full_attention24 +layer 25: linear_attention25 +layer 26: full_attention26 +layer 27: linear_attention27 +layer 28: full_attention28 +layer 29: linear_attention29 +layer 30: full_attention30 +layer 31: linear_attention31 + +model id +MiniMaxAI/MiniMax-Text-01-hf +model_type +minimax +config +MiniMaxConfig +decoder +hybrid +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +131,072 +experts (top-k) +8 (top-2) +tie_embeddings +False +legend + +self-attention + +full + +linear + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/minimax_m2.diff.svg b/minimax_m2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..1a1edb6284ee9b650cd928ca0f425df84bda30de --- /dev/null +++ b/minimax_m2.diff.svg @@ -0,0 +1,184 @@ + + + + +minimax_m2 +diff vs mixtral (+flex_olmo,glm4_moe) · 6 overridden · 29 added · 0 deleted · 1 new · 4 inherited-as-is + +MiniMaxM2Model · base model +62 × MiniMaxM2DecoderLayerMiniMaxM2DecoderLayer× 62 +MiniMaxM2ForCausalLM · task head +Self-Attention · MiniMaxM2Attention +Sparse MoE · MiniMaxM2SparseMoeBlockMoE +experts · MixtralExperts (×256 · dim 1536) ↩ i… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [200064 × 3072] → [1, 6, 3072] +MiniMaxM2RMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→6144]q_proj [3072→6144] +k_proj: Linear [3072→1024]k_proj [3072→1024] +v_proj: Linear [3072→1024]v_proj [3072→1024] +o_proj: Linear [6144→3072]o_proj [6144→3072] +q_norm: MiniMaxM2RMSNorm 6144q_norm RMSNorm 6144 +k_norm: MiniMaxM2RMSNorm 1024k_norm RMSNorm 1024 +scaled dot-product attention48 heads · head_dim 128 · GQA 48:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MiniMaxM2RMSNormpre-FFN [1, 6, 3072] +gate: MiniMaxM2TopKRouter top-8 of 256gate TopKRouter top-8 of 256 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +MiniMaxM2ForCausalLMLM HeadLinear [3072→200064] +Softmax +logits[1, 6, 200064] + +model id +MiniMaxAI/MiniMax-Text-01-hf +parent +mixtral +classes +10 +overridden +6 +added +29 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MiniMaxM2Attention +ovr __init__ + +MiniMaxM2Model +ovr forward + +MiniMaxM2PreTrainedModel +ovr _init_weights + +MiniMaxM2SparseMoeBlock +ovr __init__,forward + +MiniMaxM2TopKRouter +ovr forward + +MiniMaxM2Config +29 attr + \ No newline at end of file diff --git a/minimax_m2.svg b/minimax_m2.svg new file mode 100644 index 0000000000000000000000000000000000000000..5316c0f0af77449b0f38145c17d509ab67c566fe --- /dev/null +++ b/minimax_m2.svg @@ -0,0 +1,183 @@ + + + + +minimax_m2 +sparse-moe · 62× GQA +MoE + +MiniMaxM2Model · base model +62 × MiniMaxM2DecoderLayerMiniMaxM2DecoderLayer× 62 +MiniMaxM2ForCausalLM · task head +Self-Attention · MiniMaxM2Attention +Sparse MoE · MiniMaxM2SparseMoeBlockMoE +experts · MiniMaxM2Experts (×256 · dim 1536) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [200064 × 3072] → [1, 6, 3072] +MiniMaxM2RMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→6144]q_proj [3072→6144] +k_proj: Linear [3072→1024]k_proj [3072→1024] +v_proj: Linear [3072→1024]v_proj [3072→1024] +o_proj: Linear [6144→3072]o_proj [6144→3072] +q_norm: MiniMaxM2RMSNorm 6144q_norm RMSNorm 6144 +k_norm: MiniMaxM2RMSNorm 1024k_norm RMSNorm 1024 +scaled dot-product attention48 heads · head_dim 128 · GQA 48:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MiniMaxM2RMSNormpre-FFN [1, 6, 3072] +gate: MiniMaxM2TopKRouter top-8 of 256gate TopKRouter top-8 of 256 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +MiniMaxM2ForCausalLMLM HeadLinear [3072→200064] +Softmax +logits[1, 6, 200064] + +model id +MiniMaxAI/MiniMax-Text-01-hf +model_type +minimax_m2 +config +MiniMaxM2Config +decoder +sparse-moe +layers +62 +hidden +3,072 +intermediate +1,536 +heads / kv +48 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +200,064 +max_pos +196,608 +experts (top-k) +256 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ministral.diff.svg b/ministral.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6855170e5fe09ae8a697b7ad93c4cba0c65fe2a1 --- /dev/null +++ b/ministral.diff.svg @@ -0,0 +1,174 @@ + + + + +ministral +diff vs qwen2 · 3 overridden · 3 added · 0 deleted · 1 new · 9 inherited-as-is + +MinistralModel · base model +32 × MinistralDecoderLayerMinistralDecoderLayer× 32 +MinistralForCausalLM · task head +Self-Attention · MinistralAttention +MLP · Qwen2MLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MinistralRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +MinistralRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MinistralForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +mistralai/Ministral-8B-Instruc +parent +qwen2 +classes +12 +overridden +3 +added +3 +new classes +1 +inherited as-is +9 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MinistralAttention +ovr __init__ + +MinistralModel +ovr __init__,forward + +MinistralConfig +add __post_init__; 2 attr + \ No newline at end of file diff --git a/ministral.svg b/ministral.svg new file mode 100644 index 0000000000000000000000000000000000000000..64196e83b8c928a6876d8d7810bf656d3eb6506a --- /dev/null +++ b/ministral.svg @@ -0,0 +1,182 @@ + + + + +ministral +dense · 32× sliding + +MinistralModel · base model +32 × MinistralDecoderLayerMinistralDecoderLayer× 32 +MinistralForCausalLM · task head +Self-Attention · MinistralAttention +MLP · MinistralMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MinistralRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +MinistralRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MinistralForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +mistralai/Ministral-8B-Instru… +model_type +ministral +config +MinistralConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +131,072 +sliding_window +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ministral3.diff.svg b/ministral3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6bee62c9b5a0af2ac141c62a8c0456a8e614007b --- /dev/null +++ b/ministral3.diff.svg @@ -0,0 +1,177 @@ + + + + +ministral3 +diff vs mistral · 1 overridden · 0 added · 0 deleted · 3 new · 4 inherited-as-is + +Ministral3Model · base model +34 × Ministral3DecoderLayerMinistral3DecoderLayer× 34 +Ministral3ForCausalLM · task head +Self-Attention · Ministral3Attention +MLP · MistralMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 4096] → [1, 6, 4096] +Ministral3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Ministral3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Ministral3ForCausalLMLM HeadLinear [4096→131072] +Softmax +logits[1, 6, 131072] + +model id +mistralai/Ministral-3-8B-Base- +parent +mistral +classes +8 +overridden +1 +added +0 +new classes +3 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Ministral3Attention +ovr forward + +Ministral3ForQuestionAnswering +rename only + +Ministral3ForSequenceClassification +rename only + +Ministral3ForTokenClassification +rename only + \ No newline at end of file diff --git a/ministral3.svg b/ministral3.svg new file mode 100644 index 0000000000000000000000000000000000000000..0f88bb84fa826b84e7370e79a58f79f9591009a1 --- /dev/null +++ b/ministral3.svg @@ -0,0 +1,180 @@ + + + + +ministral3 +dense · 34× GQA + +Ministral3Model · base model +34 × Ministral3DecoderLayerMinistral3DecoderLayer× 34 +Ministral3ForCausalLM · task head +Self-Attention · Ministral3Attention +MLP · Ministral3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 4096] → [1, 6, 4096] +Ministral3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Ministral3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Ministral3ForCausalLMLM HeadLinear [4096→131072] +Softmax +logits[1, 6, 131072] + +model id +mistralai/Ministral-3-8B-Base… +model_type +ministral3 +config +Ministral3Config +decoder +dense +layers +34 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +131,072 +max_pos +262,144 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mistral.diff.svg b/mistral.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..33ac38947a7601e194bc48e06b645e0f2aac564d --- /dev/null +++ b/mistral.diff.svg @@ -0,0 +1,183 @@ + + + + +mistral +diff vs llama · 6 overridden · 0 added · 0 deleted · 1 new · 3 inherited-as-is + +MistralModel · base model +32 × MistralDecoderLayerMistralDecoderLayer× 32 +MistralForCausalLM · task head +Self-Attention · MistralAttention +MLP · MistralMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MistralRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MistralRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MistralForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +mistralai/Mistral-7B-v0.1 +parent +llama +classes +9 +overridden +6 +added +0 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MistralAttention +ovr __init__,forward + +MistralDecoderLayer +ovr __init__ + +MistralMLP +ovr __init__ + +MistralModel +ovr forward + +MistralPreTrainedModel +1 attr + +MistralForQuestionAnswering +rename only + \ No newline at end of file diff --git a/mistral.svg b/mistral.svg new file mode 100644 index 0000000000000000000000000000000000000000..bf93375b54e3cc57861dbb1786516d520a00dc69 --- /dev/null +++ b/mistral.svg @@ -0,0 +1,182 @@ + + + + +mistral +dense · 32× GQA + +MistralModel · base model +32 × MistralDecoderLayerMistralDecoderLayer× 32 +MistralForCausalLM · task head +Self-Attention · MistralAttention +MLP · MistralMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MistralRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MistralRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MistralForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +mistralai/Mistral-7B-v0.1 +model_type +mistral +config +MistralConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +131,072 +sliding_window +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mistral3.diff.svg b/mistral3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..12c357808192407e844e37e022a3a91e4199e054 --- /dev/null +++ b/mistral3.diff.svg @@ -0,0 +1,207 @@ + + + + +mistral3 +diff vs llava (+mistral) · 4 overridden · 4 added · 0 deleted · 2 new · 4 inherited-as-is + +Mistral3Model · base model +40 × MistralDecoderLayerMistralDecoderLayer× 40 +Mistral3ForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · PixtralVisionM…×24 +Self-Attention · MistralAttention +PixtralAttentionLayer×24 +Projector · Mistral3MultiModalProject… +MLP · MistralMLP +feed_forward · PixtralMLP +attention · PixtralAttention +patch_merger · Mistral3PatchMerg… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 5120] → [1, 6, 5120] +MistralRMSNormpre-attention [1, 6, 5120] +q_proj: Linear [5120→4096]q_proj [5120→4096] +k_proj: Linear [5120→1024]k_proj [5120→1024] +v_proj: Linear [5120→1024]v_proj [5120→1024] +o_proj: Linear [4096→5120]o_proj [4096→5120] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MistralRMSNormpre-FFN [1, 6, 5120] +gate_proj: Linear [5120→32768]gate_proj [5120→32768] +up_proj: Linear [5120→32768]up_proj [5120→32768] +down_proj: Linear [32768→5120]down_proj [32768→5120] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 5120] +Mistral3ForConditionalGenerationLM HeadLinear [5120→131072] · tied +Softmax +logits[1, 6, 131072] +example image +pixel_values[1, 3, 336, 336] +attention_norm: PixtralRMSNorm 1024attention_normPixtralRMSNorm 1024 +gate_proj: Linear [1024→4096]gate_proj [1024→4096] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: GELUActivationact_fn GELU +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +ffn_norm: PixtralRMSNorm 1024ffn_norm PixtralRMSNorm 1024 +norm: Mistral3RMSNorm 1024norm RMSNorm 1024 +merging_layer: Linear [4096→1024]merging_layer [4096→1024] +linear_1: Linear [1024→5120]linear_1 [1024→5120] +act: GELUActivationact GELU +linear_2: Linear [5120→5120]linear_2 [5120→5120] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +mistralai/Mistral-Small-3.1-24 +parent +llava +classes +8 +overridden +4 +added +4 +new classes +2 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Mistral3ForConditionalGeneration +ovr forward,get_image_features + +Mistral3Model +ovr forward,get_image_features + +Mistral3MultiModalProjector +add __init__,forward + +Mistral3PatchMerger +add __init__,forward + \ No newline at end of file diff --git a/mistral3.svg b/mistral3.svg new file mode 100644 index 0000000000000000000000000000000000000000..e537d52fd5829e223a83229450085a59f7f28b18 --- /dev/null +++ b/mistral3.svg @@ -0,0 +1,218 @@ + + + + +mistral3 +multimodal · vision → projector → LLM · dense + +Mistral3Model · base model +40 × MistralDecoderLayerMistralDecoderLayer× 40 +Mistral3ForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · PixtralVisionM…×24 +Self-Attention · MistralAttention +PixtralAttentionLayer×24 +Projector · Mistral3MultiModalProject… +MLP · MistralMLP +feed_forward · PixtralMLP +attention · PixtralAttention +patch_merger · Mistral3PatchMerg… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 5120] → [1, 6, 5120] +MistralRMSNormpre-attention [1, 6, 5120] +q_proj: Linear [5120→4096]q_proj [5120→4096] +k_proj: Linear [5120→1024]k_proj [5120→1024] +v_proj: Linear [5120→1024]v_proj [5120→1024] +o_proj: Linear [4096→5120]o_proj [4096→5120] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MistralRMSNormpre-FFN [1, 6, 5120] +gate_proj: Linear [5120→32768]gate_proj [5120→32768] +up_proj: Linear [5120→32768]up_proj [5120→32768] +down_proj: Linear [32768→5120]down_proj [32768→5120] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 5120] +Mistral3ForConditionalGenerationLM HeadLinear [5120→131072] · tied +Softmax +logits[1, 6, 131072] +example image +pixel_values[1, 3, 336, 336] +attention_norm: PixtralRMSNorm 1024attention_normPixtralRMSNorm 1024 +gate_proj: Linear [1024→4096]gate_proj [1024→4096] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: GELUActivationact_fn GELU +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +ffn_norm: PixtralRMSNorm 1024ffn_norm PixtralRMSNorm 1024 +norm: Mistral3RMSNorm 1024norm RMSNorm 1024 +merging_layer: Linear [4096→1024]merging_layer [4096→1024] +linear_1: Linear [1024→5120]linear_1 [1024→5120] +act: GELUActivationact GELU +linear_2: Linear [5120→5120]linear_2 [5120→5120] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +mistralai/Mistral-Small-3.1-2… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +mistral3 +config +Mistral3Config +decoder +dense +layers +40 +hidden +5,120 +intermediate +32,768 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +131,072 +max_pos +131,072 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/mistral4.diff.svg b/mistral4.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..dbdde5167909e04046e5c266002728757f1d9d81 --- /dev/null +++ b/mistral4.diff.svg @@ -0,0 +1,193 @@ + + + + +mistral4 +diff vs llama (+deepseek_v3,qwen2_moe) · 4 overridden · 16 added · 0 deleted · 4 new · 6 inherited-as-is + +Mistral4Model · base model +36 × Mistral4DecoderLayerMistral4DecoderLayer× 36 +Mistral4ForCausalLM · task head +Self-Attention · Mistral4Attention +Sparse MoE · Mistral4MoEMoE +shared_experts · LlamaMLP (×128 · dim 2048)… +experts · LlamaNaiveMoe (×128 · dim 2048) ↩… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 4096] → [1, 6, 4096] +Mistral4RMSNormpre-attention [1, 6, 4096] +q_a_proj: Linear [4096→1024]q_a_proj [4096→1024] +q_a_layernorm: Mistral4RMSNorm 1024q_a_layernorm RMSNorm 1024 +q_b_proj: Linear [1024→4096]q_b_proj [1024→4096] +kv_a_proj_with_mqa: Linear [4096→320]kv_a_proj_with_mqa [4096→320] +kv_a_layernorm: Mistral4RMSNorm 256kv_a_layernorm RMSNorm 256 +kv_b_proj: Linear [256→6144]kv_b_proj [256→6144] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Mistral4RMSNormpre-FFN [1, 6, 4096] +act_fn: SiLUActivationact_fn SiLU +gate: Mistral4TopkRouter top-4 of 128gate TopkRouter top-4 of 128 +gate_proj: Linear [4096→2048]gate_proj [4096→2048] +up_proj: Linear [4096→2048]up_proj [4096→2048] +down_proj: Linear [2048→4096]down_proj [2048→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Mistral4ForCausalLMLM HeadLinear [4096→131072] +Softmax +logits[1, 6, 131072] + +model id +mistralai/Mistral-Small-4-119B +parent +llama +classes +13 +overridden +4 +added +16 +new classes +4 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Mistral4Attention +ovr __init__,forward + +Mistral4DecoderLayer +ovr __init__ + +Mistral4MoE +ovr route_tokens_to_experts + +Mistral4ForSequenceClassification +rename only + +Mistral4ForTokenClassification +rename only + +Mistral4PreTrainedModel +add _init_weights; 13 attr + +Mistral4TopkRouter +add __init__,forward + \ No newline at end of file diff --git a/mistral4.svg b/mistral4.svg new file mode 100644 index 0000000000000000000000000000000000000000..0447ef1bb4dac91b566814c472c567fcd6127f04 --- /dev/null +++ b/mistral4.svg @@ -0,0 +1,189 @@ + + + + +mistral4 +sparse-moe · 36× MLA +MoE + +Mistral4Model · base model +36 × Mistral4DecoderLayerMistral4DecoderLayer× 36 +Mistral4ForCausalLM · task head +Self-Attention · Mistral4Attention +Sparse MoE · Mistral4MoEMoE +shared_experts · Mistral4MLP (×128 · dim 204… +experts · Mistral4NaiveMoe (×128 · dim 2048) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 4096] → [1, 6, 4096] +Mistral4RMSNormpre-attention [1, 6, 4096] +q_a_proj: Linear [4096→1024]q_a_proj [4096→1024] +q_a_layernorm: Mistral4RMSNorm 1024q_a_layernorm RMSNorm 1024 +q_b_proj: Linear [1024→4096]q_b_proj [1024→4096] +kv_a_proj_with_mqa: Linear [4096→320]kv_a_proj_with_mqa [4096→320] +kv_a_layernorm: Mistral4RMSNorm 256kv_a_layernorm RMSNorm 256 +kv_b_proj: Linear [256→6144]kv_b_proj [256→6144] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Mistral4RMSNormpre-FFN [1, 6, 4096] +act_fn: SiLUActivationact_fn SiLU +gate: Mistral4TopkRouter top-4 of 128gate TopkRouter top-4 of 128 +gate_proj: Linear [4096→2048]gate_proj [4096→2048] +up_proj: Linear [4096→2048]up_proj [4096→2048] +down_proj: Linear [2048→4096]down_proj [2048→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Mistral4ForCausalLMLM HeadLinear [4096→131072] +Softmax +logits[1, 6, 131072] + +model id +mistralai/Mistral-Small-4-119… +model_type +mistral4 +config +Mistral4Config +decoder +sparse-moe +layers +36 +hidden +4,096 +intermediate +12,288 +heads / kv +32 / 32 +attention +MLA +norm +RMSNorm +positional +RoPE +vocab +131,072 +max_pos +1,048,576 +experts (top-k) +128 (top-4) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mixtral.diff.svg b/mixtral.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..fb5d23089e5a8d6a2a0b62ecd8ca47fbf97be31d --- /dev/null +++ b/mixtral.diff.svg @@ -0,0 +1,185 @@ + + + + +mixtral +diff vs mistral · 5 overridden · 9 added · 0 deleted · 4 new · 6 inherited-as-is + +MixtralModel · base model +32 × MixtralDecoderLayerMixtralDecoderLayer× 32 +MixtralForCausalLM · task head +Self-Attention · MistralAttention ↩ inherited +Sparse MoE · MixtralSparseMoeBlockMoE +experts · MixtralExperts (×8 · dim 14336) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MixtralRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MixtralRMSNormpre-FFN [1, 6, 4096] +gate: MixtralTopKRouter top-2 of 8gate TopKRouter top-2 of 8 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MixtralForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +mistralai/Mixtral-8x7B-v0.1 +parent +mistral +classes +13 +overridden +5 +added +9 +new classes +4 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MixtralForCausalLM +ovr __init__,forward; 1 attr + +MixtralModel +ovr forward + +MixtralDecoderLayer +add __init__,forward + +MixtralExperts +add __init__,forward + +MixtralPreTrainedModel +add _init_weights; 1 attr + +MixtralSparseMoeBlock +add __init__,forward + +MixtralTopKRouter +add __init__,forward + \ No newline at end of file diff --git a/mixtral.svg b/mixtral.svg new file mode 100644 index 0000000000000000000000000000000000000000..a6c75735a1aa454146b17046ce8794c057b0c4d9 --- /dev/null +++ b/mixtral.svg @@ -0,0 +1,181 @@ + + + + +mixtral +sparse-moe · 32× GQA +MoE + +MixtralModel · base model +32 × MixtralDecoderLayerMixtralDecoderLayer× 32 +MixtralForCausalLM · task head +Self-Attention · MixtralAttention +Sparse MoE · MixtralSparseMoeBlockMoE +experts · MixtralExperts (×8 · dim 14336) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MixtralRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MixtralRMSNormpre-FFN [1, 6, 4096] +gate: MixtralTopKRouter top-2 of 8gate TopKRouter top-2 of 8 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MixtralForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +mistralai/Mixtral-8x7B-v0.1 +model_type +mixtral +config +MixtralConfig +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +131,072 +experts (top-k) +8 (top-2) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mlcd.diff.svg b/mlcd.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0a224a361366c043b21f21428cae48c372b18ffb --- /dev/null +++ b/mlcd.diff.svg @@ -0,0 +1,187 @@ + + + + +mlcd +diff vs clip (+qwen2_vl) · 11 overridden · 26 added · 0 deleted · 2 new · 1 inherited-as-is + +MLCDVisionModel · base model +48 × MLCDEncoderLayerMLCDEncoderLayer× 48 +Self-Attention · MLCDAttention +MLP · MLCDMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1664] → [1, 6, 1664] +LayerNormpre-attention [1, 6, 1664] +k_proj: Linear [1664→1664]k_proj [1664→1664] +v_proj: Linear [1664→1664]v_proj [1664→1664] +q_proj: Linear [1664→1664]q_proj [1664→1664] +out_proj: Linear [1664→1664]out_proj [1664→1664] +scaled dot-product attention16 heads · head_dim 104 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1664] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1664→8192]fc1 [1664→8192] +fc2: Linear [8192→1664]fc2 [8192→1664] +residual add+ +Final LayerNorm[1, 6, 1664] +LM HeadLinear [1664→?] +Softmax +logits[1, 6, ?] + +model id +DeepGlint-AI/mlcd-vit-bigG-pat +parent +clip +classes +9 +overridden +11 +added +26 +new classes +2 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MLCDAttention +ovr __init__,forward + +MLCDEncoder +ovr __init__,forward + +MLCDEncoderLayer +ovr __init__,forward + +MLCDRotaryEmbedding +ovr forward + +MLCDVisionEmbeddings +ovr __init__,forward + +MLCDVisionModel +ovr __init__,forward + +MLCDPreTrainedModel +add _init_weights; 10 attr + +MLCDVisionConfig +15 attr + \ No newline at end of file diff --git a/mlcd.svg b/mlcd.svg new file mode 100644 index 0000000000000000000000000000000000000000..541c86f66c20a2320d83a2d1bc2214a0af54eb77 --- /dev/null +++ b/mlcd.svg @@ -0,0 +1,178 @@ + + + + +mlcd +dense · 48× MHA + +MLCDVisionModel · base model +48 × MLCDEncoderLayerMLCDEncoderLayer× 48 +Self-Attention · MLCDAttention +MLP · MLCDMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1664] → [1, 6, 1664] +LayerNormpre-attention [1, 6, 1664] +k_proj: Linear [1664→1664]k_proj [1664→1664] +v_proj: Linear [1664→1664]v_proj [1664→1664] +q_proj: Linear [1664→1664]q_proj [1664→1664] +out_proj: Linear [1664→1664]out_proj [1664→1664] +scaled dot-product attention16 heads · head_dim 104 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1664] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1664→8192]fc1 [1664→8192] +fc2: Linear [8192→1664]fc2 [8192→1664] +residual add+ +Final LayerNorm[1, 6, 1664] +LM HeadLinear [1664→?] +Softmax +logits[1, 6, ?] + +model id +DeepGlint-AI/mlcd-vit-bigG-pa… +model_type +mlcd +config +MLCDVisionConfig +decoder +dense +layers +48 +hidden +1,664 +intermediate +8,192 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mllama.svg b/mllama.svg new file mode 100644 index 0000000000000000000000000000000000000000..eb00bb4ab426f5910968b3114bedea3f977d24d9 --- /dev/null +++ b/mllama.svg @@ -0,0 +1,217 @@ + + + + +mllama +multimodal · vision → projector → LLM · dense + +MllamaModel · base model +40 × MllamaSelfAttentionDecoderLayerMllamaSelfAttentionDecoderLayer× 40 +MllamaForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · MllamaTextSelfAttention (2 layer types — modules differ ▼) +Vision encoder · MllamaVision…×32 +MllamaVisionEncoderLayer×32 +MLP · MllamaTextMLP +self_attn · MllamaVisionAttention +mlp · MllamaVisionMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 4096] → [1, 6, 4096] +MllamaTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: MllamaTextRMSNorm 128q_norm TextRMSNorm 128 +k_norm: MllamaTextRMSNorm 128k_norm TextRMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MllamaTextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→14336]gate_proj [4096→14336] +up_proj: Linear [4096→14336]up_proj [4096→14336] +down_proj: Linear [14336→4096]down_proj [14336→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MllamaForConditionalGenerationLM HeadLinear [4096→128256] +Softmax +logits[1, 6, 128256] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +input_layernorm: LayerNorm 1280input_layernormLayerNorm 1280 +post_attention_layernorm: LayerNorm 1280post_attention_layernormLayerNorm 1280 +Projector · Linearalign features → text hidden dim +cross-attention @ 8 la… +image↓text query × image|text key5 img + 7 text · fully causal + +model id +meta-llama/Llama-3.2-11B-Visi… +inputs +input_ids, pixel_values +model_type +mllama +config +MllamaConfig +decoder +dense +layers +40 +hidden +4,096 +intermediate +14,336 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +128,256 +max_pos +131,072 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + +cross-attention + \ No newline at end of file diff --git a/mm_grounding_dino.diff.svg b/mm_grounding_dino.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..de4862be840aec885e4a526e0d725639ccf42987 --- /dev/null +++ b/mm_grounding_dino.diff.svg @@ -0,0 +1,174 @@ + + + + +mm_grounding_dino +diff vs grounding_dino · 6 overridden · 42 added · 0 deleted · 1 new · 5 inherited-as-is + +MMGroundingDinoModel · base model +12 × BertLayerBertLayer× 12 +Self-Attention · BertAttention +output · BertSelfOutput +self · BertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +openmmlab-community/mm_groundi +parent +grounding_dino +classes +10 +overridden +6 +added +42 +new classes +1 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MMGroundingDinoContrastiveEmbedding +ovr __init__,forward + +MMGroundingDinoForObjectDetection +ovr __init__; 1 attr + +MMGroundingDinoModel +ovr __init__ + +MMGroundingDinoPreTrainedModel +ovr _init_weights + +MMGroundingDinoConfig +add __post_init__; 41 attr + \ No newline at end of file diff --git a/mm_grounding_dino.svg b/mm_grounding_dino.svg new file mode 100644 index 0000000000000000000000000000000000000000..3bb05bfa64ca9b186d0a9cd1fd8962c2fac7f706 --- /dev/null +++ b/mm_grounding_dino.svg @@ -0,0 +1,174 @@ + + + + +mm_grounding_dino +dense · 12× MHA + +MMGroundingDinoModel · base model +12 × BertLayerBertLayer× 12 +Self-Attention · BertAttention +output · BertSelfOutput +self · BertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +openmmlab-community/mm_ground… +model_type +mm-grounding-dino +config +MMGroundingDinoConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mobilebert.svg b/mobilebert.svg new file mode 100644 index 0000000000000000000000000000000000000000..d0261a08035d8fe64036b961c175313919b24447 --- /dev/null +++ b/mobilebert.svg @@ -0,0 +1,200 @@ + + + + +mobilebert +dense · 24× MHA + +MobileBertModel · base model +24 × MobileBertLayerMobileBertLayer× 24 +MobileBertForMaskedLM · task head +MLP · ModuleList +Self-Attention · MobileBertAttention +0 · FFNLayer +1 · FFNLayer +2 · FFNLayer +self · MobileBertSelfAttention +output · MobileBertSelfOutput +intermediate · MobileBertIntermediate +output · FFNOutput +intermediate · MobileBertIntermediate +output · FFNOutput +intermediate · MobileBertIntermediate +output · FFNOutput + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 512] → [1, 6, 512] +Normpre-attention [1, 6, 512] +query: Linear [128→128]query [128→128] +key: Linear [128→128]key [128→128] +value: Linear [512→128]value [512→128] +dropout: Dropoutdropout Dropout +dense: Linear [128→128]dense [128→128] +LayerNorm: NoNorm 128LayerNorm NoNorm 128 +scaled dot-product attention4 heads · head_dim 128 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Normpre-FFN [1, 6, 512] +dense: Linear [128→512]dense [128→512] +intermediate_act_fn: ReLUintermediate_act_fn ReLU +dense: Linear [512→128]dense [512→128] +LayerNorm: NoNorm 128LayerNorm NoNorm 128 +dense: Linear [128→512]dense [128→512] +intermediate_act_fn: ReLUintermediate_act_fn ReLU +dense: Linear [512→128]dense [512→128] +LayerNorm: NoNorm 128LayerNorm NoNorm 128 +dense: Linear [128→512]dense [128→512] +intermediate_act_fn: ReLUintermediate_act_fn ReLU +dense: Linear [512→128]dense [512→128] +LayerNorm: NoNorm 128LayerNorm NoNorm 128 +residual add+ +Final NoNorm[1, 6, 512] +MobileBertForMaskedLMPool (CLS / mean)[1, 6, 512] → [1, 512] +MobileBertForMaskedLMClassifier headLinear [512→2] +Softmax +class logits[1, 2] (2 classes) + +model id +google/mobilebert-uncased +model_type +mobilebert +config +MobileBertConfig +decoder +dense +layers +24 +hidden +512 +intermediate +512 +heads / kv +4 / 4 +attention +MHA +norm +NoNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mobilenet_v1.svg b/mobilenet_v1.svg new file mode 100644 index 0000000000000000000000000000000000000000..499862f45f2be970361385201a23b8ce04d8ad02 --- /dev/null +++ b/mobilenet_v1.svg @@ -0,0 +1,154 @@ + + + + +mobilenet_v1 +⚠ no transformer block (conv backbone) — shown from config · dense · 26× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +MobileNetV1ConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×26 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +google/mobilenet_v1_1.0_224 +model_type +mobilenet_v1 +config +MobileNetV1Config +decoder +dense +layers +26 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/mobilenet_v2.svg b/mobilenet_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..0b74f67801b960877d873198d5c68cff18a0f7d9 --- /dev/null +++ b/mobilenet_v2.svg @@ -0,0 +1,154 @@ + + + + +mobilenet_v2 +⚠ no transformer block (conv backbone) — shown from config · dense · 16× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +MobileNetV2InvertedResidualBatchNorm2d → attentionBatchNorm2d → MLP×16 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +google/mobilenet_v2_1.0_224 +model_type +mobilenet_v2 +config +MobileNetV2Config +decoder +dense +layers +16 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/mobilevit.svg b/mobilevit.svg new file mode 100644 index 0000000000000000000000000000000000000000..25c48818ef0a2f9cecd77078a35f0b189490de8e --- /dev/null +++ b/mobilevit.svg @@ -0,0 +1,169 @@ + + + + +mobilevit +dense · 5× MHA + +MobileViTModel · base model +5 × MobileViTTransformerLayerMobileViTTransformerLayer× 5 +MobileViTForImageClassification · task head +Self-Attention · MobileViTAttention +attention · MobileViTSelfAttention +output · MobileViTSelfOutput + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +LayerNormpre-attention [1, 6, ?] +query: Linear [144→144]query [144→144] +key: Linear [144→144]key [144→144] +value: Linear [144→144]value [144→144] +dropout: Dropoutdropout Dropout +dense: Linear [144→144]dense [144→144] +dropout: Dropoutdropout Dropout +scaled dot-product attention4 heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, ?] +MobileViTForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +MobileViTForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +google/mobilenet_v2_1.0_224 +model_type +mobilevit +config +MobileViTConfig +decoder +dense +layers +5 +hidden +— +intermediate +— +heads / kv +4 / 4 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mobilevitv2.svg b/mobilevitv2.svg new file mode 100644 index 0000000000000000000000000000000000000000..76070297dc7ec7787ac62d810c963d58c3257133 --- /dev/null +++ b/mobilevitv2.svg @@ -0,0 +1,177 @@ + + + + +mobilevitv2 +dense · 5× Attention + +MobileViTV2Model · base model +5 × MobileViTV2TransformerLayerMobileViTV2TransformerLayer× 5 +MobileViTV2ForImageClassification · task head +Self-Attention · MobileViTV2LinearSelfAttention +MLP · MobileViTV2FFN +qkv_proj · MobileViTV2ConvLayer +out_proj · MobileViTV2ConvLayer +conv1 · MobileViTV2ConvLayer +conv2 · MobileViTV2ConvLayer + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +GroupNormpre-attention [1, 6, ?] +convolution: Conv2dconvolution Conv2d +attn_dropout: Dropoutattn_dropout Dropout +convolution: Conv2dconvolution Conv2d +scaled dot-product attention? heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +GroupNormpre-FFN [1, 6, ?] +convolution: Conv2dconvolution Conv2d +activation: SiLUactivation SiLU +dropout1: Dropoutdropout1 Dropout +convolution: Conv2dconvolution Conv2d +dropout2: Dropoutdropout2 Dropout +residual add+ +Final BatchNorm2d[1, 6, ?] +MobileViTV2ForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +MobileViTV2ForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +apple/mobilevitv2-1.0 +model_type +mobilevitv2 +config +MobileViTV2Config +decoder +dense +layers +5 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/modernbert.diff.svg b/modernbert.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..87c67b211cb46092e12160a606163dc7f5b41a1f --- /dev/null +++ b/modernbert.diff.svg @@ -0,0 +1,231 @@ + + + + +modernbert +diff vs gemma3 · 2 overridden · 77 added · 0 deleted · 13 new · 0 inherited-as-is + +ModernBertModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +ModernBertForMaskedLM · task head +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +MLP · ModernBertMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +Wqkv: Linear [768→2304]Wqkv [768→2304] +Wo: Linear [768→768]Wo [768→768] +out_drop: Identityout_drop Identity +scaled dot-product attention12 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +Wi: Linear [768→2304]Wi [768→2304] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [1152→768]Wo [1152→768] +residual add+ +Final LayerNorm[1, 6, 768] +ModernBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +ModernBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 + +model id +answerdotai/ModernBERT-base +parent +gemma3 +classes +14 +overridden +2 +added +77 +new classes +13 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ModernBertRotaryEmbedding +ovr __init__,compute_default_rope_parameters + +ModernBertAttention +add __init__,forward + +ModernBertConfig +add __post_init__,convert_rope_params_to_dic… + +ModernBertEmbeddings +add __init__,forward + +ModernBertEncoderLayer +add __init__,forward + +ModernBertForMaskedLM +add __init__,forward,get_output_embeddings,s… + +ModernBertForMultipleChoice +add __init__,forward + +ModernBertForQuestionAnswering +add __init__,forward + +ModernBertForSequenceClassification +add __init__,forward + +ModernBertForTokenClassification +add __init__,forward + +ModernBertMLP +add __init__,forward + +ModernBertModel +add __init__,forward,get_input_embeddings,se… + +ModernBertPreTrainedModel +add _init_weights; 9 attr + +ModernBertPredictionHead +add __init__,forward + \ No newline at end of file diff --git a/modernbert.svg b/modernbert.svg new file mode 100644 index 0000000000000000000000000000000000000000..231507642b9a2e29fa7398230150cc93f0c9632a --- /dev/null +++ b/modernbert.svg @@ -0,0 +1,210 @@ + + + + +modernbert +dense · 8× full + 14× sliding + +ModernBertModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +ModernBertForMaskedLM · task head +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +MLP · ModernBertMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +Wqkv: Linear [768→2304]Wqkv [768→2304] +Wo: Linear [768→768]Wo [768→768] +out_drop: Identityout_drop Identity +scaled dot-product attention12 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +Wi: Linear [768→2304]Wi [768→2304] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [1152→768]Wo [1152→768] +residual add+ +Final LayerNorm[1, 6, 768] +ModernBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +ModernBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 + +model id +answerdotai/ModernBERT-base +model_type +modernbert +config +ModernBertConfig +decoder +dense +layers +22 +hidden +768 +intermediate +1,152 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +50,368 +max_pos +8,192 +sliding_window +64 +tie_embeddings +True +legend + +self-attention + +full + +sliding + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/modernbert_decoder.diff.svg b/modernbert_decoder.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..31889dee9480003064364be00d269eeb9a381862 --- /dev/null +++ b/modernbert_decoder.diff.svg @@ -0,0 +1,211 @@ + + + + +modernbert_decoder +diff vs modernbert · 5 overridden · 51 added · 0 deleted · 6 new · 4 inherited-as-is + +ModernBertDecoderModel · base model +22 × ModernBertDecoderLayerModernBertDecoderLayer× 22 +ModernBertDecoderForCausalLM · task head +layers (idx) +Self-Attention · ModernBertDecoderAttention (2 layer types — same modules, mask differs) +MLP · ModernBertMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +Wo: Linear [768→768]Wo [768→768] +out_drop: Dropoutout_drop Dropout +scaled dot-product attention12 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +Wi: Linear [768→2304]Wi [768→2304] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [1152→768]Wo [1152→768] +residual add+ +Final LayerNorm[1, 6, 768] +ModernBertDecoderForCausalLMLM HeadLinear [768→50368] · tied +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 + +model id +blab-jhu/test-32m-dec +parent +modernbert +classes +11 +overridden +5 +added +51 +new classes +6 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ModernBertDecoderAttention +add __init__,forward + +ModernBertDecoderConfig +add __post_init__,convert_rope_params_to_dic… + +ModernBertDecoderForCausalLM +add __init__,forward,get_output_embeddings,s… + +ModernBertDecoderForSequenceClassification +add __init__,forward + +ModernBertDecoderLayer +add __init__,forward + +ModernBertDecoderModel +add __init__,forward,get_input_embeddings,se… + +ModernBertDecoderPreTrainedModel +ovr _init_weights; 5 attr + \ No newline at end of file diff --git a/modernbert_decoder.svg b/modernbert_decoder.svg new file mode 100644 index 0000000000000000000000000000000000000000..b9c78c788b96bfcc6c0921eeec156b882967eb64 --- /dev/null +++ b/modernbert_decoder.svg @@ -0,0 +1,211 @@ + + + + +modernbert_decoder +dense · 8× full + 14× sliding + +ModernBertDecoderModel · base model +22 × ModernBertDecoderLayerModernBertDecoderLayer× 22 +ModernBertDecoderForCausalLM · task head +layers (idx) +Self-Attention · ModernBertDecoderAttention (2 layer types — same modules, mask differs) +MLP · ModernBertDecoderMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +Wo: Linear [768→768]Wo [768→768] +out_drop: Dropoutout_drop Dropout +scaled dot-product attention12 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +Wi: Linear [768→2304]Wi [768→2304] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [1152→768]Wo [1152→768] +residual add+ +Final LayerNorm[1, 6, 768] +ModernBertDecoderForCausalLMLM HeadLinear [768→50368] · tied +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 + +model id +blab-jhu/test-32m-dec +model_type +modernbert-decoder +config +ModernBertDecoderConfig +decoder +dense +layers +22 +hidden +768 +intermediate +1,152 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +50,368 +max_pos +8,192 +sliding_window +64 +tie_embeddings +True +legend + +self-attention + +full + +sliding + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/modernvbert.diff.svg b/modernvbert.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..42f8bbd3919dbc8a96e9c71b2d61df8abb474a06 --- /dev/null +++ b/modernvbert.diff.svg @@ -0,0 +1,239 @@ + + + + +modernvbert +diff vs smolvlm (+modernbert) · 3 overridden · 36 added · 0 deleted · 7 new · 1 inherited-as-is + +ModernVBertModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +ModernVBertForMaskedLM · task head +image ⊕ text attention +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +Vision encoder · SiglipVisionMo…×12 +SiglipEncoderLayer×12 +self_attn · SiglipAttention +MLP · ModernBertMLP +mlp · SiglipMLP +Projector · ModernVBertConnector + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +Wqkv: Linear [768→2304]Wqkv [768→2304] +Wo: Linear [768→768]Wo [768→768] +out_drop: Identityout_drop Identity +scaled dot-product attention12 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +Wi: Linear [768→2304]Wi [768→2304] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [1152→768]Wo [1152→768] +residual add+ +Final LayerNorm[1, 6, 768] +ModernVBertForMaskedLMLM HeadLinear [768→50368] +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +modality_projection: Linear [12288→768]modality_projection [12288→768] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +ModernVBERT/modernvbert +parent +smolvlm +classes +10 +overridden +3 +added +36 +new classes +7 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ModernVBertModel +ovr __init__,forward + +ModernVBertBaseModelOutput +4 attr + +ModernVBertConfig +add __post_init__; 12 attr + +ModernVBertConnector +add __init__,forward,pixel_shuffle + +ModernVBertForMaskedLM +add __init__,forward,get_output_embeddings,s… + +ModernVBertForSequenceClassification +add __init__,forward + +ModernVBertForTokenClassification +add __init__,forward + +ModernVBertMaskedLMOutput +5 attr + +ModernVBertPreTrainedModel +add _init_weights; 2 attr + \ No newline at end of file diff --git a/modernvbert.svg b/modernvbert.svg new file mode 100644 index 0000000000000000000000000000000000000000..44e3a45e32ddf64270706a7e7f5695afabd066bc --- /dev/null +++ b/modernvbert.svg @@ -0,0 +1,241 @@ + + + + +modernvbert +multimodal · vision → projector → LLM · dense + +ModernVBertModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +ModernVBertForMaskedLM · task head +image ⊕ text attention +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +Vision encoder · SiglipVisionMo…×12 +SiglipEncoderLayer×12 +self_attn · SiglipAttention +MLP · ModernBertMLP +mlp · SiglipMLP +Projector · ModernVBertConnector + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +Wqkv: Linear [768→2304]Wqkv [768→2304] +Wo: Linear [768→768]Wo [768→768] +out_drop: Identityout_drop Identity +scaled dot-product attention12 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +Wi: Linear [768→2304]Wi [768→2304] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [1152→768]Wo [1152→768] +residual add+ +Final LayerNorm[1, 6, 768] +ModernVBertForMaskedLMLM HeadLinear [768→50368] +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +modality_projection: Linear [12288→768]modality_projection [12288→768] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +ModernVBERT/modernvbert +inputs +input_ids, pixel_values +built via +AutoModel +model_type +modernvbert +config +ModernVBertConfig +decoder +dense +layers +22 +hidden +768 +intermediate +1,152 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +50,368 +max_pos +8,192 +sliding_window +64 +tie_embeddings +False +legend + +vision encoder + +self-attention + +full + +sliding + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/moonshine.diff.svg b/moonshine.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..383eef3407335b2c572e567adbb6d604634611fe --- /dev/null +++ b/moonshine.diff.svg @@ -0,0 +1,199 @@ + + + + +moonshine +diff vs glm (+llama,whisper) · 6 overridden · 59 added · 1 deleted · 8 new · 1 inherited-as-is + +MoonshineModel · base model +6 × MoonshineEncoderLayerMoonshineEncoderLayer× 6 +Self-Attention · MoonshineAttention +MLP · MoonshineEncoderMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32768 × 288] → [1, 6, 288] +LayerNormpre-attention [1, 6, 288] +q_proj: Linear [288→288]q_proj [288→288] +k_proj: Linear [288→288]k_proj [288→288] +v_proj: Linear [288→288]v_proj [288→288] +o_proj: Linear [288→288]o_proj [288→288] +scaled dot-product attention8 heads · head_dim 36 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 288] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [288→1152]fc1 [288→1152] +fc2: Linear [1152→288]fc2 [1152→288] +residual add+ +Final LayerNorm[1, 6, 288] +LM HeadLinear [288→32768] · tied +Softmax +logits[1, 6, 32768] + +model id +UsefulSensors/moonshine-tiny +parent +glm +classes +13 +overridden +6 +added +59 +new classes +8 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MoonshineModel +ovr forward; del _mask_input_features + +MoonshineAttention +ovr __init__,forward + +MoonshineEncoderLayer +ovr __init__ + +MoonshineConfig +add __post_init__; 27 attr + +MoonshineDecoder +ovr __init__,forward; 2 attr + +MoonshineDecoderLayer +add __init__,forward + +MoonshineDecoderMLP +add __init__,forward + +MoonshineEncoder +add __init__,forward,get_input_embeddings,se… + +MoonshineEncoderMLP +add __init__,forward + +MoonshineEncoderModelOutput +1 attr + +MoonshineForConditionalGeneration +add __init__,forward,get_input_embeddings,ge… + +MoonshinePreTrainedModel +add _get_feat_extract_output_lengths; 9 attr + \ No newline at end of file diff --git a/moonshine.svg b/moonshine.svg new file mode 100644 index 0000000000000000000000000000000000000000..5113d016b214feb7d489fe5b3ca62fc4d8776134 --- /dev/null +++ b/moonshine.svg @@ -0,0 +1,178 @@ + + + + +moonshine +dense · 6× MHA + +MoonshineModel · base model +6 × MoonshineEncoderLayerMoonshineEncoderLayer× 6 +Self-Attention · MoonshineAttention +MLP · MoonshineEncoderMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32768 × 288] → [1, 6, 288] +LayerNormpre-attention [1, 6, 288] +q_proj: Linear [288→288]q_proj [288→288] +k_proj: Linear [288→288]k_proj [288→288] +v_proj: Linear [288→288]v_proj [288→288] +o_proj: Linear [288→288]o_proj [288→288] +scaled dot-product attention8 heads · head_dim 36 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 288] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [288→1152]fc1 [288→1152] +fc2: Linear [1152→288]fc2 [1152→288] +residual add+ +Final LayerNorm[1, 6, 288] +LM HeadLinear [288→32768] · tied +Softmax +logits[1, 6, 32768] + +model id +UsefulSensors/moonshine-tiny +model_type +moonshine +config +MoonshineConfig +decoder +dense +layers +6 +hidden +288 +intermediate +1,152 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +32,768 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/moonshine_streaming.diff.svg b/moonshine_streaming.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..599fef95873f0c5042a329b1d3b7811f96a03f26 --- /dev/null +++ b/moonshine_streaming.diff.svg @@ -0,0 +1,205 @@ + + + + +moonshine_streaming +diff vs moonshine (+llama) · 5 overridden · 19 added · 0 deleted · 10 new · 3 inherited-as-is + +MoonshineStreamingModel · base model +6 × MoonshineStreamingEncoderLayerMoonshineStreamingEncoderLayer× 6 +Self-Attention · MoonshineStreamingEncoderAttention +MLP · MoonshineStreamingEncoderMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32768 × 320] → [1, 6, 320] +MoonshineStreamingLayerNormpre-attention [1, 6, 320] +q_proj: Linear [320→320]q_proj [320→320] +k_proj: Linear [320→320]k_proj [320→320] +v_proj: Linear [320→320]v_proj [320→320] +o_proj: Linear [320→320]o_proj [320→320] +scaled dot-product attention8 heads · head_dim 40 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MoonshineStreamingLayerNormpre-FFN [1, 6, 320] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [320→1280]fc1 [320→1280] +fc2: Linear [1280→320]fc2 [1280→320] +residual add+ +Final LayerNorm[1, 6, 320] +LM HeadLinear [320→32768] +Softmax +logits[1, 6, 32768] + +model id +UsefulSensors/moonshine-stream +parent +moonshine +classes +17 +overridden +5 +added +19 +new classes +10 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MoonshineStreamingDecoder +ovr __init__,forward + +MoonshineStreamingEncoderLayer +ovr __init__ + +MoonshineStreamingModel +ovr __init__ + +MoonshineStreamingAsinhCompression +add __init__,forward + +MoonshineStreamingCausalConv1d +add __init__,forward + +MoonshineStreamingEncoder +add __init__,forward; 2 attr + +MoonshineStreamingEncoderAttention +add __init__,forward + +MoonshineStreamingEncoderEmbedder +add __init__,forward + +MoonshineStreamingEncoderModelOutput +1 attr + +MoonshineStreamingFrameCMVN +add __init__,forward + +MoonshineStreamingLayerNorm +add __init__,forward + +MoonshineStreamingPreTrainedModel +ovr _get_feat_extract_output_lengths; add _i… + +MoonshineStreamingProcessor +rename only + +MoonshineStreamingProcessorKwargs +1 attr + \ No newline at end of file diff --git a/moonshine_streaming.svg b/moonshine_streaming.svg new file mode 100644 index 0000000000000000000000000000000000000000..912844d3ea0cb4dd111635b6078d6c0d5919c6d0 --- /dev/null +++ b/moonshine_streaming.svg @@ -0,0 +1,178 @@ + + + + +moonshine_streaming +dense · 6× MHA + +MoonshineStreamingModel · base model +6 × MoonshineStreamingEncoderLayerMoonshineStreamingEncoderLayer× 6 +Self-Attention · MoonshineStreamingEncoderAttention +MLP · MoonshineStreamingEncoderMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32768 × 320] → [1, 6, 320] +MoonshineStreamingLayerNormpre-attention [1, 6, 320] +q_proj: Linear [320→320]q_proj [320→320] +k_proj: Linear [320→320]k_proj [320→320] +v_proj: Linear [320→320]v_proj [320→320] +o_proj: Linear [320→320]o_proj [320→320] +scaled dot-product attention8 heads · head_dim 40 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MoonshineStreamingLayerNormpre-FFN [1, 6, 320] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [320→1280]fc1 [320→1280] +fc2: Linear [1280→320]fc2 [1280→320] +residual add+ +Final LayerNorm[1, 6, 320] +LM HeadLinear [320→32768] +Softmax +logits[1, 6, 32768] + +model id +UsefulSensors/moonshine-strea… +model_type +moonshine_streaming +config +MoonshineStreamingConfig +decoder +dense +layers +6 +hidden +320 +intermediate +1,280 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +32,768 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/moshi.svg b/moshi.svg new file mode 100644 index 0000000000000000000000000000000000000000..5fd375e4c534cc9efe8fb8f32e6de1c18a285800 --- /dev/null +++ b/moshi.svg @@ -0,0 +1,186 @@ + + + + +moshi +dense · 32× MHA + +MoshiModel · base model +32 × MoshiDecoderLayerMoshiDecoderLayer× 32 +MoshiForCausalLM · task head +Self-Attention · MoshiSdpaAttention +MLP · MoshiGatingMLP +q_proj · MoshiLinear +k_proj · MoshiLinear +v_proj · MoshiLinear +o_proj · MoshiLinear + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +MoshiRMSNormpre-attention [1, 6, 4096] +linear: Linear [4096→4096]linear [4096→4096] +linear: Linear [4096→4096]linear [4096→4096] +linear: Linear [4096→4096]linear [4096→4096] +linear: Linear [4096→4096]linear [4096→4096] +rotary_emb: MoshiRotaryEmbeddingrotary_emb RotaryEmbedding +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +MoshiRMSNormpre-FFN [1, 6, 4096] +activation_fn: SiLUActivationactivation_fn SiLU +fc1: Linear [4096→22528]fc1 [4096→22528] +fc2: Linear [11264→4096]fc2 [11264→4096] +residual add+ +Final RMSNorm[1, 6, 4096] +MoshiForCausalLMLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] + +model id +kmhf/hf-moshiko +model_type +moshi +config +MoshiConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,528 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +3,000 +sliding_window +3,000 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mpnet.svg b/mpnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..42e2edb9468d868c39456fd86cbceebfe112d6cc --- /dev/null +++ b/mpnet.svg @@ -0,0 +1,175 @@ + + + + +mpnet +dense · 12× MHA + +MPNetModel · base model +12 × MPNetLayerMPNetLayer× 12 +MPNetForMaskedLM · task head +Self-Attention · MPNetAttention +attn · MPNetSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30527 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +q: Linear [768→768]q [768→768] +k: Linear [768→768]k [768→768] +v: Linear [768→768]v [768→768] +o: Linear [768→768]o [768→768] +dropout: Dropoutdropout Dropout +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +MPNetForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +MPNetForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/mpnet-base +model_type +mpnet +config +MPNetConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,527 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mpt.svg b/mpt.svg new file mode 100644 index 0000000000000000000000000000000000000000..236198e0eed158aaff230d720c6c9ff26d3c8a77 --- /dev/null +++ b/mpt.svg @@ -0,0 +1,175 @@ + + + + +mpt +dense · 24× MHA + +MptModel · base model +24 × MptBlockMptBlock× 24 +MptForCausalLM · task head +Self-Attention · MptAttention +MLP · MptMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 2048] → [1, 6, 2048] +LayerNormpre-attention [1, 6, 2048] +Wqkv: Linear [2048→6144]Wqkv [2048→6144] +out_proj: Linear [2048→2048]out_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 2048] +up_proj: Linear [2048→8192]up_proj [2048→8192] +act: GELUact GELU +down_proj: Linear [8192→2048]down_proj [8192→2048] +residual add+ +Final LayerNorm[1, 6, 2048] +MptForCausalLMLM HeadLinear [2048→50368] · tied +Softmax +logits[1, 6, 50368] + +model id +mosaicml/mpt-7b +model_type +mpt +config +MptConfig +decoder +dense +layers +24 +hidden +2,048 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,368 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mra.svg b/mra.svg new file mode 100644 index 0000000000000000000000000000000000000000..3d43125010fab2954615d959fd902130e4159895 --- /dev/null +++ b/mra.svg @@ -0,0 +1,176 @@ + + + + +mra +dense · 12× MHA + +MraModel · base model +12 × MraLayerMraLayer× 12 +MraForMaskedLM · task head +Self-Attention · MraAttention +output · MraSelfOutput +self · MraSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +MraForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +MraForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +uw-madison/mra-base-512-4 +model_type +mra +config +MraConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/mt5.svg b/mt5.svg new file mode 100644 index 0000000000000000000000000000000000000000..852aff94a6be4ae3a1689bfe26380dd38c77d361 --- /dev/null +++ b/mt5.svg @@ -0,0 +1,174 @@ + + + + +mt5 +dense · 8× MHA + +MT5Model · base model +8 × ModuleListModuleList× 8 +MT5ForConditionalGeneration · task head +Self-Attention · MT5LayerSelfAttention +SelfAttention · MT5Attention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250112 × 512] → [1, 6, 512] +Normpre-attention [1, 6, 512] +q: Linear [512→384]q [512→384] +k: Linear [512→384]k [512→384] +v: Linear [512→384]v [512→384] +o: Linear [384→512]o [384→512] +relative_attention_bias: Embedding 32×6relative_attention_bias Embedding 32×6 +layer_norm: MT5LayerNorm 512layer_norm LayerNorm 512 +dropout: Dropoutdropout Dropout +scaled dot-product attention6 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 512] +MT5ForConditionalGenerationLM HeadLinear [512→250112] · tied +Softmax +logits[1, 6, 250112] + +model id +google/mt5-small +model_type +mt5 +config +MT5Config +decoder +dense +layers +8 +hidden +512 +intermediate +1,024 +heads / kv +6 / 6 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +250,112 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/musicflamingo.diff.svg b/musicflamingo.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0527ccaabed106f71245afe4b161e34d89591d56 --- /dev/null +++ b/musicflamingo.diff.svg @@ -0,0 +1,204 @@ + + + + +musicflamingo +diff vs audioflamingo3 (+moonshine) · 8 overridden · 16 added · 0 deleted · 2 new · 1 inherited-as-is + +MusicFlamingoModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +MusicFlamingoForConditionalGeneration · task head +Self-Attention · Qwen2Attention +Audio encoder · AudioFlamingo…×32 +AudioFlamingo3EncoderLay…×32 +MLP · Qwen2MLP +self_attn · AudioFlamingo3Attent… +Projector · AudioFlamingo3MultiModal… + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MusicFlamingoForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +input_features[1, 128, 3000] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +out_proj: Linear [1280→1280]out_proj [1280→1280] +self_attn_layer_norm: LayerNorm 1280self_attn_layer_normLayerNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +final_layer_norm: LayerNorm 1280final_layer_normLayerNorm 1280 +linear_1: Linear [1280→4096]linear_1 [1280→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens + +model id +nvidia/music-flamingo-2601-hf +parent +audioflamingo3 +classes +7 +overridden +8 +added +16 +new classes +2 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +MusicFlamingoForConditionalGeneration +ovr __init__,get_audio_features + +MusicFlamingoConfig +add __post_init__; 5 attr + +MusicFlamingoModel +ovr __init__,forward,get_audio_features; add… + +MusicFlamingoPreTrainedModel +add _init_weights; 1 attr + +MusicFlamingoProcessor +add __init__,_strip_assistant_prefix_and_quo… + +MusicFlamingoRotaryEmbedding +ovr __init__,forward; add _compute_position_… + \ No newline at end of file diff --git a/musicflamingo.svg b/musicflamingo.svg new file mode 100644 index 0000000000000000000000000000000000000000..c6c97ccfa371560223f9a6a28aece145eec25f74 --- /dev/null +++ b/musicflamingo.svg @@ -0,0 +1,209 @@ + + + + +musicflamingo +multimodal · audio → projector → LLM · dense + +MusicFlamingoModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +MusicFlamingoForConditionalGeneration · task head +Self-Attention · Qwen2Attention +Audio encoder · AudioFlamingo…×32 +AudioFlamingo3EncoderLay…×32 +MLP · Qwen2MLP +self_attn · AudioFlamingo3Attent… +Projector · MusicFlamingoMultiModalP… + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +MusicFlamingoForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +input_features[1, 128, 3000] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +out_proj: Linear [1280→1280]out_proj [1280→1280] +self_attn_layer_norm: LayerNorm 1280self_attn_layer_normLayerNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +final_layer_norm: LayerNorm 1280final_layer_normLayerNorm 1280 +linear_1: Linear [1280→4096]linear_1 [1280→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens + +model id +nvidia/music-flamingo-2601-hf +inputs +input_ids, input_features +built via +AutoModel +model_type +musicflamingo +config +MusicFlamingoConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +False +legend + +audio encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/musicgen.svg b/musicgen.svg new file mode 100644 index 0000000000000000000000000000000000000000..c2e0c439fc7e7adf06db7afe058fe1f52427cdaa --- /dev/null +++ b/musicgen.svg @@ -0,0 +1,155 @@ + + + + +musicgen +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +musicgen +model_type +musicgen +config +MusicgenConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +— +vocab +— +max_pos +— +tie_embeddings +None +status +failed +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/musicgen_melody.svg b/musicgen_melody.svg new file mode 100644 index 0000000000000000000000000000000000000000..f59769876b81491ac96de9a90dcdaec68dd0203c --- /dev/null +++ b/musicgen_melody.svg @@ -0,0 +1,155 @@ + + + + +musicgen_melody +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +musicgen_melody +model_type +musicgen_melody +config +MusicgenMelodyConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +— +vocab +— +max_pos +— +tie_embeddings +None +status +failed +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/mvp.svg b/mvp.svg new file mode 100644 index 0000000000000000000000000000000000000000..b4c97bf1c2372324c8409e00981e83dc8fb3d1fb --- /dev/null +++ b/mvp.svg @@ -0,0 +1,170 @@ + + + + +mvp +dense · 12× MHA + +MvpModel · base model +12 × MvpEncoderLayerMvpEncoderLayer× 12 +MvpForConditionalGeneration · task head +Self-Attention · MvpAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50267 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +MvpForConditionalGenerationLM HeadLinear [1024→50267] · tied +Softmax +logits[1, 6, 50267] + +model id +RUCAIBox/mvp +model_type +mvp +config +MvpConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,267 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/nanochat.diff.svg b/nanochat.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..18cc6e12b19af1d9ecd015109a4457e04061ef68 --- /dev/null +++ b/nanochat.diff.svg @@ -0,0 +1,184 @@ + + + + +nanochat +diff vs llama (+clip,gemma2,llama4,qwen3) · 8 overridden · 1 added · 0 deleted · 0 new · 2 inherited-as-is + +NanoChatModel · base model +12 × NanoChatDecoderLayerNanoChatDecoderLayer× 12 +NanoChatForCausalLM · task head +Self-Attention · NanoChatAttention +MLP · NanoChatMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 768] → [1, 6, 768] +NanoChatRMSNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +q_norm: NanoChatRMSNormq_norm RMSNorm +k_norm: NanoChatRMSNormk_norm RMSNorm +scaled dot-product attention6 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +NanoChatRMSNormpre-FFN [1, 6, 768] +activation_fn: ReLUSquaredActivationactivation_fn ReLUSquared +fc1: Linear [768→8192]fc1 [768→8192] +fc2: Linear [8192→768]fc2 [8192→768] +residual add+ +Final RMSNorm[1, 6, 768] +NanoChatForCausalLMLM HeadLinear [768→50304] +Softmax +logits[1, 6, 50304] + +model id +karpathy/nanochat-d32 +parent +llama +classes +8 +overridden +8 +added +1 +new classes +0 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +NanoChatAttention +ovr __init__,forward + +NanoChatDecoderLayer +ovr __init__ + +NanoChatForCausalLM +ovr forward; 1 attr + +NanoChatMLP +ovr __init__ + +NanoChatModel +ovr __init__,forward + +NanoChatPreTrainedModel +add _init_weights + \ No newline at end of file diff --git a/nanochat.svg b/nanochat.svg new file mode 100644 index 0000000000000000000000000000000000000000..f58f0afccc88d2a84c8ae26cac60e8f3a7224e4d --- /dev/null +++ b/nanochat.svg @@ -0,0 +1,181 @@ + + + + +nanochat +dense · 12× MHA + +NanoChatModel · base model +12 × NanoChatDecoderLayerNanoChatDecoderLayer× 12 +NanoChatForCausalLM · task head +Self-Attention · NanoChatAttention +MLP · NanoChatMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 768] → [1, 6, 768] +NanoChatRMSNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +q_norm: NanoChatRMSNormq_norm RMSNorm +k_norm: NanoChatRMSNormk_norm RMSNorm +scaled dot-product attention6 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +NanoChatRMSNormpre-FFN [1, 6, 768] +activation_fn: ReLUSquaredActivationactivation_fn ReLUSquared +fc1: Linear [768→8192]fc1 [768→8192] +fc2: Linear [8192→768]fc2 [8192→768] +residual add+ +Final RMSNorm[1, 6, 768] +NanoChatForCausalLMLM HeadLinear [768→50304] +Softmax +logits[1, 6, 50304] + +model id +karpathy/nanochat-d32 +model_type +nanochat +config +NanoChatConfig +decoder +dense +layers +12 +hidden +768 +intermediate +8,192 +heads / kv +6 / 6 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +50,304 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/nemotron.svg b/nemotron.svg new file mode 100644 index 0000000000000000000000000000000000000000..444720a0baf569a90a9db8b90d96089a7eaa0540 --- /dev/null +++ b/nemotron.svg @@ -0,0 +1,180 @@ + + + + +nemotron +dense · 32× MHA + +NemotronModel · base model +32 × NemotronDecoderLayerNemotronDecoderLayer× 32 +NemotronForCausalLM · task head +Self-Attention · NemotronSdpaAttention +MLP · NemotronMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 6144] → [1, 6, 6144] +NemotronLayerNorm1Ppre-attention [1, 6, 6144] +rotary_emb: NemotronRotaryEmbeddingrotary_emb RotaryEmbedding +q_proj: Linear [6144→6144]q_proj [6144→6144] +k_proj: Linear [6144→6144]k_proj [6144→6144] +v_proj: Linear [6144→6144]v_proj [6144→6144] +o_proj: Linear [6144→6144]o_proj [6144→6144] +scaled dot-product attention48 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +NemotronLayerNorm1Ppre-FFN [1, 6, 6144] +up_proj: Linear [6144→24576]up_proj [6144→24576] +down_proj: Linear [24576→6144]down_proj [24576→6144] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +residual add+ +Final LayerNorm[1, 6, 6144] +NemotronForCausalLMLM HeadLinear [6144→256000] +Softmax +logits[1, 6, 256000] + +model id +thhaus/nemotron3-8b +model_type +nemotron +config +NemotronConfig +decoder +dense +layers +32 +hidden +6,144 +intermediate +24,576 +heads / kv +48 / 48 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +256,000 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/nemotron_h.diff.svg b/nemotron_h.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..88048ed5ab75a2805bd90bdb2e16e749e899a2e1 --- /dev/null +++ b/nemotron_h.diff.svg @@ -0,0 +1,203 @@ + + + + +nemotron_h +diff vs deepseek_v3 (+jamba,llama,nemotron,zamba,zamba2) · 8 overridden · 23 added · 0 deleted · 4 new · 2 inherited-as-is + +NemotronHModel · base model +4 × NemotronHBlockNemotronHBlock× 4 +NemotronHForCausalLM · task head +layers (idx) +Self-Attention · NemotronHAttention (3 layer types — modules differ ▼) +shared_experts · NemotronHMLP +experts · NemotronHExperts + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 4096] → [1, 6, 4096] +NemotronHRMSNormpre-attention [1, 6, 4096] +act: SiLUActivationact SiLU +conv1d: Conv1d 10240×1×4conv1d Conv1d 10240×1×4 +in_proj: Linear [4096→18560]in_proj [4096→18560] +norm: Zamba2RMSNormGated 8192norm Zamba2RMSNormGated 8192 +out_proj: Linear [8192→4096]out_proj [8192→4096] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +gate: NemotronHTopkRouter 8×4096gate TopkRouter 8×4096 +up_proj: Linear [4096→7688]up_proj [4096→7688] +down_proj: Linear [7688→4096]down_proj [7688→4096] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +fc1_latent_proj: Identityfc1_latent_proj Identity +fc2_latent_proj: Identityfc2_latent_proj Identity +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +mamba attention mask (q↓ × k→)mamba mask +moe attention mask (q↓ × k→)moe mask +attention attention mask (q↓ × k→)attention mask +residual add+ +Final RMSNorm[1, 6, 4096] +NemotronHForCausalLMLM HeadLinear [4096→131072] +Softmax +logits[1, 6, 131072] +layer 0: mamba0 +layer 1: moe1 +layer 2: attention2 +layer 3: mlp3 + +model id +nvidia/NVIDIA-Nemotron-3-Nano- +parent +deepseek_v3 +classes +11 +overridden +8 +added +23 +new classes +4 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +NemotronHAttention +ovr forward + +NemotronHForCausalLM +ovr forward; 1 attr + +NemotronHMLP +ovr __init__ + +NemotronHMamba2Mixer +ovr __init__,forward + +NemotronHMoE +ovr __init__,forward + +NemotronHBlock +add __init__,forward + +NemotronHExperts +add __init__,forward + +NemotronHModel +add __init__,_update_mamba_mask,forward,get_… + +NemotronHPreTrainedModel +add _init_weights; 13 attr + \ No newline at end of file diff --git a/nemotron_h.svg b/nemotron_h.svg new file mode 100644 index 0000000000000000000000000000000000000000..c2f1dbed4e4ab389c1ed04972564cdfd2cfd64c5 --- /dev/null +++ b/nemotron_h.svg @@ -0,0 +1,201 @@ + + + + +nemotron_h +hybrid · 1× Mamba + 2× GQA +MoE + 1× attention +MoE + +NemotronHModel · base model +4 × NemotronHBlockNemotronHBlock× 4 +NemotronHForCausalLM · task head +layers (idx) +Self-Attention · NemotronHAttention (3 layer types — modules differ ▼) +shared_experts · NemotronHMLP +experts · NemotronHExperts + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 4096] → [1, 6, 4096] +NemotronHRMSNormpre-attention [1, 6, 4096] +act: SiLUActivationact SiLU +conv1d: Conv1d 10240×1×4conv1d Conv1d 10240×1×4 +in_proj: Linear [4096→18560]in_proj [4096→18560] +norm: Zamba2RMSNormGated 8192norm Zamba2RMSNormGated 8192 +out_proj: Linear [8192→4096]out_proj [8192→4096] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +gate: NemotronHTopkRouter 8×4096gate TopkRouter 8×4096 +up_proj: Linear [4096→7688]up_proj [4096→7688] +down_proj: Linear [7688→4096]down_proj [7688→4096] +act_fn: ReLUSquaredActivationact_fn ReLUSquared +fc1_latent_proj: Identityfc1_latent_proj Identity +fc2_latent_proj: Identityfc2_latent_proj Identity +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +mamba attention mask (q↓ × k→)mamba mask +moe attention mask (q↓ × k→)moe mask +attention attention mask (q↓ × k→)attention mask +residual add+ +Final RMSNorm[1, 6, 4096] +NemotronHForCausalLMLM HeadLinear [4096→131072] +Softmax +logits[1, 6, 131072] +layer 0: mamba0 +layer 1: moe1 +layer 2: attention2 +layer 3: mlp3 + +model id +nvidia/NVIDIA-Nemotron-3-Nano… +model_type +nemotron_h +config +NemotronHConfig +decoder +hybrid +layers +4 +hidden +4,096 +intermediate +21,504 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +n/a +vocab +131,072 +max_pos +4,096 +experts (top-k) +8 (top-2) +tie_embeddings +False +legend + +self-attention + +mamba + +moe + +attention + +mlp + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/nllb_moe.svg b/nllb_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..20b5304ca43db639bacb8e2a1a63028e4849d44e --- /dev/null +++ b/nllb_moe.svg @@ -0,0 +1,180 @@ + + + + +nllb_moe +sparse-moe · 12× MHA +MoE + +NllbMoeModel · base model +12 × NllbMoeEncoderLayerNllbMoeEncoderLayer× 12 +NllbMoeForConditionalGeneration · task head +Self-Attention · NllbMoeAttention +Sparse MoE · NllbMoeDenseActDenseMoE + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128112 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +dropout: Dropoutdropout Dropout +act: ReLUact ReLU +residual add+ +Final LayerNorm[1, 6, 1024] +NllbMoeForConditionalGenerationLM HeadLinear [1024→128112] · tied +Softmax +logits[1, 6, 128112] + +model id +facebook/nllb-moe-54b +model_type +nllb-moe +config +NllbMoeConfig +decoder +sparse-moe +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +128,112 +max_pos +1,024 +experts (top-k) +128 (top-None) +tie_embeddings +True +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/nomic_bert.diff.svg b/nomic_bert.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d0bcf0e8e87cca64bb4928792fa10dad76ef0772 --- /dev/null +++ b/nomic_bert.diff.svg @@ -0,0 +1,187 @@ + + + + +nomic_bert +diff vs bert (+jina_embeddings_v3,gemma,llama) · 11 overridden · 26 added · 0 deleted · 1 new · 6 inherited-as-is + +NomicBertModel · base model +12 × NomicBertLayerNomicBertLayer× 12 +NomicBertForMaskedLM · task head +Self-Attention · NomicBertAttention +MLP · BertMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30528 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +gate_proj: Linear [768→3072]gate_proj [768→3072] +up_proj: Linear [768→3072]up_proj [768→3072] +down_proj: Linear [3072→768]down_proj [3072→768] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 768] +NomicBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +NomicBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +nomic-ai/nomic-embed-text-v1.5 +parent +bert +classes +13 +overridden +11 +added +26 +new classes +1 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +NomicBertAttention +ovr __init__ + +NomicBertForMaskedLM +ovr __init__,forward + +NomicBertForSequenceClassification +ovr __init__ + +NomicBertModel +ovr __init__,forward + +NomicBertPredictionHeadTransform +ovr __init__,forward + +NomicBertConfig +add __post_init__; 24 attr + +NomicBertPreTrainedModel +4 attr + \ No newline at end of file diff --git a/nomic_bert.svg b/nomic_bert.svg new file mode 100644 index 0000000000000000000000000000000000000000..4ed1c15e58a6feddb541e4538d3b70d84762d0c6 --- /dev/null +++ b/nomic_bert.svg @@ -0,0 +1,181 @@ + + + + +nomic_bert +dense · 12× MHA + +NomicBertModel · base model +12 × NomicBertLayerNomicBertLayer× 12 +NomicBertForMaskedLM · task head +Self-Attention · NomicBertAttention +MLP · NomicBertMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30528 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 768] +gate_proj: Linear [768→3072]gate_proj [768→3072] +up_proj: Linear [768→3072]up_proj [768→3072] +down_proj: Linear [3072→768]down_proj [3072→768] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 768] +NomicBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +NomicBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +nomic-ai/nomic-embed-text-v1.5 +model_type +nomic_bert +config +NomicBertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +30,528 +max_pos +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/nougat.svg b/nougat.svg new file mode 100644 index 0000000000000000000000000000000000000000..4629894b8e8b64bae70b696d87ef73ec4ba9bbcf --- /dev/null +++ b/nougat.svg @@ -0,0 +1,155 @@ + + + + +nougat +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +nougat +model_type +nougat +config +NougatConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +— +vocab +— +max_pos +— +tie_embeddings +None +status +failed +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/nystromformer.svg b/nystromformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..710adeaa8ea895e92dc2af8cea36cf2dda3a6e23 --- /dev/null +++ b/nystromformer.svg @@ -0,0 +1,177 @@ + + + + +nystromformer +dense · 12× MHA + +NystromformerModel · base model +12 × NystromformerLayerNystromformerLayer× 12 +NystromformerForMaskedLM · task head +Self-Attention · NystromformerAttention +self · NystromformerSelfAttention +output · NystromformerSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣hey'␣hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30000 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +conv: Conv2dconv Conv2d +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +NystromformerForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +NystromformerForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +uw-madison/nystromformer-512 +model_type +nystromformer +config +NystromformerConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,000 +max_pos +510 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/olmo.diff.svg b/olmo.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7993c89a8d7dbcae9b459c2e1b58ef7cd76ee367 --- /dev/null +++ b/olmo.diff.svg @@ -0,0 +1,183 @@ + + + + +olmo +diff vs llama · 5 overridden · 2 added · 0 deleted · 1 new · 2 inherited-as-is + +OlmoModel · base model +32 × OlmoDecoderLayerOlmoDecoderLayer× 32 +OlmoForCausalLM · task head +Self-Attention · OlmoAttention +MLP · OlmoMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 4096] → [1, 6, 4096] +OlmoLayerNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +OlmoLayerNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 4096] +OlmoForCausalLMLM HeadLinear [4096→50304] +Softmax +logits[1, 6, 50304] + +model id +allenai/OLMo-7B-hf +parent +llama +classes +8 +overridden +5 +added +2 +new classes +1 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +OlmoAttention +ovr forward + +OlmoDecoderLayer +ovr __init__ + +OlmoMLP +ovr __init__ + +OlmoModel +ovr __init__ + +OlmoRotaryEmbedding +ovr forward + +OlmoLayerNorm +add __init__,forward + \ No newline at end of file diff --git a/olmo.svg b/olmo.svg new file mode 100644 index 0000000000000000000000000000000000000000..4e5f7c18a8732531bef2e9ec6623d7a33244fcb6 --- /dev/null +++ b/olmo.svg @@ -0,0 +1,180 @@ + + + + +olmo +dense · 32× MHA + +OlmoModel · base model +32 × OlmoDecoderLayerOlmoDecoderLayer× 32 +OlmoForCausalLM · task head +Self-Attention · OlmoAttention +MLP · OlmoMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 4096] → [1, 6, 4096] +OlmoLayerNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +OlmoLayerNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 4096] +OlmoForCausalLMLM HeadLinear [4096→50304] +Softmax +logits[1, 6, 50304] + +model id +allenai/OLMo-7B-hf +model_type +olmo +config +OlmoConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +50,304 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/olmo2.diff.svg b/olmo2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e4c89e4f7a5eb0c1bec66a356abc1d902a0f9d00 --- /dev/null +++ b/olmo2.diff.svg @@ -0,0 +1,182 @@ + + + + +olmo2 +diff vs olmo (+llama) · 6 overridden · 5 added · 0 deleted · 1 new · 4 inherited-as-is + +Olmo2Model · base model +32 × Olmo2DecoderLayerOlmo2DecoderLayer× 32 +Olmo2ForCausalLM · task head +Self-Attention · Olmo2Attention +MLP · OlmoMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 4096] → [1, 6, 4096] +Olmo2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Olmo2RMSNorm 4096q_norm RMSNorm 4096 +k_norm: Olmo2RMSNorm 4096k_norm RMSNorm 4096 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Olmo2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Olmo2ForCausalLMLM HeadLinear [4096→50304] +Softmax +logits[1, 6, 50304] + +model id +allenai/Olmo2-7B-1124-hf +parent +olmo +classes +9 +overridden +6 +added +5 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Olmo2Attention +ovr __init__,forward + +Olmo2DecoderLayer +ovr __init__,forward + +Olmo2Model +ovr __init__ + +Olmo2RMSNorm +ovr forward + +Olmo2Config +5 attr + \ No newline at end of file diff --git a/olmo2.svg b/olmo2.svg new file mode 100644 index 0000000000000000000000000000000000000000..703ea84f2b9b11a4488eb4645b8136d89e88cdc6 --- /dev/null +++ b/olmo2.svg @@ -0,0 +1,182 @@ + + + + +olmo2 +dense · 32× MHA + +Olmo2Model · base model +32 × Olmo2DecoderLayerOlmo2DecoderLayer× 32 +Olmo2ForCausalLM · task head +Self-Attention · Olmo2Attention +MLP · Olmo2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 4096] → [1, 6, 4096] +Olmo2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Olmo2RMSNorm 4096q_norm RMSNorm 4096 +k_norm: Olmo2RMSNorm 4096k_norm RMSNorm 4096 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Olmo2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Olmo2ForCausalLMLM HeadLinear [4096→50304] +Softmax +logits[1, 6, 50304] + +model id +allenai/Olmo2-7B-1124-hf +model_type +olmo2 +config +Olmo2Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +50,304 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/olmo3.diff.svg b/olmo3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..41e09b0a3e36bbba8f66b5433c25246986ba6374 --- /dev/null +++ b/olmo3.diff.svg @@ -0,0 +1,210 @@ + + + + +olmo3 +diff vs olmo2 (+gemma2) · 4 overridden · 7 added · 0 deleted · 1 new · 6 inherited-as-is + +Olmo3Model · base model +32 × Olmo3DecoderLayerOlmo3DecoderLayer× 32 +Olmo3ForCausalLM · task head +layers (idx) +Self-Attention · Olmo3Attention (2 layer types — same modules, mask differs) +MLP · Olmo2MLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 4096] → [1, 6, 4096] +Olmo3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Olmo3RMSNorm 4096q_norm RMSNorm 4096 +k_norm: Olmo3RMSNorm 4096k_norm RMSNorm 4096 +scaled dot-product attention32 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Olmo3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Olmo3ForCausalLMLM HeadLinear [4096→50304] +Softmax +logits[1, 6, 50304] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 + +model id +allenai/Olmo-3-7B-Instruct +parent +olmo2 +classes +9 +overridden +4 +added +7 +new classes +1 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Olmo3Attention +ovr __init__,forward + +Olmo3Model +ovr __init__,forward + +Olmo3Config +add __post_init__; 6 attr + \ No newline at end of file diff --git a/olmo3.svg b/olmo3.svg new file mode 100644 index 0000000000000000000000000000000000000000..926df17a246fcfc35c0d3654f542aea447418ef0 --- /dev/null +++ b/olmo3.svg @@ -0,0 +1,222 @@ + + + + +olmo3 +dense · 24× sliding + 8× full + +Olmo3Model · base model +32 × Olmo3DecoderLayerOlmo3DecoderLayer× 32 +Olmo3ForCausalLM · task head +layers (idx) +Self-Attention · Olmo3Attention (2 layer types — same modules, mask differs) +MLP · Olmo3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 4096] → [1, 6, 4096] +Olmo3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Olmo3RMSNorm 4096q_norm RMSNorm 4096 +k_norm: Olmo3RMSNorm 4096k_norm RMSNorm 4096 +scaled dot-product attention32 heads · head_dim 128 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Olmo3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Olmo3ForCausalLMLM HeadLinear [4096→50304] +Softmax +logits[1, 6, 50304] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 +layer 26: sliding_attention26 +layer 27: full_attention27 +layer 28: sliding_attention28 +layer 29: sliding_attention29 +layer 30: sliding_attention30 +layer 31: full_attention31 + +model id +allenai/Olmo-3-7B-Instruct +model_type +olmo3 +config +Olmo3Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +50,304 +max_pos +2,048 +sliding_window +4,096 +tie_embeddings +False +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/olmo_hybrid.diff.svg b/olmo_hybrid.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..183c70714507be5f4816b1e8f4cc61f65dfd2a84 --- /dev/null +++ b/olmo_hybrid.diff.svg @@ -0,0 +1,230 @@ + + + + +olmo_hybrid +diff vs olmo3 (+qwen3_next,llama) · 12 overridden · 42 added · 0 deleted · 4 new · 4 inherited-as-is + +OlmoHybridModel · base model +32 × OlmoHybridAttentionDecoderLayerOlmoHybridAttentionDecoderLayer× 32 +OlmoHybridForCausalLM · task head +layers (idx) +Self-Attention · OlmoHybridAttention +MLP · Olmo3MLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [100352 × 3840] → [1, 6, 3840] +OlmoHybridRMSNormpre-attention [1, 6, 3840] +q_proj: Linear [3840→3840]q_proj [3840→3840] +k_proj: Linear [3840→3840]k_proj [3840→3840] +v_proj: Linear [3840→3840]v_proj [3840→3840] +o_proj: Linear [3840→3840]o_proj [3840→3840] +q_norm: OlmoHybridRMSNorm 3840q_norm RMSNorm 3840 +k_norm: OlmoHybridRMSNorm 3840k_norm RMSNorm 3840 +scaled dot-product attention30 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +OlmoHybridRMSNormpre-FFN [1, 6, 3840] +gate_proj: Linear [3840→11008]gate_proj [3840→11008] +up_proj: Linear [3840→11008]up_proj [3840→11008] +down_proj: Linear [11008→3840]down_proj [11008→3840] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3840] +OlmoHybridForCausalLMLM HeadLinear [3840→100352] +Softmax +logits[1, 6, 100352] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 + +model id +allenai/Olmo-Hybrid-7B +parent +olmo3 +classes +14 +overridden +12 +added +42 +new classes +4 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +OlmoHybridAttention +ovr __init__,forward + +OlmoHybridAttentionDecoderLayer +ovr __init__ + +OlmoHybridLinearAttentionDecoderLayer +ovr __init__,forward + +OlmoHybridModel +ovr __init__,forward + +OlmoHybridPreTrainedModel +ovr _init_weights; 3 attr + +OlmoHybridRotaryEmbedding +ovr forward + +OlmoHybridConfig +add __post_init__,validate_architecture; 28 … + +OlmoHybridDynamicCache +add __init__,__len__,get_mask_sizes,get_seq_… + +OlmoHybridGatedDeltaNet +add __init__,forward + +OlmoHybridShortConvolution +add __init__,forward + \ No newline at end of file diff --git a/olmo_hybrid.svg b/olmo_hybrid.svg new file mode 100644 index 0000000000000000000000000000000000000000..a9a9f2148effb433f4cbe8e5a4a27b2e4f2b236e --- /dev/null +++ b/olmo_hybrid.svg @@ -0,0 +1,219 @@ + + + + +olmo_hybrid +hybrid · 24× linear + 8× full + +OlmoHybridModel · base model +32 × OlmoHybridAttentionDecoderLayerOlmoHybridAttentionDecoderLayer× 32 +OlmoHybridForCausalLM · task head +layers (idx) +Self-Attention · OlmoHybridAttention +MLP · OlmoHybridMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [100352 × 3840] → [1, 6, 3840] +OlmoHybridRMSNormpre-attention [1, 6, 3840] +q_proj: Linear [3840→3840]q_proj [3840→3840] +k_proj: Linear [3840→3840]k_proj [3840→3840] +v_proj: Linear [3840→3840]v_proj [3840→3840] +o_proj: Linear [3840→3840]o_proj [3840→3840] +q_norm: OlmoHybridRMSNorm 3840q_norm RMSNorm 3840 +k_norm: OlmoHybridRMSNorm 3840k_norm RMSNorm 3840 +scaled dot-product attention30 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +OlmoHybridRMSNormpre-FFN [1, 6, 3840] +gate_proj: Linear [3840→11008]gate_proj [3840→11008] +up_proj: Linear [3840→11008]up_proj [3840→11008] +down_proj: Linear [11008→3840]down_proj [11008→3840] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3840] +OlmoHybridForCausalLMLM HeadLinear [3840→100352] +Softmax +logits[1, 6, 100352] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 + +model id +allenai/Olmo-Hybrid-7B +model_type +olmo_hybrid +config +OlmoHybridConfig +decoder +hybrid +layers +32 +hidden +3,840 +intermediate +11,008 +heads / kv +30 / 30 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +100,352 +max_pos +65,536 +tie_embeddings +False +legend + +self-attention + +linear + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/olmoe.diff.svg b/olmoe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7fe01f4e1fb195d22967a3c3df75f3c5e537a4f --- /dev/null +++ b/olmoe.diff.svg @@ -0,0 +1,187 @@ + + + + +olmoe +diff vs llama (+mixtral,gemma,qwen2_moe) · 9 overridden · 12 added · 0 deleted · 2 new · 4 inherited-as-is + +OlmoeModel · base model +16 × OlmoeDecoderLayerOlmoeDecoderLayer× 16 +OlmoeForCausalLM · task head +Self-Attention · OlmoeAttention +Sparse MoE · OlmoeSparseMoeBlockMoE +experts · LlamaExperts (×64 · dim 2048) ↩ inh… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 2048] → [1, 6, 2048] +OlmoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +q_norm: OlmoeRMSNorm 2048q_norm RMSNorm 2048 +k_norm: OlmoeRMSNorm 2048k_norm RMSNorm 2048 +scaled dot-product attention16 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +OlmoeRMSNormpre-FFN [1, 6, 2048] +gate: OlmoeTopKRouter top-8 of 64gate TopKRouter top-8 of 64 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +OlmoeForCausalLMLM HeadLinear [2048→50304] +Softmax +logits[1, 6, 50304] + +model id +allenai/OLMoE-1B-7B-0924 +parent +llama +classes +11 +overridden +9 +added +12 +new classes +2 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +OlmoeAttention +ovr __init__,forward + +OlmoeDecoderLayer +ovr __init__ + +OlmoeForCausalLM +ovr __init__,forward; 1 attr + +OlmoeModel +ovr __init__,forward + +OlmoeRMSNorm +ovr __init__ + +OlmoePreTrainedModel +add _init_weights; 9 attr + +OlmoeSparseMoeBlock +add __init__,forward + \ No newline at end of file diff --git a/olmoe.svg b/olmoe.svg new file mode 100644 index 0000000000000000000000000000000000000000..9cf8953a4a367ea00b653bd271b41bb60e5c9f44 --- /dev/null +++ b/olmoe.svg @@ -0,0 +1,183 @@ + + + + +olmoe +sparse-moe · 16× MHA +MoE + +OlmoeModel · base model +16 × OlmoeDecoderLayerOlmoeDecoderLayer× 16 +OlmoeForCausalLM · task head +Self-Attention · OlmoeAttention +Sparse MoE · OlmoeSparseMoeBlockMoE +experts · OlmoeExperts (×64 · dim 2048) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 2048] → [1, 6, 2048] +OlmoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +q_norm: OlmoeRMSNorm 2048q_norm RMSNorm 2048 +k_norm: OlmoeRMSNorm 2048k_norm RMSNorm 2048 +scaled dot-product attention16 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +OlmoeRMSNormpre-FFN [1, 6, 2048] +gate: OlmoeTopKRouter top-8 of 64gate TopKRouter top-8 of 64 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +OlmoeForCausalLMLM HeadLinear [2048→50304] +Softmax +logits[1, 6, 50304] + +model id +allenai/OLMoE-1B-7B-0924 +model_type +olmoe +config +OlmoeConfig +decoder +sparse-moe +layers +16 +hidden +2,048 +intermediate +2,048 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +50,304 +max_pos +4,096 +experts (top-k) +64 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/omdet_turbo.svg b/omdet_turbo.svg new file mode 100644 index 0000000000000000000000000000000000000000..9677ad0585ccfc1433813275596f91ba46530e63 --- /dev/null +++ b/omdet_turbo.svg @@ -0,0 +1,176 @@ + + + + +omdet_turbo +dense · 12× MHA + +OmDetTurboForObjectDetection · base model +12 × CLIPEncoderLayerCLIPEncoderLayer× 12 +Self-Attention · CLIPAttention +MLP · CLIPMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] + +model id +omlab/omdet-turbo-swin-tiny-hf +model_type +omdet-turbo +config +OmDetTurboConfig +decoder +dense +layers +12 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +49,408 +max_pos +77 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/oneformer.svg b/oneformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..b90a010c3af94377f438cd3a2b0dc32c476f8f1a --- /dev/null +++ b/oneformer.svg @@ -0,0 +1,179 @@ + + + + +oneformer +dense · 9× MHA + +OneFormerModel · base model +10 × OneFormerTransformerDecoderLayerOneFormerTransformerDecoderLayer× 10 +Self-Attention · OneFormerTransformerDecoderSelfA… +MLP · OneFormerTransformerDecoderFFNLayer +multihead_attn · MultiheadAttention + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +out_proj: NonDynamicallyQuantizableLinear [256→256]out_projNonDynamicallyQuantizableLinear [256→256] +norm: LayerNorm 256norm LayerNorm 256 +dropout: Dropoutdropout Dropout +activation: ReLUactivation ReLU +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 256] +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +norm: LayerNorm 256norm LayerNorm 256 +activation: ReLUactivation ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +shi-labs/oneformer_ade20k_swi… +model_type +oneformer +config +OneFormerConfig +decoder +dense +layers +10 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/openai.svg b/openai.svg new file mode 100644 index 0000000000000000000000000000000000000000..fec2b64438daadb991c683888e9ccaf83b40b145 --- /dev/null +++ b/openai.svg @@ -0,0 +1,178 @@ + + + + +openai +dense · 12× MHA + +OpenAIGPTModel · base model +12 × BlockBlock× 12 +OpenAIGPTLMHeadModel · task head +Self-Attention · Attention +MLP · MLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [40478 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +c_attn: Conv1D 768×2304c_attn Conv1D 768×2304 +c_proj: Conv1D 768×768c_proj Conv1D 768×768 +attn_dropout: Dropoutattn_dropout Dropout +resid_dropout: Dropoutresid_dropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +c_fc: Conv1D 768×3072c_fc Conv1D 768×3072 +c_proj: Conv1D 3072×768c_proj Conv1D 3072×768 +act: NewGELUActivationact NewGELU +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +OpenAIGPTLMHeadModelLM HeadLinear [768→40478] · tied +Softmax +logits[1, 6, 40478] + +model id +openai-community/openai-gpt +model_type +openai-gpt +config +OpenAIGPTConfig +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +40,478 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/openai_privacy_filter.diff.svg b/openai_privacy_filter.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9cb96d49a4aa05d66e3953bb4d823606df7b23ba --- /dev/null +++ b/openai_privacy_filter.diff.svg @@ -0,0 +1,190 @@ + + + + +openai_privacy_filter +diff vs gpt_oss · 14 overridden · 18 added · 0 deleted · 3 new · 2 inherited-as-is + +OpenAIPrivacyFilterModel · base model +8 × OpenAIPrivacyFilterEncoderLayerOpenAIPrivacyFilterEncoderLayer× 8 +OpenAIPrivacyFilterForTokenClassification · task head +Self-Attention · OpenAIPrivacyFilterAttention +Sparse MoE · OpenAIPrivacyFilterMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [200064 × 640] → [1, 6, 640] +OpenAIPrivacyFilterRMSNormpre-attention [1, 6, 640] +q_proj: Linear [640→896]q_proj [640→896] +k_proj: Linear [640→128]k_proj [640→128] +v_proj: Linear [640→128]v_proj [640→128] +o_proj: Linear [896→640]o_proj [896→640] +scaled dot-product attention14 heads · head_dim 64 · GQA 14:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +OpenAIPrivacyFilterRMSNormpre-FFN [1, 6, 640] +router: OpenAIPrivacyFilterTopKRouter top-4 of 128router TopKRouter top-4 of 128 +experts: OpenAIPrivacyFilterExperts ×128 · dim 640experts Experts ×128 · dim 640 +residual add+ +Final RMSNorm[1, 6, 640] +OpenAIPrivacyFilterForTokenClassificationLM HeadLinear [640→200064] +Softmax +logits[1, 6, 200064] + +model id +openai/privacy-filter +parent +gpt_oss +classes +11 +overridden +14 +added +18 +new classes +3 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +OpenAIPrivacyFilterAttention +ovr __init__,forward + +OpenAIPrivacyFilterEncoderLayer +ovr __init__,forward + +OpenAIPrivacyFilterExperts +ovr _apply_gate,forward + +OpenAIPrivacyFilterModel +ovr __init__,forward + +OpenAIPrivacyFilterTopKRouter +ovr forward + +OpenAIPrivacyFilterConfig +add __post_init__; 13 attr + +OpenAIPrivacyFilterForTokenClassification +rename only + +OpenAIPrivacyFilterMLP +add __init__,forward + +OpenAIPrivacyFilterPreTrainedModel +add get_correct_experts_implementation; 6 attr + \ No newline at end of file diff --git a/openai_privacy_filter.svg b/openai_privacy_filter.svg new file mode 100644 index 0000000000000000000000000000000000000000..d0db80e183b8b43d7266b461c2665f391eaa6384 --- /dev/null +++ b/openai_privacy_filter.svg @@ -0,0 +1,182 @@ + + + + +openai_privacy_filter +sparse-moe · 8× GQA +MoE + +OpenAIPrivacyFilterModel · base model +8 × OpenAIPrivacyFilterEncoderLayerOpenAIPrivacyFilterEncoderLayer× 8 +OpenAIPrivacyFilterForTokenClassification · task head +Self-Attention · OpenAIPrivacyFilterAttention +Sparse MoE · OpenAIPrivacyFilterMLPMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [200064 × 640] → [1, 6, 640] +OpenAIPrivacyFilterRMSNormpre-attention [1, 6, 640] +q_proj: Linear [640→896]q_proj [640→896] +k_proj: Linear [640→128]k_proj [640→128] +v_proj: Linear [640→128]v_proj [640→128] +o_proj: Linear [896→640]o_proj [896→640] +scaled dot-product attention14 heads · head_dim 64 · GQA 14:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +OpenAIPrivacyFilterRMSNormpre-FFN [1, 6, 640] +router: OpenAIPrivacyFilterTopKRouter top-4 of 128router TopKRouter top-4 of 128 +experts: OpenAIPrivacyFilterExperts ×128 · dim 640experts Experts ×128 · dim 640 +residual add+ +Final RMSNorm[1, 6, 640] +OpenAIPrivacyFilterForTokenClassificationLM HeadLinear [640→200064] +Softmax +logits[1, 6, 200064] + +model id +openai/privacy-filter +model_type +openai_privacy_filter +config +OpenAIPrivacyFilterConfig +decoder +sparse-moe +layers +8 +hidden +640 +intermediate +640 +heads / kv +14 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +200,064 +max_pos +131,072 +sliding_window +128 +experts (top-k) +128 (top-4) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/opt.svg b/opt.svg new file mode 100644 index 0000000000000000000000000000000000000000..a99b7029c52ff922e261b39ea6faa014081ac597 --- /dev/null +++ b/opt.svg @@ -0,0 +1,170 @@ + + + + +opt +dense · 12× MHA + +OPTModel · base model +12 × OPTDecoderLayerOPTDecoderLayer× 12 +OPTForCausalLM · task head +Self-Attention · OPTAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50272 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +OPTForCausalLMLM HeadLinear [768→50272] · tied +Softmax +logits[1, 6, 50272] + +model id +facebook/opt-350m +model_type +opt +config +OPTConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,272 +max_pos +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/ovis2.diff.svg b/ovis2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..90af75605b09029c90f262c19fa669a1fdd85928 --- /dev/null +++ b/ovis2.diff.svg @@ -0,0 +1,225 @@ + + + + +ovis2 +diff vs llava_next (+aimv2,llama,llava,siglip) · 12 overridden · 21 added · 0 deleted · 5 new · 5 inherited-as-is + +Ovis2Model · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +Ovis2ForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +Vision encoder · Ovis2VisionMo…×24 +Ovis2VisionEncoderLayer×24 +MLP · Qwen2MLP +attention · LlavaNextVisionAttenti… +ffn · LlavaNextMLP ↩ inherited + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Ovis2ForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +gate_proj: Linear [1024→2816]gate_proj [1024→2816] +up_proj: Linear [1024→2816]up_proj [1024→2816] +down_proj: Linear [2816→1024]down_proj [2816→1024] +act_fn: SiLUActivationact_fn SiLU +rms_norm1: Ovis2RMSNorm 1024rms_norm1 RMSNorm 1024 +rms_norm2: Ovis2RMSNorm 1024rms_norm2 RMSNorm 1024 +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Ovis2VisualEmbedding…Ovis2VisualEmbeddingTable · via AutoModel · 24 layers · h=1024×24 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +thisisiron/Ovis2-1B-hf +parent +llava_next +classes +15 +overridden +12 +added +21 +new classes +5 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Ovis2ForConditionalGeneration +ovr __init__,forward,get_image_features + +Ovis2Model +ovr __init__,forward,get_image_features + +Ovis2VisionEmbeddings +ovr __init__,forward,interpolate_pos_encoding + +Ovis2VisionEncoder +ovr __init__,forward + +Ovis2VisionEncoderLayer +ovr __init__ + +BaseModelOutputWithVisualIndicatorFeatures +1 attr + +Ovis2PreTrainedModel +add _init_weights; 12 attr + +Ovis2VisionModel +add __init__,forward; 2 attr + +Ovis2VisionTransformer +add __init__,forward + +Ovis2VisualEmbeddingTable +add forward + \ No newline at end of file diff --git a/ovis2.svg b/ovis2.svg new file mode 100644 index 0000000000000000000000000000000000000000..67d4fae38b6877f92e503c2d10baf3472834e060 --- /dev/null +++ b/ovis2.svg @@ -0,0 +1,218 @@ + + + + +ovis2 +multimodal · vision+vision → projector → LLM · dense + +Ovis2Model · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +Ovis2ForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +Vision encoder · Ovis2VisionMo…×24 +Ovis2VisionEncoderLayer×24 +MLP · Qwen2MLP +attention · Ovis2VisionAttention +ffn · Ovis2MLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Ovis2ForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +gate_proj: Linear [1024→2816]gate_proj [1024→2816] +up_proj: Linear [1024→2816]up_proj [1024→2816] +down_proj: Linear [2816→1024]down_proj [2816→1024] +act_fn: SiLUActivationact_fn SiLU +rms_norm1: Ovis2RMSNorm 1024rms_norm1 RMSNorm 1024 +rms_norm2: Ovis2RMSNorm 1024rms_norm2 RMSNorm 1024 +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Ovis2VisualEmbedding…Ovis2VisualEmbeddingTable · via AutoModel · 24 layers · h=1024×24 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +thisisiron/Ovis2-1B-hf +inputs +input_ids, pixel_values +built via +AutoModel +model_type +ovis2 +config +Ovis2Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/owlv2.diff.svg b/owlv2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..deb81a4fd922280a25b871476944ffe989602c6c --- /dev/null +++ b/owlv2.diff.svg @@ -0,0 +1,190 @@ + + + + +owlv2 +diff vs None · 0 overridden · 29 added · 0 deleted · 2 new · 0 inherited-as-is + +Owlv2Model · base model +12 × Owlv2EncoderLayerOwlv2EncoderLayer× 12 +image ⊕ text attention +Vision encoder · Owlv2VisionTra…×12 +Self-Attention · Owlv2Attention +Owlv2EncoderLayer×12 +MLP · Owlv2MLP +self_attn · Owlv2Attention +mlp · Owlv2MLP + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +google/owlv2-base-patch16 +parent +— +classes +2 +overridden +0 +added +29 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Owlv2ImageProcessor +add _pad_images,_preprocess,pad,resize; 11 a… + +Owlv2ImageProcessorPil +add _preprocess,pad,resize; 11 attr + \ No newline at end of file diff --git a/owlv2.svg b/owlv2.svg new file mode 100644 index 0000000000000000000000000000000000000000..6698b06320d5b0dc6588902d6ae4a9a64aae20be --- /dev/null +++ b/owlv2.svg @@ -0,0 +1,205 @@ + + + + +owlv2 +multimodal · vision → projector → LLM · dense + +Owlv2Model · base model +12 × Owlv2EncoderLayerOwlv2EncoderLayer× 12 +image ⊕ text attention +Vision encoder · Owlv2VisionTra…×12 +Self-Attention · Owlv2Attention +Owlv2EncoderLayer×12 +MLP · Owlv2MLP +self_attn · Owlv2Attention +mlp · Owlv2MLP + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +google/owlv2-base-patch16 +inputs +input_ids, pixel_values +model_type +owlv2 +config +Owlv2Config +decoder +dense +layers +12 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +49,408 +max_pos +16 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/owlvit.svg b/owlvit.svg new file mode 100644 index 0000000000000000000000000000000000000000..b9e14962a0e1ed9f3e0e752358ab11dfb3a560e0 --- /dev/null +++ b/owlvit.svg @@ -0,0 +1,223 @@ + + + + +owlvit +multimodal · vision+vision → projector → LLM · dense + +OwlViTModel · base model +12 × OwlViTEncoderLayerOwlViTEncoderLayer× 12 +image ⊕ text attention +Vision encoder · OwlViTTextTra…×12 +Vision encoder · OwlViTVisionTr…×12 +Self-Attention · OwlViTAttention +OwlViTEncoderLayer×12 +OwlViTEncoderLayer×12 +MLP · OwlViTMLP +self_attn · OwlViTAttention +self_attn · OwlViTAttention +mlp · OwlViTMLP +mlp · OwlViTMLP + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +google/owlvit-base-patch16 +inputs +input_ids, pixel_values +model_type +owlvit +config +OwlViTConfig +decoder +dense +layers +12 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +49,408 +max_pos +16 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/paddleocr_vl.diff.svg b/paddleocr_vl.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..2c747147dfd00c8e1bee30cd9b160932c7e9079a --- /dev/null +++ b/paddleocr_vl.diff.svg @@ -0,0 +1,234 @@ + + + + +paddleocr_vl +diff vs qwen2_vl (+ernie4_5,video_llama_3,siglip,qwen2_5_omni) · 18 overridden · 56 added · 2 deleted · 12 new · 5 inherited-as-is + +PaddleOCRVLForConditionalGeneration · base model +18 × PaddleOCRDecoderLayerPaddleOCRDecoderLayer× 18 +PaddleOCRVLForConditionalGeneration · task head +Self-Attention · PaddleOCRAttention +MLP · PaddleOCRMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [103424 × 1024] → [1, 6, 1024] +PaddleOCRRMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→2048]q_proj [1024→2048] +k_proj: Linear [1024→256]k_proj [1024→256] +v_proj: Linear [1024→256]v_proj [1024→256] +o_proj: Linear [2048→1024]o_proj [2048→1024] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +PaddleOCRRMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→3072]gate_proj [1024→3072] +up_proj: Linear [1024→3072]up_proj [1024→3072] +down_proj: Linear [3072→1024]down_proj [3072→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +PaddleOCRVLForConditionalGenerationLM HeadLinear [1024→103424] · tied +Softmax +logits[1, 6, 103424] + +model id +PaddlePaddle/PaddleOCR-VL +parent +qwen2_vl +classes +28 +overridden +18 +added +56 +new classes +12 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PaddleOCRVLForConditionalGeneration +ovr forward; del get_video_features; 1 attr + +PaddleOCRVLModel +ovr __init__,forward,get_image_features,get_… + +PaddleOCRAttention +ovr __init__ + +PaddleOCRDecoderLayer +ovr __init__ + +PaddleOCRMLP +ovr __init__ + +PaddleOCRTextModel +ovr __init__,forward + +PaddleOCRVisionAttention +ovr __init__ + +PaddleOCRVisionEmbeddings +ovr __init__,forward,interpolate_pos_encoding + +PaddleOCRVisionEncoder +ovr __init__,forward + +PaddleOCRVisionEncoderLayer +ovr __init__ + +PaddleOCRVisionMLP +ovr __init__ + +PaddleOCRProjector +add __init__,forward + +PaddleOCRTextConfig +1 attr + +PaddleOCRVLConfig +6 attr + +PaddleOCRVLImageProcessor +add _preprocess,get_number_of_image_patches;… + +PaddleOCRVLImageProcessorKwargs +rename only + +PaddleOCRVLImageProcessorPil +add _preprocess,get_number_of_image_patches;… + +PaddleOCRVLPreTrainedModel +add _init_weights; 11 attr + +PaddleOCRVLProcessor +add __call__,__init__; 2 attr + +PaddleOCRVLProcessorKwargs +1 attr + +PaddleOCRVisionConfig +9 attr + +PaddleOCRVisionModel +add __init__,forward; 3 attr + +PaddleOCRVisionTransformer +add __init__,forward; 4 attr + \ No newline at end of file diff --git a/paddleocr_vl.svg b/paddleocr_vl.svg new file mode 100644 index 0000000000000000000000000000000000000000..6f599b015cf1d85cab64fe4b89928eba4173e380 --- /dev/null +++ b/paddleocr_vl.svg @@ -0,0 +1,180 @@ + + + + +paddleocr_vl +dense · 18× GQA + +PaddleOCRVLForConditionalGeneration · base model +18 × PaddleOCRDecoderLayerPaddleOCRDecoderLayer× 18 +PaddleOCRVLForConditionalGeneration · task head +Self-Attention · PaddleOCRAttention +MLP · PaddleOCRMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [103424 × 1024] → [1, 6, 1024] +PaddleOCRRMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→2048]q_proj [1024→2048] +k_proj: Linear [1024→256]k_proj [1024→256] +v_proj: Linear [1024→256]v_proj [1024→256] +o_proj: Linear [2048→1024]o_proj [2048→1024] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +PaddleOCRRMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→3072]gate_proj [1024→3072] +up_proj: Linear [1024→3072]up_proj [1024→3072] +down_proj: Linear [3072→1024]down_proj [3072→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +PaddleOCRVLForConditionalGenerationLM HeadLinear [1024→103424] · tied +Softmax +logits[1, 6, 103424] + +model id +PaddlePaddle/PaddleOCR-VL +model_type +paddleocr_vl +config +PaddleOCRVLConfig +decoder +dense +layers +18 +hidden +1,024 +intermediate +3,072 +heads / kv +16 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +103,424 +max_pos +131,072 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/paligemma.svg b/paligemma.svg new file mode 100644 index 0000000000000000000000000000000000000000..a7189750e52a4119fb81fc71a9144c79cf261e2b --- /dev/null +++ b/paligemma.svg @@ -0,0 +1,212 @@ + + + + +paligemma +multimodal · vision → projector → LLM · dense + +PaliGemmaModel · base model +18 × GemmaDecoderLayerGemmaDecoderLayer× 18 +PaliGemmaForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · SiglipVisionMo…×27 +Self-Attention · GemmaAttention +SiglipEncoderLayer×27 +MLP · GemmaMLP +self_attn · SiglipAttention +mlp · SiglipMLP +Projector · PaliGemmaMultiModalProj… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [257152 × 2048] → [1, 6, 2048] +GemmaRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→256]k_proj [2048→256] +v_proj: Linear [2048→256]v_proj [2048→256] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:1 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +GemmaRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→16384]gate_proj [2048→16384] +up_proj: Linear [2048→16384]up_proj [2048→16384] +down_proj: Linear [16384→2048]down_proj [16384→2048] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2048] +PaliGemmaForConditionalGenerationLM HeadLinear [2048→257152] · tied +Softmax +logits[1, 6, 257152] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→4096]fc1 [1152→4096] +fc2: Linear [4096→1152]fc2 [4096→1152] +linear: Linear [1152→2048]linear [1152→2048] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/paligemma-3b-pt-224 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +paligemma +config +PaliGemmaConfig +decoder +dense +layers +18 +hidden +2,048 +intermediate +16,384 +heads / kv +8 / 1 +attention +MQA +norm +RMSNorm +positional +RoPE +vocab +257,152 +max_pos +8,192 +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/parakeet.diff.svg b/parakeet.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..2f96a14e5b7675939a9ac229b7149f2470f5c6be --- /dev/null +++ b/parakeet.diff.svg @@ -0,0 +1,209 @@ + + + + +parakeet +diff vs fastspeech2_conformer (+llama) · 3 overridden · 55 added · 0 deleted · 14 new · 0 inherited-as-is + +ParakeetForCTC · base model +24 × ParakeetEncoderBlockParakeetEncoderBlock× 24 +Self-Attention · ParakeetEncoderAttention +MLP · ParakeetEncoderFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [1025 × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +relative_k_proj: Linear [1024→1024]relative_k_proj [1024→1024] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→1025] +Softmax +logits[1, 6, 1025] + +model id +nvidia/parakeet-ctc-1.1b +parent +fastspeech2_conformer +classes +16 +overridden +3 +added +55 +new classes +14 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ParakeetEncoderConvolutionModule +ovr __init__ + +ParakeetCTCGenerateOutput +4 attr + +ParakeetEncoder +add __init__,forward; 2 attr + +ParakeetEncoderAttention +ovr __init__,forward; add _rel_shift + +ParakeetEncoderBlock +add __init__,forward + +ParakeetEncoderFeedForward +add __init__,forward + +ParakeetEncoderModelOutput +1 attr + +ParakeetEncoderRelPositionalEncoding +add __init__,compute_default_relative_positi… + +ParakeetEncoderSubsamplingConv2D +add __init__,_get_output_length,forward + +ParakeetForCTC +add __init__,forward,generate; 1 attr + +ParakeetForTDT +add __init__,forward,get_audio_features; 3 a… + +ParakeetGenerateOutput +add __init__ + +ParakeetPreTrainedModel +add _get_output_attention_mask,_get_subsampl… + +ParakeetTDTDecoder +add __init__,forward + +ParakeetTDTJointNetwork +add __init__,forward + +ParakeetTDTOutput +3 attr + \ No newline at end of file diff --git a/parakeet.svg b/parakeet.svg new file mode 100644 index 0000000000000000000000000000000000000000..363965697cd523278579783392e08bd7665da913 --- /dev/null +++ b/parakeet.svg @@ -0,0 +1,176 @@ + + + + +parakeet +dense · 24× Attention + +ParakeetForCTC · base model +24 × ParakeetEncoderBlockParakeetEncoderBlock× 24 +Self-Attention · ParakeetEncoderAttention +MLP · ParakeetEncoderFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [1025 × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +relative_k_proj: Linear [1024→1024]relative_k_proj [1024→1024] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→1025] +Softmax +logits[1, 6, 1025] + +model id +nvidia/parakeet-ctc-1.1b +model_type +parakeet_ctc +config +ParakeetCTCConfig +decoder +dense +layers +24 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +1,025 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/patchtsmixer.svg b/patchtsmixer.svg new file mode 100644 index 0000000000000000000000000000000000000000..81d3ddd0f4089146853170351f1213f3e45ca8cb --- /dev/null +++ b/patchtsmixer.svg @@ -0,0 +1,175 @@ + + + + +patchtsmixer +ssm · 3× Mamba + +PatchTSMixerModel · base model +3 × PatchMixerBlockPatchMixerBlock× 3 +Self-Attention · PatchTSMixerGatedAttention +MLP · PatchTSMixerMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 8] → [1, 6, 8] +PatchTSMixerNormLayerpre-attention [1, 6, 8] +attn_layer: Linear [4→4]attn_layer [4→4] +attn_softmax: Softmaxattn_softmax Softmax +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +PatchTSMixerNormLayerpre-FFN [1, 6, 8] +fc1: Linear [4→8]fc1 [4→8] +dropout1: Dropoutdropout1 Dropout +fc2: Linear [8→4]fc2 [8→4] +dropout2: Dropoutdropout2 Dropout +residual add+ +Final LayerNorm[1, 6, 8] +LM HeadLinear [8→?] +Softmax +logits[1, 6, ?] + +model id +ibm/patchtsmixer-etth1-pretra… +model_type +patchtsmixer +config +PatchTSMixerConfig +decoder +ssm +layers +3 +hidden +8 +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/patchtst.svg b/patchtst.svg new file mode 100644 index 0000000000000000000000000000000000000000..3849882c4fe0c44d2a6479a85d26fecb2171e21a --- /dev/null +++ b/patchtst.svg @@ -0,0 +1,169 @@ + + + + +patchtst +dense · 3× MHA + +PatchTSTModel · base model +3 × PatchTSTEncoderLayerPatchTSTEncoderLayer× 3 +Self-Attention · PatchTSTAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 128] → [1, 6, 128] +PatchTSTBatchNormpre-attention [1, 6, 128] +k_proj: Linear [128→128]k_proj [128→128] +v_proj: Linear [128→128]v_proj [128→128] +q_proj: Linear [128→128]q_proj [128→128] +out_proj: Linear [128→128]out_proj [128→128] +scaled dot-product attention4 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final BatchNorm1d[1, 6, 128] +LM HeadLinear [128→?] +Softmax +logits[1, 6, ?] + +model id +ibm-granite/granite-timeserie… +model_type +patchtst +config +PatchTSTConfig +decoder +dense +layers +3 +hidden +128 +intermediate +512 +heads / kv +4 / 4 +attention +MHA +norm +BatchNorm1d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pe_audio.diff.svg b/pe_audio.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..a7fdb7550584c0eaadff228cd3ea0d5cacbadd6d --- /dev/null +++ b/pe_audio.diff.svg @@ -0,0 +1,248 @@ + + + + +pe_audio +diff vs pe_audio_video (+dac) · 7 overridden · 17 added · 0 deleted · 5 new · 1 inherited-as-is + +PeAudioModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +Audio encoder · PeAudioEncoder×6 +PeAudioEncoderLayer×6 +self_attn · PeAudioEncoderAttent… +mlp · PeAudioEncoderMLP +MLP · ModernBertMLP +Audio encoder · PeAudioVideoC…×6 +Audio encoder · PeAudioVideoC…×6 + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +Wqkv: Linear [1024→3072]Wqkv [1024→3072] +Wo: Linear [1024→1024]Wo [1024→1024] +out_drop: Identityout_drop Identity +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +Wi: Linear [1024→5248]Wi [1024→5248] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [2624→1024]Wo [2624→1024] +residual add+ +Final RMSNorm[1, 6, 1024] +LM HeadLinear [1024→50368] +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +input_features[1, 128, 3000] +q_proj: Linear [1792→1792]q_proj [1792→1792] +k_proj: Linear [1792→1792]k_proj [1792→1792] +v_proj: Linear [1792→1792]v_proj [1792→1792] +o_proj: Linear [1792→1792]o_proj [1792→1792] +q_norm: PeAudioEncoderRMSNorm 128q_norm EncoderRMSNorm 12… +k_norm: PeAudioEncoderRMSNorm 128k_norm EncoderRMSNorm 12… +gate_proj: Linear [1792→4800]gate_proj [1792→4800] +up_proj: Linear [1792→4800]up_proj [1792→4800] +down_proj: Linear [4800→1792]down_proj [4800→1792] +act_fn: SiLUActivationact_fn SiLU +input_layernorm: PeAudioEncoderRMSNorm 1792input_layernormEncoderRMSNorm 1792 +post_attention_layernorm: PeAudioEncoderRMSNorm 1792post_attention_layernormEncoderRMSNorm 1792 +input_features[1, 128, 3000] +layer_norm: LayerNorm 1024layer_norm LayerNorm 1024 +proj: Linear [1024→1024]proj [1024→1024] +input_features[1, 128, 3000] +layer_norm: LayerNorm 1792layer_norm LayerNorm 1792 +proj: Linear [1792→1024]proj [1792→1024] +Projector · Linearalign features → text hidden dim +merge at modality tokens + +model id +facebook/pe-av-large +parent +pe_audio_video +classes +10 +overridden +7 +added +17 +new classes +5 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PeAudioDacEncoder +ovr __init__ + +PeAudioDacEncoderBlock +ovr __init__ + +PeAudioEncoder +ovr forward; 1 attr + +PeAudioPreTrainedModel +ovr _init_weights; 2 attr + +PeAudioEncoderEmbedder +add __init__,forward + +PeAudioEncoderOutput +2 attr + +PeAudioFrameLevelModel +add forward,get_audio_embeds + +PeAudioModel +add __init__,forward,get_audio_embeds,get_te… + +PeAudioOutput +add to_tuple; 6 attr + \ No newline at end of file diff --git a/pe_audio.svg b/pe_audio.svg new file mode 100644 index 0000000000000000000000000000000000000000..e61ac10286bea995174b7f5688dd63d9e8d6c2c4 --- /dev/null +++ b/pe_audio.svg @@ -0,0 +1,250 @@ + + + + +pe_audio +multimodal · audio+audio+audio → projector → LLM · dense + +PeAudioModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +Audio encoder · PeAudioEncoder×6 +PeAudioEncoderLayer×6 +self_attn · PeAudioEncoderAttent… +mlp · PeAudioEncoderMLP +MLP · ModernBertMLP +Audio encoder · PeAudioContras…×6 +Audio encoder · PeAudioContras…×6 + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +Wqkv: Linear [1024→3072]Wqkv [1024→3072] +Wo: Linear [1024→1024]Wo [1024→1024] +out_drop: Identityout_drop Identity +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +Wi: Linear [1024→5248]Wi [1024→5248] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [2624→1024]Wo [2624→1024] +residual add+ +Final RMSNorm[1, 6, 1024] +LM HeadLinear [1024→50368] +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +input_features[1, 128, 3000] +q_proj: Linear [1792→1792]q_proj [1792→1792] +k_proj: Linear [1792→1792]k_proj [1792→1792] +v_proj: Linear [1792→1792]v_proj [1792→1792] +o_proj: Linear [1792→1792]o_proj [1792→1792] +q_norm: PeAudioEncoderRMSNorm 128q_norm EncoderRMSNorm 12… +k_norm: PeAudioEncoderRMSNorm 128k_norm EncoderRMSNorm 12… +gate_proj: Linear [1792→4800]gate_proj [1792→4800] +up_proj: Linear [1792→4800]up_proj [1792→4800] +down_proj: Linear [4800→1792]down_proj [4800→1792] +act_fn: SiLUActivationact_fn SiLU +input_layernorm: PeAudioEncoderRMSNorm 1792input_layernormEncoderRMSNorm 1792 +post_attention_layernorm: PeAudioEncoderRMSNorm 1792post_attention_layernormEncoderRMSNorm 1792 +input_features[1, 128, 3000] +layer_norm: LayerNorm 1024layer_norm LayerNorm 1024 +proj: Linear [1024→1024]proj [1024→1024] +input_features[1, 128, 3000] +layer_norm: LayerNorm 1792layer_norm LayerNorm 1792 +proj: Linear [1792→1024]proj [1792→1024] +Projector · Linearalign features → text hidden dim +merge at modality tokens + +model id +facebook/pe-av-large +inputs +input_ids, input_features +built via +AutoModel +model_type +pe_audio +config +PeAudioConfig +decoder +dense +layers +22 +hidden +1,024 +intermediate +2,624 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +50,368 +max_pos +8,192 +sliding_window +64 +tie_embeddings +None +legend + +audio encoder + +self-attention + +full + +sliding + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/pe_audio_video.diff.svg b/pe_audio_video.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..6e0ff3721530d8683eea1c5c70dbec2c387a1f69 --- /dev/null +++ b/pe_audio_video.diff.svg @@ -0,0 +1,289 @@ + + + + +pe_audio_video +diff vs qwen3 · 3 overridden · 72 added · 0 deleted · 12 new · 2 inherited-as-is + +PeAudioVideoModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +Audio encoder · PeAudioVideoEncoder +Audio encoder · PeAudioModel +EvaBlock×24 +ModernBertEncoderLayer×22 +mlp · Mlp +mlp · ModernBertMLP +MLP · ModernBertMLP +attn · ModernBertAttention +Audio encoder · PeAudioVideoContrasti… +Audio encoder · PeAudioVideoContrasti… +Audio encoder · PeAudioVideoContrasti… +Audio encoder · PeAudioVideoContrasti… + + + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +Wqkv: Linear [1024→3072]Wqkv [1024→3072] +Wo: Linear [1024→1024]Wo [1024→1024] +out_drop: Identityout_drop Identity +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +Wi: Linear [1024→5248]Wi [1024→5248] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [2624→1024]Wo [2624→1024] +residual add+ +Final RMSNorm[1, 6, 1024] +LM HeadLinear [1024→50368] · tied +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +input_features[1, 128, 3000] +attn_norm: Identityattn_norm Identity +Wqkv: Linear [1024→3072]Wqkv [1024→3072] +Wo: Linear [1024→1024]Wo [1024→1024] +out_drop: Identityout_drop Identity +mlp_norm: LayerNorm 1024mlp_norm LayerNorm 1024 +Wi: Linear [1024→5248]Wi [1024→5248] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [2624→1024]Wo [2624→1024] +input_features[1, 128, 3000] +norm1: LayerNorm 1024norm1 LayerNorm 1024 +attn: AttentionRopeattn AttentionRope +drop_path1: Identitydrop_path1 Identity +norm2: LayerNorm 1024norm2 LayerNorm 1024 +fc1: Linear [1024→4096]fc1 [1024→4096] +act: GELUact GELU +drop1: Dropoutdrop1 Dropout +norm: Identitynorm Identity +fc2: Linear [4096→1024]fc2 [4096→1024] +drop2: Dropoutdrop2 Dropout +drop_path2: Identitydrop_path2 Identity +input_features[1, 128, 3000] +layer_norm: LayerNorm 1792layer_norm LayerNorm 1792 +proj: Linear [1792→1024]proj [1792→1024] +input_features[1, 128, 3000] +layer_norm: LayerNorm 1024layer_norm LayerNorm 1024 +proj: Linear [1024→1024]proj [1024→1024] +input_features[1, 128, 3000] +layer_norm: LayerNorm 2816layer_norm LayerNorm 2816 +proj: Linear [2816→1024]proj [2816→1024] +input_features[1, 128, 3000] +layer_norm: LayerNorm 2816layer_norm LayerNorm 2816 +proj: Linear [2816→1024]proj [2816→1024] +Projector · Linearalign features → text hidden dim +merge at modality tokens + +model id +facebook/pe-av-large +parent +qwen3 +classes +16 +overridden +3 +added +72 +new classes +12 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PeAudioVideoEncoderAttention +ovr __init__,forward + +PeAudioVideoEncoderLayer +ovr __init__ + +AudioVideoEmbeddings +3 attr + +PeAudioVideoContrastiveHead +add __init__,forward + +PeAudioVideoConvBlock1d +add __init__,forward + +PeAudioVideoEncoder +add __init__,forward; 3 attr + +PeAudioVideoEncoderEmbedder +add __init__,_align_video_hidden_state,forward + +PeAudioVideoEncoderOutput +2 attr + +PeAudioVideoEncoderPatchEmbedder +add __init__,forward + +PeAudioVideoMaskedGroupNorm +add forward + +PeAudioVideoModel +add __init__,_contrastive_loss,forward,get_a… + +PeAudioVideoOutput +add to_tuple; 25 attr + +PeAudioVideoPreTrainedModel +add _init_weights; 11 attr + +PeAudioVideoResnetBlock1d +add __init__,forward + \ No newline at end of file diff --git a/pe_audio_video.svg b/pe_audio_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..69803ed76ff278c8406cf49688b1b80def5f6031 --- /dev/null +++ b/pe_audio_video.svg @@ -0,0 +1,276 @@ + + + + +pe_audio_video +multimodal · audio+audio+audio+audio+audio+audio → projector → LLM · dense + +PeAudioVideoModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +Audio encoder · PeAudioVideoEncoder +Audio encoder · PeAudioModel +EvaBlock×24 +ModernBertEncoderLayer×22 +mlp · Mlp +mlp · ModernBertMLP +MLP · ModernBertMLP +attn · ModernBertAttention +Audio encoder · PeAudioVideoContrasti… +Audio encoder · PeAudioVideoContrasti… +Audio encoder · PeAudioVideoContrasti… +Audio encoder · PeAudioVideoContrasti… + + + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +Wqkv: Linear [1024→3072]Wqkv [1024→3072] +Wo: Linear [1024→1024]Wo [1024→1024] +out_drop: Identityout_drop Identity +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +Wi: Linear [1024→5248]Wi [1024→5248] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [2624→1024]Wo [2624→1024] +residual add+ +Final RMSNorm[1, 6, 1024] +LM HeadLinear [1024→50368] · tied +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +input_features[1, 128, 3000] +attn_norm: Identityattn_norm Identity +Wqkv: Linear [1024→3072]Wqkv [1024→3072] +Wo: Linear [1024→1024]Wo [1024→1024] +out_drop: Identityout_drop Identity +mlp_norm: LayerNorm 1024mlp_norm LayerNorm 1024 +Wi: Linear [1024→5248]Wi [1024→5248] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [2624→1024]Wo [2624→1024] +input_features[1, 128, 3000] +norm1: LayerNorm 1024norm1 LayerNorm 1024 +attn: AttentionRopeattn AttentionRope +drop_path1: Identitydrop_path1 Identity +norm2: LayerNorm 1024norm2 LayerNorm 1024 +fc1: Linear [1024→4096]fc1 [1024→4096] +act: GELUact GELU +drop1: Dropoutdrop1 Dropout +norm: Identitynorm Identity +fc2: Linear [4096→1024]fc2 [4096→1024] +drop2: Dropoutdrop2 Dropout +drop_path2: Identitydrop_path2 Identity +input_features[1, 128, 3000] +layer_norm: LayerNorm 1792layer_norm LayerNorm 1792 +proj: Linear [1792→1024]proj [1792→1024] +input_features[1, 128, 3000] +layer_norm: LayerNorm 1024layer_norm LayerNorm 1024 +proj: Linear [1024→1024]proj [1024→1024] +input_features[1, 128, 3000] +layer_norm: LayerNorm 2816layer_norm LayerNorm 2816 +proj: Linear [2816→1024]proj [2816→1024] +input_features[1, 128, 3000] +layer_norm: LayerNorm 2816layer_norm LayerNorm 2816 +proj: Linear [2816→1024]proj [2816→1024] +Projector · Linearalign features → text hidden dim +merge at modality tokens + +model id +facebook/pe-av-large +inputs +input_ids, input_features +built via +AutoModel +model_type +pe_audio_video +config +PeAudioVideoConfig +decoder +dense +layers +22 +hidden +1,024 +intermediate +2,624 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +50,368 +max_pos +8,192 +sliding_window +64 +tie_embeddings +True +legend + +audio encoder + +self-attention + +full + +sliding + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/pe_video.diff.svg b/pe_video.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..224e385a4e7c8f14ab9c606fbca42966fe818a89 --- /dev/null +++ b/pe_video.diff.svg @@ -0,0 +1,202 @@ + + + + +pe_video +diff vs pe_audio_video · 6 overridden · 13 added · 0 deleted · 3 new · 2 inherited-as-is + +PeVideoModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +MLP · ModernBertMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +Wqkv: Linear [1024→3072]Wqkv [1024→3072] +Wo: Linear [1024→1024]Wo [1024→1024] +out_drop: Identityout_drop Identity +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +Wi: Linear [1024→5248]Wi [1024→5248] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [2624→1024]Wo [2624→1024] +residual add+ +Final RMSNorm[1, 6, 1024] +LM HeadLinear [1024→50368] +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 + +model id +facebook/pe-av-large +parent +pe_audio_video +classes +7 +overridden +6 +added +13 +new classes +3 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PeVideoEncoder +ovr __init__,forward; 2 attr + +PeVideoEncoderEmbedder +add __init__,forward + +PeVideoModel +add __init__,forward; 1 attr + +PeVideoOutput +add to_tuple; 6 attr + +PeVideoPreTrainedModel +3 attr + \ No newline at end of file diff --git a/pe_video.svg b/pe_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..a6d1b1f389bc9bb964ac59f5e8e1834bb74a7907 --- /dev/null +++ b/pe_video.svg @@ -0,0 +1,208 @@ + + + + +pe_video +dense · 8× full + 14× sliding + +PeVideoModel · base model +22 × ModernBertEncoderLayerModernBertEncoderLayer× 22 +layers (idx) +Self-Attention · ModernBertAttention (2 layer types — same modules, mask differs) +MLP · ModernBertMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50368 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +Wqkv: Linear [1024→3072]Wqkv [1024→3072] +Wo: Linear [1024→1024]Wo [1024→1024] +out_drop: Identityout_drop Identity +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +sliding_attention attention mask (q↓ × k→)sliding mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +Wi: Linear [1024→5248]Wi [1024→5248] +act: GELUActivationact GELU +drop: Dropoutdrop Dropout +Wo: Linear [2624→1024]Wo [2624→1024] +residual add+ +Final RMSNorm[1, 6, 1024] +LM HeadLinear [1024→50368] +Softmax +logits[1, 6, 50368] +layer 0: full_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: sliding_attention5 +layer 6: full_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: sliding_attention11 +layer 12: full_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: sliding_attention17 +layer 18: full_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 + +model id +facebook/pe-av-large +model_type +pe_video +config +PeVideoConfig +decoder +dense +layers +22 +hidden +1,024 +intermediate +2,624 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +50,368 +max_pos +8,192 +sliding_window +64 +tie_embeddings +None +legend + +self-attention + +full + +sliding + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pegasus.svg b/pegasus.svg new file mode 100644 index 0000000000000000000000000000000000000000..ce517470b5432e8d1058dbfe96af2a39f6483ac1 --- /dev/null +++ b/pegasus.svg @@ -0,0 +1,170 @@ + + + + +pegasus +dense · 12× MHA + +PegasusModel · base model +12 × PegasusEncoderLayerPegasusEncoderLayer× 12 +PegasusForConditionalGeneration · task head +Self-Attention · PegasusAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +PegasusForConditionalGenerationLM HeadLinear [1024→50265] · tied +Softmax +logits[1, 6, 50265] + +model id +google/pegasus-large +model_type +pegasus +config +PegasusConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pegasus_x.svg b/pegasus_x.svg new file mode 100644 index 0000000000000000000000000000000000000000..cd45d333be00a09791b48c1d7e9b2bc2fd4fcf5e --- /dev/null +++ b/pegasus_x.svg @@ -0,0 +1,170 @@ + + + + +pegasus_x +dense · 16× MHA + +PegasusXModel · base model +16 × PegasusXEncoderLayerPegasusXEncoderLayer× 16 +PegasusXForConditionalGeneration · task head +Self-Attention · PegasusXGlobalLocalAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [96103 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +PegasusXForConditionalGenerationLM HeadLinear [1024→96103] · tied +Softmax +logits[1, 6, 96103] + +model id +google/pegasus-x-large +model_type +pegasus_x +config +PegasusXConfig +decoder +dense +layers +16 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +96,103 +max_pos +16,384 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/perceiver.svg b/perceiver.svg new file mode 100644 index 0000000000000000000000000000000000000000..80fa192c43157beb4bc92a08be27909450bc531f --- /dev/null +++ b/perceiver.svg @@ -0,0 +1,177 @@ + + + + +perceiver +dense · 26× Attention + +PerceiverModel · base model +26 × PerceiverLayerPerceiverLayer× 26 +PerceiverForImageClassificationLearned · task head +Self-Attention · PerceiverAttention +self · PerceiverSelfAttention +MLP · PerceiverMLP +output · PerceiverSelfOutput + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +layernorm1: LayerNorm 1280layernorm1 LayerNorm 1280 +layernorm2: Identitylayernorm2 Identity +query: Linear [1280→1280]query [1280→1280] +key: Linear [1280→1280]key [1280→1280] +value: Linear [1280→1280]value [1280→1280] +dropout: Dropoutdropout Dropout +dense: Linear [1280→1280]dense [1280→1280] +scaled dot-product attention? heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +dense1: Linear [1280→1280]dense1 [1280→1280] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense2: Linear [1280→1280]dense2 [1280→1280] +residual add+ +Final LayerNorm[1, 6, 768] +PerceiverForImageClassificationLearnedPool (CLS / mean)[1, 6, 768] → [1, 768] +PerceiverForImageClassificationLearnedClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +deepmind/language-perceiver +model_type +perceiver +config +PerceiverConfig +decoder +dense +layers +26 +hidden +768 +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +262 +max_pos +2,048 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/perception_lm.diff.svg b/perception_lm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..5643492ae7bc4a42656e75e058d2dc7ccf16b6c8 --- /dev/null +++ b/perception_lm.diff.svg @@ -0,0 +1,214 @@ + + + + +perception_lm +diff vs llava · 7 overridden · 6 added · 1 deleted · 2 new · 0 inherited-as-is + +PerceptionLMModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +PerceptionLMForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · TimmWrapperModel +Self-Attention · LlamaAttention +EvaBlock×24 +MLP · LlamaMLP +mlp · Mlp +Projector · PerceptionLMMultiModalPr… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +PerceptionLMForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1024norm1 LayerNorm 1024 +attn: AttentionRopeattn AttentionRope +drop_path1: Identitydrop_path1 Identity +norm2: LayerNorm 1024norm2 LayerNorm 1024 +fc1: Linear [1024→4096]fc1 [1024→4096] +act: GELUact GELU +drop1: Dropoutdrop1 Dropout +norm: Identitynorm Identity +fc2: Linear [4096→1024]fc2 [4096→1024] +drop2: Dropoutdrop2 Dropout +drop_path2: Identitydrop_path2 Identity +linear_1: Linear [1024→4096]linear_1 [1024→4096] +gelu: GELUgelu GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +pooling: Identitypooling Identity +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/Perception-LM-1B +parent +llava +classes +7 +overridden +7 +added +6 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PerceptionLMForConditionalGeneration +ovr forward,prepare_inputs_for_generation; d… + +PerceptionLMModel +ovr __init__,forward,get_image_features,get_… + +PerceptionLMPreTrainedModel +1 attr + +PerceptionLMAdaptiveAvgPooling +add __init__,forward + +PerceptionLMCausalLMOutputWithPast +1 attr + +PerceptionLMModelOutputWithPast +1 attr + +PerceptionLMMultiModalProjector +add __init__,forward + \ No newline at end of file diff --git a/perception_lm.svg b/perception_lm.svg new file mode 100644 index 0000000000000000000000000000000000000000..532efb95b9d3a9d9b1881586396c9bcf32d8c3a5 --- /dev/null +++ b/perception_lm.svg @@ -0,0 +1,216 @@ + + + + +perception_lm +multimodal · vision → projector → LLM · dense + +PerceptionLMModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +PerceptionLMForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · TimmWrapperModel +Self-Attention · LlamaAttention +EvaBlock×24 +MLP · LlamaMLP +mlp · Mlp +Projector · PerceptionLMMultiModalPr… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +PerceptionLMForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1024norm1 LayerNorm 1024 +attn: AttentionRopeattn AttentionRope +drop_path1: Identitydrop_path1 Identity +norm2: LayerNorm 1024norm2 LayerNorm 1024 +fc1: Linear [1024→4096]fc1 [1024→4096] +act: GELUact GELU +drop1: Dropoutdrop1 Dropout +norm: Identitynorm Identity +fc2: Linear [4096→1024]fc2 [4096→1024] +drop2: Dropoutdrop2 Dropout +drop_path2: Identitydrop_path2 Identity +linear_1: Linear [1024→4096]linear_1 [1024→4096] +gelu: GELUgelu GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +pooling: Identitypooling Identity +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/Perception-LM-1B +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForImageTextToText +model_type +perception_lm +config +PerceptionLMConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/persimmon.svg b/persimmon.svg new file mode 100644 index 0000000000000000000000000000000000000000..c123b41af05c7a983d375e7e1beb953feff4f88c --- /dev/null +++ b/persimmon.svg @@ -0,0 +1,180 @@ + + + + +persimmon +dense · 36× MHA + +PersimmonModel · base model +36 × PersimmonDecoderLayerPersimmonDecoderLayer× 36 +PersimmonForCausalLM · task head +Self-Attention · PersimmonAttention +MLP · PersimmonMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262144 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +query_key_value: Linear [4096→12288]query_key_value [4096→12288] +dense: Linear [4096→4096]dense [4096→4096] +q_layernorm: LayerNorm 64q_layernorm LayerNorm 64 +k_layernorm: LayerNorm 64k_layernorm LayerNorm 64 +attention_dropout: Dropoutattention_dropout Dropout +scaled dot-product attention64 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 4096] +dense_h_to_4h: Linear [4096→16384]dense_h_to_4h [4096→16384] +dense_4h_to_h: Linear [16384→4096]dense_4h_to_h [16384→4096] +act: ReLUSquaredActivationact ReLUSquared +residual add+ +Final LayerNorm[1, 6, 4096] +PersimmonForCausalLMLM HeadLinear [4096→262144] +Softmax +logits[1, 6, 262144] + +model id +adept/persimmon-8b-base +model_type +persimmon +config +PersimmonConfig +decoder +dense +layers +36 +hidden +4,096 +intermediate +16,384 +heads / kv +64 / 64 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +262,144 +max_pos +16,384 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/phi.diff.svg b/phi.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d2ce00bfdad99738ff44307c0d73f323b6524abc --- /dev/null +++ b/phi.diff.svg @@ -0,0 +1,182 @@ + + + + +phi +diff vs llama (+clip) · 7 overridden · 2 added · 0 deleted · 1 new · 3 inherited-as-is + +PhiModel · base model +24 × PhiDecoderLayerPhiDecoderLayer× 24 +PhiForCausalLM · task head +Self-Attention · PhiAttention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [51200 × 2048] → [1, 6, 2048] +LayerNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +dense: Linear [2048→2048]dense [2048→2048] +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 2048] +activation_fn: NewGELUActivationactivation_fn NewGELU +fc1: Linear [2048→8192]fc1 [2048→8192] +fc2: Linear [8192→2048]fc2 [8192→2048] +residual add+ +Final LayerNorm[1, 6, 2048] +PhiForCausalLMLM HeadLinear [2048→51200] +Softmax +logits[1, 6, 51200] + +model id +microsoft/phi-1 +parent +llama +classes +9 +overridden +7 +added +2 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PhiAttention +ovr __init__,forward + +PhiForCausalLM +ovr __init__ + +PhiModel +ovr __init__,forward + +PhiPreTrainedModel +1 attr + +PhiRotaryEmbedding +ovr compute_default_rope_parameters + +PhiDecoderLayer +add __init__,forward + \ No newline at end of file diff --git a/phi.svg b/phi.svg new file mode 100644 index 0000000000000000000000000000000000000000..fdcde89ba54cb4193d8fc81988e991b9c0829202 --- /dev/null +++ b/phi.svg @@ -0,0 +1,179 @@ + + + + +phi +dense · 24× MHA + +PhiModel · base model +24 × PhiDecoderLayerPhiDecoderLayer× 24 +PhiForCausalLM · task head +Self-Attention · PhiAttention +MLP · PhiMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [51200 × 2048] → [1, 6, 2048] +LayerNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +dense: Linear [2048→2048]dense [2048→2048] +scaled dot-product attention32 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 2048] +activation_fn: NewGELUActivationactivation_fn NewGELU +fc1: Linear [2048→8192]fc1 [2048→8192] +fc2: Linear [8192→2048]fc2 [8192→2048] +residual add+ +Final LayerNorm[1, 6, 2048] +PhiForCausalLMLM HeadLinear [2048→51200] +Softmax +logits[1, 6, 51200] + +model id +microsoft/phi-1 +model_type +phi +config +PhiConfig +decoder +dense +layers +24 +hidden +2,048 +intermediate +8,192 +heads / kv +32 / 32 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +51,200 +max_pos +2,048 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/phi3.diff.svg b/phi3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..cab22fadb9f2bfa1b647fdc0d411a1d6e37ec7fc --- /dev/null +++ b/phi3.diff.svg @@ -0,0 +1,177 @@ + + + + +phi3 +diff vs mistral (+phi) · 2 overridden · 6 added · 0 deleted · 2 new · 3 inherited-as-is + +Phi3Model · base model +32 × Phi3DecoderLayerPhi3DecoderLayer× 32 +Phi3ForCausalLM · task head +Self-Attention · Phi3Attention +MLP · Phi3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32064 × 3072] → [1, 6, 3072] +Phi3RMSNormpre-attention [1, 6, 3072] +o_proj: Linear [3072→3072]o_proj [3072→3072] +qkv_proj: Linear [3072→9216]qkv_proj [3072→9216] +scaled dot-product attention32 heads · head_dim 96 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Phi3RMSNormpre-FFN [1, 6, 3072] +gate_up_proj: Linear [3072→16384]gate_up_proj [3072→16384] +down_proj: Linear [8192→3072]down_proj [8192→3072] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +Phi3ForCausalLMLM HeadLinear [3072→32064] +Softmax +logits[1, 6, 32064] + +model id +microsoft/Phi-3-mini-4k-instru +parent +mistral +classes +8 +overridden +2 +added +6 +new classes +2 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Phi3DecoderLayer +ovr __init__,forward + +Phi3Attention +add __init__,forward + +Phi3ForCausalLM +add prepare_inputs_for_generation + +Phi3MLP +add __init__,forward + +Phi3PreTrainedModel +1 attr + \ No newline at end of file diff --git a/phi3.svg b/phi3.svg new file mode 100644 index 0000000000000000000000000000000000000000..a279df58eb284ebfe98512a9f66df09ba5fdf807 --- /dev/null +++ b/phi3.svg @@ -0,0 +1,177 @@ + + + + +phi3 +dense · 32× MHA + +Phi3Model · base model +32 × Phi3DecoderLayerPhi3DecoderLayer× 32 +Phi3ForCausalLM · task head +Self-Attention · Phi3Attention +MLP · Phi3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32064 × 3072] → [1, 6, 3072] +Phi3RMSNormpre-attention [1, 6, 3072] +o_proj: Linear [3072→3072]o_proj [3072→3072] +qkv_proj: Linear [3072→9216]qkv_proj [3072→9216] +scaled dot-product attention32 heads · head_dim 96 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Phi3RMSNormpre-FFN [1, 6, 3072] +gate_up_proj: Linear [3072→16384]gate_up_proj [3072→16384] +down_proj: Linear [8192→3072]down_proj [8192→3072] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +Phi3ForCausalLMLM HeadLinear [3072→32064] +Softmax +logits[1, 6, 32064] + +model id +microsoft/Phi-3-mini-4k-instr… +model_type +phi3 +config +Phi3Config +decoder +dense +layers +32 +hidden +3,072 +intermediate +8,192 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,064 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/phi4_multimodal.diff.svg b/phi4_multimodal.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..8d189a78486bc7aa7d58be8859fc5ff1b1415bc9 --- /dev/null +++ b/phi4_multimodal.diff.svg @@ -0,0 +1,243 @@ + + + + +phi4_multimodal +diff vs siglip (+phi3) · 22 overridden · 95 added · 0 deleted · 19 new · 3 inherited-as-is + +Phi4MultimodalModel · base model +32 × Phi4MultimodalDecoderLayerPhi4MultimodalDecoderLayer× 32 +Phi4MultimodalForCausalLM · task head +Self-Attention · SiglipAttention ↩ inherited +MLP · SiglipMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [200064 × 3072] → [1, 6, 3072] +Phi4MultimodalRMSNormpre-attention [1, 6, 3072] +o_proj: Linear [3072→3072]o_proj [3072→3072] +qkv_proj: Linear [3072→4608]qkv_proj [3072→4608] +scaled dot-product attention32 heads · head_dim 96 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Phi4MultimodalRMSNormpre-FFN [1, 6, 3072] +gate_up_proj: Linear [3072→16384]gate_up_proj [3072→16384] +down_proj: Linear [8192→3072]down_proj [8192→3072] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +Phi4MultimodalForCausalLMLM HeadLinear [3072→200064] +Softmax +logits[1, 6, 200064] + +model id +microsoft/Phi-4-multimodal-ins +parent +siglip +classes +30 +overridden +22 +added +95 +new classes +19 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Phi4MultimodalForCausalLM +ovr __init__,forward,prepare_inputs_for_gene… + +Phi4MultimodalModel +ovr __init__,forward + +Phi4MultimodalVisionEmbeddings +ovr __init__,forward + +Phi4MultimodalVisionEncoder +ovr __init__ + +Phi4MultimodalVisionEncoderLayer +ovr __init__ + +Phi4MultimodalVisionMultiheadAttentionPoolingHead +ovr __init__,forward + +Phi4MultimodalVisionPreTrainedModel +ovr _init_weights; 9 attr + +Phi4MultimodalAudioAttention +add __init__,forward + +Phi4MultimodalAudioConfig +add __post_init__,validate_architecture; 25 … + +Phi4MultimodalAudioConformerEncoderLayer +add __init__,forward + +Phi4MultimodalAudioConvModule +add __init__,forward + +Phi4MultimodalAudioDepthWiseSeparableConv1d +add __init__,forward + +Phi4MultimodalAudioEmbedding +add __init__,forward + +Phi4MultimodalAudioGluPointWiseConv +add __init__,forward + +Phi4MultimodalAudioMLP +add __init__,forward + +Phi4MultimodalAudioMeanVarianceNormLayer +add __init__,forward + +Phi4MultimodalAudioModel +add __init__,_streaming_mask,calculate_hs_ma… + +Phi4MultimodalAudioNemoConvSubsampling +add __init__,forward + +Phi4MultimodalAudioPreTrainedModel +add _init_weights; 7 attr + +Phi4MultimodalAudioRelativeAttentionBias +add __init__,forward + +Phi4MultimodalConfig +add __post_init__; 10 attr + +Phi4MultimodalFeatureEmbedding +add __init__,forward + +Phi4MultimodalImageEmbedding +add __init__,forward,get_img_features + +Phi4MultimodalPreTrainedModel +add _init_weights; 1 attr + +Phi4MultimodalVisionAttention +add __init__,forward + +Phi4MultimodalVisionConfig +10 attr + +Phi4MultimodalVisionModel +add __init__,forward,get_input_embeddings; 2… + \ No newline at end of file diff --git a/phi4_multimodal.svg b/phi4_multimodal.svg new file mode 100644 index 0000000000000000000000000000000000000000..88dedd2c307acd5cdb2daef14a5a6a59f3c5901b --- /dev/null +++ b/phi4_multimodal.svg @@ -0,0 +1,177 @@ + + + + +phi4_multimodal +dense · 32× GQA + +Phi4MultimodalModel · base model +32 × Phi4MultimodalDecoderLayerPhi4MultimodalDecoderLayer× 32 +Phi4MultimodalForCausalLM · task head +Self-Attention · Phi4MultimodalAttention +MLP · Phi4MultimodalMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [200064 × 3072] → [1, 6, 3072] +Phi4MultimodalRMSNormpre-attention [1, 6, 3072] +o_proj: Linear [3072→3072]o_proj [3072→3072] +qkv_proj: Linear [3072→4608]qkv_proj [3072→4608] +scaled dot-product attention32 heads · head_dim 96 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Phi4MultimodalRMSNormpre-FFN [1, 6, 3072] +gate_up_proj: Linear [3072→16384]gate_up_proj [3072→16384] +down_proj: Linear [8192→3072]down_proj [8192→3072] +activation_fn: SiLUActivationactivation_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +Phi4MultimodalForCausalLMLM HeadLinear [3072→200064] +Softmax +logits[1, 6, 200064] + +model id +microsoft/Phi-4-multimodal-in… +model_type +phi4_multimodal +config +Phi4MultimodalConfig +decoder +dense +layers +32 +hidden +3,072 +intermediate +8,192 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +200,064 +max_pos +131,072 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/phimoe.diff.svg b/phimoe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..31c6712746ce7a5f36a85802f81187453fdbc446 --- /dev/null +++ b/phimoe.diff.svg @@ -0,0 +1,191 @@ + + + + +phimoe +diff vs mixtral (+llama) · 6 overridden · 7 added · 0 deleted · 4 new · 2 inherited-as-is + +PhimoeModel · base model +32 × PhimoeDecoderLayerPhimoeDecoderLayer× 32 +PhimoeForCausalLM · task head +Self-Attention · MixtralAttention ↩ inherited +Sparse MoE · PhimoeSparseMoeBlockMoE +experts · MixtralExperts (×16 · dim 6400) ↩ inh… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32064 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 4096] +router: PhimoeTopKRouter top-2 of 16router TopKRouter top-2 of 16 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 4096] +PhimoeForCausalLMLM HeadLinear [4096→32064] +Softmax +logits[1, 6, 32064] + +model id +microsoft/Phi-3.5-MoE-instruct +parent +mixtral +classes +11 +overridden +6 +added +7 +new classes +4 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PhimoeDecoderLayer +ovr __init__ + +PhimoeModel +ovr __init__ + +PhimoePreTrainedModel +1 attr + +PhimoeRotaryEmbedding +ovr __init__,forward + +PhimoeForCausalLM +ovr __init__; add prepare_inputs_for_generat… + +PhimoeForSequenceClassification +rename only + +PhimoeMultiplier +add backward,forward + +PhimoeSparseMoeBlock +add __init__,forward + +PhimoeTopKRouter +add __init__,forward + \ No newline at end of file diff --git a/phimoe.svg b/phimoe.svg new file mode 100644 index 0000000000000000000000000000000000000000..dd091bec52ed63e3230db1c09e23c5e773d1ed2b --- /dev/null +++ b/phimoe.svg @@ -0,0 +1,181 @@ + + + + +phimoe +sparse-moe · 32× GQA +MoE + +PhimoeModel · base model +32 × PhimoeDecoderLayerPhimoeDecoderLayer× 32 +PhimoeForCausalLM · task head +Self-Attention · PhimoeAttention +Sparse MoE · PhimoeSparseMoeBlockMoE +experts · PhimoeExperts (×16 · dim 6400) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32064 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 4096] +router: PhimoeTopKRouter top-2 of 16router TopKRouter top-2 of 16 +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 4096] +PhimoeForCausalLMLM HeadLinear [4096→32064] +Softmax +logits[1, 6, 32064] + +model id +microsoft/Phi-3.5-MoE-instruct +model_type +phimoe +config +PhimoeConfig +decoder +sparse-moe +layers +32 +hidden +4,096 +intermediate +6,400 +heads / kv +32 / 8 +attention +GQA +norm +LayerNorm +positional +RoPE +vocab +32,064 +max_pos +131,072 +experts (top-k) +16 (top-2) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pi0.diff.svg b/pi0.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..23eb339c0275a6ef2c90aff5f18990283e107c33 --- /dev/null +++ b/pi0.diff.svg @@ -0,0 +1,191 @@ + + + + +pi0 +diff vs None · 0 overridden · 50 added · 0 deleted · 9 new · 0 inherited-as-is + +PI0Model · base model +27 × SiglipEncoderLayerSiglipEncoderLayer× 27 +PI0ForConditionalGeneration · task head +Self-Attention · SiglipAttention +MLP · SiglipMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→4304]fc1 [1152→4304] +fc2: Linear [4304→1152]fc2 [4304→1152] +residual add+ +Final RMSNorm[1, 6, ?] +PI0ForConditionalGenerationLM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +lerobot/pi0_base +parent +— +classes +9 +overridden +0 +added +50 +new classes +9 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PI0ActionTimeEmbedding +add __init__,forward + +PI0Config +add __post_init__,validate_architecture; 15 … + +PI0ForConditionalGeneration +add __init__,forward,sample_actions; 1 attr + +PI0ImageProcessor +3 attr + +PI0Model +add __init__,embed_prefix,forward,get_input_… + +PI0PreTrainedModel +add _init_weights; 11 attr + +PI0Processor +add __call__,__init__,model_input_names + +PI0ProcessorKwargs +1 attr + +PI0TimestepEmbeddings +add __init__,compute_freqs,forward + \ No newline at end of file diff --git a/pi0.svg b/pi0.svg new file mode 100644 index 0000000000000000000000000000000000000000..363294d5fb5baa86f8c72507963dc86b017222d3 --- /dev/null +++ b/pi0.svg @@ -0,0 +1,179 @@ + + + + +pi0 +dense · 27× Attention + +PI0Model · base model +27 × SiglipEncoderLayerSiglipEncoderLayer× 27 +PI0ForConditionalGeneration · task head +Self-Attention · SiglipAttention +MLP · SiglipMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→4304]fc1 [1152→4304] +fc2: Linear [4304→1152]fc2 [4304→1152] +residual add+ +Final RMSNorm[1, 6, ?] +PI0ForConditionalGenerationLM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +lerobot/pi0_base +model_type +pi0 +config +PI0Config +decoder +dense +layers +27 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +RMSNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pix2struct.svg b/pix2struct.svg new file mode 100644 index 0000000000000000000000000000000000000000..877e206297d7b7434d027606d479a84c4327fcbf --- /dev/null +++ b/pix2struct.svg @@ -0,0 +1,217 @@ + + + + +pix2struct +multimodal · vision → projector → LLM · dense + +Pix2StructForConditionalGeneration · base model +12 × Pix2StructTextBlockPix2StructTextBlock× 12 +Pix2StructForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Pix2StructTextLayerCrossAttention +Vision encoder · Pix2StructVisio…×12 +Pix2StructVisionLayer×12 +MLP · Pix2StructTextLayerFF +attention · Pix2StructTextAttention +DenseReluDense · Pix2StructTextDenseGatedActD… +mlp · Pix2StructVisionMlp +attention · Pix2StructVisionAttent… + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50244 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +output: Linear [768→768]output [768→768] +relative_attention_bias: Embedding 32×12relative_attention_bias Embedding 32×12 +layer_norm: Pix2StructLayerNorm 768layer_norm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 768] +wi_0: Linear [768→2048]wi_0 [768→2048] +wi_1: Linear [768→2048]wi_1 [768→2048] +wo: Linear [2048→768]wo [2048→768] +dropout: Dropoutdropout Dropout +act: NewGELUActivationact NewGELU +layer_norm: Pix2StructLayerNorm 768layer_norm LayerNorm 768 +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +Pix2StructForConditionalGenerationLM HeadLinear [768→50244] +Softmax +logits[1, 6, 50244] +example image +pixel_values[1, 3, 336, 336] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +output: Linear [768→768]output [768→768] +wi_0: Linear [768→2048]wi_0 [768→2048] +wi_1: Linear [768→2048]wi_1 [768→2048] +wo: Linear [2048→768]wo [2048→768] +dropout: Dropoutdropout Dropout +act: NewGELUActivationact NewGELU +pre_mlp_layer_norm: Pix2StructLayerNorm 768pre_mlp_layer_normLayerNorm 768 +pre_attention_layer_norm: Pix2StructLayerNorm 768pre_attention_layer_normLayerNorm 768 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/pix2struct-base +inputs +input_ids, pixel_values +model_type +pix2struct +config +Pix2StructConfig +decoder +dense +layers +12 +hidden +768 +intermediate +2,048 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,244 +max_pos +— +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/pixio.diff.svg b/pixio.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..4c0d5b501e8e62f22487c261a7764f904379384b --- /dev/null +++ b/pixio.diff.svg @@ -0,0 +1,176 @@ + + + + +pixio +diff vs vit (+dinov2,swin) · 2 overridden · 17 added · 0 deleted · 4 new · 5 inherited-as-is + +PixioModel · base model +32 × PixioLayerPixioLayer× 32 +Self-Attention · ViTAttention ↩ inherited +MLP · ViTMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1280] → [1, 6, 1280] +LayerNormpre-attention [1, 6, 1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +scaled dot-product attention16 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1280] +fc1: Linear [1280→5120]fc1 [1280→5120] +activation: GELUActivationactivation GELU +fc2: Linear [5120→1280]fc2 [5120→1280] +residual add+ +Final LayerNorm[1, 6, 1280] +LM HeadLinear [1280→?] +Softmax +logits[1, 6, ?] + +model id +facebook/pixio-huge +parent +vit +classes +10 +overridden +2 +added +17 +new classes +4 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PixioLayer +ovr __init__,forward + +PixioBackbone +add __init__,forward + +PixioConfig +10 attr + +PixioEmbeddings +add __init__,forward,interpolate_pos_encoding + +PixioModel +add __init__,forward + \ No newline at end of file diff --git a/pixio.svg b/pixio.svg new file mode 100644 index 0000000000000000000000000000000000000000..d72515e874e654d9a61559cd82bf097da577d044 --- /dev/null +++ b/pixio.svg @@ -0,0 +1,176 @@ + + + + +pixio +dense · 32× MHA + +PixioModel · base model +32 × PixioLayerPixioLayer× 32 +Self-Attention · PixioAttention +MLP · PixioMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1280] → [1, 6, 1280] +LayerNormpre-attention [1, 6, 1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +scaled dot-product attention16 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1280] +fc1: Linear [1280→5120]fc1 [1280→5120] +activation: GELUActivationactivation GELU +fc2: Linear [5120→1280]fc2 [5120→1280] +residual add+ +Final LayerNorm[1, 6, 1280] +LM HeadLinear [1280→?] +Softmax +logits[1, 6, ?] + +model id +facebook/pixio-huge +model_type +pixio +config +PixioConfig +decoder +dense +layers +32 +hidden +1,280 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pixtral.svg b/pixtral.svg new file mode 100644 index 0000000000000000000000000000000000000000..191c6280e99ae0dacebe39da734e191d92f8c926 --- /dev/null +++ b/pixtral.svg @@ -0,0 +1,179 @@ + + + + +pixtral +dense · 24× MHA + +PixtralVisionModel · base model +24 × PixtralAttentionLayerPixtralAttentionLayer× 24 +Self-Attention · PixtralAttention +MLP · PixtralMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +PixtralRMSNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +PixtralRMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→4096]gate_proj [1024→4096] +up_proj: Linear [1024→4096]up_proj [1024→4096] +down_proj: Linear [4096→1024]down_proj [4096→1024] +act_fn: GELUActivationact_fn GELU +residual add+ +Final RMSNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +mistral-labs/pixtral-12b +model_type +pixtral +config +PixtralVisionConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/plbart.diff.svg b/plbart.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ce9ca6f0687a2eddb8820e651f8df7906b6f2489 --- /dev/null +++ b/plbart.diff.svg @@ -0,0 +1,170 @@ + + + + +plbart +diff vs bart (+bigbird_pegasus) · 2 overridden · 21 added · 0 deleted · 3 new · 4 inherited-as-is + +PLBartModel · base model +6 × PLBartEncoderLayerPLBartEncoderLayer× 6 +PLBartForConditionalGeneration · task head +Self-Attention · BartAttention ↩ inherited + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50005 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +PLBartForConditionalGenerationLM HeadLinear [768→50005] · tied +Softmax +logits[1, 6, 50005] + +model id +uclanlp/plbart-base +parent +bart +classes +9 +overridden +2 +added +21 +new classes +3 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PLBartForCausalLM +ovr forward + +PLBartForSequenceClassification +ovr forward + +PLBartForConditionalGeneration +add __init__,_resize_final_logits_bias,forwa… + +PLBartModel +add __init__,forward,get_input_embeddings,se… + +PLBartPreTrainedModel +add _init_weights; 7 attr + \ No newline at end of file diff --git a/plbart.svg b/plbart.svg new file mode 100644 index 0000000000000000000000000000000000000000..69f996c3679a3160e86e6f8688b703ae34060116 --- /dev/null +++ b/plbart.svg @@ -0,0 +1,170 @@ + + + + +plbart +dense · 6× MHA + +PLBartModel · base model +6 × PLBartEncoderLayerPLBartEncoderLayer× 6 +PLBartForConditionalGeneration · task head +Self-Attention · PLBartAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50005 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +PLBartForConditionalGenerationLM HeadLinear [768→50005] · tied +Softmax +logits[1, 6, 50005] + +model id +uclanlp/plbart-base +model_type +plbart +config +PLBartConfig +decoder +dense +layers +6 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,005 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/poolformer.svg b/poolformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..c2215e6f06788b4af05fdf0226ee326c0a3c02ff --- /dev/null +++ b/poolformer.svg @@ -0,0 +1,154 @@ + + + + +poolformer +⚠ no transformer block (conv backbone) — shown from config · dense · 6× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +PoolFormerLayerPoolFormerGroupNorm → attentionPoolFormerGroupNorm → MLP×6 +Final PoolFormerGroupNorm +Pool + Classifier head→ class logits [1, 2] + +model id +sail/poolformer_s12 +model_type +poolformer +config +PoolFormerConfig +decoder +dense +layers +6 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +PoolFormerGroupNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pop2piano.svg b/pop2piano.svg new file mode 100644 index 0000000000000000000000000000000000000000..5bf2231ef2504a93da77fe48b6d3f1274edaae13 --- /dev/null +++ b/pop2piano.svg @@ -0,0 +1,173 @@ + + + + +pop2piano +dense · 6× MHA + +Pop2PianoForConditionalGeneration · base model +6 × ModuleListModuleList× 6 +Self-Attention · Pop2PianoLayerSelfAttention +SelfAttention · Pop2PianoAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [2400 × 512] → [1, 6, 512] +Normpre-attention [1, 6, 512] +q: Linear [512→512]q [512→512] +k: Linear [512→512]k [512→512] +v: Linear [512→512]v [512→512] +o: Linear [512→512]o [512→512] +relative_attention_bias: Embedding 32×8relative_attention_bias Embedding 32×8 +layer_norm: Pop2PianoLayerNorm 512layer_norm LayerNorm 512 +dropout: Dropoutdropout Dropout +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→2400] · tied +Softmax +logits[1, 6, 2400] + +model id +sweetcocoa/pop2piano +model_type +pop2piano +config +Pop2PianoConfig +decoder +dense +layers +6 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +2,400 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pp_chart2table.diff.svg b/pp_chart2table.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0479672df8adbfa87eb012df33988782aad3b339 --- /dev/null +++ b/pp_chart2table.diff.svg @@ -0,0 +1,177 @@ + + + + +pp_chart2table +diff vs None · 0 overridden · 17 added · 0 deleted · 4 new · 0 inherited-as-is + +GotOcr2ForConditionalGeneration · base model +24 × Qwen2DecoderLayerQwen2DecoderLayer× 24 +GotOcr2ForConditionalGeneration · task head +Self-Attention · Qwen2Attention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151860 × 1024] → [1, 6, 1024] +Qwen2RMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→2816]gate_proj [1024→2816] +up_proj: Linear [1024→2816]up_proj [1024→2816] +down_proj: Linear [2816→1024]down_proj [2816→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +GotOcr2ForConditionalGenerationLM HeadLinear [1024→151860] · tied +Softmax +logits[1, 6, 151860] + +model id +facebook/sam-vit-huge +parent +— +classes +4 +overridden +0 +added +17 +new classes +4 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPChart2TableConfig +1 attr + +PPChart2TableImageProcessor +7 attr + +PPChart2TableImageProcessorPil +7 attr + +PPChart2TableProcessor +add __call__,__init__ + \ No newline at end of file diff --git a/pp_chart2table.svg b/pp_chart2table.svg new file mode 100644 index 0000000000000000000000000000000000000000..400aadb36ec98668831c19cf373b0aa67d48cc74 --- /dev/null +++ b/pp_chart2table.svg @@ -0,0 +1,180 @@ + + + + +pp_chart2table +dense · 24× full + +GotOcr2ForConditionalGeneration · base model +24 × Qwen2DecoderLayerQwen2DecoderLayer× 24 +GotOcr2ForConditionalGeneration · task head +Self-Attention · Qwen2Attention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151860 × 1024] → [1, 6, 1024] +Qwen2RMSNormpre-attention [1, 6, 1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 1024] +gate_proj: Linear [1024→2816]gate_proj [1024→2816] +up_proj: Linear [1024→2816]up_proj [1024→2816] +down_proj: Linear [2816→1024]down_proj [2816→1024] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 1024] +GotOcr2ForConditionalGenerationLM HeadLinear [1024→151860] · tied +Softmax +logits[1, 6, 151860] + +model id +facebook/sam-vit-huge +model_type +pp_chart2table +config +PPChart2TableConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +2,816 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,860 +max_pos +32,768 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pp_doclayout_v2.diff.svg b/pp_doclayout_v2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..3de5ad6c3e68dc21992f5b5d1437f59bd78a05ac --- /dev/null +++ b/pp_doclayout_v2.diff.svg @@ -0,0 +1,215 @@ + + + + +pp_doclayout_v2 +diff vs layoutlmv3 (+rt_detr,pp_doclayout_v3) · 16 overridden · 115 added · 0 deleted · 6 new · 3 inherited-as-is + +PPDocLayoutV2ForObjectDetection · base model +6 × PPDocLayoutV2EncoderLayerPPDocLayoutV2EncoderLayer× 6 +layers (idx) +Self-Attention · LayoutLMv3SelfAttention ↩ inherited +MLP · LayoutLMv3MLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: GELUActivationactivation_fn GELU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +PaddlePaddle/PP-DocLayoutV2_sa +parent +layoutlmv3 +classes +20 +overridden +16 +added +115 +new classes +6 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPDocLayoutV2GlobalPointer +ovr __init__ + +PPDocLayoutV2Model +ovr __init__ + +PPDocLayoutV2PreTrainedModel +ovr _init_weights + +PPDocLayoutV2ReadingOrderAttention +ovr __init__ + +PPDocLayoutV2ReadingOrderEncoder +ovr __init__,_cal_2d_pos_emb + +PPDocLayoutV2ReadingOrderLayer +ovr __init__ + +PPDocLayoutV2ReadingOrderOutput +ovr __init__,forward + +PPDocLayoutV2ReadingOrderSelfAttention +ovr forward + +PPDocLayoutV2ReadingOrderSelfOutput +ovr __init__,forward + +PPDocLayoutV2TextEmbeddings +ovr __init__,forward + +PPDocLayoutV2Config +add __post_init__; 45 attr + +PPDocLayoutV2ForObjectDetection +ovr __init__,forward; 1 attr + +PPDocLayoutV2ForObjectDetectionOutput +21 attr + +PPDocLayoutV2ImageProcessor +add _extract_polygon_points_by_masks,_mask2p… + +PPDocLayoutV2PositionRelationEmbedding +add __init__,box_relative_encoding,compute_d… + +PPDocLayoutV2ReadingOrder +add __init__,forward; 4 attr + +PPDocLayoutV2ReadingOrderConfig +31 attr + \ No newline at end of file diff --git a/pp_doclayout_v2.svg b/pp_doclayout_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..6514963da488418b7811ea1293e18707f743ebf8 --- /dev/null +++ b/pp_doclayout_v2.svg @@ -0,0 +1,183 @@ + + + + +pp_doclayout_v2 +dense · 2× MHA + +PPDocLayoutV2ForObjectDetection · base model +6 × PPDocLayoutV2EncoderLayerPPDocLayoutV2EncoderLayer× 6 +layers (idx) +Self-Attention · PPDocLayoutV2SelfAttention +MLP · PPDocLayoutV2MLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: GELUActivationactivation_fn GELU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +PaddlePaddle/PP-DocLayoutV2_s… +model_type +pp_doclayout_v2 +config +PPDocLayoutV2Config +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +basic + +bottleneck + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pp_doclayout_v3.diff.svg b/pp_doclayout_v3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..2c3dc6d5f3eca5f9e346f7ed147323f70a3f5d0f --- /dev/null +++ b/pp_doclayout_v3.diff.svg @@ -0,0 +1,209 @@ + + + + +pp_doclayout_v3 +diff vs rt_detr (+resnet) · 9 overridden · 100 added · 0 deleted · 8 new · 3 inherited-as-is + +PPDocLayoutV3Model · base model +6 × PPDocLayoutV3EncoderLayerPPDocLayoutV3EncoderLayer× 6 +layers (idx) +Self-Attention · RTDetrSelfAttention ↩ inherited +MLP · RTDetrMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: GELUActivationactivation_fn GELU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +PaddlePaddle/PP-DocLayoutV3_sa +parent +rt_detr +classes +18 +overridden +9 +added +100 +new classes +8 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPDocLayoutV3Decoder +ovr __init__,forward + +PPDocLayoutV3HybridEncoder +ovr __init__,forward + +PPDocLayoutV3PreTrainedModel +ovr _init_weights + +PPDocLayoutV3Config +add __post_init__; 49 attr + +PPDocLayoutV3DecoderOutput +2 attr + +PPDocLayoutV3EncoderMaskOutput +add __init__,forward + +PPDocLayoutV3ForObjectDetection +ovr __init__,forward; 1 attr + +PPDocLayoutV3ForObjectDetectionOutput +22 attr + +PPDocLayoutV3GlobalPointer +add __init__,forward + +PPDocLayoutV3HybridEncoderOutput +1 attr + +PPDocLayoutV3ImageProcessor +add _extract_polygon_points_by_masks,_get_or… + +PPDocLayoutV3MaskFeatFPN +add __init__,forward + +PPDocLayoutV3Model +ovr __init__,forward; 1 attr + +PPDocLayoutV3ModelOutput +2 attr + +PPDocLayoutV3ScaleHead +add __init__,forward + \ No newline at end of file diff --git a/pp_doclayout_v3.svg b/pp_doclayout_v3.svg new file mode 100644 index 0000000000000000000000000000000000000000..0cb446ef6a8fe524df3e7f39e285db1093e95855 --- /dev/null +++ b/pp_doclayout_v3.svg @@ -0,0 +1,183 @@ + + + + +pp_doclayout_v3 +dense · 2× MHA + +PPDocLayoutV3Model · base model +6 × PPDocLayoutV3EncoderLayerPPDocLayoutV3EncoderLayer× 6 +layers (idx) +Self-Attention · PPDocLayoutV3SelfAttention +MLP · PPDocLayoutV3MLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: GELUActivationactivation_fn GELU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +PaddlePaddle/PP-DocLayoutV3_s… +model_type +pp_doclayout_v3 +config +PPDocLayoutV3Config +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +True +legend + +self-attention + +basic + +bottleneck + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pp_formulanet.diff.svg b/pp_formulanet.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..251b7c497b963d053bca1f99490bd4ce763020b3 --- /dev/null +++ b/pp_formulanet.diff.svg @@ -0,0 +1,193 @@ + + + + +pp_formulanet +diff vs slanext (+florence2,mbart) · 7 overridden · 39 added · 3 deleted · 8 new · 2 inherited-as-is + +PPFormulaNetForConditionalGeneration · base model +12 × PPFormulaNetVisionLayerPPFormulaNetVisionLayer× 12 +PPFormulaNetForConditionalGeneration · task head +Self-Attention · SLANeXtVisionAttention ↩ inherited +MLP · SLANeXtMLPBlock ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50000 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +scaled dot-product attention16 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 512] +PPFormulaNetForConditionalGenerationLM HeadLinear [512→50000] +Softmax +logits[1, 6, 50000] + +model id +PaddlePaddle/PPFormulaNet_plus +parent +slanext +classes +13 +overridden +7 +added +39 +new classes +8 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPFormulaNetForConditionalGeneration +ovr forward; add get_encoder; del _prepare_e… + +PPFormulaNetVisionModel +ovr __init__,forward + +PPFormulaNetConfig +add __post_init__; 5 attr + +PPFormulaNetImageProcessor +3 attr + +PPFormulaNetModel +add __init__,forward + +PPFormulaNetMultiModalProjector +add __init__,forward + +PPFormulaNetPreTrainedModel +ovr _init_weights; 3 attr + +PPFormulaNetProcessor +add __call__,__init__,normalize,post_process… + +PPFormulaNetTextConfig +14 attr + +PPFormulaNetVisionConfig +4 attr + +PPFormulaNetVisionEncoderOutput +rename only + \ No newline at end of file diff --git a/pp_formulanet.svg b/pp_formulanet.svg new file mode 100644 index 0000000000000000000000000000000000000000..19ffae05a57ea2c7a75b6740e773e042f9514c44 --- /dev/null +++ b/pp_formulanet.svg @@ -0,0 +1,175 @@ + + + + +pp_formulanet +dense · 12× MHA + +PPFormulaNetForConditionalGeneration · base model +12 × PPFormulaNetVisionLayerPPFormulaNetVisionLayer× 12 +PPFormulaNetForConditionalGeneration · task head +Self-Attention · PPFormulaNetVisionAttention +MLP · PPFormulaNetMLPBlock + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50000 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +scaled dot-product attention16 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 512] +PPFormulaNetForConditionalGenerationLM HeadLinear [512→50000] +Softmax +logits[1, 6, 50000] + +model id +PaddlePaddle/PPFormulaNet_plu… +model_type +pp_formulanet +config +PPFormulaNetConfig +decoder +dense +layers +12 +hidden +512 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,000 +max_pos +2,560 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pp_lcnet.diff.svg b/pp_lcnet.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e8b4c5f24e57fe866f5f48f7c0553b29964f26b3 --- /dev/null +++ b/pp_lcnet.diff.svg @@ -0,0 +1,168 @@ + + + + +pp_lcnet +diff vs resnet · 1 overridden · 52 added · 0 deleted · 10 new · 0 inherited-as-is + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +PPLCNetDepthwiseSeparableConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×6 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +PaddlePaddle/PP-LCNet_x1_0_doc +parent +resnet +classes +11 +overridden +1 +added +52 +new classes +10 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPLCNetConvLayer +ovr __init__ + +PPLCNetBackbone +add __init__,forward; 1 attr + +PPLCNetBlock +add __init__,forward + +PPLCNetConfig +add __post_init__,validate_architecture; 12 … + +PPLCNetDepthwiseSeparableConvLayer +add __init__,forward + +PPLCNetEncoder +add __init__,forward + +PPLCNetForImageClassification +add __init__,forward; 1 attr + +PPLCNetImageProcessor +add _preprocess,get_image_size; 12 attr + +PPLCNetImageProcessorKwargs +2 attr + +PPLCNetPreTrainedModel +8 attr + +PPLCNetSqueezeExcitationModule +add __init__,forward + \ No newline at end of file diff --git a/pp_lcnet.svg b/pp_lcnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..323e57714b2387be18f58afa2b58a4ef3bb6fd1e --- /dev/null +++ b/pp_lcnet.svg @@ -0,0 +1,154 @@ + + + + +pp_lcnet +⚠ no transformer block (conv backbone) — shown from config · dense · 6× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +PPLCNetDepthwiseSeparableConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×6 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +PaddlePaddle/PP-LCNet_x1_0_do… +model_type +pp_lcnet +config +PPLCNetConfig +decoder +dense +layers +6 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_lcnet_v3.diff.svg b/pp_lcnet_v3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..acf846bcddb3a4a2959b8bc7bc3ce2c549ebfdaa --- /dev/null +++ b/pp_lcnet_v3.diff.svg @@ -0,0 +1,152 @@ + + + + +pp_lcnet_v3 +diff vs pp_lcnet (+hgnet_v2) · 2 overridden · 10 added · 0 deleted · 3 new · 3 inherited-as-is + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/Not_yet_released +parent +pp_lcnet +classes +9 +overridden +2 +added +10 +new classes +3 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPLCNetV3DepthwiseSeparableConvLayer +ovr __init__ + +PPLCNetV3Encoder +ovr __init__ + +PPLCNetV3ActLearnableAffineBlock +add __init__,forward + +PPLCNetV3Config +add __post_init__; 4 attr + +PPLCNetV3LearnableRepLayer +add __init__,forward + +PPLCNetV3PreTrainedModel +add _init_weights + \ No newline at end of file diff --git a/pp_lcnet_v3.svg b/pp_lcnet_v3.svg new file mode 100644 index 0000000000000000000000000000000000000000..88087950d53a9267b277492555d2db1c06cab6fd --- /dev/null +++ b/pp_lcnet_v3.svg @@ -0,0 +1,155 @@ + + + + +pp_lcnet_v3 +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/Not_yet_released +model_type +pp_lcnet_v3 +config +PPLCNetV3Config +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_lcnet_v4.diff.svg b/pp_lcnet_v4.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..dd0c24bd2bf765d13d3bfaea0e2560d8ed3ba911 --- /dev/null +++ b/pp_lcnet_v4.diff.svg @@ -0,0 +1,149 @@ + + + + +pp_lcnet_v4 +diff vs pp_lcnet (+hgnet_v2) · 1 overridden · 19 added · 0 deleted · 4 new · 5 inherited-as-is + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/Not_yet_released +parent +pp_lcnet +classes +10 +overridden +1 +added +19 +new classes +4 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPLCNetV4Encoder +ovr __init__ + +PPLCNetV4Block +add __init__,forward + +PPLCNetV4Config +add __post_init__,validate_architecture; 11 … + +PPLCNetV4DepthwiseSeparableConvLayer +add __init__,forward + +PPLCNetV4SmallStem +add __init__,forward + \ No newline at end of file diff --git a/pp_lcnet_v4.svg b/pp_lcnet_v4.svg new file mode 100644 index 0000000000000000000000000000000000000000..ef6a64ecc025dff8daf8230d97418b42ac22b0e2 --- /dev/null +++ b/pp_lcnet_v4.svg @@ -0,0 +1,155 @@ + + + + +pp_lcnet_v4 +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/Not_yet_released +model_type +pp_lcnet_v4 +config +PPLCNetV4Config +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_ocrv5_mobile_det.diff.svg b/pp_ocrv5_mobile_det.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e4b52e8a80811841c5b61f35176ce9c1128a6da4 --- /dev/null +++ b/pp_ocrv5_mobile_det.diff.svg @@ -0,0 +1,153 @@ + + + + +pp_ocrv5_mobile_det +diff vs pp_ocrv5_server_det · 1 overridden · 17 added · 0 deleted · 5 new · 2 inherited-as-is + +input_ids[1, S] +Token Embedding[? × ?] +PPLCNetV3BlockBatchNorm2d → attentionBatchNorm2d → MLP×5 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv5_mobile_d +parent +pp_ocrv5_server_det +classes +8 +overridden +1 +added +17 +new classes +5 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPOCRV5MobileDetHead +ovr forward + +PPOCRV5MobileDetConfig +add __post_init__; 8 attr + +PPOCRV5MobileDetModel +add __init__,forward + +PPOCRV5MobileDetNeck +add __init__,forward + +PPOCRV5MobileDetResidualSqueezeExcitationLayer +add __init__,forward + +PPOCRV5MobileDetSqueezeExcitationModule +add __init__,forward + \ No newline at end of file diff --git a/pp_ocrv5_mobile_det.svg b/pp_ocrv5_mobile_det.svg new file mode 100644 index 0000000000000000000000000000000000000000..7d344733f88634cd72cab174427698397a8f1f5b --- /dev/null +++ b/pp_ocrv5_mobile_det.svg @@ -0,0 +1,154 @@ + + + + +pp_ocrv5_mobile_det +⚠ no transformer block (conv backbone) — shown from config · dense · 5× Attention + +input_ids[1, S] +Token Embedding[? × ?] +PPLCNetV3BlockBatchNorm2d → attentionBatchNorm2d → MLP×5 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv5_mobile_… +model_type +pp_ocrv5_mobile_det +config +PPOCRV5MobileDetConfig +decoder +dense +layers +5 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_ocrv5_mobile_rec.diff.svg b/pp_ocrv5_mobile_rec.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..83f1013fe2ac76ed81748aa9e4ffe288df3e14ac --- /dev/null +++ b/pp_ocrv5_mobile_rec.diff.svg @@ -0,0 +1,141 @@ + + + + +pp_ocrv5_mobile_rec +diff vs pp_ocrv5_server_rec · 1 overridden · 1 added · 0 deleted · 1 new · 2 inherited-as-is + +input_ids[1, S] +Token Embedding[? × 120] +PPLCNetV3BlockBatchNorm2d → MHABatchNorm2d → MLP×5 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv5_mobile_r +parent +pp_ocrv5_server_rec +classes +4 +overridden +1 +added +1 +new classes +1 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPOCRV5MobileRecEncoderWithSVTR +ovr __init__ + +PPOCRV5MobileRecConfig +add __post_init__ + \ No newline at end of file diff --git a/pp_ocrv5_mobile_rec.svg b/pp_ocrv5_mobile_rec.svg new file mode 100644 index 0000000000000000000000000000000000000000..48f2f9cd25cbb5d4862e3bf9855d2b11cfeff04f --- /dev/null +++ b/pp_ocrv5_mobile_rec.svg @@ -0,0 +1,154 @@ + + + + +pp_ocrv5_mobile_rec +⚠ no transformer block (conv backbone) — shown from config · dense · 5× MHA + +input_ids[1, S] +Token Embedding[? × 120] +PPLCNetV3BlockBatchNorm2d → MHABatchNorm2d → MLP×5 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv5_mobile_… +model_type +pp_ocrv5_mobile_rec +config +PPOCRV5MobileRecConfig +decoder +dense +layers +5 +hidden +120 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_ocrv5_server_det.diff.svg b/pp_ocrv5_server_det.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..415e208639b62613498b00e9cf155f26651f4a08 --- /dev/null +++ b/pp_ocrv5_server_det.diff.svg @@ -0,0 +1,171 @@ + + + + +pp_ocrv5_server_det +diff vs None · 0 overridden · 57 added · 0 deleted · 12 new · 0 inherited-as-is + +input_ids[1, S] +Token Embedding[? × ?] +HGNetV2ConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×6 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv5_server_d +parent +— +classes +12 +overridden +0 +added +57 +new classes +12 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPOCRV5ServerDetConfig +add __post_init__; 13 attr + +PPOCRV5ServerDetConvBatchnormLayer +add __init__,forward + +PPOCRV5ServerDetForObjectDetection +add __init__,forward; 1 attr + +PPOCRV5ServerDetHead +add __init__,forward + +PPOCRV5ServerDetImageProcessor +add _boxes_from_bitmap,_get_box_score,_get_m… + +PPOCRV5ServerDetImageProcessorKwargs +3 attr + +PPOCRV5ServerDetIntraclassBlock +add __init__,forward + +PPOCRV5ServerDetLocalModule +add __init__,forward + +PPOCRV5ServerDetModel +add __init__,forward + +PPOCRV5ServerDetNeck +add __init__,forward + +PPOCRV5ServerDetPreTrainedModel +5 attr + +PPOCRV5ServerDetSegmentationHead +add __init__,forward + \ No newline at end of file diff --git a/pp_ocrv5_server_det.svg b/pp_ocrv5_server_det.svg new file mode 100644 index 0000000000000000000000000000000000000000..6cc35f18a729197e385b429ea7f4b18b582211ae --- /dev/null +++ b/pp_ocrv5_server_det.svg @@ -0,0 +1,154 @@ + + + + +pp_ocrv5_server_det +⚠ no transformer block (conv backbone) — shown from config · dense · 6× Attention + +input_ids[1, S] +Token Embedding[? × ?] +HGNetV2ConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×6 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv5_server_… +model_type +pp_ocrv5_server_det +config +PPOCRV5ServerDetConfig +decoder +dense +layers +6 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_ocrv5_server_rec.diff.svg b/pp_ocrv5_server_rec.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..3f8a1d2f806ead56ffb9700eca5bb5afca4afc7d --- /dev/null +++ b/pp_ocrv5_server_rec.diff.svg @@ -0,0 +1,171 @@ + + + + +pp_ocrv5_server_rec +diff vs clip (+blip_2,focalnet,paddleocr_vl,resnet) · 6 overridden · 44 added · 1 deleted · 8 new · 1 inherited-as-is + +input_ids[1, S] +Token Embedding[? × 120] +HGNetV2ConvLayerBatchNorm2d → MHABatchNorm2d → MLP×6 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv5_server_r +parent +clip +classes +13 +overridden +6 +added +44 +new classes +8 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPOCRV5ServerRecPreTrainedModel +del _init_weights; 4 attr + +PPOCRV5ServerRecAttention +ovr forward + +PPOCRV5ServerRecBlock +ovr __init__,forward + +PPOCRV5ServerRecConvLayer +ovr __init__ + +PPOCRV5ServerRecConfig +add __post_init__; 13 attr + +PPOCRV5ServerRecEncoderWithSVTR +add __init__,forward + +PPOCRV5ServerRecForTextRecognition +add __init__,forward; 1 attr + +PPOCRV5ServerRecForTextRecognitionOutput +1 attr + +PPOCRV5ServerRecHead +add __init__,forward + +PPOCRV5ServerRecImageProcessor +add _preprocess,get_target_size,post_process… + +PPOCRV5ServerRecImageProcessorKwargs +2 attr + +PPOCRV5ServerRecModel +add __init__,forward + \ No newline at end of file diff --git a/pp_ocrv5_server_rec.svg b/pp_ocrv5_server_rec.svg new file mode 100644 index 0000000000000000000000000000000000000000..30942cdead6855442386d89f0917bc68e7d1b1d6 --- /dev/null +++ b/pp_ocrv5_server_rec.svg @@ -0,0 +1,154 @@ + + + + +pp_ocrv5_server_rec +⚠ no transformer block (conv backbone) — shown from config · dense · 6× MHA + +input_ids[1, S] +Token Embedding[? × 120] +HGNetV2ConvLayerBatchNorm2d → MHABatchNorm2d → MLP×6 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv5_server_… +model_type +pp_ocrv5_server_rec +config +PPOCRV5ServerRecConfig +decoder +dense +layers +6 +hidden +120 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_ocrv6_medium_det.diff.svg b/pp_ocrv6_medium_det.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..684180ff19a65ec3c338cb49c9d89fdd95ce9339 --- /dev/null +++ b/pp_ocrv6_medium_det.diff.svg @@ -0,0 +1,141 @@ + + + + +pp_ocrv6_medium_det +diff vs pp_ocrv5_server_det (+pp_ocrv5_mobile_det) · 1 overridden · 2 added · 0 deleted · 1 new · 3 inherited-as-is + +input_ids[1, S] +Token Embedding[? × ?] +PPLCNetV4DepthwiseSeparableConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×7 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv6_medium_d +parent +pp_ocrv5_server_det +classes +5 +overridden +1 +added +2 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPOCRV6MediumDetNeck +ovr __init__ + +PPOCRV6MediumDetConfig +add __post_init__; 1 attr + \ No newline at end of file diff --git a/pp_ocrv6_medium_det.svg b/pp_ocrv6_medium_det.svg new file mode 100644 index 0000000000000000000000000000000000000000..9ab6959086e99f5868b2f9127d4d593bd53dcc00 --- /dev/null +++ b/pp_ocrv6_medium_det.svg @@ -0,0 +1,154 @@ + + + + +pp_ocrv6_medium_det +⚠ no transformer block (conv backbone) — shown from config · dense · 7× Attention + +input_ids[1, S] +Token Embedding[? × ?] +PPLCNetV4DepthwiseSeparableConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×7 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv6_medium_… +model_type +pp_ocrv6_medium_det +config +PPOCRV6MediumDetConfig +decoder +dense +layers +7 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_ocrv6_small_det.diff.svg b/pp_ocrv6_small_det.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..95f917904ebac7bfe102113629216858e6856402 --- /dev/null +++ b/pp_ocrv6_small_det.diff.svg @@ -0,0 +1,144 @@ + + + + +pp_ocrv6_small_det +diff vs pp_ocrv5_mobile_det (+pp_lcnet,pp_ocrv5_server_det) · 3 overridden · 2 added · 0 deleted · 1 new · 4 inherited-as-is + +input_ids[1, S] +Token Embedding[? × ?] +PPLCNetV4DepthwiseSeparableConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×7 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv6_small_de +parent +pp_ocrv5_mobile_det +classes +7 +overridden +3 +added +2 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPOCRV6SmallDetDepthwiseSeparableConvLayer +ovr __init__,forward + +PPOCRV6SmallDetNeck +ovr __init__ + +PPOCRV6SmallDetConfig +add __post_init__; 1 attr + \ No newline at end of file diff --git a/pp_ocrv6_small_det.svg b/pp_ocrv6_small_det.svg new file mode 100644 index 0000000000000000000000000000000000000000..7304bbe4b4156468d5ec0f5fc0d0369d78f24308 --- /dev/null +++ b/pp_ocrv6_small_det.svg @@ -0,0 +1,154 @@ + + + + +pp_ocrv6_small_det +⚠ no transformer block (conv backbone) — shown from config · dense · 7× Attention + +input_ids[1, S] +Token Embedding[? × ?] +PPLCNetV4DepthwiseSeparableConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×7 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv6_small_d… +model_type +pp_ocrv6_small_det +config +PPOCRV6SmallDetConfig +decoder +dense +layers +7 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_ocrv6_small_rec.diff.svg b/pp_ocrv6_small_rec.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e9aa4948282950f0695a261512a0be23d4f7d781 --- /dev/null +++ b/pp_ocrv6_small_rec.diff.svg @@ -0,0 +1,147 @@ + + + + +pp_ocrv6_small_rec +diff vs pp_ocrv5_server_rec · 3 overridden · 3 added · 0 deleted · 2 new · 1 inherited-as-is + +input_ids[1, S] +Token Embedding[? × 120] +PPLCNetV4DepthwiseSeparableConvLayerBatchNorm2d → MHABatchNorm2d → MLP×7 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv6_small_re +parent +pp_ocrv5_server_rec +classes +5 +overridden +3 +added +3 +new classes +2 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPOCRV6SmallRecConvLayer +ovr __init__ + +PPOCRV6SmallRecEncoderWithSVTR +ovr __init__,forward + +PPOCRV6SmallRecConfig +add __post_init__; 1 attr + +PPOCRV6SmallRecImageProcessor +add _preprocess + \ No newline at end of file diff --git a/pp_ocrv6_small_rec.svg b/pp_ocrv6_small_rec.svg new file mode 100644 index 0000000000000000000000000000000000000000..4dcd6173214d177c2cad82ce360039ccbd081042 --- /dev/null +++ b/pp_ocrv6_small_rec.svg @@ -0,0 +1,154 @@ + + + + +pp_ocrv6_small_rec +⚠ no transformer block (conv backbone) — shown from config · dense · 7× MHA + +input_ids[1, S] +Token Embedding[? × 120] +PPLCNetV4DepthwiseSeparableConvLayerBatchNorm2d → MHABatchNorm2d → MLP×7 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv6_small_r… +model_type +pp_ocrv6_small_rec +config +PPOCRV6SmallRecConfig +decoder +dense +layers +7 +hidden +120 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/pp_ocrv6_tiny_rec.diff.svg b/pp_ocrv6_tiny_rec.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..7bb849823d3d7d3e55150f6bded78680cdac3902 --- /dev/null +++ b/pp_ocrv6_tiny_rec.diff.svg @@ -0,0 +1,147 @@ + + + + +pp_ocrv6_tiny_rec +diff vs pp_ocrv6_small_rec · 4 overridden · 12 added · 0 deleted · 2 new · 0 inherited-as-is + +input_ids[1, S] +Token Embedding[? × 120] +PPLCNetV4DepthwiseSeparableConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×7 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv6_tiny_rec +parent +pp_ocrv6_small_rec +classes +4 +overridden +4 +added +12 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PPOCRV6TinyRecForTextRecognition +ovr forward + +PPOCRV6TinyRecPreTrainedModel +3 attr + +PPOCRV6TinyRecConfig +add __post_init__; 9 attr + +PPOCRV6TinyRecHead +add __init__,forward + \ No newline at end of file diff --git a/pp_ocrv6_tiny_rec.svg b/pp_ocrv6_tiny_rec.svg new file mode 100644 index 0000000000000000000000000000000000000000..f70cca3fe871f14a53ff65d1c324f2a1d9cb5333 --- /dev/null +++ b/pp_ocrv6_tiny_rec.svg @@ -0,0 +1,154 @@ + + + + +pp_ocrv6_tiny_rec +⚠ no transformer block (conv backbone) — shown from config · dense · 7× Attention + +input_ids[1, S] +Token Embedding[? × 120] +PPLCNetV4DepthwiseSeparableConvLayerBatchNorm2d → attentionBatchNorm2d → MLP×7 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/PP-OCRv6_tiny_re… +model_type +pp_ocrv6_tiny_rec +config +PPOCRV6TinyRecConfig +decoder +dense +layers +7 +hidden +120 +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/prompt_depth_anything.diff.svg b/prompt_depth_anything.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d016922ee8ef627c318e1fc1348218789e0e9768 --- /dev/null +++ b/prompt_depth_anything.diff.svg @@ -0,0 +1,191 @@ + + + + +prompt_depth_anything +diff vs depth_anything · 6 overridden · 9 added · 0 deleted · 4 new · 1 inherited-as-is + +PromptDepthAnythingForDepthEstimation · base model +12 × Dinov2LayerDinov2Layer× 12 +Self-Attention · Dinov2Attention +MLP · Dinov2MLP +attention · Dinov2SelfAttention +output · Dinov2SelfOutput + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +query: Linear [384→384]query [384→384] +key: Linear [384→384]key [384→384] +value: Linear [384→384]value [384→384] +dense: Linear [384→384]dense [384→384] +dropout: Dropoutdropout Dropout +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +fc1: Linear [384→1536]fc1 [384→1536] +activation: GELUActivationactivation GELU +fc2: Linear [1536→384]fc2 [1536→384] +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +LiheYoung/depth-anything-small +parent +depth_anything +classes +10 +overridden +6 +added +9 +new classes +4 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +PromptDepthAnythingDepthEstimationHead +ovr forward + +PromptDepthAnythingFeatureFusionLayer +ovr __init__,forward + +PromptDepthAnythingFeatureFusionStage +ovr forward + +PromptDepthAnythingForDepthEstimation +ovr forward + +PromptDepthAnythingNeck +ovr forward + +PromptDepthAnythingConfig +rename only + +PromptDepthAnythingLayer +add __init__,forward + +PromptDepthAnythingPreTrainedModel +5 attr + +PromptDepthAnythingReassembleLayer +add __init__,forward + \ No newline at end of file diff --git a/prompt_depth_anything.svg b/prompt_depth_anything.svg new file mode 100644 index 0000000000000000000000000000000000000000..de336b8fa4bf547b5f0500602f3874119929e511 --- /dev/null +++ b/prompt_depth_anything.svg @@ -0,0 +1,179 @@ + + + + +prompt_depth_anything +dense · 12× Attention + +PromptDepthAnythingForDepthEstimation · base model +12 × Dinov2LayerDinov2Layer× 12 +Self-Attention · Dinov2Attention +MLP · Dinov2MLP +attention · Dinov2SelfAttention +output · Dinov2SelfOutput + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +query: Linear [384→384]query [384→384] +key: Linear [384→384]key [384→384] +value: Linear [384→384]value [384→384] +dense: Linear [384→384]dense [384→384] +dropout: Dropoutdropout Dropout +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +fc1: Linear [384→1536]fc1 [384→1536] +activation: GELUActivationactivation GELU +fc2: Linear [1536→384]fc2 [1536→384] +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +LiheYoung/depth-anything-smal… +model_type +prompt_depth_anything +config +PromptDepthAnythingConfig +decoder +dense +layers +12 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/prophetnet.svg b/prophetnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..72962241d4f534bdbcd925b1f2e9ef31fc9d4d14 --- /dev/null +++ b/prophetnet.svg @@ -0,0 +1,177 @@ + + + + +prophetnet +dense · 12× MHA + +ProphetNetModel · base model +12 × ProphetNetEncoderLayerProphetNetEncoderLayer× 12 +ProphetNetForConditionalGeneration · task head +Self-Attention · ProphetNetAttention +MLP · ProphetNetFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +key_proj: Linear [1024→1024]key_proj [1024→1024] +value_proj: Linear [1024→1024]value_proj [1024→1024] +query_proj: Linear [1024→1024]query_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +activation_fn: GELUActivationactivation_fn GELU +intermediate: Linear [1024→4096]intermediate [1024→4096] +output: Linear [4096→1024]output [4096→1024] +residual add+ +Final LayerNorm[1, 6, 1024] +ProphetNetForConditionalGenerationLM HeadLinear [1024→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +microsoft/prophetnet-large-un… +model_type +prophetnet +config +ProphetNetConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pvt.svg b/pvt.svg new file mode 100644 index 0000000000000000000000000000000000000000..7907d1142922e06ebc5462baf2cf94cab56193f9 --- /dev/null +++ b/pvt.svg @@ -0,0 +1,179 @@ + + + + +pvt +dense · 4× MHA + +PvtModel · base model +4 × PvtLayerPvtLayer× 4 +PvtForImageClassification · task head +Self-Attention · PvtAttention +self · PvtEfficientSelfAttention +MLP · PvtFFN +output · PvtSelfOutput + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +LayerNormpre-attention [1, 6, ?] +query: Linear [64→64]query [64→64] +key: Linear [64→64]key [64→64] +value: Linear [64→64]value [64→64] +dropout: Dropoutdropout Dropout +sequence_reduction: Conv2dsequence_reduction Conv2d +layer_norm: LayerNorm 64layer_norm LayerNorm 64 +dense: Linear [64→64]dense [64→64] +dropout: Dropoutdropout Dropout +scaled dot-product attention(1, 2, 5, 8) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +dense1: Linear [64→512]dense1 [64→512] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense2: Linear [512→64]dense2 [512→64] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, ?] +PvtForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +PvtForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +Xrenya/pvt-tiny-224 +model_type +pvt +config +PvtConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +(1, 2, 5, 8) / (1, 2, 5, 8) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/pvt_v2.svg b/pvt_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..c7fe24362009f2bdb0866077b3b4e1ec08345aea --- /dev/null +++ b/pvt_v2.svg @@ -0,0 +1,180 @@ + + + + +pvt_v2 +dense · 4× MHA + +PvtV2Model · base model +4 × PvtV2BlockLayerPvtV2BlockLayer× 4 +PvtV2ForImageClassification · task head +Self-Attention · PvtV2SelfAttention +MLP · PvtV2ConvFeedForwardNetwork +dwconv · PvtV2DepthWiseConv + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +LayerNormpre-attention [1, 6, ?] +query: Linear [32→32]query [32→32] +key: Linear [32→32]key [32→32] +value: Linear [32→32]value [32→32] +attn_drop: Dropoutattn_drop Dropout +proj: Linear [32→32]proj [32→32] +proj_drop: Dropoutproj_drop Dropout +spatial_reduction: Conv2dspatial_reduction Conv2d +layer_norm: LayerNorm 32layer_norm LayerNorm 32 +scaled dot-product attention(1, 2, 5, 8) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +dense1: Linear [32→256]dense1 [32→256] +dwconv: Conv2ddwconv Conv2d +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +dense2: Linear [256→32]dense2 [256→32] +dropout: Dropoutdropout Dropout +relu: Identityrelu Identity +residual add+ +Final LayerNorm[1, 6, ?] +PvtV2ForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +PvtV2ForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +OpenGVLab/pvt_v2_b0 +model_type +pvt_v2 +config +PvtV2Config +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +(1, 2, 5, 8) / (1, 2, 5, 8) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/qianfan_ocr.diff.svg b/qianfan_ocr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..a55bb2db96305c834db663d6ed11617a1759bc59 --- /dev/null +++ b/qianfan_ocr.diff.svg @@ -0,0 +1,227 @@ + + + + +qianfan_ocr +diff vs internvl (+beit) · 9 overridden · 13 added · 0 deleted · 4 new · 8 inherited-as-is + +QianfanOCRModel · base model +32 × Qwen3DecoderLayerQwen3DecoderLayer× 32 +QianfanOCRForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen3Attention +Vision encoder · QianfanOCRVisi…×24 +QianfanOCRVisionLayer×24 +MLP · Qwen3MLP +attention · InternVLVisionAttentio… +Projector · InternVLMultiModalProject… +mlp · InternVLVisionMLP ↩ inhe… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3RMSNorm 128q_norm Qwen3RMSNorm 128 +k_norm: Qwen3RMSNorm 128k_norm Qwen3RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +QianfanOCRForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +projection_layer: Linear [1024→1024]projection_layer [1024→1024] +projection_dropout: Identityprojection_dropout Identity +q_norm: Identityq_norm Identity +k_norm: Identityk_norm Identity +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layernorm_before: LayerNorm 1024layernorm_beforeLayerNorm 1024 +layernorm_after: LayerNorm 1024layernorm_afterLayerNorm 1024 +dropout: Dropoutdropout Dropout +drop_path1: Identitydrop_path1 Identity +drop_path2: Identitydrop_path2 Identity +layer_norm: LayerNorm 4096layer_norm LayerNorm 4096 +linear_1: Linear [4096→4096]linear_1 [4096→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +baidu/Qianfan-OCR +parent +internvl +classes +17 +overridden +9 +added +13 +new classes +4 +inherited as-is +8 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +QianfanOCRForConditionalGeneration +ovr forward + +QianfanOCRVisionLayer +ovr __init__,forward + +QianfanOCRVisionModel +ovr __init__,forward + +QianfanOCRConfig +add __post_init__; 3 attr + +QianfanOCRPreTrainedModel +2 attr + +QianfanOCRProcessor +add __call__,__init__,_insert_media_placehol… + +QianfanOCRVisionConfig +4 attr + +QianfanOCRVisionModelOutputWithPooling +rename only + +QianfanOCRVisionPreTrainedModel +4 attr + \ No newline at end of file diff --git a/qianfan_ocr.svg b/qianfan_ocr.svg new file mode 100644 index 0000000000000000000000000000000000000000..a5a1404281411146ead1401a2f04f1ceb39cfa71 --- /dev/null +++ b/qianfan_ocr.svg @@ -0,0 +1,223 @@ + + + + +qianfan_ocr +multimodal · vision → projector → LLM · dense + +QianfanOCRModel · base model +32 × Qwen3DecoderLayerQwen3DecoderLayer× 32 +QianfanOCRForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen3Attention +Vision encoder · QianfanOCRVisi…×24 +QianfanOCRVisionLayer×24 +MLP · Qwen3MLP +attention · QianfanOCRVisionAtte… +Projector · QianfanOCRMultiModalProj… +mlp · QianfanOCRVisionMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3RMSNorm 128q_norm Qwen3RMSNorm 128 +k_norm: Qwen3RMSNorm 128k_norm Qwen3RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +QianfanOCRForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +projection_layer: Linear [1024→1024]projection_layer [1024→1024] +projection_dropout: Identityprojection_dropout Identity +q_norm: Identityq_norm Identity +k_norm: Identityk_norm Identity +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layernorm_before: LayerNorm 1024layernorm_beforeLayerNorm 1024 +layernorm_after: LayerNorm 1024layernorm_afterLayerNorm 1024 +dropout: Dropoutdropout Dropout +drop_path1: Identitydrop_path1 Identity +drop_path2: Identitydrop_path2 Identity +layer_norm: LayerNorm 4096layer_norm LayerNorm 4096 +linear_1: Linear [4096→4096]linear_1 [4096→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +baidu/Qianfan-OCR +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForImageTextToText +model_type +qianfan_ocr +config +QianfanOCRConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/qwen2.diff.svg b/qwen2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b5f3657fe579c9cfa690c92eae6a1f50293dc070 --- /dev/null +++ b/qwen2.diff.svg @@ -0,0 +1,174 @@ + + + + +qwen2 +diff vs llama (+gemma2,mistral) · 5 overridden · 0 added · 0 deleted · 0 new · 7 inherited-as-is + +Qwen2Model · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +Qwen2ForCausalLM · task head +Self-Attention · Qwen2Attention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen2ForCausalLMLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] + +model id +Qwen/Qwen2-7B +parent +llama +classes +10 +overridden +5 +added +0 +new classes +0 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen2Attention +ovr __init__,forward + +Qwen2MLP +ovr __init__ + +Qwen2Model +ovr __init__,forward + \ No newline at end of file diff --git a/qwen2.svg b/qwen2.svg new file mode 100644 index 0000000000000000000000000000000000000000..32a740d1e5e6ba12956a12ca86bc035325d99cb0 --- /dev/null +++ b/qwen2.svg @@ -0,0 +1,180 @@ + + + + +qwen2 +dense · 32× full + +Qwen2Model · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +Qwen2ForCausalLM · task head +Self-Attention · Qwen2Attention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen2ForCausalLMLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] + +model id +Qwen/Qwen2-7B +model_type +qwen2 +config +Qwen2Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/qwen2_5_omni.diff.svg b/qwen2_5_omni.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..f1da23cd4cca815f4172ed5aab94f5b9c0ce8a86 --- /dev/null +++ b/qwen2_5_omni.diff.svg @@ -0,0 +1,320 @@ + + + + +qwen2_5_omni +diff vs qwen2_5_vl (+llama,qwen2_audio,qwen2_vl) · 23 overridden · 267 added · 0 deleted · 43 new · 2 inherited-as-is + +Qwen2_5OmniForConditionalGeneration · base model +28 × Qwen2_5OmniDecoderLayerQwen2_5OmniDecoderLayer× 28 +Self-Attention · Qwen2_5OmniAttention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 3584] → [1, 6, 3584] +Qwen2_5OmniRMSNormpre-attention [1, 6, 3584] +q_proj: Linear [3584→3584]q_proj [3584→3584] +k_proj: Linear [3584→512]k_proj [3584→512] +v_proj: Linear [3584→512]v_proj [3584→512] +o_proj: Linear [3584→3584]o_proj [3584→3584] +scaled dot-product attention28 heads · head_dim 128 · GQA 28:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2_5OmniRMSNormpre-FFN [1, 6, 3584] +gate_proj: Linear [3584→18944]gate_proj [3584→18944] +up_proj: Linear [3584→18944]up_proj [3584→18944] +down_proj: Linear [18944→3584]down_proj [18944→3584] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3584] +LM HeadLinear [3584→152064] +Softmax +logits[1, 6, 152064] + +model id +Qwen/Qwen2.5-Omni-7B +parent +qwen2_5_vl +classes +54 +overridden +23 +added +267 +new classes +43 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen2_5OmniAttention +ovr __init__ + +Qwen2_5OmniAudioEncoderLayer +ovr __init__,forward + +Qwen2_5OmniDiTRotaryEmbedding +ovr __init__,compute_default_rope_parameters + +Qwen2_5OmniPreTrainedModel +ovr _init_weights; 3 attr + +Qwen2_5OmniRotaryEmbedding +ovr __init__ + +Qwen2_5OmniVisionBlock +ovr __init__,forward + +AMPBlock +add __init__,_get_padding,forward + +AttentiveStatisticsPooling +add __init__,_compute_statistics,_length_to_… + +DiTAttention +add __init__,forward + +DiTCodecEmbedding +add __init__,forward + +DiTDecoderLayer +add __init__,forward + +DiTInputEmbedding +add __init__,forward + +DiTMLP +add __init__,forward + +DiTTimestepEmbedding +add __init__,forward + +DownSample1d +add __init__,forward + +ECAPA_TimeDelayNet +add __init__,forward + +Qwen2_5OmniAudioAttention +add __init__,forward + +Qwen2_5OmniAudioEncoder +add __init__,_freeze_parameters,_get_feat_ex… + +Qwen2_5OmniAudioEncoderConfig +4 attr + +Qwen2_5OmniBigVGANConfig +7 attr + +Qwen2_5OmniConfig +add __post_init__,get_text_config; 6 attr + +Qwen2_5OmniDiTConfig +24 attr + +Qwen2_5OmniForConditionalGeneration +add __init__,disable_talker,enable_talker,fr… + +Qwen2_5OmniPreTrainedModelForConditionalGeneration +add get_chunked_index,get_llm_pos_ids_for_vi… + +Qwen2_5OmniTalkerCausalLMOutputWithPast +3 attr + +Qwen2_5OmniTalkerConfig +add __post_init__; 42 attr + +Qwen2_5OmniTalkerForConditionalGeneration +add __init__,_update_model_kwargs_for_genera… + +Qwen2_5OmniTalkerModel +ovr __init__; 3 attr + +Qwen2_5OmniTextConfig +add __post_init__; 27 attr + +Qwen2_5OmniThinkerCausalLMOutputWithPast +1 attr + +Qwen2_5OmniThinkerConfig +add __post_init__; 16 attr + +Qwen2_5OmniThinkerForConditionalGeneration +add __init__,forward,get_audio_features,get_… + +Qwen2_5OmniThinkerTextModel +ovr __init__; 2 attr + +Qwen2_5OmniToken2WavBigVGANModel +add __init__,amplitude_to_db,forward,normali… + +Qwen2_5OmniToken2WavConfig +add __post_init__; 4 attr + +Qwen2_5OmniToken2WavDiTModel +add __init__,_create_block_diff,forward,samp… + +Qwen2_5OmniToken2WavModel +add __init__,forward; 4 attr + +Qwen2_5OmniVisionAttention +add __init__,forward + +Qwen2_5OmniVisionEncoder +ovr __init__,forward; 5 attr + +Qwen2_5OmniVisionEncoderConfig +2 attr + +Qwen2_5_OmniAdaLayerNormZero +add __init__,forward + +Qwen2_5_OmniAdaLayerNormZero_Final +add __init__,forward + +Res2NetBlock +add __init__,forward + +RungeKutta4ODESolver +add __init__,_compute_step,_linear_interpola… + +SinusPositionEmbedding +add __init__,forward + +SinusoidsPositionEmbedding +add __init__,forward + +SnakeBeta +add __init__,forward + +SqueezeExcitationBlock +add __init__,forward + +SqueezeExcitationRes2NetBlock +add __init__,forward + +TimeDelayNetBlock +add __init__,forward + +TorchActivation1d +add __init__,forward + +UpSample1d +add __init__,forward + \ No newline at end of file diff --git a/qwen2_5_omni.svg b/qwen2_5_omni.svg new file mode 100644 index 0000000000000000000000000000000000000000..7dc6d4e541de13da6510744839ffe6314caab931 --- /dev/null +++ b/qwen2_5_omni.svg @@ -0,0 +1,179 @@ + + + + +qwen2_5_omni +dense · 28× full + +Qwen2_5OmniForConditionalGeneration · base model +28 × Qwen2_5OmniDecoderLayerQwen2_5OmniDecoderLayer× 28 +Self-Attention · Qwen2_5OmniAttention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 3584] → [1, 6, 3584] +Qwen2_5OmniRMSNormpre-attention [1, 6, 3584] +q_proj: Linear [3584→3584]q_proj [3584→3584] +k_proj: Linear [3584→512]k_proj [3584→512] +v_proj: Linear [3584→512]v_proj [3584→512] +o_proj: Linear [3584→3584]o_proj [3584→3584] +scaled dot-product attention28 heads · head_dim 128 · GQA 28:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2_5OmniRMSNormpre-FFN [1, 6, 3584] +gate_proj: Linear [3584→18944]gate_proj [3584→18944] +up_proj: Linear [3584→18944]up_proj [3584→18944] +down_proj: Linear [18944→3584]down_proj [18944→3584] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3584] +LM HeadLinear [3584→152064] +Softmax +logits[1, 6, 152064] + +model id +Qwen/Qwen2.5-Omni-7B +model_type +qwen2_5_omni +config +Qwen2_5OmniConfig +decoder +dense +layers +28 +hidden +3,584 +intermediate +18,944 +heads / kv +28 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +152,064 +max_pos +32,768 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/qwen2_5_vl.diff.svg b/qwen2_5_vl.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..4043a6fe553c11dd35da9764bebb32f7325c7d5a --- /dev/null +++ b/qwen2_5_vl.diff.svg @@ -0,0 +1,226 @@ + + + + +qwen2_5_vl +diff vs qwen2_vl (+llama) · 11 overridden · 34 added · 0 deleted · 8 new · 5 inherited-as-is + +Qwen2_5_VLModel · base model +80 × Qwen2_5_VLDecoderLayerQwen2_5_VLDecoderLayer× 80 +Qwen2_5_VLForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2VLAttention ↩ inherited +Vision encoder · Qwen2_5_Visio…×32 +Qwen2_5_VLVisionBlock×32 +MLP · Qwen2MLP +mlp · Qwen2_5_VLMLP +attn · Qwen2_5_VLVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 8192] → [1, 6, 8192] +Qwen2_5_VLRMSNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→1024]k_proj [8192→1024] +v_proj: Linear [8192→1024]v_proj [8192→1024] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2_5_VLRMSNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→29568]gate_proj [8192→29568] +up_proj: Linear [8192→29568]up_proj [8192→29568] +down_proj: Linear [29568→8192]down_proj [29568→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 8192] +Qwen2_5_VLForConditionalGenerationLM HeadLinear [8192→152064] +Softmax +logits[1, 6, 152064] +example image +pixel_values[1, 3, 336, 336] +norm1: Qwen2_5_VLRMSNorm 3584norm1 RMSNorm 3584 +norm2: Qwen2_5_VLRMSNorm 3584norm2 RMSNorm 3584 +qkv: Linear [3584→10752]qkv [3584→10752] +proj: Linear [3584→3584]proj [3584→3584] +gate_proj: Linear [3584→3420]gate_proj [3584→3420] +up_proj: Linear [3584→3420]up_proj [3584→3420] +down_proj: Linear [3420→3584]down_proj [3420→3584] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen2-VL-7B-Instruct +parent +qwen2_vl +classes +18 +overridden +11 +added +34 +new classes +8 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen2_5_VLPatchMerger +ovr __init__ + +Qwen2_5_VLPreTrainedModel +ovr _init_weights + +Qwen2_5_VLVisionAttention +ovr __init__ + +Qwen2_5_VLConfig +rename only + +Qwen2_5_VLForConditionalGeneration +ovr forward,prepare_inputs_for_generation; 1… + +Qwen2_5_VLMLP +add __init__,forward + +Qwen2_5_VLModel +ovr __init__,compute_3d_position_ids,forward… + +Qwen2_5_VLProcessor +add _process_videos,model_input_names + +Qwen2_5_VLProcessorKwargs +1 attr + +Qwen2_5_VLTextConfig +rename only + +Qwen2_5_VLVisionBlock +add __init__,forward + +Qwen2_5_VLVisionConfig +16 attr + +Qwen2_5_VisionTransformerPretrainedModel +add __init__,forward,get_window_index,rot_po… + \ No newline at end of file diff --git a/qwen2_5_vl.svg b/qwen2_5_vl.svg new file mode 100644 index 0000000000000000000000000000000000000000..4a5d5aaffe1ee928461a0aa32eef291c37090b02 --- /dev/null +++ b/qwen2_5_vl.svg @@ -0,0 +1,208 @@ + + + + +qwen2_5_vl +multimodal · vision → projector → LLM · dense + +Qwen2_5_VLModel · base model +80 × Qwen2_5_VLDecoderLayerQwen2_5_VLDecoderLayer× 80 +Qwen2_5_VLForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2_5_VLAttention +Vision encoder · Qwen2_5_Visio…×32 +Qwen2_5_VLVisionBlock×32 +MLP · Qwen2MLP +mlp · Qwen2_5_VLMLP +attn · Qwen2_5_VLVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 8192] → [1, 6, 8192] +Qwen2_5_VLRMSNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→1024]k_proj [8192→1024] +v_proj: Linear [8192→1024]v_proj [8192→1024] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2_5_VLRMSNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→29568]gate_proj [8192→29568] +up_proj: Linear [8192→29568]up_proj [8192→29568] +down_proj: Linear [29568→8192]down_proj [29568→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 8192] +Qwen2_5_VLForConditionalGenerationLM HeadLinear [8192→152064] +Softmax +logits[1, 6, 152064] +example image +pixel_values[1, 3, 336, 336] +norm1: Qwen2_5_VLRMSNorm 3584norm1 RMSNorm 3584 +norm2: Qwen2_5_VLRMSNorm 3584norm2 RMSNorm 3584 +qkv: Linear [3584→10752]qkv [3584→10752] +proj: Linear [3584→3584]proj [3584→3584] +gate_proj: Linear [3584→3420]gate_proj [3584→3420] +up_proj: Linear [3584→3420]up_proj [3584→3420] +down_proj: Linear [3420→3584]down_proj [3420→3584] +act_fn: SiLUActivationact_fn SiLU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen2-VL-7B-Instruct +inputs +input_ids, pixel_values +model_type +qwen2_5_vl +config +Qwen2_5_VLConfig +decoder +dense +layers +80 +hidden +8,192 +intermediate +29,568 +heads / kv +64 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +152,064 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/qwen2_audio.svg b/qwen2_audio.svg new file mode 100644 index 0000000000000000000000000000000000000000..121d063f39cad5f32e01094e3878529df12f186d --- /dev/null +++ b/qwen2_audio.svg @@ -0,0 +1,207 @@ + + + + +qwen2_audio +multimodal · audio → projector → LLM · dense + +Qwen2AudioModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +Qwen2AudioForConditionalGeneration · task head +Self-Attention · Qwen2Attention +Audio encoder · Qwen2AudioEnc…×32 +Qwen2AudioEncoderLayer×32 +MLP · Qwen2MLP +self_attn · Qwen2AudioAttention +Projector · Qwen2AudioMultiModalProj… + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen2AudioForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] +input_features[1, 128, 3000] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +out_proj: Linear [1280→1280]out_proj [1280→1280] +self_attn_layer_norm: LayerNorm 1280self_attn_layer_normLayerNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +final_layer_norm: LayerNorm 1280final_layer_normLayerNorm 1280 +linear: Linear [1280→4096]linear [1280→4096] +merge at modality tokens + +model id +Qwen/Qwen2-Audio-7B +inputs +input_ids, input_features +built via +AutoModel +model_type +qwen2_audio +config +Qwen2AudioConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +True +legend + +audio encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/qwen2_moe.diff.svg b/qwen2_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b653e1b2e955b9a4f8300e3303d518d05f02eed1 --- /dev/null +++ b/qwen2_moe.diff.svg @@ -0,0 +1,206 @@ + + + + +qwen2_moe +diff vs mixtral (+llama,gemma,gemma2) · 11 overridden · 4 added · 0 deleted · 5 new · 2 inherited-as-is + +Qwen2MoeModel · base model +24 × Qwen2MoeDecoderLayerQwen2MoeDecoderLayer× 24 +Qwen2MoeForCausalLM · task head +Self-Attention · Qwen2MoeAttention +Sparse MoE · Qwen2MoeSparseMoeBlockMoE +shared_expert · Qwen2MoeMLP (×60 · dim 1408) +experts · Qwen2MoeExperts (×60 · dim 1408) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 2048] → [1, 6, 2048] +Qwen2MoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2MoeRMSNormpre-FFN [1, 6, 2048] +gate: Qwen2MoeTopKRouter top-4 of 60gate TopKRouter top-4 of 60 +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [2048→5632]gate_proj [2048→5632] +up_proj: Linear [2048→5632]up_proj [2048→5632] +down_proj: Linear [5632→2048]down_proj [5632→2048] +act_fn: SiLUActivationact_fn SiLU +shared_expert_gate: Linear [2048→1]shared_expert_gate [2048→1] +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen2MoeForCausalLMLM HeadLinear [2048→151936] +Softmax +logits[1, 6, 151936] + +model id +Qwen/Qwen1.5-MoE-A2.7B +parent +mixtral +classes +14 +overridden +11 +added +4 +new classes +5 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen2MoeAttention +ovr __init__ + +Qwen2MoeDecoderLayer +ovr __init__ + +Qwen2MoeExperts +ovr __init__ + +Qwen2MoeForCausalLM +ovr __init__; 3 attr + +Qwen2MoeMLP +ovr __init__ + +Qwen2MoeModel +ovr __init__,forward + +Qwen2MoePreTrainedModel +1 attr + +Qwen2MoeForQuestionAnswering +rename only + +Qwen2MoeForSequenceClassification +rename only + +Qwen2MoeForTokenClassification +rename only + +Qwen2MoeSparseMoeBlock +add __init__,forward + +Qwen2MoeTopKRouter +add __init__,forward + \ No newline at end of file diff --git a/qwen2_moe.svg b/qwen2_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..5b980eac9084a309325bb3d36aeac8249d2947bd --- /dev/null +++ b/qwen2_moe.svg @@ -0,0 +1,187 @@ + + + + +qwen2_moe +sparse-moe · 24× full +MoE + +Qwen2MoeModel · base model +24 × Qwen2MoeDecoderLayerQwen2MoeDecoderLayer× 24 +Qwen2MoeForCausalLM · task head +Self-Attention · Qwen2MoeAttention +Sparse MoE · Qwen2MoeSparseMoeBlockMoE +shared_expert · Qwen2MoeMLP (×60 · dim 1408) +experts · Qwen2MoeExperts (×60 · dim 1408) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 2048] → [1, 6, 2048] +Qwen2MoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2MoeRMSNormpre-FFN [1, 6, 2048] +gate: Qwen2MoeTopKRouter top-4 of 60gate TopKRouter top-4 of 60 +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [2048→5632]gate_proj [2048→5632] +up_proj: Linear [2048→5632]up_proj [2048→5632] +down_proj: Linear [5632→2048]down_proj [5632→2048] +act_fn: SiLUActivationact_fn SiLU +shared_expert_gate: Linear [2048→1]shared_expert_gate [2048→1] +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen2MoeForCausalLMLM HeadLinear [2048→151936] +Softmax +logits[1, 6, 151936] + +model id +Qwen/Qwen1.5-MoE-A2.7B +model_type +qwen2_moe +config +Qwen2MoeConfig +decoder +sparse-moe +layers +24 +hidden +2,048 +intermediate +5,632 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +experts (top-k) +60 (top-4) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/qwen2_vl.svg b/qwen2_vl.svg new file mode 100644 index 0000000000000000000000000000000000000000..b684a8f1af7745f570e3f1548b1c9cc14ded3557 --- /dev/null +++ b/qwen2_vl.svg @@ -0,0 +1,207 @@ + + + + +qwen2_vl +multimodal · vision → projector → LLM · dense + +Qwen2VLModel · base model +80 × Qwen2VLDecoderLayerQwen2VLDecoderLayer× 80 +Qwen2VLForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2VLAttention +Vision encoder · Qwen2VisionTr…×32 +Qwen2VLVisionBlock×32 +MLP · Qwen2MLP +mlp · VisionMlp +attn · VisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [152064 × 8192] → [1, 6, 8192] +Qwen2VLRMSNormpre-attention [1, 6, 8192] +q_proj: Linear [8192→8192]q_proj [8192→8192] +k_proj: Linear [8192→1024]k_proj [8192→1024] +v_proj: Linear [8192→1024]v_proj [8192→1024] +o_proj: Linear [8192→8192]o_proj [8192→8192] +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2VLRMSNormpre-FFN [1, 6, 8192] +gate_proj: Linear [8192→29568]gate_proj [8192→29568] +up_proj: Linear [8192→29568]up_proj [8192→29568] +down_proj: Linear [29568→8192]down_proj [29568→8192] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 8192] +Qwen2VLForConditionalGenerationLM HeadLinear [8192→152064] +Softmax +logits[1, 6, 152064] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1280norm1 LayerNorm 1280 +norm2: LayerNorm 1280norm2 LayerNorm 1280 +qkv: Linear [1280→3840]qkv [1280→3840] +proj: Linear [1280→1280]proj [1280→1280] +fc1: Linear [1280→5120]fc1 [1280→5120] +act: QuickGELUActivationact QuickGELU +fc2: Linear [5120→1280]fc2 [5120→1280] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen2-VL-7B-Instruct +inputs +input_ids, pixel_values +model_type +qwen2_vl +config +Qwen2VLConfig +decoder +dense +layers +80 +hidden +8,192 +intermediate +29,568 +heads / kv +64 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +152,064 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/qwen3.diff.svg b/qwen3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..67f3963a6cb2d0094f8dd5b67cf198431e464adb --- /dev/null +++ b/qwen3.diff.svg @@ -0,0 +1,173 @@ + + + + +qwen3 +diff vs qwen2 (+gemma,llama) · 3 overridden · 0 added · 0 deleted · 0 new · 6 inherited-as-is + +Qwen3Model · base model +32 × Qwen3DecoderLayerQwen3DecoderLayer× 32 +Qwen3ForCausalLM · task head +Self-Attention · Qwen3Attention +MLP · Qwen2MLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3RMSNorm 128q_norm RMSNorm 128 +k_norm: Qwen3RMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen3ForCausalLMLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] + +model id +Qwen/Qwen3-8B +parent +qwen2 +classes +8 +overridden +3 +added +0 +new classes +0 +inherited as-is +6 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen3Attention +ovr __init__,forward + +Qwen3ForCausalLM +ovr forward + \ No newline at end of file diff --git a/qwen3.svg b/qwen3.svg new file mode 100644 index 0000000000000000000000000000000000000000..ea48b6e03310c97e6be7815df51261c618647e1b --- /dev/null +++ b/qwen3.svg @@ -0,0 +1,182 @@ + + + + +qwen3 +dense · 32× full + +Qwen3Model · base model +32 × Qwen3DecoderLayerQwen3DecoderLayer× 32 +Qwen3ForCausalLM · task head +Self-Attention · Qwen3Attention +MLP · Qwen3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen3RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3RMSNorm 128q_norm RMSNorm 128 +k_norm: Qwen3RMSNorm 128k_norm RMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen3ForCausalLMLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] + +model id +Qwen/Qwen3-8B +model_type +qwen3 +config +Qwen3Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/qwen3_5.diff.svg b/qwen3_5.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..8e200418c0a0ce029af3e14e1326a87a4285f57d --- /dev/null +++ b/qwen3_5.diff.svg @@ -0,0 +1,269 @@ + + + + +qwen3_5 +diff vs qwen3_vl (+qwen3_next,qwen3) · 22 overridden · 33 added · 1 deleted · 7 new · 4 inherited-as-is + +Qwen3_5Model · base model +32 × Qwen3_5DecoderLayerQwen3_5DecoderLayer× 32 +Qwen3_5ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Qwen3VLAttention ↩ inherited +Vision encoder · Qwen3_5Vision…×27 +Qwen3VLVisionBlock ↩ inher…×27 +MLP · Qwen3_5MLP +mlp · Qwen3VLVisionMLP ↩ inh… +attn · Qwen3VLVisionAttention ↩… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [248320 × 4096] → [1, 6, 4096] +Qwen3_5RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→8192]q_proj [4096→8192] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3_5RMSNorm 256q_norm RMSNorm 256 +k_norm: Qwen3_5RMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention16 heads · head_dim 256 · GQA 16:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3_5RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→12288]gate_proj [4096→12288] +up_proj: Linear [4096→12288]up_proj [4096→12288] +down_proj: Linear [12288→4096]down_proj [12288→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen3_5ForConditionalGenerationLM HeadLinear [4096→248320] +Softmax +logits[1, 6, 248320] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1152norm1 LayerNorm 1152 +norm2: LayerNorm 1152norm2 LayerNorm 1152 +qkv: Linear [1152→3456]qkv [1152→3456] +proj: Linear [1152→1152]proj [1152→1152] +linear_fc1: Linear [1152→4304]linear_fc1 [1152→4304] +linear_fc2: Linear [4304→1152]linear_fc2 [4304→1152] +act_fn: GELUTanhact_fn GELUTanh +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen3.5-27B +parent +qwen3_vl +classes +20 +overridden +22 +added +33 +new classes +7 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen3_5GatedDeltaNet +ovr __init__,forward; del fix_query_key_valu… + +Qwen3_5ForConditionalGeneration +ovr get_image_features,get_video_features + +Qwen3_5MLP +ovr __init__ + +Qwen3_5Model +ovr forward,get_image_features,get_video_fea… + +Qwen3_5PreTrainedModel +ovr _init_weights; 3 attr + +Qwen3_5TextRotaryEmbedding +ovr __init__,compute_default_rope_parameters + +Qwen3_5VisionModel +ovr __init__,forward; 2 attr + +Qwen3_5Config +4 attr + +Qwen3_5DecoderLayer +add __init__,forward + +Qwen3_5ForCausalLM +ovr __init__; 2 attr + +Qwen3_5ForSequenceClassification +add forward + +Qwen3_5ForTokenClassification +1 attr + +Qwen3_5TextConfig +add __post_init__; 18 attr + +Qwen3_5TextForSequenceClassification +2 attr + +Qwen3_5TextModel +ovr __init__,forward; 1 attr + +Qwen3_5VisionConfig +1 attr + \ No newline at end of file diff --git a/qwen3_5.svg b/qwen3_5.svg new file mode 100644 index 0000000000000000000000000000000000000000..e667108bd7454409a9c448199a48cb7457a126ea --- /dev/null +++ b/qwen3_5.svg @@ -0,0 +1,246 @@ + + + + +qwen3_5 +multimodal · vision → projector → LLM · hybrid + +Qwen3_5Model · base model +32 × Qwen3_5DecoderLayerQwen3_5DecoderLayer× 32 +Qwen3_5ForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Qwen3_5Attention +Vision encoder · Qwen3_5Vision…×27 +Qwen3_5VisionBlock×27 +MLP · Qwen3_5MLP +mlp · Qwen3_5VisionMLP +attn · Qwen3_5VisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [248320 × 4096] → [1, 6, 4096] +Qwen3_5RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→8192]q_proj [4096→8192] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3_5RMSNorm 256q_norm RMSNorm 256 +k_norm: Qwen3_5RMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention16 heads · head_dim 256 · GQA 16:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3_5RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→12288]gate_proj [4096→12288] +up_proj: Linear [4096→12288]up_proj [4096→12288] +down_proj: Linear [12288→4096]down_proj [12288→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen3_5ForConditionalGenerationLM HeadLinear [4096→248320] +Softmax +logits[1, 6, 248320] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1152norm1 LayerNorm 1152 +norm2: LayerNorm 1152norm2 LayerNorm 1152 +qkv: Linear [1152→3456]qkv [1152→3456] +proj: Linear [1152→1152]proj [1152→1152] +linear_fc1: Linear [1152→4304]linear_fc1 [1152→4304] +linear_fc2: Linear [4304→1152]linear_fc2 [4304→1152] +act_fn: GELUTanhact_fn GELUTanh +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen3.5-27B +inputs +input_ids, pixel_values +model_type +qwen3_5 +config +Qwen3_5Config +decoder +hybrid +layers +32 +hidden +4,096 +intermediate +12,288 +heads / kv +16 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +248,320 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +linear + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/qwen3_5_moe.diff.svg b/qwen3_5_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..716781759a82e40ade56588947e5b9bb7f38b43c --- /dev/null +++ b/qwen3_5_moe.diff.svg @@ -0,0 +1,258 @@ + + + + +qwen3_5_moe +diff vs qwen3_5 (+qwen3_next,qwen3_vl_moe) · 8 overridden · 21 added · 0 deleted · 3 new · 13 inherited-as-is + +Qwen3_5MoeModel · base model +40 × Qwen3_5MoeDecoderLayerQwen3_5MoeDecoderLayer× 40 +Qwen3_5MoeForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Qwen3_5Attention ↩ inherited +Sparse MoE · Qwen3_5SparseMoeBlock ↩ inh…MoE +Vision encoder · Qwen3_5Vision…×27 +Qwen3_5VisionBlock ↩ inher…×27 +shared_expert · Qwen3_5MLP (×256 · dim 512)… +mlp · Qwen3_5VisionMLP ↩ inhe… +experts · Qwen3_5Experts (×256 · dim 512) ↩ i… +attn · Qwen3_5VisionAttention ↩… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [248320 × 2048] → [1, 6, 2048] +Qwen3_5MoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→8192]q_proj [2048→8192] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [4096→2048]o_proj [4096→2048] +q_norm: Qwen3_5MoeRMSNorm 256q_norm RMSNorm 256 +k_norm: Qwen3_5MoeRMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention16 heads · head_dim 256 · GQA 16:2 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3_5MoeRMSNormpre-FFN [1, 6, 2048] +gate: Qwen3_5MoeTopKRouter top-8 of 256gate TopKRouter top-8 of 256 +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [2048→512]gate_proj [2048→512] +up_proj: Linear [2048→512]up_proj [2048→512] +down_proj: Linear [512→2048]down_proj [512→2048] +act_fn: SiLUActivationact_fn SiLU +shared_expert_gate: Linear [2048→1]shared_expert_gate [2048→1] +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen3_5MoeForConditionalGenerationLM HeadLinear [2048→248320] +Softmax +logits[1, 6, 248320] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 +layer 32: linear_attention32 +layer 33: linear_attention33 +layer 34: linear_attention34 +layer 35: full_attention35 +layer 36: linear_attention36 +layer 37: linear_attention37 +layer 38: linear_attention38 +layer 39: full_attention39 +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1152norm1 LayerNorm 1152 +norm2: LayerNorm 1152norm2 LayerNorm 1152 +qkv: Linear [1152→3456]qkv [1152→3456] +proj: Linear [1152→1152]proj [1152→1152] +linear_fc1: Linear [1152→4304]linear_fc1 [1152→4304] +linear_fc2: Linear [4304→1152]linear_fc2 [4304→1152] +act_fn: GELUTanhact_fn GELUTanh +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen3.5-35B-A3B +parent +qwen3_5 +classes +21 +overridden +8 +added +21 +new classes +3 +inherited as-is +13 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen3_5MoeDecoderLayer +ovr __init__ + +Qwen3_5MoeModelOutputWithPast +1 attr + +Qwen3_5MoePreTrainedModel +ovr _init_weights; 1 attr + +Qwen3_5MoeConfig +4 attr + +Qwen3_5MoeForCausalLM +ovr __init__; 2 attr + +Qwen3_5MoeForConditionalGeneration +ovr forward,get_image_features,get_video_fea… + +Qwen3_5MoeTextConfig +add __post_init__; 13 attr + +Qwen3_5MoeVisionConfig +rename only + \ No newline at end of file diff --git a/qwen3_5_moe.svg b/qwen3_5_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..1520d5f574f07fd8d9626803c60daff5b0b687ec --- /dev/null +++ b/qwen3_5_moe.svg @@ -0,0 +1,261 @@ + + + + +qwen3_5_moe +multimodal · vision → projector → LLM · hybrid + +Qwen3_5MoeModel · base model +40 × Qwen3_5MoeDecoderLayerQwen3_5MoeDecoderLayer× 40 +Qwen3_5MoeForConditionalGeneration · task head +image ⊕ text attention +layers (idx) +Self-Attention · Qwen3_5MoeAttention +Sparse MoE · Qwen3_5MoeSparseMoeBlockMoE +Vision encoder · Qwen3_5MoeVi…×27 +Qwen3_5MoeVisionBlock×27 +shared_expert · Qwen3_5MoeMLP (×256 · dim… +mlp · Qwen3_5MoeVisionMLP +experts · Qwen3_5MoeExperts (×256 · dim 512) +attn · Qwen3_5MoeVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [248320 × 2048] → [1, 6, 2048] +Qwen3_5MoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→8192]q_proj [2048→8192] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [4096→2048]o_proj [4096→2048] +q_norm: Qwen3_5MoeRMSNorm 256q_norm RMSNorm 256 +k_norm: Qwen3_5MoeRMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention16 heads · head_dim 256 · GQA 16:2 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3_5MoeRMSNormpre-FFN [1, 6, 2048] +gate: Qwen3_5MoeTopKRouter top-8 of 256gate TopKRouter top-8 of 256 +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [2048→512]gate_proj [2048→512] +up_proj: Linear [2048→512]up_proj [2048→512] +down_proj: Linear [512→2048]down_proj [512→2048] +act_fn: SiLUActivationact_fn SiLU +shared_expert_gate: Linear [2048→1]shared_expert_gate [2048→1] +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen3_5MoeForConditionalGenerationLM HeadLinear [2048→248320] +Softmax +logits[1, 6, 248320] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 +layer 32: linear_attention32 +layer 33: linear_attention33 +layer 34: linear_attention34 +layer 35: full_attention35 +layer 36: linear_attention36 +layer 37: linear_attention37 +layer 38: linear_attention38 +layer 39: full_attention39 +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1152norm1 LayerNorm 1152 +norm2: LayerNorm 1152norm2 LayerNorm 1152 +qkv: Linear [1152→3456]qkv [1152→3456] +proj: Linear [1152→1152]proj [1152→1152] +linear_fc1: Linear [1152→4304]linear_fc1 [1152→4304] +linear_fc2: Linear [4304→1152]linear_fc2 [4304→1152] +act_fn: GELUTanhact_fn GELUTanh +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen3.5-35B-A3B +inputs +input_ids, pixel_values +model_type +qwen3_5_moe +config +Qwen3_5MoeConfig +decoder +hybrid +layers +40 +hidden +2,048 +intermediate +— +heads / kv +16 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +248,320 +max_pos +32,768 +experts (top-k) +256 (top-8) +tie_embeddings +False +legend + +vision encoder + +self-attention + +linear + +full + +MoE / experts + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/qwen3_moe.diff.svg b/qwen3_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d4db1096cee38162699bf36b0be882d8fac1e74f --- /dev/null +++ b/qwen3_moe.diff.svg @@ -0,0 +1,178 @@ + + + + +qwen3_moe +diff vs qwen2_moe (+llama,mixtral,qwen3) · 4 overridden · 2 added · 0 deleted · 1 new · 9 inherited-as-is + +Qwen3MoeModel · base model +24 × Qwen3MoeDecoderLayerQwen3MoeDecoderLayer× 24 +Qwen3MoeForCausalLM · task head +Self-Attention · Qwen3MoeAttention +Sparse MoE · Qwen3MoeSparseMoeBlockMoE +experts · Qwen2MoeExperts (×128 · dim 768) ↩… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 2048] → [1, 6, 2048] +Qwen3MoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→256]k_proj [2048→256] +v_proj: Linear [2048→256]v_proj [2048→256] +o_proj: Linear [2048→2048]o_proj [2048→2048] +q_norm: Qwen3MoeRMSNorm 64q_norm RMSNorm 64 +k_norm: Qwen3MoeRMSNorm 64k_norm RMSNorm 64 +scaled dot-product attention32 heads · head_dim 64 · GQA 32:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Qwen3MoeRMSNormpre-FFN [1, 6, 2048] +act_fn: SiLUActivationact_fn SiLU +gate: Qwen3MoeTopKRouter top-8 of 128gate TopKRouter top-8 of 128 +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen3MoeForCausalLMLM HeadLinear [2048→151936] +Softmax +logits[1, 6, 151936] + +model id +Qwen/Qwen3-30B-A3B-Base +parent +qwen2_moe +classes +13 +overridden +4 +added +2 +new classes +1 +inherited as-is +9 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen3MoeAttention +ovr __init__ + +Qwen3MoeForCausalLM +ovr __init__,forward + +Qwen3MoePreTrainedModel +1 attr + +Qwen3MoeSparseMoeBlock +add __init__,forward + \ No newline at end of file diff --git a/qwen3_moe.svg b/qwen3_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..1cbeb8c4f1c3548126ea9776739efe94d1711de7 --- /dev/null +++ b/qwen3_moe.svg @@ -0,0 +1,183 @@ + + + + +qwen3_moe +sparse-moe · 24× GQA +MoE + +Qwen3MoeModel · base model +24 × Qwen3MoeDecoderLayerQwen3MoeDecoderLayer× 24 +Qwen3MoeForCausalLM · task head +Self-Attention · Qwen3MoeAttention +Sparse MoE · Qwen3MoeSparseMoeBlockMoE +experts · Qwen3MoeExperts (×128 · dim 768) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 2048] → [1, 6, 2048] +Qwen3MoeRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→256]k_proj [2048→256] +v_proj: Linear [2048→256]v_proj [2048→256] +o_proj: Linear [2048→2048]o_proj [2048→2048] +q_norm: Qwen3MoeRMSNorm 64q_norm RMSNorm 64 +k_norm: Qwen3MoeRMSNorm 64k_norm RMSNorm 64 +scaled dot-product attention32 heads · head_dim 64 · GQA 32:4 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Qwen3MoeRMSNormpre-FFN [1, 6, 2048] +act_fn: SiLUActivationact_fn SiLU +gate: Qwen3MoeTopKRouter top-8 of 128gate TopKRouter top-8 of 128 +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen3MoeForCausalLMLM HeadLinear [2048→151936] +Softmax +logits[1, 6, 151936] + +model id +Qwen/Qwen3-30B-A3B-Base +model_type +qwen3_moe +config +Qwen3MoeConfig +decoder +sparse-moe +layers +24 +hidden +2,048 +intermediate +6,144 +heads / kv +32 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +experts (top-k) +128 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/qwen3_next.diff.svg b/qwen3_next.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9257ea63f7ff4433f74aab2b7bbc64f0d68c16f2 --- /dev/null +++ b/qwen3_next.diff.svg @@ -0,0 +1,245 @@ + + + + +qwen3_next +diff vs qwen3_moe (+llama,qwen2_moe,gemma2,gemma3,mixtral) · 7 overridden · 19 added · 0 deleted · 4 new · 8 inherited-as-is + +Qwen3NextModel · base model +48 × Qwen3NextDecoderLayerQwen3NextDecoderLayer× 48 +Qwen3NextForCausalLM · task head +layers (idx) +Self-Attention · Qwen3NextAttention +Sparse MoE · Qwen3MoeSparseMoeBlock ↩ in…MoE +shared_expert · Qwen3MoeMLP (×512 · dim 51… +experts · Qwen3MoeExperts (×512 · dim 512) ↩… + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 2048] → [1, 6, 2048] +Qwen3NextRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→8192]q_proj [2048→8192] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [4096→2048]o_proj [4096→2048] +q_norm: Qwen3NextRMSNorm 256q_norm RMSNorm 256 +k_norm: Qwen3NextRMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention16 heads · head_dim 256 · GQA 16:2 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3NextRMSNormpre-FFN [1, 6, 2048] +gate: Qwen3NextTopKRouter top-10 of 512gate TopKRouter top-10 of 512 +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [2048→512]gate_proj [2048→512] +up_proj: Linear [2048→512]up_proj [2048→512] +down_proj: Linear [512→2048]down_proj [512→2048] +act_fn: SiLUActivationact_fn SiLU +shared_expert_gate: Linear [2048→1]shared_expert_gate [2048→1] +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen3NextForCausalLMLM HeadLinear [2048→151936] +Softmax +logits[1, 6, 151936] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 +layer 32: linear_attention32 +layer 33: linear_attention33 +layer 34: linear_attention34 +layer 35: full_attention35 +layer 36: linear_attention36 +layer 37: linear_attention37 +layer 38: linear_attention38 +layer 39: full_attention39 +layer 40: linear_attention40 +layer 41: linear_attention41 +layer 42: linear_attention42 +layer 43: full_attention43 +layer 44: linear_attention44 +layer 45: linear_attention45 +layer 46: linear_attention46 +layer 47: full_attention47 + +model id +Qwen/Qwen3-Next-80B-A3B-Instru +parent +qwen3_moe +classes +16 +overridden +7 +added +19 +new classes +4 +inherited as-is +8 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen3NextAttention +ovr __init__,forward + +Qwen3NextDecoderLayer +ovr __init__,forward + +Qwen3NextForCausalLM +ovr __init__,forward + +Qwen3NextRotaryEmbedding +ovr compute_default_rope_parameters + +Qwen3NextGatedDeltaNet +add __init__,fix_query_key_value_ordering,fo… + +Qwen3NextModel +add __init__,_update_linear_attn_mask,forward + +Qwen3NextPreTrainedModel +add _init_weights; 10 attr + +Qwen3NextRMSNormGated +add __init__,forward + \ No newline at end of file diff --git a/qwen3_next.svg b/qwen3_next.svg new file mode 100644 index 0000000000000000000000000000000000000000..f49d56f9d0e59a5d3a8047af3c447fbd857a0bcf --- /dev/null +++ b/qwen3_next.svg @@ -0,0 +1,242 @@ + + + + +qwen3_next +hybrid · 36× linear +MoE + 12× full +MoE + +Qwen3NextModel · base model +48 × Qwen3NextDecoderLayerQwen3NextDecoderLayer× 48 +Qwen3NextForCausalLM · task head +layers (idx) +Self-Attention · Qwen3NextAttention +Sparse MoE · Qwen3NextSparseMoeBlockMoE +shared_expert · Qwen3NextMLP (×512 · dim 512) +experts · Qwen3NextExperts (×512 · dim 512) + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 2048] → [1, 6, 2048] +Qwen3NextRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→8192]q_proj [2048→8192] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [4096→2048]o_proj [4096→2048] +q_norm: Qwen3NextRMSNorm 256q_norm RMSNorm 256 +k_norm: Qwen3NextRMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention16 heads · head_dim 256 · GQA 16:2 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen3NextRMSNormpre-FFN [1, 6, 2048] +gate: Qwen3NextTopKRouter top-10 of 512gate TopKRouter top-10 of 512 +act_fn: SiLUActivationact_fn SiLU +gate_proj: Linear [2048→512]gate_proj [2048→512] +up_proj: Linear [2048→512]up_proj [2048→512] +down_proj: Linear [512→2048]down_proj [512→2048] +act_fn: SiLUActivationact_fn SiLU +shared_expert_gate: Linear [2048→1]shared_expert_gate [2048→1] +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen3NextForCausalLMLM HeadLinear [2048→151936] +Softmax +logits[1, 6, 151936] +layer 0: linear_attention0 +layer 1: linear_attention1 +layer 2: linear_attention2 +layer 3: full_attention3 +layer 4: linear_attention4 +layer 5: linear_attention5 +layer 6: linear_attention6 +layer 7: full_attention7 +layer 8: linear_attention8 +layer 9: linear_attention9 +layer 10: linear_attention10 +layer 11: full_attention11 +layer 12: linear_attention12 +layer 13: linear_attention13 +layer 14: linear_attention14 +layer 15: full_attention15 +layer 16: linear_attention16 +layer 17: linear_attention17 +layer 18: linear_attention18 +layer 19: full_attention19 +layer 20: linear_attention20 +layer 21: linear_attention21 +layer 22: linear_attention22 +layer 23: full_attention23 +layer 24: linear_attention24 +layer 25: linear_attention25 +layer 26: linear_attention26 +layer 27: full_attention27 +layer 28: linear_attention28 +layer 29: linear_attention29 +layer 30: linear_attention30 +layer 31: full_attention31 +layer 32: linear_attention32 +layer 33: linear_attention33 +layer 34: linear_attention34 +layer 35: full_attention35 +layer 36: linear_attention36 +layer 37: linear_attention37 +layer 38: linear_attention38 +layer 39: full_attention39 +layer 40: linear_attention40 +layer 41: linear_attention41 +layer 42: linear_attention42 +layer 43: full_attention43 +layer 44: linear_attention44 +layer 45: linear_attention45 +layer 46: linear_attention46 +layer 47: full_attention47 + +model id +Qwen/Qwen3-Next-80B-A3B-Instr… +model_type +qwen3_next +config +Qwen3NextConfig +decoder +hybrid +layers +48 +hidden +2,048 +intermediate +5,632 +heads / kv +16 / 2 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +experts (top-k) +512 (top-10) +tie_embeddings +False +legend + +self-attention + +linear + +full + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/qwen3_omni_moe.diff.svg b/qwen3_omni_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..861ac22b106f77e952f6bad268ffbe1eeac07b0a --- /dev/null +++ b/qwen3_omni_moe.diff.svg @@ -0,0 +1,276 @@ + + + + +qwen3_omni_moe +diff vs qwen3_moe (+qwen3,qwen2_5_omni,qwen3_vl_moe,qwen2_moe,mimi) · 40 overridden · 191 added · 0 deleted · 26 new · 12 inherited-as-is + +input_ids[1, S] +Token Embedding[3584 × 2048] +Qwen3OmniMoeDecoderLayerNorm → GQANorm → MoE 128E·top-8×28 +Final Norm +LM Head→ logits [1, S, 3584] + +model id +Qwen/Qwen2.5-Omni-7B +parent +qwen3_moe +classes +59 +overridden +40 +added +191 +new classes +26 +inherited as-is +12 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen3OmniMoeAudioAttention +ovr __init__ + +Qwen3OmniMoeAudioEncoder +ovr __init__,forward,get_input_embeddings,se… + +Qwen3OmniMoeCode2WavAttention +ovr __init__ + +Qwen3OmniMoePreTrainedModel +ovr _init_weights + +Qwen3OmniMoePreTrainedModelForConditionalGeneration +ovr get_llm_pos_ids_for_vision,get_rope_index + +Qwen3OmniMoeTalkerCodePredictorDecoderLayer +ovr __init__ + +Qwen3OmniMoeTalkerDecoderLayer +ovr __init__ + +Qwen3OmniMoeThinkerTextAttention +ovr __init__ + +Qwen3OmniMoeThinkerTextDecoderLayer +ovr __init__ + +Qwen3OmniMoeThinkerTextExperts +ovr __init__ + +Qwen3OmniMoeThinkerTextSparseMoeBlock +ovr __init__ + +Qwen3OmniMoeVisionAttention +ovr __init__ + +BaseModelOutputWithDeepstackFeatures +1 attr + +Qwen3OmniMoeAudioEncoderConfig +3 attr + +Qwen3OmniMoeCausalConvNet +add __init__,_get_extra_padding_for_conv1d,f… + +Qwen3OmniMoeCausalTransConvNet +add __init__,forward + +Qwen3OmniMoeCode2Wav +add __init__,chunked_decode,forward; 1 attr + +Qwen3OmniMoeCode2WavConfig +add layer_types; 19 attr + +Qwen3OmniMoeCode2WavDecoderBlock +add __init__,forward + +Qwen3OmniMoeCode2WavDecoderResidualUnit +add __init__,forward + +Qwen3OmniMoeCode2WavTransformerLayer +add __init__,forward + +Qwen3OmniMoeCode2WavTransformerModel +ovr __init__,forward; 1 attr + +Qwen3OmniMoeConfig +add __post_init__,get_text_config; 15 attr + +Qwen3OmniMoeConvNeXtBlock +add __init__,forward + +Qwen3OmniMoeForConditionalGeneration +add __init__,_get_talker_assistant_parts,_ge… + +Qwen3OmniMoeProcessor +add __call__,apply_chat_template,replace_mul… + +Qwen3OmniMoeProcessorKwargs +1 attr + +Qwen3OmniMoeTalkerCodePredictorConfig +add __post_init__; 9 attr + +Qwen3OmniMoeTalkerCodePredictorModel +ovr __init__,forward; add get_input_embeddin… + +Qwen3OmniMoeTalkerCodePredictorModelForConditionalGeneration +ovr __init__,forward; add _update_model_kwar… + +Qwen3OmniMoeTalkerCodePredictorOutputWithPast +1 attr + +Qwen3OmniMoeTalkerConfig +add __post_init__; 21 attr + +Qwen3OmniMoeTalkerForConditionalGeneration +ovr __init__,forward; add _update_model_kwar… + +Qwen3OmniMoeTalkerModel +ovr __init__; add get_input_embeddings; 5 attr + +Qwen3OmniMoeTalkerOutputWithPast +1 attr + +Qwen3OmniMoeTalkerResizeMLP +add __init__,forward + +Qwen3OmniMoeTalkerRotaryEmbedding +rename only + +Qwen3OmniMoeTalkerTextConfig +add __post_init__; 10 attr + +Qwen3OmniMoeTextConfig +add __post_init__; 32 attr + +Qwen3OmniMoeThinkerCausalLMOutputWithPast +1 attr + +Qwen3OmniMoeThinkerConfig +10 attr + +Qwen3OmniMoeThinkerForConditionalGeneration +ovr __init__,forward,get_audio_features,get_… + +Qwen3OmniMoeThinkerTextModel +ovr __init__; 2 attr + +Qwen3OmniMoeThinkerTextPreTrainedModel +2 attr + +Qwen3OmniMoeVisionEncoder +ovr __init__; add deepstack_merger_list; 2 a… + +Qwen3OmniMoeVisionEncoderConfig +rename only + +Qwen3OmniMoeVisionPatchMerger +add __init__,forward + \ No newline at end of file diff --git a/qwen3_omni_moe.svg b/qwen3_omni_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..1fc713f02ef24372e0c3f3d4c1561461a060ffcd --- /dev/null +++ b/qwen3_omni_moe.svg @@ -0,0 +1,158 @@ + + + + +qwen3_omni_moe +⚠ config-only — built from config (weights not instantiable on meta) · sparse-moe · 28× GQA +MoE + +input_ids[1, S] +Token Embedding[3584 × 2048] +Qwen3OmniMoeDecoderLayerNorm → GQANorm → MoE 128E·top-8×28 +Final Norm +LM Head→ logits [1, S, 3584] + +model id +Qwen/Qwen2.5-Omni-7B +model_type +qwen3_omni_moe +config +Qwen3OmniMoeConfig +decoder +sparse-moe +layers +28 +hidden +2,048 +intermediate +18,944 +heads / kv +28 / 4 +attention +GQA +norm +— +positional +RoPE +vocab +3,584 +max_pos +32,768 +experts (top-k) +128 (top-8) +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/qwen3_vl.diff.svg b/qwen3_vl.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ad46838e17a610e0684984a15d35362a8bc4cfa6 --- /dev/null +++ b/qwen3_vl.diff.svg @@ -0,0 +1,245 @@ + + + + +qwen3_vl +diff vs qwen2_vl (+qwen2_5_vl,qwen3,llama) · 26 overridden · 73 added · 0 deleted · 9 new · 3 inherited-as-is + +Qwen3VLModel · base model +32 × Qwen3VLTextDecoderLayerQwen3VLTextDecoderLayer× 32 +Qwen3VLForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen3VLTextAttention +Vision encoder · Qwen3VLVision…×27 +Qwen3VLVisionBlock×27 +MLP · Qwen2VLTextMLP ↩ inherited +mlp · Qwen3VLVisionMLP +attn · Qwen3VLVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen3VLTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3VLTextRMSNorm 128q_norm TextRMSNorm 128 +k_norm: Qwen3VLTextRMSNorm 128k_norm TextRMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Qwen3VLTextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen3VLForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1152norm1 LayerNorm 1152 +norm2: LayerNorm 1152norm2 LayerNorm 1152 +qkv: Linear [1152→3456]qkv [1152→3456] +proj: Linear [1152→1152]proj [1152→1152] +linear_fc1: Linear [1152→4304]linear_fc1 [1152→4304] +linear_fc2: Linear [4304→1152]linear_fc2 [4304→1152] +act_fn: GELUTanhact_fn GELUTanh +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen3-VL-4B-Instruct +parent +qwen2_vl +classes +22 +overridden +26 +added +73 +new classes +9 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen3VLTextAttention +ovr __init__,forward + +Qwen3VLTextDecoderLayer +ovr __init__,forward + +Qwen3VLVisionAttention +ovr __init__ + +Qwen3VLVisionBlock +ovr __init__ + +Qwen3VLVisionPatchEmbed +ovr __init__ + +BaseModelOutputWithDeepstackFeatures +1 attr + +Qwen3VLConfig +add __post_init__; 10 attr + +Qwen3VLForConditionalGeneration +ovr _expand_inputs_for_generation,forward,ge… + +Qwen3VLModel +ovr __init__,forward,get_image_features,get_… + +Qwen3VLPreTrainedModel +ovr _init_weights; 3 attr + +Qwen3VLProcessor +add __init__,_calculate_timestamps,replace_v… + +Qwen3VLProcessorKwargs +1 attr + +Qwen3VLTextConfig +add __post_init__; 20 attr + +Qwen3VLTextModel +ovr __init__,forward; add _deepstack_process… + +Qwen3VLTextRotaryEmbedding +ovr __init__,forward; add apply_interleaved_… + +Qwen3VLVisionConfig +15 attr + +Qwen3VLVisionMLP +add __init__,forward + +Qwen3VLVisionModel +add __init__,fast_pos_embed_interpolate,forw… + +Qwen3VLVisionPatchMerger +add __init__,forward + \ No newline at end of file diff --git a/qwen3_vl.svg b/qwen3_vl.svg new file mode 100644 index 0000000000000000000000000000000000000000..6e92aac073dba4f4eb03f2ba295c3647d43a5a61 --- /dev/null +++ b/qwen3_vl.svg @@ -0,0 +1,209 @@ + + + + +qwen3_vl +multimodal · vision → projector → LLM · dense + +Qwen3VLModel · base model +32 × Qwen3VLTextDecoderLayerQwen3VLTextDecoderLayer× 32 +Qwen3VLForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen3VLTextAttention +Vision encoder · Qwen3VLVision…×27 +Qwen3VLVisionBlock×27 +MLP · Qwen3VLTextMLP +mlp · Qwen3VLVisionMLP +attn · Qwen3VLVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen3VLTextRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +q_norm: Qwen3VLTextRMSNorm 128q_norm TextRMSNorm 128 +k_norm: Qwen3VLTextRMSNorm 128k_norm TextRMSNorm 128 +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Qwen3VLTextRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +Qwen3VLForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1152norm1 LayerNorm 1152 +norm2: LayerNorm 1152norm2 LayerNorm 1152 +qkv: Linear [1152→3456]qkv [1152→3456] +proj: Linear [1152→1152]proj [1152→1152] +linear_fc1: Linear [1152→4304]linear_fc1 [1152→4304] +linear_fc2: Linear [4304→1152]linear_fc2 [4304→1152] +act_fn: GELUTanhact_fn GELUTanh +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen3-VL-4B-Instruct +inputs +input_ids, pixel_values +model_type +qwen3_vl +config +Qwen3VLConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +128,000 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/qwen3_vl_moe.diff.svg b/qwen3_vl_moe.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..22c1393ebce99c38e8407880e1c12d8979be5548 --- /dev/null +++ b/qwen3_vl_moe.diff.svg @@ -0,0 +1,217 @@ + + + + +qwen3_vl_moe +diff vs qwen3_vl (+qwen3_moe) · 6 overridden · 30 added · 0 deleted · 4 new · 8 inherited-as-is + +Qwen3VLMoeModel · base model +24 × Qwen3VLMoeTextDecoderLayerQwen3VLMoeTextDecoderLayer× 24 +Qwen3VLMoeForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen3VLTextAttention ↩ inherited +Vision encoder · Qwen3VLMoeVi…×27 +Qwen3VLVisionBlock ↩ inher…×27 +Sparse MoE · Qwen3VLTextSparseMoeBlock…MoE +mlp · Qwen3VLVisionMLP ↩ inh… +experts · Qwen3VLTextExperts (×60 · dim 1408)… +attn · Qwen3VLVisionAttention ↩… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 2048] → [1, 6, 2048] +Qwen3VLMoeTextRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +q_norm: Qwen3VLMoeTextRMSNorm 128q_norm TextRMSNorm 128 +k_norm: Qwen3VLMoeTextRMSNorm 128k_norm TextRMSNorm 128 +scaled dot-product attention16 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Qwen3VLMoeTextRMSNormpre-FFN [1, 6, 2048] +act_fn: SiLUActivationact_fn SiLU +gate: Qwen3VLMoeTextTopKRouter top-4 of 60gate TextTopKRouter top-4 of 60 +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen3VLMoeForConditionalGenerationLM HeadLinear [2048→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1152norm1 LayerNorm 1152 +norm2: LayerNorm 1152norm2 LayerNorm 1152 +qkv: Linear [1152→3456]qkv [1152→3456] +proj: Linear [1152→1152]proj [1152→1152] +linear_fc1: Linear [1152→4304]linear_fc1 [1152→4304] +linear_fc2: Linear [4304→1152]linear_fc2 [4304→1152] +act_fn: GELUTanhact_fn GELUTanh +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen3-VL-30B-A3B-Instruct +parent +qwen3_vl +classes +18 +overridden +6 +added +30 +new classes +4 +inherited as-is +8 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Qwen3VLMoeForConditionalGeneration +ovr forward + +Qwen3VLMoeTextModel +ovr forward + +Qwen3VLMoeVisionModel +1 attr + +Qwen3VLMoeCausalLMOutputWithPast +2 attr + +Qwen3VLMoeConfig +rename only + +Qwen3VLMoeModelOutputWithPast +1 attr + +Qwen3VLMoePreTrainedModel +ovr _init_weights; 3 attr + +Qwen3VLMoeTextConfig +add __post_init__; 22 attr + +Qwen3VLMoeTextTopKRouter +add __init__,forward + +Qwen3VLMoeVisionConfig +1 attr + \ No newline at end of file diff --git a/qwen3_vl_moe.svg b/qwen3_vl_moe.svg new file mode 100644 index 0000000000000000000000000000000000000000..c85eeaa1039f52e0a7f1dea4a135b2d6e8842958 --- /dev/null +++ b/qwen3_vl_moe.svg @@ -0,0 +1,210 @@ + + + + +qwen3_vl_moe +multimodal · vision → projector → LLM · sparse-moe + +Qwen3VLMoeModel · base model +24 × Qwen3VLMoeTextDecoderLayerQwen3VLMoeTextDecoderLayer× 24 +Qwen3VLMoeForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen3VLMoeTextAttention +Vision encoder · Qwen3VLMoeVi…×27 +Qwen3VLMoeVisionBlock×27 +Sparse MoE · Qwen3VLMoeTextSparseMoeBlo…MoE +mlp · Qwen3VLMoeVisionMLP +experts · Qwen3VLMoeTextExperts (×60 · dim 1… +attn · Qwen3VLMoeVisionAttention + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 2048] → [1, 6, 2048] +Qwen3VLMoeTextRMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→2048]k_proj [2048→2048] +v_proj: Linear [2048→2048]v_proj [2048→2048] +o_proj: Linear [2048→2048]o_proj [2048→2048] +q_norm: Qwen3VLMoeTextRMSNorm 128q_norm TextRMSNorm 128 +k_norm: Qwen3VLMoeTextRMSNorm 128k_norm TextRMSNorm 128 +scaled dot-product attention16 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Qwen3VLMoeTextRMSNormpre-FFN [1, 6, 2048] +act_fn: SiLUActivationact_fn SiLU +gate: Qwen3VLMoeTextTopKRouter top-4 of 60gate TextTopKRouter top-4 of 60 +residual add+ +Final RMSNorm[1, 6, 2048] +Qwen3VLMoeForConditionalGenerationLM HeadLinear [2048→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +norm1: LayerNorm 1152norm1 LayerNorm 1152 +norm2: LayerNorm 1152norm2 LayerNorm 1152 +qkv: Linear [1152→3456]qkv [1152→3456] +proj: Linear [1152→1152]proj [1152→1152] +linear_fc1: Linear [1152→4304]linear_fc1 [1152→4304] +linear_fc2: Linear [4304→1152]linear_fc2 [4304→1152] +act_fn: GELUTanhact_fn GELUTanh +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +Qwen/Qwen3-VL-30B-A3B-Instruct +inputs +input_ids, pixel_values +model_type +qwen3_vl_moe +config +Qwen3VLMoeConfig +decoder +sparse-moe +layers +24 +hidden +2,048 +intermediate +5,632 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +128,000 +experts (top-k) +60 (top-4) +tie_embeddings +False +legend + +vision encoder + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/rag.svg b/rag.svg new file mode 100644 index 0000000000000000000000000000000000000000..a10365e2cd8c15a593cc1e135cfa325d2d83ab7d --- /dev/null +++ b/rag.svg @@ -0,0 +1,155 @@ + + + + +rag +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +rag +model_type +rag +config +RagConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +— +vocab +— +max_pos +— +tie_embeddings +None +status +failed +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/recurrent_gemma.svg b/recurrent_gemma.svg new file mode 100644 index 0000000000000000000000000000000000000000..57f0157213d58b5e06d0e8ff339c15a6fc37e5ab --- /dev/null +++ b/recurrent_gemma.svg @@ -0,0 +1,183 @@ + + + + +recurrent_gemma +other · 26× Recurrent + +RecurrentGemmaModel · base model +26 × RecurrentGemmaDecoderLayerRecurrentGemmaDecoderLayer× 26 +RecurrentGemmaForCausalLM · task head +Self-Attention · RecurrentGemmaSdpaAttention +MLP · RecurrentGemmaMlp + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 2560] → [1, 6, 2560] +RecurrentGemmaRMSNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→2560]k_proj [2560→2560] +v_proj: Linear [2560→2560]v_proj [2560→2560] +o_proj: Linear [2560→2560]o_proj [2560→2560] +rotary_emb: RecurrentGemmaRotaryEmbeddingrotary_emb RotaryEmbedding +scaled dot-product attention10 heads · head_dim 256 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +RecurrentGemmaRMSNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→3840]gate_proj [2560→3840] +up_proj: Linear [2560→3840]up_proj [2560→3840] +down_proj: Linear [3840→2560]down_proj [3840→2560] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2560] +RecurrentGemmaForCausalLMLM HeadLinear [2560→256000] · tied +Softmax +logits[1, 6, 256000] + +model id +google/recurrentgemma-2b +model_type +recurrent_gemma +config +RecurrentGemmaConfig +decoder +other +layers +26 +hidden +2,560 +intermediate +7,680 +heads / kv +10 / 10 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +256,000 +max_pos +— +sliding_window +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/reformer.svg b/reformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..1fa270b8e155278aa75123e2ffc0235d39b47616 --- /dev/null +++ b/reformer.svg @@ -0,0 +1,185 @@ + + + + +reformer +dense · 6× MHA + +ReformerModel · base model +6 × ReformerLayerReformerLayer× 6 +ReformerModelWithLMHead · task head +Self-Attention · ReformerAttention +MLP · ChunkReformerFeedForward +self_attention · LocalSelfAttention +output · ReformerSelfOutput +dense · ReformerFeedForwardDense +output · ReformerFeedForwardOutput + + +input_idstokenize("Hey, how are you?") → [1, 8] +token 0: '␣He'␣He0 +token 1: 'y'y1 +token 2: ',',2 +token 3: '␣h'␣h3 +token 4: 'ow'ow4 +token 5: '␣are'␣a…5 +token 6: '␣you'␣y…6 +token 7: '?'?7 +Token Embeddingweight [320 × 256] → [1, 8, 256] +Normpre-attention [1, 8, 256] +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +query: Linear [256→768]query [256→768] +key: Linear [256→768]key [256→768] +value: Linear [256→768]value [256→768] +dense: Linear [768→256]dense [768→256] +scaled dot-product attention12 heads · head_dim 21 +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 8, 256] +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +act_fn: ReLUact_fn ReLU +dense: Linear [256→512]dense [256→512] +dense: Linear [512→256]dense [512→256] +residual add+ +Final LayerNorm[1, 8, 256] +ReformerModelWithLMHeadLM HeadLinear [256→320] +Softmax +logits[1, 8, 320] + +model id +google/reformer-crime-and-pun… +model_type +reformer +config +ReformerConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +320 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/regnet.svg b/regnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..6f3cca114adba18eaac4efc5c7162db3f64348ce --- /dev/null +++ b/regnet.svg @@ -0,0 +1,172 @@ + + + + +regnet +dense · 2× Attention + +RegNetModel · base model +4 × RegNetSELayerRegNetSELayer× 4 +RegNetForImageClassification · task head +layers (idx) +Self-Attention · Sequential + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +Normpre-attention [1, 6, ?] +0: Conv2d0 Conv2d +1: ReLU1 ReLU +2: Conv2d2 Conv2d +3: Sigmoid3 Sigmoid +scaled dot-product attention? heads · head_dim ? +x attention mask (q↓ × k→)x mask +residual add+ +Final BatchNorm2d[1, 6, ?] +RegNetForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +RegNetForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) +layer 0: x0 +layer 1: y1 + +model id +facebook/regnet-y-040 +model_type +regnet +config +RegNetConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +x + +y + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/rembert.svg b/rembert.svg new file mode 100644 index 0000000000000000000000000000000000000000..3aa0433777fc8bc1046304dfb671d7a45f10d9e5 --- /dev/null +++ b/rembert.svg @@ -0,0 +1,175 @@ + + + + +rembert +dense · 32× MHA + +RemBertModel · base model +32 × RemBertLayerRemBertLayer× 32 +RemBertForCausalLM · task head +Self-Attention · RemBertAttention +output · RemBertSelfOutput +self · RemBertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250300 × 1152] → [1, 6, 1152] +Normpre-attention [1, 6, 1152] +query: Linear [1152→1152]query [1152→1152] +key: Linear [1152→1152]key [1152→1152] +value: Linear [1152→1152]value [1152→1152] +dropout: Dropoutdropout Dropout +dense: Linear [1152→1152]dense [1152→1152] +LayerNorm: LayerNorm 1152LayerNorm LayerNorm 1152 +dropout: Dropoutdropout Dropout +scaled dot-product attention18 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1152] +RemBertForCausalLMLM HeadLinear [1152→250300] +Softmax +logits[1, 6, 250300] + +model id +google/rembert +model_type +rembert +config +RemBertConfig +decoder +dense +layers +32 +hidden +1,152 +intermediate +4,608 +heads / kv +18 / 18 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +250,300 +max_pos +512 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/report.json b/report.json new file mode 100644 index 0000000000000000000000000000000000000000..565c375caf8e2cbe31589e6270858f06902ab824 --- /dev/null +++ b/report.json @@ -0,0 +1,8757 @@ +{ + "mode": "both", + "summary": { + "total": 456, + "ok": 435, + "config_only": 13, + "failed": 8, + "modular": 251, + "standalone": 205, + "largest_diffs": [ + { + "model": "qwen2_5_omni", + "parent": "qwen2_5_vl", + "diff_size": 419, + "totals": { + "overridden": 23, + "added": 267, + "deleted": 0, + "new_classes": 43, + "trivial": 2 + } + }, + { + "model": "qwen3_omni_moe", + "parent": "qwen3_moe", + "diff_size": 309, + "totals": { + "overridden": 40, + "added": 191, + "deleted": 0, + "new_classes": 26, + "trivial": 12 + } + }, + { + "model": "gemma3n", + "parent": "gemma3", + "diff_size": 211, + "totals": { + "overridden": 18, + "added": 132, + "deleted": 1, + "new_classes": 20, + "trivial": 3 + } + }, + { + "model": "rt_detr", + "parent": "detr", + "diff_size": 197, + "totals": { + "overridden": 0, + "added": 137, + "deleted": 0, + "new_classes": 20, + "trivial": 4 + } + }, + { + "model": "lw_detr", + "parent": "deformable_detr", + "diff_size": 177, + "totals": { + "overridden": 16, + "added": 110, + "deleted": 0, + "new_classes": 17, + "trivial": 6 + } + }, + { + "model": "phi4_multimodal", + "parent": "siglip", + "diff_size": 174, + "totals": { + "overridden": 22, + "added": 95, + "deleted": 0, + "new_classes": 19, + "trivial": 3 + } + }, + { + "model": "sam2_video", + "parent": "sam2", + "diff_size": 172, + "totals": { + "overridden": 5, + "added": 116, + "deleted": 0, + "new_classes": 17, + "trivial": 5 + } + }, + { + "model": "ernie4_5_vl_moe", + "parent": "ernie4_5_moe", + "diff_size": 168, + "totals": { + "overridden": 22, + "added": 75, + "deleted": 2, + "new_classes": 23, + "trivial": 7 + } + }, + { + "model": "pp_doclayout_v2", + "parent": "layoutlmv3", + "diff_size": 149, + "totals": { + "overridden": 16, + "added": 115, + "deleted": 0, + "new_classes": 6, + "trivial": 3 + } + }, + { + "model": "janus", + "parent": "chameleon", + "diff_size": 147, + "totals": { + "overridden": 10, + "added": 89, + "deleted": 0, + "new_classes": 16, + "trivial": 5 + } + }, + { + "model": "florence2", + "parent": "llava", + "diff_size": 145, + "totals": { + "overridden": 9, + "added": 82, + "deleted": 0, + "new_classes": 18, + "trivial": 1 + } + }, + { + "model": "gemma4", + "parent": "gemma3", + "diff_size": 144, + "totals": { + "overridden": 34, + "added": 56, + "deleted": 0, + "new_classes": 18, + "trivial": 2 + } + }, + { + "model": "maskformer", + "parent": "detr", + "diff_size": 143, + "totals": { + "overridden": 0, + "added": 86, + "deleted": 0, + "new_classes": 19, + "trivial": 3 + } + }, + { + "model": "emu3", + "parent": "llama", + "diff_size": 138, + "totals": { + "overridden": 10, + "added": 71, + "deleted": 0, + "new_classes": 19, + "trivial": 2 + } + }, + { + "model": "aria", + "parent": "llama", + "diff_size": 137, + "totals": { + "overridden": 17, + "added": 78, + "deleted": 0, + "new_classes": 14, + "trivial": 4 + } + }, + { + "model": "video_llama_3", + "parent": "qwen2_vl", + "diff_size": 134, + "totals": { + "overridden": 18, + "added": 70, + "deleted": 4, + "new_classes": 14, + "trivial": 2 + } + }, + { + "model": "pp_doclayout_v3", + "parent": "rt_detr", + "diff_size": 133, + "totals": { + "overridden": 9, + "added": 100, + "deleted": 0, + "new_classes": 8, + "trivial": 3 + } + }, + { + "model": "sam2", + "parent": "sam", + "diff_size": 131, + "totals": { + "overridden": 11, + "added": 75, + "deleted": 0, + "new_classes": 15, + "trivial": 4 + } + }, + { + "model": "d_fine", + "parent": "rt_detr", + "diff_size": 128, + "totals": { + "overridden": 13, + "added": 88, + "deleted": 0, + "new_classes": 9, + "trivial": 4 + } + }, + { + "model": "qwen3_vl", + "parent": "qwen2_vl", + "diff_size": 126, + "totals": { + "overridden": 26, + "added": 73, + "deleted": 0, + "new_classes": 9, + "trivial": 3 + } + } + ] + }, + "models": [ + { + "model": "afmoe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "24\u00d7 sliding +MoE + 8\u00d7 full +MoE", + "svg": "afmoe.svg", + "diff_svg": "afmoe.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "qwen2_moe", + "gpt_oss" + ], + "diff_totals": { + "overridden": 7, + "added": 21, + "deleted": 0, + "new_classes": 5, + "trivial": 4 + }, + "note": null + }, + { + "model": "aimv2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "aimv2.svg", + "diff_svg": "aimv2.diff.svg", + "is_modular": true, + "parent_model": "siglip", + "parent_models": [ + "siglip", + "clip", + "llama" + ], + "diff_totals": { + "overridden": 3, + "added": 62, + "deleted": 0, + "new_classes": 9, + "trivial": 5 + }, + "note": null + }, + { + "model": "albert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "1\u00d7 MHA", + "svg": "albert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "align", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "align.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "altclip", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "altclip.svg", + "diff_svg": "altclip.diff.svg", + "is_modular": true, + "parent_model": "clip", + "parent_models": [ + "clip", + "roberta", + "chinese_clip" + ], + "diff_totals": { + "overridden": 13, + "added": 31, + "deleted": 0, + "new_classes": 5, + "trivial": 10 + }, + "note": null + }, + { + "model": "apertus", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "apertus.svg", + "diff_svg": "apertus.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "nemotron" + ], + "diff_totals": { + "overridden": 6, + "added": 24, + "deleted": 0, + "new_classes": 1, + "trivial": 5 + }, + "note": null + }, + { + "model": "arcee", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "arcee.svg", + "diff_svg": "arcee.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "nemotron" + ], + "diff_totals": { + "overridden": 0, + "added": 23, + "deleted": 0, + "new_classes": 1, + "trivial": 5 + }, + "note": null + }, + { + "model": "aria", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 MHA +MoE", + "svg": "aria.svg", + "diff_svg": "aria.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "llava" + ], + "diff_totals": { + "overridden": 17, + "added": 78, + "deleted": 0, + "new_classes": 14, + "trivial": 4 + }, + "note": null + }, + { + "model": "audio_spectrogram_transformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "audio_spectrogram_transformer.svg", + "diff_svg": "audio_spectrogram_transformer.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit" + ], + "diff_totals": { + "overridden": 7, + "added": 12, + "deleted": 0, + "new_classes": 5, + "trivial": 3 + }, + "note": null + }, + { + "model": "audioflamingo3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "audioflamingo3.svg", + "diff_svg": "audioflamingo3.diff.svg", + "is_modular": true, + "parent_model": "voxtral", + "parent_models": [ + "voxtral", + "qwen2_audio", + "whisper" + ], + "diff_totals": { + "overridden": 10, + "added": 10, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "autoformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "autoformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "aya_vision", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "30\u00d7 sliding + 10\u00d7 full", + "svg": "aya_vision.svg", + "diff_svg": "aya_vision.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava" + ], + "diff_totals": { + "overridden": 4, + "added": 3, + "deleted": 0, + "new_classes": 1, + "trivial": 2 + }, + "note": null + }, + { + "model": "bamba", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "ssm", + "layer_summary": "32\u00d7 Mamba", + "svg": "bamba.svg", + "diff_svg": "bamba.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "jamba", + "mamba2" + ], + "diff_totals": { + "overridden": 4, + "added": 23, + "deleted": 0, + "new_classes": 4, + "trivial": 5 + }, + "note": null + }, + { + "model": "bark", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 Attention", + "svg": "bark.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "bart", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "bart.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "beit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "beit.svg", + "diff_svg": "beit.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit", + "resnet", + "swin" + ], + "diff_totals": { + "overridden": 10, + "added": 30, + "deleted": 0, + "new_classes": 14, + "trivial": 3 + }, + "note": null + }, + { + "model": "bert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "bert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "bert_generation", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "bert_generation.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "big_bird", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "big_bird.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "bigbird_pegasus", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 MHA", + "svg": "bigbird_pegasus.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "biogpt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "biogpt.svg", + "diff_svg": "biogpt.diff.svg", + "is_modular": true, + "parent_model": "bart", + "parent_models": [ + "bart", + "opt" + ], + "diff_totals": { + "overridden": 3, + "added": 21, + "deleted": 0, + "new_classes": 5, + "trivial": 2 + }, + "note": null + }, + { + "model": "bit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 Attention", + "svg": "bit.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "bitnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "30\u00d7 GQA", + "svg": "bitnet.svg", + "diff_svg": "bitnet.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "gemma" + ], + "diff_totals": { + "overridden": 8, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 3 + }, + "note": null + }, + { + "model": "blenderbot", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "blenderbot.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "blenderbot_small", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 MHA", + "svg": "blenderbot_small.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "blip", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "blip.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "blip_2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "blip_2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "bloom", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "bloom.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "blt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "25\u00d7 Attention", + "svg": "blt.svg", + "diff_svg": "blt.diff.svg", + "is_modular": true, + "parent_model": "mllama", + "parent_models": [ + "mllama", + "llama" + ], + "diff_totals": { + "overridden": 12, + "added": 27, + "deleted": 0, + "new_classes": 6, + "trivial": 2 + }, + "note": null + }, + { + "model": "bridgetower", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "bridgetower.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "bros", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "bros.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "camembert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "camembert.svg", + "diff_svg": "camembert.diff.svg", + "is_modular": true, + "parent_model": "roberta", + "parent_models": [ + "roberta" + ], + "diff_totals": { + "overridden": 15, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 1 + }, + "note": null + }, + { + "model": "canine", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "canine.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "chameleon", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "chameleon.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "chinese_clip", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "chinese_clip.svg", + "diff_svg": "chinese_clip.diff.svg", + "is_modular": true, + "parent_model": "clip", + "parent_models": [ + "clip", + "align", + "bert" + ], + "diff_totals": { + "overridden": 12, + "added": 22, + "deleted": 0, + "new_classes": 4, + "trivial": 12 + }, + "note": null + }, + { + "model": "chmv2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 Attention", + "svg": "chmv2.svg", + "diff_svg": "chmv2.diff.svg", + "is_modular": true, + "parent_model": "dpt", + "parent_models": [ + "depth_anything", + "dpt" + ], + "diff_totals": { + "overridden": 0, + "added": 55, + "deleted": 0, + "new_classes": 10, + "trivial": 2 + }, + "note": null + }, + { + "model": "clap", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "clap.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "clip", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "clip.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "clipseg", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "clipseg.svg", + "diff_svg": "clipseg.diff.svg", + "is_modular": true, + "parent_model": "clip", + "parent_models": [ + "clip" + ], + "diff_totals": { + "overridden": 9, + "added": 26, + "deleted": 0, + "new_classes": 7, + "trivial": 6 + }, + "note": null + }, + { + "model": "clvp", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "20\u00d7 MHA", + "svg": "clvp.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "codegen", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 MHA", + "svg": "codegen.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "cohere", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 MHA", + "svg": "cohere.svg", + "diff_svg": "cohere.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 7, + "added": 4, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "cohere2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "30\u00d7 sliding + 10\u00d7 full", + "svg": "cohere2.svg", + "diff_svg": "cohere2.diff.svg", + "is_modular": true, + "parent_model": "cohere", + "parent_models": [ + "cohere", + "gemma2" + ], + "diff_totals": { + "overridden": 9, + "added": 26, + "deleted": 0, + "new_classes": 1, + "trivial": 2 + }, + "note": null + }, + { + "model": "cohere2_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "30\u00d7 sliding +MoE + 10\u00d7 full +MoE", + "svg": "cohere2_moe.svg", + "diff_svg": "cohere2_moe.diff.svg", + "is_modular": true, + "parent_model": "cohere2", + "parent_models": [ + "cohere2", + "llama", + "mixtral" + ], + "diff_totals": { + "overridden": 9, + "added": 5, + "deleted": 0, + "new_classes": 2, + "trivial": 3 + }, + "note": null + }, + { + "model": "cohere2_vision", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "30\u00d7 sliding + 10\u00d7 full", + "svg": "cohere2_vision.svg", + "diff_svg": "cohere2_vision.diff.svg", + "is_modular": true, + "parent_model": "aya_vision", + "parent_models": [ + "aya_vision" + ], + "diff_totals": { + "overridden": 5, + "added": 12, + "deleted": 0, + "new_classes": 3, + "trivial": 2 + }, + "note": null + }, + { + "model": "cohere_asr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 MHA", + "svg": "cohere_asr.svg", + "diff_svg": "cohere_asr.diff.svg", + "is_modular": true, + "parent_model": "moonshine", + "parent_models": [ + "moonshine", + "clip" + ], + "diff_totals": { + "overridden": 8, + "added": 8, + "deleted": 0, + "new_classes": 3, + "trivial": 1 + }, + "note": null + }, + { + "model": "colmodernvbert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 full + 14\u00d7 sliding", + "svg": "colmodernvbert.svg", + "diff_svg": "colmodernvbert.diff.svg", + "is_modular": true, + "parent_model": "colpali", + "parent_models": [ + "colpali" + ], + "diff_totals": { + "overridden": 3, + "added": 16, + "deleted": 0, + "new_classes": 4, + "trivial": 0 + }, + "note": null + }, + { + "model": "colpali", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "18\u00d7 MQA", + "svg": "colpali.svg", + "diff_svg": "colpali.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 7, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "colqwen2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "80\u00d7 full", + "svg": "colqwen2.svg", + "diff_svg": "colqwen2.diff.svg", + "is_modular": true, + "parent_model": "colpali", + "parent_models": [ + "colpali" + ], + "diff_totals": { + "overridden": 2, + "added": 10, + "deleted": 0, + "new_classes": 3, + "trivial": 1 + }, + "note": null + }, + { + "model": "conditional_detr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "conditional_detr.svg", + "diff_svg": "conditional_detr.diff.svg", + "is_modular": true, + "parent_model": "detr", + "parent_models": [ + "detr" + ], + "diff_totals": { + "overridden": 7, + "added": 14, + "deleted": 0, + "new_classes": 5, + "trivial": 11 + }, + "note": null + }, + { + "model": "convbert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "convbert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "convnext", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "9\u00d7 Attention", + "svg": "convnext.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "convnextv2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "9\u00d7 Attention", + "svg": "convnextv2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "cpmant", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "48\u00d7 MHA", + "svg": "cpmant.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "csm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 GQA", + "svg": "csm.svg", + "diff_svg": "csm.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 9, + "added": 38, + "deleted": 0, + "new_classes": 5, + "trivial": 5 + }, + "note": null + }, + { + "model": "ctrl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "48\u00d7 MHA", + "svg": "ctrl.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "cvt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "3\u00d7 MHA", + "svg": "cvt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "cwm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 full + 48\u00d7 sliding", + "svg": "cwm.svg", + "diff_svg": "cwm.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "qwen2" + ], + "diff_totals": { + "overridden": 4, + "added": 27, + "deleted": 0, + "new_classes": 2, + "trivial": 3 + }, + "note": null + }, + { + "model": "d_fine", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "d_fine.svg", + "diff_svg": "d_fine.diff.svg", + "is_modular": true, + "parent_model": "rt_detr", + "parent_models": [ + "rt_detr" + ], + "diff_totals": { + "overridden": 13, + "added": 88, + "deleted": 0, + "new_classes": 9, + "trivial": 4 + }, + "note": null + }, + { + "model": "dab_detr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "dab_detr.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "dac", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "9\u00d7 Attention", + "svg": "dac.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "data2vec", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "data2vec.svg", + "diff_svg": "data2vec.diff.svg", + "is_modular": true, + "parent_model": "wav2vec2", + "parent_models": [ + "wav2vec2" + ], + "diff_totals": { + "overridden": 15, + "added": 6, + "deleted": 5, + "new_classes": 3, + "trivial": 7 + }, + "note": null + }, + { + "model": "dbrx", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "24\u00d7 MQA +MoE", + "svg": "dbrx.svg", + "diff_svg": "dbrx.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 0, + "added": 42, + "deleted": 0, + "new_classes": 10, + "trivial": 1 + }, + "note": null + }, + { + "model": "deberta", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "deberta.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "deberta_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "deberta_v2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "decision_transformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "3\u00d7 MQA", + "svg": "decision_transformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "deepseek_ocr2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 MHA +MoE", + "svg": "deepseek_ocr2.svg", + "diff_svg": "deepseek_ocr2.diff.svg", + "is_modular": true, + "parent_model": "qwen2", + "parent_models": [ + "qwen2", + "deepseek_v2", + "llava_next", + "sam", + "llama" + ], + "diff_totals": { + "overridden": 18, + "added": 65, + "deleted": 0, + "new_classes": 11, + "trivial": 15 + }, + "note": null + }, + { + "model": "deepseek_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 MLA +MoE", + "svg": "deepseek_v2.svg", + "diff_svg": "deepseek_v2.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "qwen2_moe" + ], + "diff_totals": { + "overridden": 4, + "added": 44, + "deleted": 0, + "new_classes": 3, + "trivial": 4 + }, + "note": null + }, + { + "model": "deepseek_v3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "61\u00d7 MLA +MoE", + "svg": "deepseek_v3.svg", + "diff_svg": "deepseek_v3.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "mixtral", + "qwen2_moe" + ], + "diff_totals": { + "overridden": 2, + "added": 10, + "deleted": 0, + "new_classes": 5, + "trivial": 5 + }, + "note": null + }, + { + "model": "deepseek_v4", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "23\u00d7 heavily-compressed +MoE + 20\u00d7 compressed-sparse +MoE", + "svg": "deepseek_v4.svg", + "diff_svg": "deepseek_v4.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "llama", + "deepseek_v3", + "laguna" + ], + "diff_totals": { + "overridden": 18, + "added": 36, + "deleted": 0, + "new_classes": 12, + "trivial": 3 + }, + "note": null + }, + { + "model": "deepseek_vl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "deepseek_vl.svg", + "diff_svg": "deepseek_vl.diff.svg", + "is_modular": true, + "parent_model": "janus", + "parent_models": [ + "janus", + "idefics" + ], + "diff_totals": { + "overridden": 3, + "added": 18, + "deleted": 4, + "new_classes": 6, + "trivial": 2 + }, + "note": null + }, + { + "model": "deepseek_vl_hybrid", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "deepseek_vl_hybrid.svg", + "diff_svg": "deepseek_vl_hybrid.diff.svg", + "is_modular": true, + "parent_model": "deepseek_vl", + "parent_models": [ + "deepseek_vl", + "idefics", + "sam" + ], + "diff_totals": { + "overridden": 6, + "added": 36, + "deleted": 0, + "new_classes": 9, + "trivial": 3 + }, + "note": null + }, + { + "model": "deformable_detr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "deformable_detr.svg", + "diff_svg": "deformable_detr.diff.svg", + "is_modular": true, + "parent_model": "detr", + "parent_models": [ + "detr" + ], + "diff_totals": { + "overridden": 8, + "added": 56, + "deleted": 0, + "new_classes": 9, + "trivial": 4 + }, + "note": null + }, + { + "model": "deimv2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "deimv2.svg", + "diff_svg": "deimv2.diff.svg", + "is_modular": true, + "parent_model": "d_fine", + "parent_models": [ + "d_fine", + "llama" + ], + "diff_totals": { + "overridden": 14, + "added": 29, + "deleted": 0, + "new_classes": 8, + "trivial": 12 + }, + "note": null + }, + { + "model": "deit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "deit.svg", + "diff_svg": "deit.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit" + ], + "diff_totals": { + "overridden": 6, + "added": 7, + "deleted": 0, + "new_classes": 2, + "trivial": 2 + }, + "note": null + }, + { + "model": "depth_anything", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 Attention", + "svg": "depth_anything.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "depth_pro", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 Attention", + "svg": "depth_pro.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "detr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "detr.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "dia", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "18\u00d7 GQA", + "svg": "dia.svg", + "diff_svg": "dia.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "phi3" + ], + "diff_totals": { + "overridden": 1, + "added": 30, + "deleted": 0, + "new_classes": 9, + "trivial": 3 + }, + "note": null + }, + { + "model": "diffllama", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 MHA", + "svg": "diffllama.svg", + "diff_svg": "diffllama.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "gemma", + "mistral" + ], + "diff_totals": { + "overridden": 3, + "added": 6, + "deleted": 0, + "new_classes": 3, + "trivial": 7 + }, + "note": null + }, + { + "model": "dinat", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConfig, Owlv2Config,", + "svg": "dinat.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "dinov2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "dinov2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "dinov2_with_registers", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "dinov2_with_registers.svg", + "diff_svg": "dinov2_with_registers.diff.svg", + "is_modular": true, + "parent_model": "dinov2", + "parent_models": [ + "dinov2" + ], + "diff_totals": { + "overridden": 5, + "added": 26, + "deleted": 0, + "new_classes": 2, + "trivial": 3 + }, + "note": null + }, + { + "model": "dinov3_convnext", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "9\u00d7 Attention", + "svg": "dinov3_convnext.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "dinov3_vit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "dinov3_vit.svg", + "diff_svg": "dinov3_vit.diff.svg", + "is_modular": true, + "parent_model": "dinov2", + "parent_models": [ + "dinov2", + "arcee", + "llama", + "pixtral", + "swin" + ], + "diff_totals": { + "overridden": 5, + "added": 16, + "deleted": 0, + "new_classes": 7, + "trivial": 4 + }, + "note": null + }, + { + "model": "distilbert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "distilbert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "doge", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 MHA +MoE", + "svg": "doge.svg", + "diff_svg": "doge.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "mixtral" + ], + "diff_totals": { + "overridden": 5, + "added": 41, + "deleted": 0, + "new_classes": 4, + "trivial": 5 + }, + "note": null + }, + { + "model": "donut", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "donut.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "dots1", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "62\u00d7 full +MoE", + "svg": "dots1.svg", + "diff_svg": "dots1.diff.svg", + "is_modular": true, + "parent_model": "qwen3", + "parent_models": [ + "deepseek_v3", + "qwen3" + ], + "diff_totals": { + "overridden": 2, + "added": 36, + "deleted": 0, + "new_classes": 1, + "trivial": 8 + }, + "note": null + }, + { + "model": "dpr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "dpr.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "dpt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "dpt.svg", + "diff_svg": "dpt.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 23, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "edgetam", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "edgetam.svg", + "diff_svg": "edgetam.diff.svg", + "is_modular": true, + "parent_model": "sam2", + "parent_models": [ + "sam2" + ], + "diff_totals": { + "overridden": 8, + "added": 17, + "deleted": 0, + "new_classes": 4, + "trivial": 5 + }, + "note": null + }, + { + "model": "edgetam_video", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "edgetam_video.svg", + "diff_svg": "edgetam_video.diff.svg", + "is_modular": true, + "parent_model": "sam2_video", + "parent_models": [ + "sam2_video" + ], + "diff_totals": { + "overridden": 15, + "added": 72, + "deleted": 0, + "new_classes": 11, + "trivial": 10 + }, + "note": null + }, + { + "model": "efficientloftr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "14\u00d7 MHA", + "svg": "efficientloftr.svg", + "diff_svg": "efficientloftr.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 2, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "efficientnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "55\u00d7 Attention", + "svg": "efficientnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "electra", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "electra.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "emu3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 GQA", + "svg": "emu3.svg", + "diff_svg": "emu3.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "chameleon", + "siglip" + ], + "diff_totals": { + "overridden": 10, + "added": 71, + "deleted": 0, + "new_classes": 19, + "trivial": 2 + }, + "note": null + }, + { + "model": "encodec", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 Attention", + "svg": "encodec.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "encoder_decoder", + "mode": "full", + "status": "failed", + "build_status": "failed", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "config instantiation failed: ValueError('A configuration of type encoder-decoder cannot be instantiated because not both `encoder` and `decoder` sub-configurations are passed, but only {}')", + "svg": "encoder_decoder.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "eomt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "eomt.svg", + "diff_svg": "eomt.diff.svg", + "is_modular": true, + "parent_model": "dinov2", + "parent_models": [ + "dinov2", + "mask2former", + "siglip" + ], + "diff_totals": { + "overridden": 5, + "added": 61, + "deleted": 2, + "new_classes": 7, + "trivial": 4 + }, + "note": null + }, + { + "model": "eomt_dinov3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "eomt_dinov3.svg", + "diff_svg": "eomt_dinov3.diff.svg", + "is_modular": true, + "parent_model": "dinov3_vit", + "parent_models": [ + "dinov3_vit", + "eomt" + ], + "diff_totals": { + "overridden": 9, + "added": 41, + "deleted": 0, + "new_classes": 1, + "trivial": 5 + }, + "note": null + }, + { + "model": "ernie", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "ernie.svg", + "diff_svg": "ernie.diff.svg", + "is_modular": true, + "parent_model": "bert", + "parent_models": [ + "bert" + ], + "diff_totals": { + "overridden": 15, + "added": 9, + "deleted": 0, + "new_classes": 1, + "trivial": 7 + }, + "note": null + }, + { + "model": "ernie4_5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "18\u00d7 GQA", + "svg": "ernie4_5.svg", + "diff_svg": "ernie4_5.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "olmo" + ], + "diff_totals": { + "overridden": 4, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 0 + }, + "note": null + }, + { + "model": "ernie4_5_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "28\u00d7 GQA +MoE", + "svg": "ernie4_5_moe.svg", + "diff_svg": "ernie4_5_moe.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "llama", + "qwen3_moe", + "ernie4_5" + ], + "diff_totals": { + "overridden": 11, + "added": 10, + "deleted": 0, + "new_classes": 4, + "trivial": 1 + }, + "note": null + }, + { + "model": "ernie4_5_vl_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "28\u00d7 GQA +MoE", + "svg": "ernie4_5_vl_moe.svg", + "diff_svg": "ernie4_5_vl_moe.diff.svg", + "is_modular": true, + "parent_model": "ernie4_5_moe", + "parent_models": [ + "ernie4_5_moe", + "qwen2_5_vl", + "qwen2_vl", + "glm4v" + ], + "diff_totals": { + "overridden": 22, + "added": 75, + "deleted": 2, + "new_classes": 23, + "trivial": 7 + }, + "note": null + }, + { + "model": "esm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "esm.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "eurobert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "eurobert.svg", + "diff_svg": "eurobert.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 3, + "added": 35, + "deleted": 0, + "new_classes": 4, + "trivial": 1 + }, + "note": null + }, + { + "model": "evolla", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 GQA", + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConfig, Owlv2Conf", + "svg": "evolla.svg", + "diff_svg": "evolla.diff.svg", + "is_modular": true, + "parent_model": "esm", + "parent_models": [ + "esm", + "llama" + ], + "diff_totals": { + "overridden": 9, + "added": 36, + "deleted": 0, + "new_classes": 10, + "trivial": 12 + }, + "note": null + }, + { + "model": "exaone4", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 sliding + 8\u00d7 full", + "svg": "exaone4.svg", + "diff_svg": "exaone4.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "olmo2", + "gemma2" + ], + "diff_totals": { + "overridden": 4, + "added": 28, + "deleted": 0, + "new_classes": 2, + "trivial": 7 + }, + "note": null + }, + { + "model": "exaone4_5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 sliding + 8\u00d7 full", + "svg": "exaone4_5.svg", + "diff_svg": "exaone4_5.diff.svg", + "is_modular": true, + "parent_model": "qwen2_5_vl", + "parent_models": [ + "qwen2_5_vl", + "exaone4" + ], + "diff_totals": { + "overridden": 10, + "added": 16, + "deleted": 0, + "new_classes": 4, + "trivial": 5 + }, + "note": null + }, + { + "model": "exaone_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "24\u00d7 sliding +MoE + 8\u00d7 full +MoE", + "svg": "exaone_moe.svg", + "diff_svg": "exaone_moe.diff.svg", + "is_modular": true, + "parent_model": "exaone4", + "parent_models": [ + "exaone4", + "deepseek_v3", + "olmoe", + "qwen2_moe" + ], + "diff_totals": { + "overridden": 7, + "added": 34, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "falcon", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "falcon.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "falcon_h1", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 GQA", + "svg": "falcon_h1.svg", + "diff_svg": "falcon_h1.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "mamba2" + ], + "diff_totals": { + "overridden": 7, + "added": 20, + "deleted": 0, + "new_classes": 4, + "trivial": 2 + }, + "note": null + }, + { + "model": "falcon_mamba", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "ssm", + "layer_summary": "32\u00d7 Mamba", + "svg": "falcon_mamba.svg", + "diff_svg": "falcon_mamba.diff.svg", + "is_modular": true, + "parent_model": "mamba", + "parent_models": [ + "mamba" + ], + "diff_totals": { + "overridden": 7, + "added": 5, + "deleted": 1, + "new_classes": 1, + "trivial": 5 + }, + "note": null + }, + { + "model": "fast_vlm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 full", + "svg": "fast_vlm.svg", + "diff_svg": "fast_vlm.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava" + ], + "diff_totals": { + "overridden": 5, + "added": 11, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "fastspeech2_conformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "fastspeech2_conformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "flaubert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "flaubert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "flava", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "flava.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "flex_olmo", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 MHA +MoE", + "svg": "flex_olmo.svg", + "diff_svg": "flex_olmo.diff.svg", + "is_modular": true, + "parent_model": "olmoe", + "parent_models": [ + "olmoe", + "olmo2", + "mixtral" + ], + "diff_totals": { + "overridden": 4, + "added": 30, + "deleted": 0, + "new_classes": 1, + "trivial": 7 + }, + "note": null + }, + { + "model": "florence2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "florence2.svg", + "diff_svg": "florence2.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava", + "llama4", + "swin" + ], + "diff_totals": { + "overridden": 9, + "added": 82, + "deleted": 0, + "new_classes": 18, + "trivial": 1 + }, + "note": null + }, + { + "model": "fnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 Attention", + "svg": "fnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "focalnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 Attention", + "svg": "focalnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "fsmt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "fsmt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "funnel", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "funnel.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "fuyu", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "36\u00d7 MHA", + "svg": "fuyu.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "gemma", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 MHA", + "svg": "gemma.svg", + "diff_svg": "gemma.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 5, + "added": 31, + "deleted": 0, + "new_classes": 3, + "trivial": 3 + }, + "note": null + }, + { + "model": "gemma2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "13\u00d7 sliding + 13\u00d7 full", + "svg": "gemma2.svg", + "diff_svg": "gemma2.diff.svg", + "is_modular": true, + "parent_model": "gemma", + "parent_models": [ + "gemma" + ], + "diff_totals": { + "overridden": 9, + "added": 33, + "deleted": 0, + "new_classes": 2, + "trivial": 4 + }, + "note": null + }, + { + "model": "gemma3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "22\u00d7 sliding + 4\u00d7 full", + "svg": "gemma3.svg", + "diff_svg": "gemma3.diff.svg", + "is_modular": true, + "parent_model": "gemma2", + "parent_models": [ + "gemma2", + "paligemma" + ], + "diff_totals": { + "overridden": 20, + "added": 38, + "deleted": 0, + "new_classes": 7, + "trivial": 2 + }, + "note": null + }, + { + "model": "gemma3n", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 sliding + 7\u00d7 full", + "svg": "gemma3n.svg", + "diff_svg": "gemma3n.diff.svg", + "is_modular": true, + "parent_model": "gemma3", + "parent_models": [ + "gemma3", + "paligemma", + "gemma2" + ], + "diff_totals": { + "overridden": 18, + "added": 132, + "deleted": 1, + "new_classes": 20, + "trivial": 3 + }, + "note": null + }, + { + "model": "gemma4", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "25\u00d7 sliding + 5\u00d7 full", + "svg": "gemma4.svg", + "diff_svg": "gemma4.diff.svg", + "is_modular": true, + "parent_model": "gemma3", + "parent_models": [ + "gemma3", + "gemma3n", + "llama", + "mixtral" + ], + "diff_totals": { + "overridden": 34, + "added": 56, + "deleted": 0, + "new_classes": 18, + "trivial": 2 + }, + "note": null + }, + { + "model": "gemma4_assistant", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig", + "svg": "gemma4_assistant.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "git", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "git.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "glm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 GQA", + "svg": "glm.svg", + "diff_svg": "glm.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "phi3" + ], + "diff_totals": { + "overridden": 2, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 4 + }, + "note": null + }, + { + "model": "glm4", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 GQA", + "svg": "glm4.svg", + "diff_svg": "glm4.diff.svg", + "is_modular": true, + "parent_model": "glm", + "parent_models": [ + "glm", + "phi3" + ], + "diff_totals": { + "overridden": 1, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "glm46v", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 GQA", + "svg": "glm46v.svg", + "diff_svg": "glm46v.diff.svg", + "is_modular": true, + "parent_model": "glm4v", + "parent_models": [ + "glm4v" + ], + "diff_totals": { + "overridden": 3, + "added": 16, + "deleted": 1, + "new_classes": 5, + "trivial": 1 + }, + "note": null + }, + { + "model": "glm4_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "46\u00d7 GQA +MoE", + "svg": "glm4_moe.svg", + "diff_svg": "glm4_moe.diff.svg", + "is_modular": true, + "parent_model": "deepseek_v3", + "parent_models": [ + "deepseek_v3", + "cohere", + "glm" + ], + "diff_totals": { + "overridden": 3, + "added": 34, + "deleted": 0, + "new_classes": 1, + "trivial": 6 + }, + "note": null + }, + { + "model": "glm4_moe_lite", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "47\u00d7 MLA +MoE", + "svg": "glm4_moe_lite.svg", + "diff_svg": "glm4_moe_lite.diff.svg", + "is_modular": true, + "parent_model": "glm4_moe", + "parent_models": [ + "glm4_moe", + "deepseek_v3" + ], + "diff_totals": { + "overridden": 2, + "added": 40, + "deleted": 0, + "new_classes": 1, + "trivial": 9 + }, + "note": null + }, + { + "model": "glm4v", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 GQA", + "svg": "glm4v.svg", + "diff_svg": "glm4v.diff.svg", + "is_modular": true, + "parent_model": "qwen2_5_vl", + "parent_models": [ + "qwen2_5_vl", + "glm4", + "qwen2_vl" + ], + "diff_totals": { + "overridden": 19, + "added": 73, + "deleted": 0, + "new_classes": 10, + "trivial": 5 + }, + "note": null + }, + { + "model": "glm4v_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "46\u00d7 GQA +MoE", + "svg": "glm4v_moe.svg", + "diff_svg": "glm4v_moe.diff.svg", + "is_modular": true, + "parent_model": "glm4_moe", + "parent_models": [ + "glm4_moe", + "glm4v", + "qwen3_vl_moe", + "deepseek_v3", + "glm4" + ], + "diff_totals": { + "overridden": 15, + "added": 15, + "deleted": 0, + "new_classes": 2, + "trivial": 6 + }, + "note": null + }, + { + "model": "glm_image", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 GQA", + "svg": "glm_image.svg", + "diff_svg": "glm_image.diff.svg", + "is_modular": true, + "parent_model": "glm4v", + "parent_models": [ + "glm4v", + "chameleon", + "glm4v_moe", + "siglip" + ], + "diff_totals": { + "overridden": 27, + "added": 62, + "deleted": 1, + "new_classes": 10, + "trivial": 6 + }, + "note": null + }, + { + "model": "glm_moe_dsa", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "78\u00d7 MLA +MoE", + "svg": "glm_moe_dsa.svg", + "diff_svg": "glm_moe_dsa.diff.svg", + "is_modular": true, + "parent_model": "glm4_moe", + "parent_models": [ + "glm4_moe", + "glm4_moe_lite" + ], + "diff_totals": { + "overridden": 8, + "added": 25, + "deleted": 0, + "new_classes": 3, + "trivial": 2 + }, + "note": null + }, + { + "model": "glm_ocr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 GQA", + "svg": "glm_ocr.svg", + "diff_svg": "glm_ocr.diff.svg", + "is_modular": true, + "parent_model": "glm4v", + "parent_models": [ + "glm4v" + ], + "diff_totals": { + "overridden": 8, + "added": 19, + "deleted": 0, + "new_classes": 3, + "trivial": 6 + }, + "note": null + }, + { + "model": "glmasr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 GQA", + "svg": "glmasr.svg", + "diff_svg": "glmasr.diff.svg", + "is_modular": true, + "parent_model": "audioflamingo3", + "parent_models": [ + "audioflamingo3", + "glm", + "llama" + ], + "diff_totals": { + "overridden": 6, + "added": 14, + "deleted": 0, + "new_classes": 5, + "trivial": 2 + }, + "note": null + }, + { + "model": "glmga", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 GQA", + "svg": "glmga.svg", + "diff_svg": "glmga.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 22, + "deleted": 0, + "new_classes": 6, + "trivial": 0 + }, + "note": null + }, + { + "model": "glpn", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "glpn.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "got_ocr2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 full", + "svg": "got_ocr2.svg", + "diff_svg": "got_ocr2.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava", + "sam" + ], + "diff_totals": { + "overridden": 9, + "added": 31, + "deleted": 0, + "new_classes": 3, + "trivial": 4 + }, + "note": null + }, + { + "model": "gpt2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "gpt2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "gpt_bigcode", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MQA", + "svg": "gpt_bigcode.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "gpt_neo", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "gpt_neo.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "gpt_neox", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "44\u00d7 MHA", + "svg": "gpt_neox.svg", + "diff_svg": "gpt_neox.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 6, + "added": 22, + "deleted": 0, + "new_classes": 7, + "trivial": 0 + }, + "note": null + }, + { + "model": "gpt_neox_japanese", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "gpt_neox_japanese.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "gpt_oss", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "18\u00d7 sliding +MoE + 18\u00d7 full +MoE", + "svg": "gpt_oss.svg", + "diff_svg": "gpt_oss.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "llama", + "qwen2" + ], + "diff_totals": { + "overridden": 9, + "added": 10, + "deleted": 0, + "new_classes": 3, + "trivial": 3 + }, + "note": null + }, + { + "model": "gptj", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 MHA", + "svg": "gptj.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "granite", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "granite.svg", + "diff_svg": "granite.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 7, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 0 + }, + "note": null + }, + { + "model": "granite4_vision", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "granite4_vision.svg", + "diff_svg": "granite4_vision.diff.svg", + "is_modular": true, + "parent_model": "llava_next", + "parent_models": [ + "llava_next", + "granite" + ], + "diff_totals": { + "overridden": 9, + "added": 25, + "deleted": 0, + "new_classes": 5, + "trivial": 3 + }, + "note": null + }, + { + "model": "granite_speech", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "granite_speech.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "granite_speech_plus", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "granite_speech_plus.svg", + "diff_svg": "granite_speech_plus.diff.svg", + "is_modular": true, + "parent_model": "granite_speech", + "parent_models": [ + "granite_speech" + ], + "diff_totals": { + "overridden": 1, + "added": 2, + "deleted": 0, + "new_classes": 2, + "trivial": 3 + }, + "note": null + }, + { + "model": "granitemoe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 MHA +MoE", + "svg": "granitemoe.svg", + "diff_svg": "granitemoe.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "granite", + "jetmoe", + "llama" + ], + "diff_totals": { + "overridden": 15, + "added": 3, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "granitemoehybrid", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "ssm", + "layer_summary": "32\u00d7 Mamba", + "svg": "granitemoehybrid.svg", + "diff_svg": "granitemoehybrid.diff.svg", + "is_modular": true, + "parent_model": "granitemoeshared", + "parent_models": [ + "granitemoeshared", + "bamba", + "gemma2" + ], + "diff_totals": { + "overridden": 15, + "added": 2, + "deleted": 0, + "new_classes": 0, + "trivial": 2 + }, + "note": null + }, + { + "model": "granitemoeshared", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 MHA +MoE", + "svg": "granitemoeshared.svg", + "diff_svg": "granitemoeshared.diff.svg", + "is_modular": true, + "parent_model": "granitemoe", + "parent_models": [ + "granitemoe" + ], + "diff_totals": { + "overridden": 7, + "added": 7, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "grounding_dino", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "grounding_dino.svg", + "diff_svg": "grounding_dino.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 8, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "groupvit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "groupvit.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "helium", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "helium.svg", + "diff_svg": "helium.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "gemma", + "granite" + ], + "diff_totals": { + "overridden": 3, + "added": 3, + "deleted": 0, + "new_classes": 1, + "trivial": 6 + }, + "note": null + }, + { + "model": "hgnet_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 Attention", + "svg": "hgnet_v2.svg", + "diff_svg": "hgnet_v2.diff.svg", + "is_modular": true, + "parent_model": "rt_detr", + "parent_models": [ + "rt_detr" + ], + "diff_totals": { + "overridden": 2, + "added": 46, + "deleted": 0, + "new_classes": 10, + "trivial": 0 + }, + "note": null + }, + { + "model": "hiera", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 MHA", + "svg": "hiera.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "higgs_audio_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 GQA", + "svg": "higgs_audio_v2.svg", + "diff_svg": "higgs_audio_v2.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "csm" + ], + "diff_totals": { + "overridden": 5, + "added": 25, + "deleted": 0, + "new_classes": 2, + "trivial": 2 + }, + "note": null + }, + { + "model": "higgs_audio_v2_tokenizer", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig,", + "svg": "higgs_audio_v2_tokenizer.svg", + "diff_svg": "higgs_audio_v2_tokenizer.diff.svg", + "is_modular": true, + "parent_model": "xcodec", + "parent_models": [ + "xcodec" + ], + "diff_totals": { + "overridden": 2, + "added": 11, + "deleted": 0, + "new_classes": 2, + "trivial": 1 + }, + "note": null + }, + { + "model": "hrm_text", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 MHA", + "svg": "hrm_text.svg", + "diff_svg": "hrm_text.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "nanochat" + ], + "diff_totals": { + "overridden": 7, + "added": 25, + "deleted": 0, + "new_classes": 2, + "trivial": 2 + }, + "note": null + }, + { + "model": "hubert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "hubert.svg", + "diff_svg": "hubert.diff.svg", + "is_modular": true, + "parent_model": "wav2vec2", + "parent_models": [ + "wav2vec2" + ], + "diff_totals": { + "overridden": 2, + "added": 16, + "deleted": 1, + "new_classes": 3, + "trivial": 6 + }, + "note": null + }, + { + "model": "hunyuan_v1_dense", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "hunyuan_v1_dense.svg", + "diff_svg": "hunyuan_v1_dense.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 5, + "added": 1, + "deleted": 0, + "new_classes": 0, + "trivial": 4 + }, + "note": null + }, + { + "model": "hunyuan_v1_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 MHA +MoE", + "svg": "hunyuan_v1_moe.svg", + "diff_svg": "hunyuan_v1_moe.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "hunyuan_v1_dense", + "mixtral" + ], + "diff_totals": { + "overridden": 4, + "added": 6, + "deleted": 0, + "new_classes": 2, + "trivial": 6 + }, + "note": null + }, + { + "model": "hy_v3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "80\u00d7 GQA +MoE", + "svg": "hy_v3.svg", + "diff_svg": "hy_v3.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "minimax_m2", + "apertus", + "deepseek_v3", + "mixtral", + "qwen3_moe" + ], + "diff_totals": { + "overridden": 10, + "added": 38, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "hyperclovax", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "hyperclovax.svg", + "diff_svg": "hyperclovax.diff.svg", + "is_modular": true, + "parent_model": "granite", + "parent_models": [ + "granite" + ], + "diff_totals": { + "overridden": 3, + "added": 6, + "deleted": 0, + "new_classes": 1, + "trivial": 5 + }, + "note": null + }, + { + "model": "ibert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "ibert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "idefics", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "idefics.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "idefics2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 GQA", + "svg": "idefics2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "idefics3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "idefics3.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "ijepa", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "ijepa.svg", + "diff_svg": "ijepa.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit" + ], + "diff_totals": { + "overridden": 7, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 0 + }, + "note": null + }, + { + "model": "imagegpt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "imagegpt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "informer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "informer.svg", + "diff_svg": "informer.diff.svg", + "is_modular": true, + "parent_model": "time_series_transformer", + "parent_models": [ + "time_series_transformer", + "bart" + ], + "diff_totals": { + "overridden": 11, + "added": 11, + "deleted": 0, + "new_classes": 3, + "trivial": 7 + }, + "note": null + }, + { + "model": "instructblip", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "instructblip.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "instructblipvideo", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "instructblipvideo.svg", + "diff_svg": "instructblipvideo.diff.svg", + "is_modular": true, + "parent_model": "instructblip", + "parent_models": [ + "instructblip" + ], + "diff_totals": { + "overridden": 6, + "added": 4, + "deleted": 1, + "new_classes": 3, + "trivial": 2 + }, + "note": null + }, + { + "model": "internvl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "internvl.svg", + "diff_svg": "internvl.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava", + "clip", + "janus", + "llama" + ], + "diff_totals": { + "overridden": 6, + "added": 27, + "deleted": 0, + "new_classes": 8, + "trivial": 4 + }, + "note": null + }, + { + "model": "jais2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "jais2.svg", + "diff_svg": "jais2.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "nemotron" + ], + "diff_totals": { + "overridden": 3, + "added": 14, + "deleted": 0, + "new_classes": 1, + "trivial": 2 + }, + "note": null + }, + { + "model": "jamba", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "28\u00d7 Mamba + 4\u00d7 full +MoE", + "svg": "jamba.svg", + "diff_svg": "jamba.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "mixtral", + "mistral" + ], + "diff_totals": { + "overridden": 4, + "added": 24, + "deleted": 0, + "new_classes": 7, + "trivial": 3 + }, + "note": null + }, + { + "model": "janus", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "janus.svg", + "diff_svg": "janus.diff.svg", + "is_modular": true, + "parent_model": "chameleon", + "parent_models": [ + "chameleon", + "siglip", + "idefics", + "blip_2" + ], + "diff_totals": { + "overridden": 10, + "added": 89, + "deleted": 0, + "new_classes": 16, + "trivial": 5 + }, + "note": null + }, + { + "model": "jetmoe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "12\u00d7 GQA +MoE", + "svg": "jetmoe.svg", + "diff_svg": "jetmoe.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "llama" + ], + "diff_totals": { + "overridden": 14, + "added": 15, + "deleted": 0, + "new_classes": 7, + "trivial": 2 + }, + "note": null + }, + { + "model": "jina_embeddings_v3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "jina_embeddings_v3.svg", + "diff_svg": "jina_embeddings_v3.diff.svg", + "is_modular": true, + "parent_model": "xlm_roberta", + "parent_models": [ + "xlm_roberta", + "llama", + "clip", + "gpt_neox" + ], + "diff_totals": { + "overridden": 11, + "added": 13, + "deleted": 3, + "new_classes": 1, + "trivial": 7 + }, + "note": null + }, + { + "model": "kosmos2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "kosmos2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "kosmos2_5", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConf", + "svg": "kosmos2_5.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "kyutai_speech_to_text", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "48\u00d7 MHA", + "svg": "kyutai_speech_to_text.svg", + "diff_svg": "kyutai_speech_to_text.diff.svg", + "is_modular": true, + "parent_model": "moshi", + "parent_models": [ + "moshi", + "llama", + "mimi" + ], + "diff_totals": { + "overridden": 5, + "added": 12, + "deleted": 0, + "new_classes": 2, + "trivial": 1 + }, + "note": null + }, + { + "model": "laguna", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "40\u00d7 full +MoE", + "svg": "laguna.svg", + "diff_svg": "laguna.diff.svg", + "is_modular": true, + "parent_model": "qwen2_moe", + "parent_models": [ + "qwen2_moe", + "qwen3_moe", + "afmoe", + "gemma3", + "glm4_moe_lite", + "llama", + "qwen3_5_moe" + ], + "diff_totals": { + "overridden": 12, + "added": 29, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "lasr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "17\u00d7 Attention", + "svg": "lasr.svg", + "diff_svg": "lasr.diff.svg", + "is_modular": true, + "parent_model": "parakeet", + "parent_models": [ + "parakeet", + "llama" + ], + "diff_totals": { + "overridden": 9, + "added": 31, + "deleted": 0, + "new_classes": 7, + "trivial": 2 + }, + "note": null + }, + { + "model": "layoutlm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "layoutlm.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "layoutlmv2", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConfi", + "svg": "layoutlmv2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "layoutlmv3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "layoutlmv3.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "layoutxlm", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConfig, ", + "svg": "layoutxlm.svg", + "diff_svg": "layoutxlm.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 0, + "deleted": 0, + "new_classes": 1, + "trivial": 0 + }, + "note": null + }, + { + "model": "led", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "led.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "levit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "10\u00d7 MHA", + "svg": "levit.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "lfm2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "lfm2.svg", + "diff_svg": "lfm2.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "gemma2" + ], + "diff_totals": { + "overridden": 5, + "added": 8, + "deleted": 0, + "new_classes": 3, + "trivial": 3 + }, + "note": null + }, + { + "model": "lfm2_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 full +MoE", + "svg": "lfm2_moe.svg", + "diff_svg": "lfm2_moe.diff.svg", + "is_modular": true, + "parent_model": "lfm2", + "parent_models": [ + "lfm2", + "llama", + "mixtral", + "qwen2_moe" + ], + "diff_totals": { + "overridden": 6, + "added": 4, + "deleted": 0, + "new_classes": 1, + "trivial": 5 + }, + "note": null + }, + { + "model": "lfm2_vl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "lfm2_vl.svg", + "diff_svg": "lfm2_vl.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava" + ], + "diff_totals": { + "overridden": 8, + "added": 3, + "deleted": 0, + "new_classes": 1, + "trivial": 2 + }, + "note": null + }, + { + "model": "lightglue", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "9\u00d7 MHA", + "svg": "lightglue.svg", + "diff_svg": "lightglue.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "clip", + "llama" + ], + "diff_totals": { + "overridden": 4, + "added": 53, + "deleted": 0, + "new_classes": 11, + "trivial": 0 + }, + "note": null + }, + { + "model": "lighton_ocr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 full", + "svg": "lighton_ocr.svg", + "diff_svg": "lighton_ocr.diff.svg", + "is_modular": true, + "parent_model": "mistral3", + "parent_models": [ + "mistral3" + ], + "diff_totals": { + "overridden": 5, + "added": 14, + "deleted": 0, + "new_classes": 3, + "trivial": 1 + }, + "note": null + }, + { + "model": "lilt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "lilt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "llama", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "llama.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "llama4", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "36\u00d7 chunked +MoE + 12\u00d7 full +MoE", + "svg": "llama4.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "llava", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "llava.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "llava_next", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "llava_next.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "llava_next_video", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "llava_next_video.svg", + "diff_svg": "llava_next_video.diff.svg", + "is_modular": true, + "parent_model": "llava_next", + "parent_models": [ + "llava_next" + ], + "diff_totals": { + "overridden": 7, + "added": 25, + "deleted": 0, + "new_classes": 2, + "trivial": 1 + }, + "note": null + }, + { + "model": "llava_onevision", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "llava_onevision.svg", + "diff_svg": "llava_onevision.diff.svg", + "is_modular": true, + "parent_model": "llava_next_video", + "parent_models": [ + "llava_next_video" + ], + "diff_totals": { + "overridden": 8, + "added": 35, + "deleted": 0, + "new_classes": 3, + "trivial": 3 + }, + "note": null + }, + { + "model": "longcat_flash", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "28\u00d7 MLA +MoE", + "svg": "longcat_flash.svg", + "diff_svg": "longcat_flash.diff.svg", + "is_modular": true, + "parent_model": "deepseek_v3", + "parent_models": [ + "deepseek_v3" + ], + "diff_totals": { + "overridden": 8, + "added": 22, + "deleted": 0, + "new_classes": 4, + "trivial": 2 + }, + "note": null + }, + { + "model": "longformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "longformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "longt5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "longt5.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "luke", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "luke.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "lw_detr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "13\u00d7 Attention", + "svg": "lw_detr.svg", + "diff_svg": "lw_detr.diff.svg", + "is_modular": true, + "parent_model": "deformable_detr", + "parent_models": [ + "deformable_detr", + "vitdet", + "convnext", + "rt_detr", + "vit" + ], + "diff_totals": { + "overridden": 16, + "added": 110, + "deleted": 0, + "new_classes": 17, + "trivial": 6 + }, + "note": null + }, + { + "model": "lxmert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "9\u00d7 MHA", + "svg": "lxmert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "m2m_100", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "m2m_100.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mamba", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "ssm", + "layer_summary": "32\u00d7 Mamba", + "svg": "mamba.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mamba2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "ssm", + "layer_summary": "64\u00d7 Mamba", + "svg": "mamba2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "marian", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "marian.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "markuplm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "markuplm.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mask2former", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "18\u00d7 MHA", + "svg": "mask2former.svg", + "diff_svg": "mask2former.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 6, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "maskformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "maskformer.svg", + "diff_svg": "maskformer.diff.svg", + "is_modular": true, + "parent_model": "detr", + "parent_models": [ + "detr" + ], + "diff_totals": { + "overridden": 0, + "added": 86, + "deleted": 0, + "new_classes": 19, + "trivial": 3 + }, + "note": null + }, + { + "model": "mbart", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "mbart.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "megatron_bert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "megatron_bert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mellum", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "28\u00d7 full +MoE", + "svg": "mellum.svg", + "diff_svg": "mellum.diff.svg", + "is_modular": true, + "parent_model": "qwen3_moe", + "parent_models": [ + "qwen3_moe", + "laguna" + ], + "diff_totals": { + "overridden": 3, + "added": 19, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "metaclip_2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "metaclip_2.svg", + "diff_svg": "metaclip_2.diff.svg", + "is_modular": true, + "parent_model": "clip", + "parent_models": [ + "clip" + ], + "diff_totals": { + "overridden": 10, + "added": 0, + "deleted": 0, + "new_classes": 3, + "trivial": 5 + }, + "note": null + }, + { + "model": "mgp_str", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "mgp_str.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mimi", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 MHA", + "svg": "mimi.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "minicpmv4_6", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "24\u00d7 linear + 8\u00d7 full", + "svg": "minicpmv4_6.svg", + "diff_svg": "minicpmv4_6.diff.svg", + "is_modular": true, + "parent_model": "siglip", + "parent_models": [ + "siglip", + "idefics3", + "lfm2_vl", + "qwen2_vl" + ], + "diff_totals": { + "overridden": 9, + "added": 52, + "deleted": 0, + "new_classes": 9, + "trivial": 1 + }, + "note": null + }, + { + "model": "minimax", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "16\u00d7 full +MoE + 16\u00d7 linear +MoE", + "svg": "minimax.svg", + "diff_svg": "minimax.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "gemma2" + ], + "diff_totals": { + "overridden": 7, + "added": 50, + "deleted": 0, + "new_classes": 3, + "trivial": 8 + }, + "note": null + }, + { + "model": "minimax_m2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "62\u00d7 GQA +MoE", + "svg": "minimax_m2.svg", + "diff_svg": "minimax_m2.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "flex_olmo", + "glm4_moe" + ], + "diff_totals": { + "overridden": 6, + "added": 29, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "ministral", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 sliding", + "svg": "ministral.svg", + "diff_svg": "ministral.diff.svg", + "is_modular": true, + "parent_model": "qwen2", + "parent_models": [ + "qwen2" + ], + "diff_totals": { + "overridden": 3, + "added": 3, + "deleted": 0, + "new_classes": 1, + "trivial": 9 + }, + "note": null + }, + { + "model": "ministral3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "34\u00d7 GQA", + "svg": "ministral3.svg", + "diff_svg": "ministral3.diff.svg", + "is_modular": true, + "parent_model": "mistral", + "parent_models": [ + "mistral" + ], + "diff_totals": { + "overridden": 1, + "added": 0, + "deleted": 0, + "new_classes": 3, + "trivial": 4 + }, + "note": null + }, + { + "model": "mistral", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 GQA", + "svg": "mistral.svg", + "diff_svg": "mistral.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 6, + "added": 0, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "mistral3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 GQA", + "svg": "mistral3.svg", + "diff_svg": "mistral3.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava", + "mistral" + ], + "diff_totals": { + "overridden": 4, + "added": 4, + "deleted": 0, + "new_classes": 2, + "trivial": 4 + }, + "note": null + }, + { + "model": "mistral4", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "36\u00d7 MLA +MoE", + "svg": "mistral4.svg", + "diff_svg": "mistral4.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "deepseek_v3", + "llama", + "qwen2_moe" + ], + "diff_totals": { + "overridden": 4, + "added": 16, + "deleted": 0, + "new_classes": 4, + "trivial": 6 + }, + "note": null + }, + { + "model": "mixtral", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 GQA +MoE", + "svg": "mixtral.svg", + "diff_svg": "mixtral.diff.svg", + "is_modular": true, + "parent_model": "mistral", + "parent_models": [ + "mistral" + ], + "diff_totals": { + "overridden": 5, + "added": 9, + "deleted": 0, + "new_classes": 4, + "trivial": 6 + }, + "note": null + }, + { + "model": "mlcd", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "48\u00d7 MHA", + "svg": "mlcd.svg", + "diff_svg": "mlcd.diff.svg", + "is_modular": true, + "parent_model": "clip", + "parent_models": [ + "clip", + "qwen2_vl" + ], + "diff_totals": { + "overridden": 11, + "added": 26, + "deleted": 0, + "new_classes": 2, + "trivial": 1 + }, + "note": null + }, + { + "model": "mllama", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "40\u00d7 GQA", + "svg": "mllama.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mm_grounding_dino", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "mm_grounding_dino.svg", + "diff_svg": "mm_grounding_dino.diff.svg", + "is_modular": true, + "parent_model": "grounding_dino", + "parent_models": [ + "grounding_dino" + ], + "diff_totals": { + "overridden": 6, + "added": 42, + "deleted": 0, + "new_classes": 1, + "trivial": 5 + }, + "note": null + }, + { + "model": "mobilebert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "mobilebert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mobilenet_v1", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "26\u00d7 Attention", + "svg": "mobilenet_v1.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mobilenet_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 Attention", + "svg": "mobilenet_v2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mobilevit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "5\u00d7 MHA", + "svg": "mobilevit.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mobilevitv2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "5\u00d7 Attention", + "svg": "mobilevitv2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "modernbert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 full + 14\u00d7 sliding", + "svg": "modernbert.svg", + "diff_svg": "modernbert.diff.svg", + "is_modular": true, + "parent_model": "gemma3", + "parent_models": [ + "gemma3" + ], + "diff_totals": { + "overridden": 2, + "added": 77, + "deleted": 0, + "new_classes": 13, + "trivial": 0 + }, + "note": null + }, + { + "model": "modernbert_decoder", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 full + 14\u00d7 sliding", + "svg": "modernbert_decoder.svg", + "diff_svg": "modernbert_decoder.diff.svg", + "is_modular": true, + "parent_model": "modernbert", + "parent_models": [ + "modernbert" + ], + "diff_totals": { + "overridden": 5, + "added": 51, + "deleted": 0, + "new_classes": 6, + "trivial": 4 + }, + "note": null + }, + { + "model": "modernvbert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 full + 14\u00d7 sliding", + "svg": "modernvbert.svg", + "diff_svg": "modernvbert.diff.svg", + "is_modular": true, + "parent_model": "smolvlm", + "parent_models": [ + "smolvlm", + "modernbert" + ], + "diff_totals": { + "overridden": 3, + "added": 36, + "deleted": 0, + "new_classes": 7, + "trivial": 1 + }, + "note": null + }, + { + "model": "moonshine", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "moonshine.svg", + "diff_svg": "moonshine.diff.svg", + "is_modular": true, + "parent_model": "glm", + "parent_models": [ + "glm", + "llama", + "whisper" + ], + "diff_totals": { + "overridden": 6, + "added": 59, + "deleted": 1, + "new_classes": 8, + "trivial": 1 + }, + "note": null + }, + { + "model": "moonshine_streaming", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "moonshine_streaming.svg", + "diff_svg": "moonshine_streaming.diff.svg", + "is_modular": true, + "parent_model": "moonshine", + "parent_models": [ + "moonshine", + "llama" + ], + "diff_totals": { + "overridden": 5, + "added": 19, + "deleted": 0, + "new_classes": 10, + "trivial": 3 + }, + "note": null + }, + { + "model": "moshi", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "moshi.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mpnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "mpnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mpt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "mpt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mra", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "mra.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mt5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 MHA", + "svg": "mt5.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "musicflamingo", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "musicflamingo.svg", + "diff_svg": "musicflamingo.diff.svg", + "is_modular": true, + "parent_model": "audioflamingo3", + "parent_models": [ + "audioflamingo3", + "moonshine" + ], + "diff_totals": { + "overridden": 8, + "added": 16, + "deleted": 0, + "new_classes": 2, + "trivial": 1 + }, + "note": null + }, + { + "model": "musicgen", + "mode": "full", + "status": "failed", + "build_status": "failed", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "config instantiation failed: StrictDataclassFieldValidationError(\"Validation error for field 'text_encoder':\\n TypeError: Field 'text_encoder' with value None doesn't match any type in (, ). Errors: Field 'text_encoder' expe", + "svg": "musicgen.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "musicgen_melody", + "mode": "full", + "status": "failed", + "build_status": "failed", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "config instantiation failed: StrictDataclassFieldValidationError(\"Validation error for field 'text_encoder':\\n TypeError: Field 'text_encoder' with value None doesn't match any type in (, ). Errors: Field 'text_encoder' expe", + "svg": "musicgen_melody.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "mvp", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "mvp.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "nanochat", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "nanochat.svg", + "diff_svg": "nanochat.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "clip", + "gemma2", + "llama4", + "qwen3" + ], + "diff_totals": { + "overridden": 8, + "added": 1, + "deleted": 0, + "new_classes": 0, + "trivial": 2 + }, + "note": null + }, + { + "model": "nemotron", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "nemotron.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "nemotron_h", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "1\u00d7 Mamba + 2\u00d7 GQA +MoE + 1\u00d7 attention +MoE", + "svg": "nemotron_h.svg", + "diff_svg": "nemotron_h.diff.svg", + "is_modular": true, + "parent_model": "deepseek_v3", + "parent_models": [ + "deepseek_v3", + "jamba", + "llama", + "nemotron", + "zamba", + "zamba2" + ], + "diff_totals": { + "overridden": 8, + "added": 23, + "deleted": 0, + "new_classes": 4, + "trivial": 2 + }, + "note": null + }, + { + "model": "nllb_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "12\u00d7 MHA +MoE", + "svg": "nllb_moe.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "nomic_bert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "nomic_bert.svg", + "diff_svg": "nomic_bert.diff.svg", + "is_modular": true, + "parent_model": "bert", + "parent_models": [ + "bert", + "jina_embeddings_v3", + "gemma", + "llama" + ], + "diff_totals": { + "overridden": 11, + "added": 26, + "deleted": 0, + "new_classes": 1, + "trivial": 6 + }, + "note": null + }, + { + "model": "nougat", + "mode": "full", + "status": "failed", + "build_status": "failed", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "config instantiation failed: ValueError('A configuration of type nougat cannot be instantiated because one of both `encoder` or `decoder` sub-configurations is not passed.')", + "svg": "nougat.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "nystromformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "nystromformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "olmo", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "olmo.svg", + "diff_svg": "olmo.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 5, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 2 + }, + "note": null + }, + { + "model": "olmo2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "olmo2.svg", + "diff_svg": "olmo2.diff.svg", + "is_modular": true, + "parent_model": "olmo", + "parent_models": [ + "olmo", + "llama" + ], + "diff_totals": { + "overridden": 6, + "added": 5, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "olmo3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 sliding + 8\u00d7 full", + "svg": "olmo3.svg", + "diff_svg": "olmo3.diff.svg", + "is_modular": true, + "parent_model": "olmo2", + "parent_models": [ + "olmo2", + "gemma2" + ], + "diff_totals": { + "overridden": 4, + "added": 7, + "deleted": 0, + "new_classes": 1, + "trivial": 6 + }, + "note": null + }, + { + "model": "olmo_hybrid", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "24\u00d7 linear + 8\u00d7 full", + "svg": "olmo_hybrid.svg", + "diff_svg": "olmo_hybrid.diff.svg", + "is_modular": true, + "parent_model": "olmo3", + "parent_models": [ + "olmo3", + "qwen3_next", + "llama" + ], + "diff_totals": { + "overridden": 12, + "added": 42, + "deleted": 0, + "new_classes": 4, + "trivial": 4 + }, + "note": null + }, + { + "model": "olmoe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "16\u00d7 MHA +MoE", + "svg": "olmoe.svg", + "diff_svg": "olmoe.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "mixtral", + "gemma", + "qwen2_moe" + ], + "diff_totals": { + "overridden": 9, + "added": 12, + "deleted": 0, + "new_classes": 2, + "trivial": 4 + }, + "note": null + }, + { + "model": "omdet_turbo", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "omdet_turbo.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "oneformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "9\u00d7 MHA", + "svg": "oneformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "openai", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "openai.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "openai_privacy_filter", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "8\u00d7 GQA +MoE", + "svg": "openai_privacy_filter.svg", + "diff_svg": "openai_privacy_filter.diff.svg", + "is_modular": true, + "parent_model": "gpt_oss", + "parent_models": [ + "gpt_oss" + ], + "diff_totals": { + "overridden": 14, + "added": 18, + "deleted": 0, + "new_classes": 3, + "trivial": 2 + }, + "note": null + }, + { + "model": "opt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "opt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "ovis2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "ovis2.svg", + "diff_svg": "ovis2.diff.svg", + "is_modular": true, + "parent_model": "llava_next", + "parent_models": [ + "aimv2", + "llama", + "llava", + "llava_next", + "siglip" + ], + "diff_totals": { + "overridden": 12, + "added": 21, + "deleted": 0, + "new_classes": 5, + "trivial": 5 + }, + "note": null + }, + { + "model": "owlv2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "owlv2.svg", + "diff_svg": "owlv2.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 29, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "owlvit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "owlvit.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "paddleocr_vl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "18\u00d7 GQA", + "svg": "paddleocr_vl.svg", + "diff_svg": "paddleocr_vl.diff.svg", + "is_modular": true, + "parent_model": "qwen2_vl", + "parent_models": [ + "qwen2_vl", + "ernie4_5", + "video_llama_3", + "siglip", + "qwen2_5_omni" + ], + "diff_totals": { + "overridden": 18, + "added": 56, + "deleted": 2, + "new_classes": 12, + "trivial": 5 + }, + "note": null + }, + { + "model": "paligemma", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "18\u00d7 MQA", + "svg": "paligemma.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "parakeet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 Attention", + "svg": "parakeet.svg", + "diff_svg": "parakeet.diff.svg", + "is_modular": true, + "parent_model": "fastspeech2_conformer", + "parent_models": [ + "fastspeech2_conformer", + "llama" + ], + "diff_totals": { + "overridden": 3, + "added": 55, + "deleted": 0, + "new_classes": 14, + "trivial": 0 + }, + "note": null + }, + { + "model": "patchtsmixer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "ssm", + "layer_summary": "3\u00d7 Mamba", + "svg": "patchtsmixer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "patchtst", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "3\u00d7 MHA", + "svg": "patchtst.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "pe_audio", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 full + 14\u00d7 sliding", + "svg": "pe_audio.svg", + "diff_svg": "pe_audio.diff.svg", + "is_modular": true, + "parent_model": "pe_audio_video", + "parent_models": [ + "pe_audio_video", + "dac" + ], + "diff_totals": { + "overridden": 7, + "added": 17, + "deleted": 0, + "new_classes": 5, + "trivial": 1 + }, + "note": null + }, + { + "model": "pe_audio_video", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 full + 14\u00d7 sliding", + "svg": "pe_audio_video.svg", + "diff_svg": "pe_audio_video.diff.svg", + "is_modular": true, + "parent_model": "qwen3", + "parent_models": [ + "qwen3" + ], + "diff_totals": { + "overridden": 3, + "added": 72, + "deleted": 0, + "new_classes": 12, + "trivial": 2 + }, + "note": null + }, + { + "model": "pe_video", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 full + 14\u00d7 sliding", + "svg": "pe_video.svg", + "diff_svg": "pe_video.diff.svg", + "is_modular": true, + "parent_model": "pe_audio_video", + "parent_models": [ + "pe_audio_video" + ], + "diff_totals": { + "overridden": 6, + "added": 13, + "deleted": 0, + "new_classes": 3, + "trivial": 2 + }, + "note": null + }, + { + "model": "pegasus", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "pegasus.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "pegasus_x", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "16\u00d7 MHA", + "svg": "pegasus_x.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "perceiver", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "26\u00d7 Attention", + "svg": "perceiver.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "perception_lm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "perception_lm.svg", + "diff_svg": "perception_lm.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava" + ], + "diff_totals": { + "overridden": 7, + "added": 6, + "deleted": 1, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "persimmon", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "36\u00d7 MHA", + "svg": "persimmon.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "phi", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "phi.svg", + "diff_svg": "phi.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "clip" + ], + "diff_totals": { + "overridden": 7, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "phi3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "phi3.svg", + "diff_svg": "phi3.diff.svg", + "is_modular": true, + "parent_model": "mistral", + "parent_models": [ + "mistral", + "phi" + ], + "diff_totals": { + "overridden": 2, + "added": 6, + "deleted": 0, + "new_classes": 2, + "trivial": 3 + }, + "note": null + }, + { + "model": "phi4_multimodal", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 GQA", + "svg": "phi4_multimodal.svg", + "diff_svg": "phi4_multimodal.diff.svg", + "is_modular": true, + "parent_model": "siglip", + "parent_models": [ + "siglip", + "phi3" + ], + "diff_totals": { + "overridden": 22, + "added": 95, + "deleted": 0, + "new_classes": 19, + "trivial": 3 + }, + "note": null + }, + { + "model": "phimoe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "32\u00d7 GQA +MoE", + "svg": "phimoe.svg", + "diff_svg": "phimoe.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "llama" + ], + "diff_totals": { + "overridden": 6, + "added": 7, + "deleted": 0, + "new_classes": 4, + "trivial": 2 + }, + "note": null + }, + { + "model": "pi0", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "27\u00d7 Attention", + "svg": "pi0.svg", + "diff_svg": "pi0.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 50, + "deleted": 0, + "new_classes": 9, + "trivial": 0 + }, + "note": null + }, + { + "model": "pix2struct", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "pix2struct.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "pixio", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "pixio.svg", + "diff_svg": "pixio.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit", + "dinov2", + "swin" + ], + "diff_totals": { + "overridden": 2, + "added": 17, + "deleted": 0, + "new_classes": 4, + "trivial": 5 + }, + "note": null + }, + { + "model": "pixtral", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "pixtral.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "plbart", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "plbart.svg", + "diff_svg": "plbart.diff.svg", + "is_modular": true, + "parent_model": "bart", + "parent_models": [ + "bart", + "bigbird_pegasus" + ], + "diff_totals": { + "overridden": 2, + "added": 21, + "deleted": 0, + "new_classes": 3, + "trivial": 4 + }, + "note": null + }, + { + "model": "poolformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 Attention", + "svg": "poolformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "pop2piano", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "pop2piano.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "pp_chart2table", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 full", + "svg": "pp_chart2table.svg", + "diff_svg": "pp_chart2table.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 17, + "deleted": 0, + "new_classes": 4, + "trivial": 0 + }, + "note": null + }, + { + "model": "pp_doclayout_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "pp_doclayout_v2.svg", + "diff_svg": "pp_doclayout_v2.diff.svg", + "is_modular": true, + "parent_model": "layoutlmv3", + "parent_models": [ + "layoutlmv3", + "rt_detr", + "pp_doclayout_v3" + ], + "diff_totals": { + "overridden": 16, + "added": 115, + "deleted": 0, + "new_classes": 6, + "trivial": 3 + }, + "note": null + }, + { + "model": "pp_doclayout_v3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "pp_doclayout_v3.svg", + "diff_svg": "pp_doclayout_v3.diff.svg", + "is_modular": true, + "parent_model": "rt_detr", + "parent_models": [ + "rt_detr", + "resnet" + ], + "diff_totals": { + "overridden": 9, + "added": 100, + "deleted": 0, + "new_classes": 8, + "trivial": 3 + }, + "note": null + }, + { + "model": "pp_formulanet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "pp_formulanet.svg", + "diff_svg": "pp_formulanet.diff.svg", + "is_modular": true, + "parent_model": "slanext", + "parent_models": [ + "slanext", + "florence2", + "mbart" + ], + "diff_totals": { + "overridden": 7, + "added": 39, + "deleted": 3, + "new_classes": 8, + "trivial": 2 + }, + "note": null + }, + { + "model": "pp_lcnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 Attention", + "svg": "pp_lcnet.svg", + "diff_svg": "pp_lcnet.diff.svg", + "is_modular": true, + "parent_model": "resnet", + "parent_models": [ + "resnet" + ], + "diff_totals": { + "overridden": 1, + "added": 52, + "deleted": 0, + "new_classes": 10, + "trivial": 0 + }, + "note": null + }, + { + "model": "pp_lcnet_v3", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConf", + "svg": "pp_lcnet_v3.svg", + "diff_svg": "pp_lcnet_v3.diff.svg", + "is_modular": true, + "parent_model": "pp_lcnet", + "parent_models": [ + "pp_lcnet", + "hgnet_v2" + ], + "diff_totals": { + "overridden": 2, + "added": 10, + "deleted": 0, + "new_classes": 3, + "trivial": 3 + }, + "note": null + }, + { + "model": "pp_lcnet_v4", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConf", + "svg": "pp_lcnet_v4.svg", + "diff_svg": "pp_lcnet_v4.diff.svg", + "is_modular": true, + "parent_model": "pp_lcnet", + "parent_models": [ + "pp_lcnet", + "hgnet_v2" + ], + "diff_totals": { + "overridden": 1, + "added": 19, + "deleted": 0, + "new_classes": 4, + "trivial": 5 + }, + "note": null + }, + { + "model": "pp_ocrv5_mobile_det", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "5\u00d7 Attention", + "svg": "pp_ocrv5_mobile_det.svg", + "diff_svg": "pp_ocrv5_mobile_det.diff.svg", + "is_modular": true, + "parent_model": "pp_ocrv5_server_det", + "parent_models": [ + "pp_ocrv5_server_det" + ], + "diff_totals": { + "overridden": 1, + "added": 17, + "deleted": 0, + "new_classes": 5, + "trivial": 2 + }, + "note": null + }, + { + "model": "pp_ocrv5_mobile_rec", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "5\u00d7 MHA", + "svg": "pp_ocrv5_mobile_rec.svg", + "diff_svg": "pp_ocrv5_mobile_rec.diff.svg", + "is_modular": true, + "parent_model": "pp_ocrv5_server_rec", + "parent_models": [ + "pp_ocrv5_server_rec" + ], + "diff_totals": { + "overridden": 1, + "added": 1, + "deleted": 0, + "new_classes": 1, + "trivial": 2 + }, + "note": null + }, + { + "model": "pp_ocrv5_server_det", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 Attention", + "svg": "pp_ocrv5_server_det.svg", + "diff_svg": "pp_ocrv5_server_det.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 57, + "deleted": 0, + "new_classes": 12, + "trivial": 0 + }, + "note": null + }, + { + "model": "pp_ocrv5_server_rec", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "pp_ocrv5_server_rec.svg", + "diff_svg": "pp_ocrv5_server_rec.diff.svg", + "is_modular": true, + "parent_model": "clip", + "parent_models": [ + "blip_2", + "clip", + "focalnet", + "paddleocr_vl", + "resnet" + ], + "diff_totals": { + "overridden": 6, + "added": 44, + "deleted": 1, + "new_classes": 8, + "trivial": 1 + }, + "note": null + }, + { + "model": "pp_ocrv6_medium_det", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "7\u00d7 Attention", + "svg": "pp_ocrv6_medium_det.svg", + "diff_svg": "pp_ocrv6_medium_det.diff.svg", + "is_modular": true, + "parent_model": "pp_ocrv5_server_det", + "parent_models": [ + "pp_ocrv5_server_det", + "pp_ocrv5_mobile_det" + ], + "diff_totals": { + "overridden": 1, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "pp_ocrv6_small_det", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "7\u00d7 Attention", + "svg": "pp_ocrv6_small_det.svg", + "diff_svg": "pp_ocrv6_small_det.diff.svg", + "is_modular": true, + "parent_model": "pp_ocrv5_mobile_det", + "parent_models": [ + "pp_ocrv5_mobile_det", + "pp_lcnet", + "pp_ocrv5_server_det" + ], + "diff_totals": { + "overridden": 3, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "pp_ocrv6_small_rec", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "7\u00d7 MHA", + "svg": "pp_ocrv6_small_rec.svg", + "diff_svg": "pp_ocrv6_small_rec.diff.svg", + "is_modular": true, + "parent_model": "pp_ocrv5_server_rec", + "parent_models": [ + "pp_ocrv5_server_rec" + ], + "diff_totals": { + "overridden": 3, + "added": 3, + "deleted": 0, + "new_classes": 2, + "trivial": 1 + }, + "note": null + }, + { + "model": "pp_ocrv6_tiny_rec", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "7\u00d7 Attention", + "svg": "pp_ocrv6_tiny_rec.svg", + "diff_svg": "pp_ocrv6_tiny_rec.diff.svg", + "is_modular": true, + "parent_model": "pp_ocrv6_small_rec", + "parent_models": [ + "pp_ocrv6_small_rec" + ], + "diff_totals": { + "overridden": 4, + "added": 12, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "prompt_depth_anything", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 Attention", + "svg": "prompt_depth_anything.svg", + "diff_svg": "prompt_depth_anything.diff.svg", + "is_modular": true, + "parent_model": "depth_anything", + "parent_models": [ + "depth_anything" + ], + "diff_totals": { + "overridden": 6, + "added": 9, + "deleted": 0, + "new_classes": 4, + "trivial": 1 + }, + "note": null + }, + { + "model": "prophetnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "prophetnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "pvt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "pvt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "pvt_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "pvt_v2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "qianfan_ocr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "qianfan_ocr.svg", + "diff_svg": "qianfan_ocr.diff.svg", + "is_modular": true, + "parent_model": "internvl", + "parent_models": [ + "internvl", + "beit" + ], + "diff_totals": { + "overridden": 9, + "added": 13, + "deleted": 0, + "new_classes": 4, + "trivial": 8 + }, + "note": null + }, + { + "model": "qwen2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "qwen2.svg", + "diff_svg": "qwen2.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "gemma2", + "mistral" + ], + "diff_totals": { + "overridden": 5, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 7 + }, + "note": null + }, + { + "model": "qwen2_5_omni", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "28\u00d7 full", + "svg": "qwen2_5_omni.svg", + "diff_svg": "qwen2_5_omni.diff.svg", + "is_modular": true, + "parent_model": "qwen2_5_vl", + "parent_models": [ + "qwen2_5_vl", + "llama", + "qwen2_audio", + "qwen2_vl" + ], + "diff_totals": { + "overridden": 23, + "added": 267, + "deleted": 0, + "new_classes": 43, + "trivial": 2 + }, + "note": null + }, + { + "model": "qwen2_5_vl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "80\u00d7 full", + "svg": "qwen2_5_vl.svg", + "diff_svg": "qwen2_5_vl.diff.svg", + "is_modular": true, + "parent_model": "qwen2_vl", + "parent_models": [ + "qwen2_vl", + "llama" + ], + "diff_totals": { + "overridden": 11, + "added": 34, + "deleted": 0, + "new_classes": 8, + "trivial": 5 + }, + "note": null + }, + { + "model": "qwen2_audio", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "qwen2_audio.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "qwen2_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "24\u00d7 full +MoE", + "svg": "qwen2_moe.svg", + "diff_svg": "qwen2_moe.diff.svg", + "is_modular": true, + "parent_model": "mixtral", + "parent_models": [ + "mixtral", + "llama", + "gemma", + "gemma2" + ], + "diff_totals": { + "overridden": 11, + "added": 4, + "deleted": 0, + "new_classes": 5, + "trivial": 2 + }, + "note": null + }, + { + "model": "qwen2_vl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "80\u00d7 full", + "svg": "qwen2_vl.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "qwen3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "qwen3.svg", + "diff_svg": "qwen3.diff.svg", + "is_modular": true, + "parent_model": "qwen2", + "parent_models": [ + "qwen2", + "gemma", + "llama" + ], + "diff_totals": { + "overridden": 3, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 6 + }, + "note": null + }, + { + "model": "qwen3_5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "24\u00d7 linear + 8\u00d7 full", + "svg": "qwen3_5.svg", + "diff_svg": "qwen3_5.diff.svg", + "is_modular": true, + "parent_model": "qwen3_vl", + "parent_models": [ + "qwen3_next", + "qwen3_vl", + "qwen3" + ], + "diff_totals": { + "overridden": 22, + "added": 33, + "deleted": 1, + "new_classes": 7, + "trivial": 4 + }, + "note": null + }, + { + "model": "qwen3_5_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "30\u00d7 linear +MoE + 10\u00d7 full +MoE", + "svg": "qwen3_5_moe.svg", + "diff_svg": "qwen3_5_moe.diff.svg", + "is_modular": true, + "parent_model": "qwen3_5", + "parent_models": [ + "qwen3_5", + "qwen3_next", + "qwen3_vl_moe" + ], + "diff_totals": { + "overridden": 8, + "added": 21, + "deleted": 0, + "new_classes": 3, + "trivial": 13 + }, + "note": null + }, + { + "model": "qwen3_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "24\u00d7 GQA +MoE", + "svg": "qwen3_moe.svg", + "diff_svg": "qwen3_moe.diff.svg", + "is_modular": true, + "parent_model": "qwen2_moe", + "parent_models": [ + "llama", + "qwen2_moe", + "mixtral", + "qwen3" + ], + "diff_totals": { + "overridden": 4, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 9 + }, + "note": null + }, + { + "model": "qwen3_next", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "36\u00d7 linear +MoE + 12\u00d7 full +MoE", + "svg": "qwen3_next.svg", + "diff_svg": "qwen3_next.diff.svg", + "is_modular": true, + "parent_model": "qwen3_moe", + "parent_models": [ + "llama", + "qwen2_moe", + "qwen3_moe", + "gemma2", + "gemma3", + "mixtral" + ], + "diff_totals": { + "overridden": 7, + "added": 19, + "deleted": 0, + "new_classes": 4, + "trivial": 8 + }, + "note": null + }, + { + "model": "qwen3_omni_moe", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "sparse-moe", + "layer_summary": "28\u00d7 GQA +MoE", + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDet", + "svg": "qwen3_omni_moe.svg", + "diff_svg": "qwen3_omni_moe.diff.svg", + "is_modular": true, + "parent_model": "qwen3_moe", + "parent_models": [ + "qwen3", + "qwen3_moe", + "qwen2_5_omni", + "qwen3_vl_moe", + "qwen2_moe", + "mimi" + ], + "diff_totals": { + "overridden": 40, + "added": 191, + "deleted": 0, + "new_classes": 26, + "trivial": 12 + }, + "note": null + }, + { + "model": "qwen3_vl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "qwen3_vl.svg", + "diff_svg": "qwen3_vl.diff.svg", + "is_modular": true, + "parent_model": "qwen2_vl", + "parent_models": [ + "qwen2_vl", + "qwen2_5_vl", + "qwen3", + "llama" + ], + "diff_totals": { + "overridden": 26, + "added": 73, + "deleted": 0, + "new_classes": 9, + "trivial": 3 + }, + "note": null + }, + { + "model": "qwen3_vl_moe", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "24\u00d7 MHA +MoE", + "svg": "qwen3_vl_moe.svg", + "diff_svg": "qwen3_vl_moe.diff.svg", + "is_modular": true, + "parent_model": "qwen3_vl", + "parent_models": [ + "qwen3_vl", + "qwen3_moe" + ], + "diff_totals": { + "overridden": 6, + "added": 30, + "deleted": 0, + "new_classes": 4, + "trivial": 8 + }, + "note": null + }, + { + "model": "rag", + "mode": "full", + "status": "failed", + "build_status": "failed", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "config instantiation failed: ValueError('A configuration of type rag cannot be instantiated because not both `question_encoder` and `generator` sub-configurations are passed, but only {}')", + "svg": "rag.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "recurrent_gemma", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "other", + "layer_summary": "26\u00d7 Recurrent", + "svg": "recurrent_gemma.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "reformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "reformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "regnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 Attention", + "svg": "regnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "rembert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "rembert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "resnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 Attention", + "svg": "resnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "rf_detr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "13\u00d7 Attention", + "svg": "rf_detr.svg", + "diff_svg": "rf_detr.diff.svg", + "is_modular": true, + "parent_model": "lw_detr", + "parent_models": [ + "lw_detr", + "dinov2", + "clip", + "convnext" + ], + "diff_totals": { + "overridden": 16, + "added": 66, + "deleted": 0, + "new_classes": 8, + "trivial": 3 + }, + "note": null + }, + { + "model": "roberta", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "roberta.svg", + "diff_svg": "roberta.diff.svg", + "is_modular": true, + "parent_model": "bert", + "parent_models": [ + "bert" + ], + "diff_totals": { + "overridden": 3, + "added": 33, + "deleted": 0, + "new_classes": 9, + "trivial": 3 + }, + "note": null + }, + { + "model": "roberta_prelayernorm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "roberta_prelayernorm.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "roc_bert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "roc_bert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "roformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "roformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "rt_detr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "rt_detr.svg", + "diff_svg": "rt_detr.diff.svg", + "is_modular": true, + "parent_model": "detr", + "parent_models": [ + "detr", + "deformable_detr" + ], + "diff_totals": { + "overridden": 0, + "added": 137, + "deleted": 0, + "new_classes": 20, + "trivial": 4 + }, + "note": null + }, + { + "model": "rt_detr_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "rt_detr_v2.svg", + "diff_svg": "rt_detr_v2.diff.svg", + "is_modular": true, + "parent_model": "rt_detr", + "parent_models": [ + "rt_detr" + ], + "diff_totals": { + "overridden": 5, + "added": 63, + "deleted": 0, + "new_classes": 2, + "trivial": 1 + }, + "note": null + }, + { + "model": "rwkv", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "other", + "layer_summary": "32\u00d7 linear-attn", + "svg": "rwkv.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "sam", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "sam.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "sam2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "sam2.svg", + "diff_svg": "sam2.diff.svg", + "is_modular": true, + "parent_model": "sam", + "parent_models": [ + "sam", + "detr" + ], + "diff_totals": { + "overridden": 11, + "added": 75, + "deleted": 0, + "new_classes": 15, + "trivial": 4 + }, + "note": null + }, + { + "model": "sam2_video", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "sam2_video.svg", + "diff_svg": "sam2_video.diff.svg", + "is_modular": true, + "parent_model": "sam2", + "parent_models": [ + "sam2" + ], + "diff_totals": { + "overridden": 5, + "added": 116, + "deleted": 0, + "new_classes": 17, + "trivial": 5 + }, + "note": null + }, + { + "model": "sam3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "sam3.svg", + "diff_svg": "sam3.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 7, + "deleted": 0, + "new_classes": 1, + "trivial": 0 + }, + "note": null + }, + { + "model": "sam3_lite_text", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "sam3_lite_text.svg", + "diff_svg": "sam3_lite_text.diff.svg", + "is_modular": true, + "parent_model": "siglip", + "parent_models": [ + "siglip", + "sam3" + ], + "diff_totals": { + "overridden": 6, + "added": 47, + "deleted": 0, + "new_classes": 15, + "trivial": 2 + }, + "note": null + }, + { + "model": "sam3_tracker", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "sam3_tracker.svg", + "diff_svg": "sam3_tracker.diff.svg", + "is_modular": true, + "parent_model": "sam2", + "parent_models": [ + "sam2" + ], + "diff_totals": { + "overridden": 2, + "added": 6, + "deleted": 0, + "new_classes": 4, + "trivial": 10 + }, + "note": null + }, + { + "model": "sam3_tracker_video", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "sam3_tracker_video.svg", + "diff_svg": "sam3_tracker_video.diff.svg", + "is_modular": true, + "parent_model": "sam2_video", + "parent_models": [ + "sam2_video" + ], + "diff_totals": { + "overridden": 4, + "added": 47, + "deleted": 0, + "new_classes": 4, + "trivial": 24 + }, + "note": null + }, + { + "model": "sam3_video", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 Attention", + "svg": "sam3_video.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "sam_hq", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "sam_hq.svg", + "diff_svg": "sam_hq.diff.svg", + "is_modular": true, + "parent_model": "sam", + "parent_models": [ + "sam" + ], + "diff_totals": { + "overridden": 5, + "added": 7, + "deleted": 0, + "new_classes": 6, + "trivial": 8 + }, + "note": null + }, + { + "model": "seamless_m4t", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "ssm", + "layer_summary": "24\u00d7 Mamba", + "svg": "seamless_m4t.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "seamless_m4t_v2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "ssm", + "layer_summary": "24\u00d7 Mamba", + "svg": "seamless_m4t_v2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "seed_oss", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "64\u00d7 GQA", + "svg": "seed_oss.svg", + "diff_svg": "seed_oss.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 1, + "added": 4, + "deleted": 0, + "new_classes": 2, + "trivial": 7 + }, + "note": null + }, + { + "model": "segformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "segformer.svg", + "diff_svg": "segformer.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit", + "swin" + ], + "diff_totals": { + "overridden": 5, + "added": 52, + "deleted": 0, + "new_classes": 14, + "trivial": 1 + }, + "note": null + }, + { + "model": "seggpt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "seggpt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "sew", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "sew.svg", + "diff_svg": "sew.diff.svg", + "is_modular": true, + "parent_model": "wav2vec2", + "parent_models": [ + "wav2vec2" + ], + "diff_totals": { + "overridden": 0, + "added": 20, + "deleted": 0, + "new_classes": 5, + "trivial": 10 + }, + "note": null + }, + { + "model": "sew_d", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "sew_d.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "shieldgemma2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "22\u00d7 sliding + 4\u00d7 full", + "svg": "shieldgemma2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "siglip", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "siglip.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "siglip2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "siglip2.svg", + "diff_svg": "siglip2.diff.svg", + "is_modular": true, + "parent_model": "siglip", + "parent_models": [ + "siglip" + ], + "diff_totals": { + "overridden": 9, + "added": 6, + "deleted": 0, + "new_classes": 5, + "trivial": 4 + }, + "note": null + }, + { + "model": "slanet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 Attention", + "svg": "slanet.svg", + "diff_svg": "slanet.diff.svg", + "is_modular": true, + "parent_model": "slanext", + "parent_models": [ + "slanext", + "pp_lcnet" + ], + "diff_totals": { + "overridden": 4, + "added": 21, + "deleted": 0, + "new_classes": 6, + "trivial": 2 + }, + "note": null + }, + { + "model": "slanext", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 Attention", + "svg": "slanext.svg", + "diff_svg": "slanext.diff.svg", + "is_modular": true, + "parent_model": "got_ocr2", + "parent_models": [ + "got_ocr2" + ], + "diff_totals": { + "overridden": 0, + "added": 45, + "deleted": 0, + "new_classes": 10, + "trivial": 2 + }, + "note": null + }, + { + "model": "smollm3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "36\u00d7 full", + "svg": "smollm3.svg", + "diff_svg": "smollm3.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "qwen2" + ], + "diff_totals": { + "overridden": 2, + "added": 30, + "deleted": 0, + "new_classes": 1, + "trivial": 8 + }, + "note": null + }, + { + "model": "smolvlm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "smolvlm.svg", + "diff_svg": "smolvlm.diff.svg", + "is_modular": true, + "parent_model": "idefics3", + "parent_models": [ + "idefics3" + ], + "diff_totals": { + "overridden": 6, + "added": 2, + "deleted": 0, + "new_classes": 4, + "trivial": 3 + }, + "note": null + }, + { + "model": "solar_open", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "48\u00d7 GQA +MoE", + "svg": "solar_open.svg", + "diff_svg": "solar_open.diff.svg", + "is_modular": true, + "parent_model": "glm4_moe", + "parent_models": [ + "glm4_moe", + "llama" + ], + "diff_totals": { + "overridden": 3, + "added": 13, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "speech_encoder_decoder", + "mode": "full", + "status": "failed", + "build_status": "failed", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "config instantiation failed: ValueError('A configuration of type speech-encoder-decoder cannot be instantiated because not both `encoder` and `decoder` sub-configurations are passed, but only {}')", + "svg": "speech_encoder_decoder.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "speech_to_text", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "speech_to_text.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "speecht5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "speecht5.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "splinter", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "splinter.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "squeezebert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "squeezebert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "stablelm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "stablelm.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "starcoder2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "30\u00d7 GQA", + "svg": "starcoder2.svg", + "diff_svg": "starcoder2.diff.svg", + "is_modular": true, + "parent_model": "mistral", + "parent_models": [ + "mistral" + ], + "diff_totals": { + "overridden": 5, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "superglue", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "18\u00d7 MHA", + "svg": "superglue.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "superpoint", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "superpoint.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "swiftformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "7\u00d7 Attention", + "svg": "swiftformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "swin", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "swin.svg", + "diff_svg": "swin.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit" + ], + "diff_totals": { + "overridden": 11, + "added": 53, + "deleted": 0, + "new_classes": 15, + "trivial": 0 + }, + "note": null + }, + { + "model": "swin2sr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "swin2sr.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "swinv2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "swinv2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "switch_transformers", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "sparse-moe", + "layer_summary": "12\u00d7 MHA +MoE", + "svg": "switch_transformers.svg", + "diff_svg": "switch_transformers.diff.svg", + "is_modular": true, + "parent_model": "t5", + "parent_models": [ + "t5" + ], + "diff_totals": { + "overridden": 0, + "added": 37, + "deleted": 0, + "new_classes": 10, + "trivial": 5 + }, + "note": null + }, + { + "model": "t5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "t5.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "t5gemma", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "13\u00d7 sliding + 13\u00d7 full", + "svg": "t5gemma.svg", + "diff_svg": "t5gemma.diff.svg", + "is_modular": true, + "parent_model": "gemma2", + "parent_models": [ + "gemma2" + ], + "diff_totals": { + "overridden": 11, + "added": 54, + "deleted": 0, + "new_classes": 13, + "trivial": 2 + }, + "note": null + }, + { + "model": "t5gemma2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "22\u00d7 sliding + 4\u00d7 full", + "svg": "t5gemma2.svg", + "diff_svg": "t5gemma2.diff.svg", + "is_modular": true, + "parent_model": "gemma3", + "parent_models": [ + "gemma3", + "t5gemma" + ], + "diff_totals": { + "overridden": 20, + "added": 69, + "deleted": 0, + "new_classes": 11, + "trivial": 4 + }, + "note": null + }, + { + "model": "table_transformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "table_transformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "tapas", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "tapas.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "textnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "textnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "time_series_transformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "2\u00d7 MHA", + "svg": "time_series_transformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "timesfm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "50\u00d7 MHA", + "svg": "timesfm.svg", + "diff_svg": "timesfm.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama" + ], + "diff_totals": { + "overridden": 0, + "added": 36, + "deleted": 0, + "new_classes": 10, + "trivial": 1 + }, + "note": null + }, + { + "model": "timesfm2_5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "20\u00d7 MHA", + "svg": "timesfm2_5.svg", + "diff_svg": "timesfm2_5.diff.svg", + "is_modular": true, + "parent_model": "timesfm", + "parent_models": [ + "timesfm", + "llama", + "apertus", + "clip" + ], + "diff_totals": { + "overridden": 12, + "added": 29, + "deleted": 0, + "new_classes": 2, + "trivial": 3 + }, + "note": null + }, + { + "model": "timesformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "timesformer.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "timm_backbone", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": null, + "svg": "timm_backbone.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "timm_wrapper", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": null, + "svg": "timm_wrapper.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "trocr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "trocr.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "tvp", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "tvp.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "udop", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "udop.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "umt5", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 MHA", + "svg": "umt5.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "unispeech", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "unispeech.svg", + "diff_svg": "unispeech.diff.svg", + "is_modular": true, + "parent_model": "wav2vec2", + "parent_models": [ + "wav2vec2" + ], + "diff_totals": { + "overridden": 4, + "added": 22, + "deleted": 1, + "new_classes": 3, + "trivial": 7 + }, + "note": null + }, + { + "model": "unispeech_sat", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "unispeech_sat.svg", + "diff_svg": "unispeech_sat.diff.svg", + "is_modular": true, + "parent_model": "wav2vec2", + "parent_models": [ + "wav2vec2" + ], + "diff_totals": { + "overridden": 5, + "added": 23, + "deleted": 1, + "new_classes": 3, + "trivial": 9 + }, + "note": null + }, + { + "model": "univnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "univnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "upernet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 Attention", + "svg": "upernet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "uvdoc", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 Attention", + "svg": "uvdoc.svg", + "diff_svg": "uvdoc.diff.svg", + "is_modular": true, + "parent_model": "pp_lcnet", + "parent_models": [ + "pp_lcnet", + "pp_ocrv5_server_det" + ], + "diff_totals": { + "overridden": 1, + "added": 46, + "deleted": 0, + "new_classes": 12, + "trivial": 0 + }, + "note": null + }, + { + "model": "vaultgemma", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "13\u00d7 sliding + 13\u00d7 full", + "svg": "vaultgemma.svg", + "diff_svg": "vaultgemma.diff.svg", + "is_modular": true, + "parent_model": "gemma2", + "parent_models": [ + "gemma2" + ], + "diff_totals": { + "overridden": 3, + "added": 1, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "vibevoice_acoustic_tokenizer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "8\u00d7 Attention", + "svg": "vibevoice_acoustic_tokenizer.svg", + "diff_svg": "vibevoice_acoustic_tokenizer.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "voxtral_realtime" + ], + "diff_totals": { + "overridden": 0, + "added": 38, + "deleted": 0, + "new_classes": 15, + "trivial": 2 + }, + "note": null + }, + { + "model": "vibevoice_asr", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "vibevoice_asr.svg", + "diff_svg": "vibevoice_asr.diff.svg", + "is_modular": true, + "parent_model": "qwen2", + "parent_models": [ + "qwen2", + "vibevoice_acoustic_tokenizer" + ], + "diff_totals": { + "overridden": 4, + "added": 36, + "deleted": 0, + "new_classes": 6, + "trivial": 1 + }, + "note": null + }, + { + "model": "video_llama_3", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 full", + "svg": "video_llama_3.svg", + "diff_svg": "video_llama_3.diff.svg", + "is_modular": true, + "parent_model": "qwen2_vl", + "parent_models": [ + "qwen2_vl", + "siglip" + ], + "diff_totals": { + "overridden": 18, + "added": 70, + "deleted": 4, + "new_classes": 14, + "trivial": 2 + }, + "note": null + }, + { + "model": "video_llava", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "video_llava.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "videomae", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "videomae.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "videomt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "videomt.svg", + "diff_svg": "videomt.diff.svg", + "is_modular": true, + "parent_model": "eomt", + "parent_models": [ + "eomt" + ], + "diff_totals": { + "overridden": 9, + "added": 7, + "deleted": 1, + "new_classes": 2, + "trivial": 7 + }, + "note": null + }, + { + "model": "vilt", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "vilt.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vipllava", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "vipllava.svg", + "diff_svg": "vipllava.diff.svg", + "is_modular": true, + "parent_model": "llava", + "parent_models": [ + "llava" + ], + "diff_totals": { + "overridden": 4, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 3 + }, + "note": null + }, + { + "model": "vision_encoder_decoder", + "mode": "full", + "status": "failed", + "build_status": "failed", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "config instantiation failed: ValueError('A configuration of type vision-encoder-decoder cannot be instantiated because not both `encoder` and `decoder` sub-configurations are passed, but only {}')", + "svg": "vision_encoder_decoder.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vision_text_dual_encoder", + "mode": "full", + "status": "failed", + "build_status": "failed", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "config instantiation failed: ValueError('A configuration of type vision-text-dual-encoder cannot be instantiated because not both `vision_config` and `text_config` sub-configurations are passed, but only {}')", + "svg": "vision_text_dual_encoder.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "visual_bert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "visual_bert.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "vit.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vit_mae", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "vit_mae.svg", + "diff_svg": "vit_mae.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit" + ], + "diff_totals": { + "overridden": 7, + "added": 24, + "deleted": 0, + "new_classes": 5, + "trivial": 4 + }, + "note": null + }, + { + "model": "vit_msn", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "vit_msn.svg", + "diff_svg": "vit_msn.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit" + ], + "diff_totals": { + "overridden": 5, + "added": 2, + "deleted": 0, + "new_classes": 1, + "trivial": 4 + }, + "note": null + }, + { + "model": "vitdet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "vitdet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vitmatte", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConfig, Owl", + "svg": "vitmatte.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vitpose", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": null, + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig, OmDetTurboConfig, Owlv2C", + "svg": "vitpose.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vitpose_backbone", + "mode": "full", + "status": "built-from-config-only", + "build_status": "config-only", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "build_error": "meta build failed: ValueError(\"Unrecognized configuration class for this kind of AutoModel: AutoModelForZeroShotObjectDetection.\\nModel type should be one of GroundingDinoConfig, MMGroundingDinoConfig", + "svg": "vitpose_backbone.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vits", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "6\u00d7 MHA", + "svg": "vits.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "vivit", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "vivit.svg", + "diff_svg": "vivit.diff.svg", + "is_modular": true, + "parent_model": "vit", + "parent_models": [ + "vit" + ], + "diff_totals": { + "overridden": 10, + "added": 4, + "deleted": 0, + "new_classes": 2, + "trivial": 4 + }, + "note": null + }, + { + "model": "vjepa2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "vjepa2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "voxtral", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "30\u00d7 GQA", + "svg": "voxtral.svg", + "diff_svg": "voxtral.diff.svg", + "is_modular": true, + "parent_model": "qwen2_audio", + "parent_models": [ + "qwen2_audio" + ], + "diff_totals": { + "overridden": 3, + "added": 17, + "deleted": 0, + "new_classes": 4, + "trivial": 2 + }, + "note": null + }, + { + "model": "voxtral_realtime", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "26\u00d7 GQA", + "svg": "voxtral_realtime.svg", + "diff_svg": "voxtral_realtime.diff.svg", + "is_modular": true, + "parent_model": "mistral", + "parent_models": [ + "mistral", + "voxtral", + "llama" + ], + "diff_totals": { + "overridden": 7, + "added": 48, + "deleted": 0, + "new_classes": 13, + "trivial": 4 + }, + "note": null + }, + { + "model": "wav2vec2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "wav2vec2.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "wav2vec2_bert", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "wav2vec2_bert.svg", + "diff_svg": "wav2vec2_bert.diff.svg", + "is_modular": true, + "parent_model": "wav2vec2_conformer", + "parent_models": [ + "wav2vec2_conformer", + "wav2vec2" + ], + "diff_totals": { + "overridden": 15, + "added": 21, + "deleted": 5, + "new_classes": 7, + "trivial": 1 + }, + "note": null + }, + { + "model": "wav2vec2_conformer", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "wav2vec2_conformer.svg", + "diff_svg": "wav2vec2_conformer.diff.svg", + "is_modular": true, + "parent_model": "wav2vec2", + "parent_models": [ + "wav2vec2" + ], + "diff_totals": { + "overridden": 6, + "added": 31, + "deleted": 2, + "new_classes": 8, + "trivial": 7 + }, + "note": null + }, + { + "model": "wavlm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "wavlm.svg", + "diff_svg": "wavlm.diff.svg", + "is_modular": true, + "parent_model": "wav2vec2", + "parent_models": [ + "wav2vec2" + ], + "diff_totals": { + "overridden": 9, + "added": 16, + "deleted": 3, + "new_classes": 6, + "trivial": 8 + }, + "note": null + }, + { + "model": "whisper", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "4\u00d7 MHA", + "svg": "whisper.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "x_clip", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "x_clip.svg", + "diff_svg": "x_clip.diff.svg", + "is_modular": true, + "parent_model": "clip", + "parent_models": [ + "clip", + "altclip", + "beit" + ], + "diff_totals": { + "overridden": 26, + "added": 11, + "deleted": 3, + "new_classes": 3, + "trivial": 1 + }, + "note": null + }, + { + "model": "xcodec", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 Attention", + "svg": "xcodec.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "xglm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "xglm.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "xlm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "xlm.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "xlm_roberta", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "xlm_roberta.svg", + "diff_svg": "xlm_roberta.diff.svg", + "is_modular": true, + "parent_model": "roberta", + "parent_models": [ + "roberta" + ], + "diff_totals": { + "overridden": 15, + "added": 0, + "deleted": 0, + "new_classes": 0, + "trivial": 1 + }, + "note": null + }, + { + "model": "xlm_roberta_xl", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "36\u00d7 MHA", + "svg": "xlm_roberta_xl.svg", + "diff_svg": "xlm_roberta_xl.diff.svg", + "is_modular": true, + "parent_model": "bert", + "parent_models": [ + "bert", + "roberta" + ], + "diff_totals": { + "overridden": 7, + "added": 26, + "deleted": 0, + "new_classes": 10, + "trivial": 4 + }, + "note": null + }, + { + "model": "xlnet", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 MHA", + "svg": "xlnet.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "xlstm", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MHA", + "svg": "xlstm.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "xmod", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "xmod.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "yolos", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "yolos.svg", + "diff_svg": "yolos.diff.svg", + "is_modular": true, + "parent_model": null, + "parent_models": [], + "diff_totals": { + "overridden": 0, + "added": 10, + "deleted": 0, + "new_classes": 2, + "trivial": 0 + }, + "note": null + }, + { + "model": "yoso", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "12\u00d7 MHA", + "svg": "yoso.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "youtu", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "32\u00d7 MLA", + "svg": "youtu.svg", + "diff_svg": "youtu.diff.svg", + "is_modular": true, + "parent_model": "llama", + "parent_models": [ + "llama", + "deepseek_v3", + "qwen3" + ], + "diff_totals": { + "overridden": 0, + "added": 28, + "deleted": 0, + "new_classes": 1, + "trivial": 7 + }, + "note": null + }, + { + "model": "zamba", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "63\u00d7 Mamba + 13\u00d7 MHA", + "svg": "zamba.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + }, + { + "model": "zamba2", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "hybrid", + "layer_summary": "45\u00d7 Mamba + 9\u00d7 MHA", + "svg": "zamba2.svg", + "diff_svg": "zamba2.diff.svg", + "is_modular": true, + "parent_model": "zamba", + "parent_models": [ + "zamba", + "llama" + ], + "diff_totals": { + "overridden": 12, + "added": 20, + "deleted": 0, + "new_classes": 4, + "trivial": 2 + }, + "note": null + }, + { + "model": "zoedepth", + "mode": "full", + "status": "ok", + "build_status": "ok", + "decoder_kind": "dense", + "layer_summary": "24\u00d7 Attention", + "svg": "zoedepth.svg", + "is_modular": false, + "parent_model": null, + "note": "standalone (no modular parent)" + } + ] +} \ No newline at end of file diff --git a/resnet.svg b/resnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..a534a48d647a8c89c9e4da15b3725aa36f1bae45 --- /dev/null +++ b/resnet.svg @@ -0,0 +1,155 @@ + + + + +resnet +⚠ no transformer block (conv backbone) — shown from config · dense · 2× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +basicBatchNorm2d → attentionBatchNorm2d → MLP×1 +bottleneckBatchNorm2d → attentionBatchNorm2d → MLP×1 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +microsoft/resnet-50 +model_type +resnet +config +ResNetConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/rf_detr.diff.svg b/rf_detr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..29b91827f166e78c60748d60261a84433b076045 --- /dev/null +++ b/rf_detr.diff.svg @@ -0,0 +1,224 @@ + + + + +rf_detr +diff vs lw_detr (+dinov2,clip,convnext) · 16 overridden · 66 added · 0 deleted · 8 new · 3 inherited-as-is + +RfDetrModel · base model +13 × RfDetrDinov2LayerRfDetrDinov2Layer× 13 +Self-Attention · LwDetrDinov2Attention ↩ inherited +MLP · LwDetrDinov2MLP ↩ inherited +attention · LwDetrDinov2SelfAttention ↩ inherited +output · LwDetrDinov2SelfOutput ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +query: Linear [384→384]query [384→384] +key: Linear [384→384]key [384→384] +value: Linear [384→384]value [384→384] +dense: Linear [384→384]dense [384→384] +dropout: Dropoutdropout Dropout +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [384→1536]fc1 [384→1536] +activation: GELUActivationactivation GELU +fc2: Linear [1536→384]fc2 [1536→384] +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +Roboflow/rf-detr-base +parent +lw_detr +classes +23 +overridden +16 +added +66 +new classes +8 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +RfDetrConvEncoder +ovr __init__,forward + +RfDetrConvNormLayer +ovr __init__ + +RfDetrDinov2Encoder +ovr __init__ + +RfDetrSegmentationBlock +ovr __init__,forward + +RfDetrSegmentationMLP +ovr __init__ + +RfDetrConfig +add __post_init__,validate_architecture; 13 … + +RfDetrDinov2Backbone +ovr forward; add window_unpartition + +RfDetrDinov2Config +add __post_init__; 2 attr + +RfDetrDinov2Embeddings +ovr forward,interpolate_pos_encoding; add wi… + +RfDetrDinov2Layer +ovr __init__,forward; add window_partition_a… + +RfDetrForInstanceSegmentation +add __init__,forward,get_mask_logits,segment… + +RfDetrForObjectDetection +ovr forward; add predict_class_and_boxes,pre… + +RfDetrImageProcessor +add _preprocess,post_process_instance_segmen… + +RfDetrInstanceSegmentationOutput +14 attr + +RfDetrModel +ovr __init__,forward; add generate_topk_prop… + +RfDetrModelOutput +10 attr + +RfDetrObjectDetectionOutput +1 attr + +RfDetrPreTrainedModel +ovr _init_weights; 1 attr + +RfDetrScaleProjector +add __init__,forward + +RfDetrSegmentationMLPBlock +add __init__,forward + \ No newline at end of file diff --git a/rf_detr.svg b/rf_detr.svg new file mode 100644 index 0000000000000000000000000000000000000000..343e26a4a0d13f6b817519d1e50b1dff237b61c0 --- /dev/null +++ b/rf_detr.svg @@ -0,0 +1,179 @@ + + + + +rf_detr +dense · 13× Attention + +RfDetrModel · base model +13 × RfDetrDinov2LayerRfDetrDinov2Layer× 13 +Self-Attention · RfDetrDinov2Attention +MLP · RfDetrDinov2MLP +attention · RfDetrDinov2SelfAttention +output · RfDetrDinov2SelfOutput + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +query: Linear [384→384]query [384→384] +key: Linear [384→384]key [384→384] +value: Linear [384→384]value [384→384] +dense: Linear [384→384]dense [384→384] +dropout: Dropoutdropout Dropout +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [384→1536]fc1 [384→1536] +activation: GELUActivationactivation GELU +fc2: Linear [1536→384]fc2 [1536→384] +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +Roboflow/rf-detr-base +model_type +rf_detr +config +RfDetrConfig +decoder +dense +layers +13 +hidden +256 +intermediate +1,024 +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/roberta.diff.svg b/roberta.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..672003c5863f346e0c9401c0f46794c4c8ef2942 --- /dev/null +++ b/roberta.diff.svg @@ -0,0 +1,193 @@ + + + + +roberta +diff vs bert · 3 overridden · 33 added · 0 deleted · 9 new · 3 inherited-as-is + +RobertaModel · base model +12 × RobertaLayerRobertaLayer× 12 +RobertaForCausalLM · task head +Self-Attention · BertAttention ↩ inherited +output · BertSelfOutput ↩ inherited +self · BertSelfAttention ↩ inherited + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +RobertaForCausalLMLM HeadLinear [768→50265] · tied +Softmax +logits[1, 6, 50265] + +model id +FacebookAI/roberta-base +parent +bert +classes +14 +overridden +3 +added +33 +new classes +9 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +RobertaModel +ovr __init__ + +RobertaClassificationHead +add __init__,forward + +RobertaEmbeddings +ovr __init__,forward; add create_position_id… + +RobertaForCausalLM +add __init__,forward,get_output_embeddings,s… + +RobertaForMaskedLM +add __init__,forward,get_output_embeddings,s… + +RobertaForMultipleChoice +add __init__,forward + +RobertaForQuestionAnswering +add __init__,forward + +RobertaForSequenceClassification +add __init__,forward + +RobertaForTokenClassification +add __init__,forward + +RobertaLMHead +add __init__,forward + +RobertaPreTrainedModel +add _init_weights; 8 attr + \ No newline at end of file diff --git a/roberta.svg b/roberta.svg new file mode 100644 index 0000000000000000000000000000000000000000..ed27e2527a8101f7779c7317b97c3fc6ac6e35f2 --- /dev/null +++ b/roberta.svg @@ -0,0 +1,175 @@ + + + + +roberta +dense · 12× MHA + +RobertaModel · base model +12 × RobertaLayerRobertaLayer× 12 +RobertaForCausalLM · task head +Self-Attention · RobertaAttention +output · RobertaSelfOutput +self · RobertaSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +RobertaForCausalLMLM HeadLinear [768→50265] · tied +Softmax +logits[1, 6, 50265] + +model id +FacebookAI/roberta-base +model_type +roberta +config +RobertaConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/roberta_prelayernorm.svg b/roberta_prelayernorm.svg new file mode 100644 index 0000000000000000000000000000000000000000..9c16f837c12ccd477de92117d12f6ea03c9af25a --- /dev/null +++ b/roberta_prelayernorm.svg @@ -0,0 +1,154 @@ + + + + +roberta_prelayernorm +⚠ no transformer block (conv backbone) — shown from config · dense · 12× MHA + +input_ids[1, S] +Token Embedding[50265 × 768] +RobertaPreLayerNormLayerRMSNorm → MHARMSNorm → MLP×12 +Final RMSNorm +LM Head→ logits [1, S, 50265] + +model id +andreasmadsen/efficient_mlm_m… +model_type +roberta-prelayernorm +config +RobertaPreLayerNormConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +RMSNorm +positional +n/a +vocab +50,265 +max_pos +512 +tie_embeddings +True +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/roc_bert.svg b/roc_bert.svg new file mode 100644 index 0000000000000000000000000000000000000000..01ca5fd7c3f02eeab746aa922f8b3d25b4aa77cf --- /dev/null +++ b/roc_bert.svg @@ -0,0 +1,175 @@ + + + + +roc_bert +dense · 12× MHA + +RoCBertModel · base model +12 × RoCBertLayerRoCBertLayer× 12 +RoCBertForCausalLM · task head +Self-Attention · RoCBertAttention +output · RoCBertSelfOutput +self · RoCBertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +RoCBertForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +weiweishi/roc-bert-base-zh +model_type +roc_bert +config +RoCBertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/roformer.svg b/roformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..f48a6ce98a1b6aa4ba8128320c306b22e066f04f --- /dev/null +++ b/roformer.svg @@ -0,0 +1,175 @@ + + + + +roformer +dense · 12× MHA + +RoFormerModel · base model +12 × RoFormerLayerRoFormerLayer× 12 +RoFormerForCausalLM · task head +Self-Attention · RoFormerAttention +output · RoFormerSelfOutput +self · RoFormerSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey'hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [50000 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +RoFormerForCausalLMLM HeadLinear [768→50000] · tied +Softmax +logits[1, 6, 50000] + +model id +junnyu/roformer_chinese_base +model_type +roformer +config +RoFormerConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,000 +max_pos +1,536 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/rt_detr.diff.svg b/rt_detr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..4774587b05f33edb00d7867e9cd3bf953ea28774 --- /dev/null +++ b/rt_detr.diff.svg @@ -0,0 +1,225 @@ + + + + +rt_detr +diff vs detr (+deformable_detr) · 0 overridden · 137 added · 0 deleted · 20 new · 4 inherited-as-is + +RTDetrModel · base model +6 × RTDetrDecoderLayerRTDetrDecoderLayer× 6 +layers (idx) +Self-Attention · DetrMultiscaleDeformableAttention (3 layer types — same modules, mask differs) ↩ inherited +MLP · RTDetrMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +bottleneck attention mask (q↓ × k→)bottleneck mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +PekingU/rtdetr_r50vd +parent +detr +classes +24 +overridden +0 +added +137 +new classes +20 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +RTDetrAIFILayer +add __init__,forward + +RTDetrCSPRepLayer +add __init__,forward + +RTDetrConvEncoder +add __init__,forward + +RTDetrConvNormLayer +add __init__,forward + +RTDetrDecoder +add __init__,forward; 1 attr + +RTDetrDecoderLayer +add __init__,forward + +RTDetrDecoderOutput +9 attr + +RTDetrEncoderLayer +add __init__,forward + +RTDetrForObjectDetection +add __init__,_set_aux_loss,forward; 1 attr + +RTDetrHybridEncoder +add __init__,forward; 1 attr + +RTDetrImageProcessor +add __init__,_preprocess,post_process_instan… + +RTDetrImageProcessorKwargs +2 attr + +RTDetrImageProcessorPil +add __init__,_preprocess,post_process_instan… + +RTDetrMLP +add __init__,forward + +RTDetrModel +add __init__,_cached_generate_anchors,forwar… + +RTDetrModelOutput +18 attr + +RTDetrObjectDetectionOutput +23 attr + +RTDetrPreTrainedModel +add _init_weights; 9 attr + +RTDetrRepVggBlock +add __init__,forward + +RTDetrSinePositionEmbedding +add __init__,_cached_build_2d_sinusoidal_pos… + \ No newline at end of file diff --git a/rt_detr.svg b/rt_detr.svg new file mode 100644 index 0000000000000000000000000000000000000000..9fc6c42a4c25a733b506ffd41fc82fc8d53cc8bf --- /dev/null +++ b/rt_detr.svg @@ -0,0 +1,184 @@ + + + + +rt_detr +dense · 2× MHA + +RTDetrModel · base model +6 × RTDetrDecoderLayerRTDetrDecoderLayer× 6 +layers (idx) +Self-Attention · RTDetrMultiscaleDeformableAttention (3 layer types — same modules, mask differs) +MLP · RTDetrMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +bottleneck attention mask (q↓ × k→)bottleneck mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +PekingU/rtdetr_r50vd +model_type +rt_detr +config +RTDetrConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +basic + +bottleneck + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/rt_detr_v2.diff.svg b/rt_detr_v2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..5251016380a557ad89d361c5de7614b8045472ae --- /dev/null +++ b/rt_detr_v2.diff.svg @@ -0,0 +1,186 @@ + + + + +rt_detr_v2 +diff vs rt_detr · 5 overridden · 63 added · 0 deleted · 2 new · 1 inherited-as-is + +RTDetrV2Model · base model +6 × RTDetrV2DecoderLayerRTDetrV2DecoderLayer× 6 +layers (idx) +Self-Attention · RTDetrV2MultiscaleDeformableAttention (3 layer types — same modules, mask differs) +MLP · RTDetrMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +bottleneck attention mask (q↓ × k→)bottleneck mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +PekingU/rtdetr_r18vd +parent +rt_detr +classes +8 +overridden +5 +added +63 +new classes +2 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +RTDetrV2Decoder +ovr __init__ + +RTDetrV2DecoderLayer +ovr __init__ + +RTDetrV2Model +ovr __init__ + +RTDetrV2PreTrainedModel +ovr _init_weights + +RTDetrV2Config +add __post_init__; 59 attr + +RTDetrV2ForObjectDetection +ovr __init__; 1 attr + +RTDetrV2MultiscaleDeformableAttention +add __init__,forward + \ No newline at end of file diff --git a/rt_detr_v2.svg b/rt_detr_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..bc0b6cd0b5479bd82b19486326be9dfd6112edec --- /dev/null +++ b/rt_detr_v2.svg @@ -0,0 +1,184 @@ + + + + +rt_detr_v2 +dense · 2× MHA + +RTDetrV2Model · base model +6 × RTDetrV2DecoderLayerRTDetrV2DecoderLayer× 6 +layers (idx) +Self-Attention · RTDetrV2MultiscaleDeformableAttention (3 layer types — same modules, mask differs) +MLP · RTDetrV2MLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +basic attention mask (q↓ × k→)basic mask +bottleneck attention mask (q↓ × k→)bottleneck mask +residual add+ +LayerNormpre-FFN [1, 6, 256] +fc1: Linear [256→1024]fc1 [256→1024] +fc2: Linear [1024→256]fc2 [1024→256] +activation_fn: ReLUactivation_fn ReLU +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] · tied +Softmax +logits[1, 6, ?] +layer 0: basic0 +layer 1: bottleneck1 + +model id +PekingU/rtdetr_r18vd +model_type +rt_detr_v2 +config +RTDetrV2Config +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +True +legend + +self-attention + +basic + +bottleneck + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/rwkv.svg b/rwkv.svg new file mode 100644 index 0000000000000000000000000000000000000000..41d346432c6bab932161a844653fb4b207609f89 --- /dev/null +++ b/rwkv.svg @@ -0,0 +1,179 @@ + + + + +rwkv +other · 32× linear-attn + +RwkvModel · base model +32 × RwkvBlockRwkvBlock× 32 +RwkvForCausalLM · task head +Self-Attention · RwkvSelfAttention +MLP · RwkvFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50277 × 4096] → [1, 6, 4096] +LayerNormpre-attention [1, 6, 4096] +time_shift: ZeroPad2dtime_shift ZeroPad2d +key: Linear [4096→4096]key [4096→4096] +value: Linear [4096→4096]value [4096→4096] +receptance: Linear [4096→4096]receptance [4096→4096] +output: Linear [4096→4096]output [4096→4096] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 4096] +time_shift: ZeroPad2dtime_shift ZeroPad2d +key: Linear [4096→16384]key [4096→16384] +receptance: Linear [4096→4096]receptance [4096→4096] +value: Linear [16384→4096]value [16384→4096] +residual add+ +Final LayerNorm[1, 6, 4096] +RwkvForCausalLMLM HeadLinear [4096→50277] +Softmax +logits[1, 6, 50277] + +model id +RWKV/rwkv-4-169m-pile +model_type +rwkv +config +RwkvConfig +decoder +other +layers +32 +hidden +4,096 +intermediate +16,384 +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +50,277 +max_pos +1,024 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/sam.svg b/sam.svg new file mode 100644 index 0000000000000000000000000000000000000000..234d31579e31da9bd866d2cab04c37e38c13407d --- /dev/null +++ b/sam.svg @@ -0,0 +1,209 @@ + + + + +sam +multimodal · vision+vision → projector → LLM · dense + +SamModel · base model +4 × SamVisionLayerSamVisionLayer× 4 +image ⊕ text attention +Self-Attention · SamVisionSdpaAttention +Vision encoder · SamVisionEnco…×12 +SamVisionLayer×12 +MLP · SamMLPBlock +mlp · SamMLPBlock +attn · SamVisionSdpaAttention + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] · tied +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · SamPositionalEmbedd…SamPositionalEmbedding · via AutoModelsam_vision_model · 12 layers · h=768×12 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam-vit-huge +inputs +input_ids, pixel_values +built via +AutoModel +model_type +sam +config +SamConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/sam2.diff.svg b/sam2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..560fe36c998ef4d5de8f3a77904617319fbab8e6 --- /dev/null +++ b/sam2.diff.svg @@ -0,0 +1,245 @@ + + + + +sam2 +diff vs sam (+detr) · 11 overridden · 75 added · 0 deleted · 15 new · 4 inherited-as-is + +Sam2Model · base model +4 × Sam2MultiScaleBlockSam2MultiScaleBlock× 4 +image ⊕ text attention +Vision encoder · Sam2VisionModel +Self-Attention · Sam2MultiScaleAttention +Sam2MultiScaleBlock×12 +mlp · Sam2FeedForward +MLP · Sam2FeedForward +attn · Sam2MultiScaleAttention + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +qkv: Linear [96→288]qkv [96→288] +proj: Linear [96→96]proj [96→96] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +activation: GELUActivationactivation GELU +proj_in: Linear [96→384]proj_in [96→384] +proj_out: Linear [384→96]proj_out [384→96] +layers: ModuleListlayers ModuleList +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Sam2PositionalEmbed…Sam2PositionalEmbedding · via AutoModelsam2_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 96layer_norm1 LayerNorm 96 +qkv: Linear [96→288]qkv [96→288] +proj: Linear [96→96]proj [96→96] +layer_norm2: LayerNorm 96layer_norm2 LayerNorm 96 +activation: GELUActivationactivation GELU +proj_in: Linear [96→384]proj_in [96→384] +proj_out: Linear [384→96]proj_out [384→96] +layers: ModuleListlayers ModuleList +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam2.1-hiera-tiny +parent +sam +classes +23 +overridden +11 +added +75 +new classes +15 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Sam2PromptEncoder +ovr __init__,_embed_boxes,_embed_points + +Sam2TwoWayAttentionBlock +ovr __init__ + +Sam2Attention +add __init__,forward + +Sam2FeedForward +add __init__,forward + +Sam2HieraDetModel +add __init__,_get_pos_embed,forward,get_inpu… + +Sam2HieraDetModelOutput +4 attr + +Sam2ImageProcessor +add __init__,_apply_non_overlapping_constrai… + +Sam2ImageProcessorKwargs +1 attr + +Sam2ImageSegmentationOutput +7 attr + +Sam2MaskDecoder +ovr __init__,forward; add _dynamic_multimask… + +Sam2Model +ovr __init__,forward,get_image_embeddings,ge… + +Sam2MultiScaleAttention +add __init__,forward + +Sam2MultiScaleBlock +add __init__,forward + +Sam2PatchEmbeddings +add __init__,forward + +Sam2PositionalEmbedding +add __init__,forward + +Sam2PreTrainedModel +add _init_weights; 8 attr + +Sam2VisionEncoderOutput +2 attr + +Sam2VisionModel +add __init__,forward,get_input_embeddings; 3… + +Sam2VisionNeck +add __init__,forward + \ No newline at end of file diff --git a/sam2.svg b/sam2.svg new file mode 100644 index 0000000000000000000000000000000000000000..0097f307e26226be041d98b643cea94730634924 --- /dev/null +++ b/sam2.svg @@ -0,0 +1,211 @@ + + + + +sam2 +multimodal · vision+vision → projector → LLM · dense + +Sam2Model · base model +4 × Sam2MultiScaleBlockSam2MultiScaleBlock× 4 +image ⊕ text attention +Vision encoder · Sam2VisionModel +Self-Attention · Sam2MultiScaleAttention +Sam2MultiScaleBlock×12 +mlp · Sam2FeedForward +MLP · Sam2FeedForward +attn · Sam2MultiScaleAttention + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +qkv: Linear [96→288]qkv [96→288] +proj: Linear [96→96]proj [96→96] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +activation: GELUActivationactivation GELU +proj_in: Linear [96→384]proj_in [96→384] +proj_out: Linear [384→96]proj_out [384→96] +layers: ModuleListlayers ModuleList +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Sam2PositionalEmbed…Sam2PositionalEmbedding · via AutoModelsam2_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 96layer_norm1 LayerNorm 96 +qkv: Linear [96→288]qkv [96→288] +proj: Linear [96→96]proj [96→96] +layer_norm2: LayerNorm 96layer_norm2 LayerNorm 96 +activation: GELUActivationactivation GELU +proj_in: Linear [96→384]proj_in [96→384] +proj_out: Linear [384→96]proj_out [384→96] +layers: ModuleListlayers ModuleList +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam2.1-hiera-tiny +inputs +input_ids, pixel_values +built via +AutoModel +model_type +sam2 +config +Sam2Config +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/sam2_video.diff.svg b/sam2_video.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..fe121c5b4d4fd689b418a137a072aade9defdfe9 --- /dev/null +++ b/sam2_video.diff.svg @@ -0,0 +1,298 @@ + + + + +sam2_video +diff vs sam2 · 5 overridden · 116 added · 0 deleted · 17 new · 5 inherited-as-is + +Sam2VideoModel · base model +4 × Sam2VideoModelSam2VideoModel× 4 +image ⊕ text attention +Self-Attention · Sam2VideoMemoryAttention +layers · ModuleList +0 · Sam2VideoMemoryAttentionLayer +1 · Sam2VideoMemoryAttentionLayer +2 · Sam2VideoMemoryAttentionLayer +3 · Sam2VideoMemoryAttentionLayer +Vision encoder · Sam2VisionModel +Sam2MultiScaleBlock×12 +MLP · Sam2FeedForward ↩ inherited +mlp · Sam2FeedForward +attn · Sam2MultiScaleAttention + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +Normpre-attention [1, 6, ?] +self_attn: Sam2VideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam2VideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam2VideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam2VideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam2VideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam2VideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam2VideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam2VideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +rotary_emb: Sam2VideoVisionRotaryEmbeddingrotary_emb VisionRotaryEmbedding +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Normpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Sam2VideoPositionalE…Sam2VideoPositionalEmbedding · via AutoM…sam2_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 96layer_norm1 LayerNorm 96 +qkv: Linear [96→288]qkv [96→288] +proj: Linear [96→96]proj [96→96] +layer_norm2: LayerNorm 96layer_norm2 LayerNorm 96 +activation: GELUActivationactivation GELU +proj_in: Linear [96→384]proj_in [96→384] +proj_out: Linear [384→96]proj_out [384→96] +layers: ModuleListlayers ModuleList +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam2_video.1-hiera-ti +parent +sam2 +classes +24 +overridden +5 +added +116 +new classes +17 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Sam2VideoConfig +add __post_init__; 43 attr + +Sam2VideoImageSegmentationOutput +2 attr + +Sam2VideoInferenceCache +add __init__,cache_vision_features,clear_all… + +Sam2VideoInferenceSession +add __init__,add_mask_inputs,add_new_frame,a… + +Sam2VideoMaskDecoderConfig +rename only + +Sam2VideoMaskDownSampler +add __init__,forward + +Sam2VideoMaskDownSamplerLayer +add __init__,forward + +Sam2VideoMemoryAttention +add __init__,forward + +Sam2VideoMemoryAttentionLayer +add __init__,forward + +Sam2VideoMemoryEncoder +add __init__,forward + +Sam2VideoMemoryFuser +add __init__,forward + +Sam2VideoMemoryFuserCXBlock +add __init__,forward + +Sam2VideoModel +ovr __init__,forward,get_prompt_embeddings; … + +Sam2VideoPreTrainedModel +add _init_weights; 7 attr + +Sam2VideoProcessor +add __init__,add_inputs_to_inference_session… + +Sam2VideoPromptEncoderConfig +rename only + +Sam2VideoRoPEAttention +add __init__,forward + +Sam2VideoSegmentationOutput +4 attr + +Sam2VideoVisionRotaryEmbedding +add __init__,create_inv_freq,forward + \ No newline at end of file diff --git a/sam2_video.svg b/sam2_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..1a1cdd9d866133172173019d9122114f87eac9da --- /dev/null +++ b/sam2_video.svg @@ -0,0 +1,264 @@ + + + + +sam2_video +multimodal · vision+vision → projector → LLM · dense + +Sam2VideoModel · base model +4 × Sam2VideoModelSam2VideoModel× 4 +image ⊕ text attention +Self-Attention · Sam2VideoMemoryAttention +layers · ModuleList +0 · Sam2VideoMemoryAttentionLayer +1 · Sam2VideoMemoryAttentionLayer +2 · Sam2VideoMemoryAttentionLayer +3 · Sam2VideoMemoryAttentionLayer +Vision encoder · Sam2VisionModel +Sam2MultiScaleBlock×12 +MLP · Sam2VideoFeedForward +mlp · Sam2FeedForward +attn · Sam2MultiScaleAttention + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +Normpre-attention [1, 6, ?] +self_attn: Sam2VideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam2VideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam2VideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam2VideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam2VideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam2VideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam2VideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam2VideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +rotary_emb: Sam2VideoVisionRotaryEmbeddingrotary_emb VisionRotaryEmbedding +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Normpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Sam2VideoPositionalE…Sam2VideoPositionalEmbedding · via AutoM…sam2_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 96layer_norm1 LayerNorm 96 +qkv: Linear [96→288]qkv [96→288] +proj: Linear [96→96]proj [96→96] +layer_norm2: LayerNorm 96layer_norm2 LayerNorm 96 +activation: GELUActivationactivation GELU +proj_in: Linear [96→384]proj_in [96→384] +proj_out: Linear [384→96]proj_out [384→96] +layers: ModuleListlayers ModuleList +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam2_video.1-hiera-t… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +sam2_video +config +Sam2VideoConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/sam3.diff.svg b/sam3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e699bd1a9c934c891b9db596b6f564c93d2ff760 --- /dev/null +++ b/sam3.diff.svg @@ -0,0 +1,207 @@ + + + + +sam3 +diff vs None · 0 overridden · 7 added · 0 deleted · 1 new · 0 inherited-as-is + +Sam3Model · base model +24 × Sam3DetrDecoderLayerSam3DetrDecoderLayer× 24 +image ⊕ text attention +Vision encoder · CLIPTextModelWithPr… +Self-Attention · Sam3Attention +Vision encoder · Sam3VisionModel +CLIPEncoderLayer×24 +Sam3ViTLayer×32 +mlp · Sam3MLP +self_attn · CLIPAttention +MLP · Sam3MLP +mlp · CLIPMLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +q_proj: Linear [256→256]q_proj [256→256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +activation_fn: ReLUactivation_fn ReLU +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +rotary_emb: Sam3ViTRotaryEmbeddingrotary_emb ViTRotaryEmbedding +attention: Sam3ViTRoPEAttentionattention ViTRoPEAttention +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +dropout: Dropoutdropout Dropout +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +facebook/sam3 +parent +— +classes +1 +overridden +0 +added +7 +new classes +1 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Sam3ImageProcessor +add post_process_instance_segmentation,post_… + \ No newline at end of file diff --git a/sam3.svg b/sam3.svg new file mode 100644 index 0000000000000000000000000000000000000000..bfb83535e9393aadd8baa6eefdf8f7459f783bf7 --- /dev/null +++ b/sam3.svg @@ -0,0 +1,227 @@ + + + + +sam3 +multimodal · vision+vision → projector → LLM · dense + +Sam3Model · base model +24 × Sam3DetrDecoderLayerSam3DetrDecoderLayer× 24 +image ⊕ text attention +Vision encoder · CLIPTextModelWithPr… +Self-Attention · Sam3Attention +Vision encoder · Sam3VisionModel +CLIPEncoderLayer×24 +Sam3ViTLayer×32 +mlp · Sam3MLP +self_attn · CLIPAttention +MLP · Sam3MLP +mlp · CLIPMLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +q_proj: Linear [256→256]q_proj [256→256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +activation_fn: ReLUactivation_fn ReLU +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +rotary_emb: Sam3ViTRotaryEmbeddingrotary_emb ViTRotaryEmbedding +attention: Sam3ViTRoPEAttentionattention ViTRoPEAttention +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +dropout: Dropoutdropout Dropout +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +facebook/sam3 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +sam3 +config +Sam3Config +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +49,408 +max_pos +32 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/sam3_lite_text.diff.svg b/sam3_lite_text.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..02e19ec88fd7a692c25c45ac2fbb87df6c204331 --- /dev/null +++ b/sam3_lite_text.diff.svg @@ -0,0 +1,243 @@ + + + + +sam3_lite_text +diff vs siglip (+sam3) · 6 overridden · 47 added · 0 deleted · 15 new · 2 inherited-as-is + +Sam3LiteTextModel · base model +12 × Sam3LiteTextDetrDecoderLayerSam3LiteTextDetrDecoderLayer× 12 +image ⊕ text attention +Self-Attention · SiglipAttention ↩ inherited +Vision encoder · Sam3VisionModel +Sam3ViTLayer×32 +mlp · Sam3MLP +MLP · SiglipMLP ↩ inherited + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +q_proj: Linear [256→256]q_proj [256→256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: ReLUactivation_fn ReLU +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +rotary_emb: Sam3ViTRotaryEmbeddingrotary_embSam3ViTRotaryEmbedding +attention: Sam3ViTRoPEAttentionattention Sam3ViTRoPEAttention +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +dropout: Dropoutdropout Dropout +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +yonigozlan/sam3-litetext-s0 +parent +siglip +classes +21 +overridden +6 +added +47 +new classes +15 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Sam3LiteTextConvMLP +ovr __init__ + +Sam3LiteTextTextEncoderLayer +ovr __init__ + +Sam3LiteTextConfig +add __post_init__,image_size; 9 attr + +Sam3LiteTextConvolutionalFeedForward +add __init__,forward + +Sam3LiteTextDETRDecoderConfig +rename only + +Sam3LiteTextDETREncoderConfig +rename only + +Sam3LiteTextGeometryEncoderConfig +rename only + +Sam3LiteTextLayerScaledResidual +add __init__,layer_scale_residual + +Sam3LiteTextMaskDecoderConfig +rename only + +Sam3LiteTextMobileOneBlock +add __init__,forward + +Sam3LiteTextModel +ovr __init__; 2 attr + +Sam3LiteTextPreTrainedModel +ovr _init_weights; 3 attr + +Sam3LiteTextRepMixer +add __init__,forward + +Sam3LiteTextRepMixerBlock +add __init__,forward + +Sam3LiteTextTextConfig +14 attr + +Sam3LiteTextTextEmbeddings +add __init__,forward + +Sam3LiteTextTextEncoderOutput +rename only + +Sam3LiteTextTextModel +add __init__,forward; 3 attr + +Sam3LiteTextTextPositionEmbedding +add __init__,forward + \ No newline at end of file diff --git a/sam3_lite_text.svg b/sam3_lite_text.svg new file mode 100644 index 0000000000000000000000000000000000000000..6620b95783ee9cc4ec0c482931e7a28cdb8f3866 --- /dev/null +++ b/sam3_lite_text.svg @@ -0,0 +1,209 @@ + + + + +sam3_lite_text +multimodal · vision → projector → LLM · dense + +Sam3LiteTextModel · base model +12 × Sam3LiteTextDetrDecoderLayerSam3LiteTextDetrDecoderLayer× 12 +image ⊕ text attention +Self-Attention · Sam3LiteTextAttention +Vision encoder · Sam3VisionModel +Sam3ViTLayer×32 +mlp · Sam3MLP +MLP · Sam3LiteTextMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +q_proj: Linear [256→256]q_proj [256→256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +o_proj: Linear [256→256]o_proj [256→256] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: ReLUactivation_fn ReLU +fc1: Linear [256→2048]fc1 [256→2048] +fc2: Linear [2048→256]fc2 [2048→256] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +rotary_emb: Sam3ViTRotaryEmbeddingrotary_embSam3ViTRotaryEmbedding +attention: Sam3ViTRoPEAttentionattention Sam3ViTRoPEAttention +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +dropout: Dropoutdropout Dropout +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +yonigozlan/sam3-litetext-s0 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +sam3_lite_text +config +Sam3LiteTextConfig +decoder +dense +layers +12 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +49,408 +max_pos +77 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/sam3_tracker.diff.svg b/sam3_tracker.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7af6d45bf0965b9e1077e6b44eacf60ff1e517d --- /dev/null +++ b/sam3_tracker.diff.svg @@ -0,0 +1,210 @@ + + + + +sam3_tracker +diff vs sam2 · 2 overridden · 6 added · 0 deleted · 4 new · 10 inherited-as-is + +Sam3TrackerModel · base model +4 × Sam3ViTLayerSam3ViTLayer× 4 +image ⊕ text attention +Self-Attention · Sam3ViTRoPEAttention +Vision encoder · Sam3VisionModel +Sam3ViTLayer×32 +mlp · Sam3MLP +MLP · Sam3MLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Sam3TrackerPosition…Sam3TrackerPositionalEmbedding · via Aut…sam3_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +rotary_emb: Sam3ViTRotaryEmbeddingrotary_embSam3ViTRotaryEmbedding +attention: Sam3ViTRoPEAttentionattention Sam3ViTRoPEAttention +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +dropout: Dropoutdropout Dropout +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam3 +parent +sam2 +classes +16 +overridden +2 +added +6 +new classes +4 +inherited as-is +10 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Sam3TrackerPreTrainedModel +ovr _init_weights + +Sam3TrackerConfig +add __post_init__ + +Sam3TrackerMaskDecoderConfig +rename only + +Sam3TrackerModel +ovr __init__; 2 attr + +Sam3TrackerProcessor +rename only + +Sam3TrackerPromptEncoderConfig +3 attr + \ No newline at end of file diff --git a/sam3_tracker.svg b/sam3_tracker.svg new file mode 100644 index 0000000000000000000000000000000000000000..45ffa8a4491396c235d49481b6e791530cbe3c24 --- /dev/null +++ b/sam3_tracker.svg @@ -0,0 +1,215 @@ + + + + +sam3_tracker +multimodal · vision+vision → projector → LLM · dense + +Sam3TrackerModel · base model +4 × Sam3ViTLayerSam3ViTLayer× 4 +image ⊕ text attention +Self-Attention · Sam3ViTRoPEAttention +Vision encoder · Sam3VisionModel +Sam3ViTLayer×32 +mlp · Sam3MLP +MLP · Sam3MLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Sam3TrackerPosition…Sam3TrackerPositionalEmbedding · via Aut…sam3_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +rotary_emb: Sam3ViTRotaryEmbeddingrotary_embSam3ViTRotaryEmbedding +attention: Sam3ViTRoPEAttentionattention Sam3ViTRoPEAttention +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +dropout: Dropoutdropout Dropout +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam3 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +sam3_tracker +config +Sam3TrackerConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/sam3_tracker_video.diff.svg b/sam3_tracker_video.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..a8f0962decf87c4292284590e0916179d2aa68f9 --- /dev/null +++ b/sam3_tracker_video.diff.svg @@ -0,0 +1,259 @@ + + + + +sam3_tracker_video +diff vs sam2_video · 4 overridden · 47 added · 0 deleted · 4 new · 24 inherited-as-is + +Sam3TrackerVideoModel · base model +4 × Sam3TrackerVideoModelSam3TrackerVideoModel× 4 +image ⊕ text attention +Self-Attention · Sam2VideoMemoryAttention ↩ inheri… +layers · ModuleList +0 · Sam2VideoMemoryAttentionLayer ↩ inheri… +1 · Sam2VideoMemoryAttentionLayer ↩ inheri… +2 · Sam2VideoMemoryAttentionLayer ↩ inheri… +3 · Sam2VideoMemoryAttentionLayer ↩ inheri… +Vision encoder · Sam3VisionModel +Sam3ViTLayer×32 +MLP · Sam2VideoFeedForward ↩ inherited +mlp · Sam3MLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +Normpre-attention [1, 6, ?] +self_attn: Sam3TrackerVideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam3TrackerVideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam3TrackerVideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam3TrackerVideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam3TrackerVideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam3TrackerVideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam3TrackerVideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam3TrackerVideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +rotary_emb: Sam3TrackerVideoVisionRotaryEmbeddingrotary_emb VisionRotaryEmbedding +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Normpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Sam3TrackerVideoPo…Sam3TrackerVideoPositionalEmbedding · vi…sam3_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +rotary_emb: Sam3ViTRotaryEmbeddingrotary_embSam3ViTRotaryEmbedding +attention: Sam3ViTRoPEAttentionattention Sam3ViTRoPEAttention +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +dropout: Dropoutdropout Dropout +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam3 +parent +sam2_video +classes +30 +overridden +4 +added +47 +new classes +4 +inherited as-is +24 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Sam3TrackerVideoModel +ovr __init__,get_image_features; 1 attr + +Sam3TrackerVideoPreTrainedModel +1 attr + +Sam3TrackerVideoConfig +add __post_init__,image_size; 42 attr + +Sam3TrackerVideoMaskDecoderConfig +rename only + +Sam3TrackerVideoProcessor +rename only + +Sam3TrackerVideoPromptEncoderConfig +3 attr + \ No newline at end of file diff --git a/sam3_tracker_video.svg b/sam3_tracker_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..1e1e48f7d51c36d3a3356da888c75aa91fdeb2c7 --- /dev/null +++ b/sam3_tracker_video.svg @@ -0,0 +1,264 @@ + + + + +sam3_tracker_video +multimodal · vision+vision → projector → LLM · dense + +Sam3TrackerVideoModel · base model +4 × Sam3TrackerVideoModelSam3TrackerVideoModel× 4 +image ⊕ text attention +Self-Attention · Sam3TrackerVideoMemoryAttention +layers · ModuleList +0 · Sam3TrackerVideoMemoryAttentionLayer +1 · Sam3TrackerVideoMemoryAttentionLayer +2 · Sam3TrackerVideoMemoryAttentionLayer +3 · Sam3TrackerVideoMemoryAttentionLayer +Vision encoder · Sam3VisionModel +Sam3ViTLayer×32 +MLP · Sam3TrackerVideoFeedForward +mlp · Sam3MLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +Normpre-attention [1, 6, ?] +self_attn: Sam3TrackerVideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam3TrackerVideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam3TrackerVideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam3TrackerVideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam3TrackerVideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam3TrackerVideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +self_attn: Sam3TrackerVideoRoPEAttentionself_attn RoPEAttention +cross_attn_image: Sam3TrackerVideoRoPEAttentioncross_attn_image RoPEAttention +linear1: Linear [256→2048]linear1 [256→2048] +dropout: Dropoutdropout Dropout +linear2: Linear [2048→256]linear2 [2048→256] +layer_norm1: LayerNorm 256layer_norm1 LayerNorm 256 +layer_norm2: LayerNorm 256layer_norm2 LayerNorm 256 +layer_norm3: LayerNorm 256layer_norm3 LayerNorm 256 +dropout1: Dropoutdropout1 Dropout +dropout2: Dropoutdropout2 Dropout +dropout3: Dropoutdropout3 Dropout +activation: ReLUactivation ReLU +layer_norm: LayerNorm 256layer_norm LayerNorm 256 +rotary_emb: Sam3TrackerVideoVisionRotaryEmbeddingrotary_emb VisionRotaryEmbedding +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +Normpre-FFN [1, 6, ?] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · Sam3TrackerVideoPo…Sam3TrackerVideoPositionalEmbedding · vi…sam3_vision_model · ? layers · h=? +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +rotary_emb: Sam3ViTRotaryEmbeddingrotary_embSam3ViTRotaryEmbedding +attention: Sam3ViTRoPEAttentionattention Sam3ViTRoPEAttention +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +dropout: Dropoutdropout Dropout +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +facebook/sam3 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +sam3_tracker_video +config +Sam3TrackerVideoConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/sam3_video.svg b/sam3_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..0d32aac9e54a34e0f8dd0aabff2deda71001c38b --- /dev/null +++ b/sam3_video.svg @@ -0,0 +1,179 @@ + + + + +sam3_video +dense · 32× Attention + +Sam3VideoModel · base model +32 × Sam3ViTLayerSam3ViTLayer× 32 +Self-Attention · Sam3ViTRoPEAttention +MLP · Sam3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, ?] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4736]fc1 [1024→4736] +fc2: Linear [4736→1024]fc2 [4736→1024] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +facebook/sam3 +model_type +sam3_video +config +Sam3VideoConfig +decoder +dense +layers +32 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/sam_hq.diff.svg b/sam_hq.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..f2f702f7cdf5f5baeb7dd25fb46137fd0338b31f --- /dev/null +++ b/sam_hq.diff.svg @@ -0,0 +1,213 @@ + + + + +sam_hq +diff vs sam · 5 overridden · 7 added · 0 deleted · 6 new · 8 inherited-as-is + +SamHQModel · base model +4 × SamHQVisionLayerSamHQVisionLayer× 4 +image ⊕ text attention +Self-Attention · SamVisionSdpaAttention ↩ inherited +Vision encoder · SamHQVisionE…×12 +SamVisionLayer ↩ inherited×12 +MLP · SamMLPBlock ↩ inherited +mlp · SamMLPBlock ↩ inherited +attn · SamVisionSdpaAttention ↩… + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] · tied +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · SamHQPositionalEmbe…SamHQPositionalEmbedding · via AutoModelsam_hq_vision_model · 12 layers · h=768×12 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +syscv-community/sam-hq-vit-bas +parent +sam +classes +17 +overridden +5 +added +7 +new classes +6 +inherited as-is +8 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SamHQModel +ovr __init__,forward,get_image_embeddings + +SamHQVisionEncoder +ovr forward; 1 attr + +SamHQConfig +rename only + +SamHQMMaskDecoderOutputs +3 attr + +SamHQMaskDecoder +add __init__,forward + +SamHQMaskDecoderConfig +1 attr + +SamHQPromptEncoderConfig +rename only + +SamHQVisionConfig +rename only + +SamHQVisionEncoderOutput +1 attr + \ No newline at end of file diff --git a/sam_hq.svg b/sam_hq.svg new file mode 100644 index 0000000000000000000000000000000000000000..5b0fcf8ac64e321313ebe333e2eec39fc6a403e5 --- /dev/null +++ b/sam_hq.svg @@ -0,0 +1,209 @@ + + + + +sam_hq +multimodal · vision+vision → projector → LLM · dense + +SamHQModel · base model +4 × SamHQVisionLayerSamHQVisionLayer× 4 +image ⊕ text attention +Self-Attention · SamHQVisionSdpaAttention +Vision encoder · SamHQVisionE…×12 +SamHQVisionLayer×12 +MLP · SamHQMLPBlock +mlp · SamHQMLPBlock +attn · SamHQVisionSdpaAttention + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] · tied +Softmax +logits[1, 6, ?] +example image +pixel_values[1, 3, 336, 336] +Vision encoder · SamHQPositionalEmbe…SamHQPositionalEmbedding · via AutoModelsam_hq_vision_model · 12 layers · h=768×12 +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +syscv-community/sam-hq-vit-ba… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +sam_hq +config +SamHQConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +True +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/seamless_m4t.svg b/seamless_m4t.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7191bc0536483d7085216d6214fb144cdbe1827 --- /dev/null +++ b/seamless_m4t.svg @@ -0,0 +1,178 @@ + + + + +seamless_m4t +ssm · 24× Mamba + +SeamlessM4TModel · base model +24 × SeamlessM4TEncoderLayerSeamlessM4TEncoderLayer× 24 +SeamlessM4TForTextToText · task head +Self-Attention · SeamlessM4TAttention +MLP · SeamlessM4TFeedForwardNetwork + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256102 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +fc1: Linear [1024→8192]fc1 [1024→8192] +fc2: Linear [8192→1024]fc2 [8192→1024] +dropout: Dropoutdropout Dropout +act: ReLUact ReLU +residual add+ +Final LayerNorm[1, 6, 1024] +SeamlessM4TForTextToTextLM HeadLinear [1024→256102] · tied +Softmax +logits[1, 6, 256102] + +model id +facebook/hf-seamless-m4t-medi… +model_type +seamless_m4t +config +SeamlessM4TConfig +decoder +ssm +layers +24 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +256,102 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/seamless_m4t_v2.svg b/seamless_m4t_v2.svg new file mode 100644 index 0000000000000000000000000000000000000000..7e048d5ee48062df6017f829bee97ac2d89ce9f4 --- /dev/null +++ b/seamless_m4t_v2.svg @@ -0,0 +1,178 @@ + + + + +seamless_m4t_v2 +ssm · 24× Mamba + +SeamlessM4Tv2Model · base model +24 × SeamlessM4Tv2EncoderLayerSeamlessM4Tv2EncoderLayer× 24 +SeamlessM4Tv2ForTextToText · task head +Self-Attention · SeamlessM4Tv2Attention +MLP · SeamlessM4Tv2FeedForwardNetwork + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256102 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +fc1: Linear [1024→8192]fc1 [1024→8192] +fc2: Linear [8192→1024]fc2 [8192→1024] +dropout: Dropoutdropout Dropout +act: ReLUact ReLU +residual add+ +Final LayerNorm[1, 6, 1024] +SeamlessM4Tv2ForTextToTextLM HeadLinear [1024→256102] · tied +Softmax +logits[1, 6, 256102] + +model id +facebook/hf-seamless-m4t-medi… +model_type +seamless_m4t_v2 +config +SeamlessM4Tv2Config +decoder +ssm +layers +24 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +256,102 +max_pos +4,096 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/seed_oss.diff.svg b/seed_oss.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..c8252fe04ba2d90d47c9dd5164adc7e66112a470 --- /dev/null +++ b/seed_oss.diff.svg @@ -0,0 +1,174 @@ + + + + +seed_oss +diff vs llama · 1 overridden · 4 added · 0 deleted · 2 new · 7 inherited-as-is + +SeedOssModel · base model +64 × SeedOssDecoderLayerSeedOssDecoderLayer× 64 +SeedOssForCausalLM · task head +Self-Attention · SeedOssAttention +MLP · SeedOssMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [155136 × 4096] → [1, 6, 4096] +SeedOssRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→10240]q_proj [4096→10240] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [10240→4096]o_proj [10240→4096] +scaled dot-product attention80 heads · head_dim 128 · GQA 80:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +SeedOssRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→27648]gate_proj [4096→27648] +up_proj: Linear [4096→27648]up_proj [4096→27648] +down_proj: Linear [27648→4096]down_proj [27648→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +SeedOssForCausalLMLM HeadLinear [4096→155136] +Softmax +logits[1, 6, 155136] + +model id +ByteDance-Seed/Seed-OSS-36B-In +parent +llama +classes +10 +overridden +1 +added +4 +new classes +2 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SeedOssForCausalLM +ovr forward + +SeedOssAttention +add __init__,forward + +SeedOssMLP +add __init__,forward + \ No newline at end of file diff --git a/seed_oss.svg b/seed_oss.svg new file mode 100644 index 0000000000000000000000000000000000000000..d0dc4c45e4e9b9ed3c397ea1e394ca872101172d --- /dev/null +++ b/seed_oss.svg @@ -0,0 +1,180 @@ + + + + +seed_oss +dense · 64× GQA + +SeedOssModel · base model +64 × SeedOssDecoderLayerSeedOssDecoderLayer× 64 +SeedOssForCausalLM · task head +Self-Attention · SeedOssAttention +MLP · SeedOssMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [155136 × 4096] → [1, 6, 4096] +SeedOssRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→10240]q_proj [4096→10240] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [10240→4096]o_proj [10240→4096] +scaled dot-product attention80 heads · head_dim 128 · GQA 80:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +SeedOssRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→27648]gate_proj [4096→27648] +up_proj: Linear [4096→27648]up_proj [4096→27648] +down_proj: Linear [27648→4096]down_proj [27648→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +SeedOssForCausalLMLM HeadLinear [4096→155136] +Softmax +logits[1, 6, 155136] + +model id +ByteDance-Seed/Seed-OSS-36B-I… +model_type +seed_oss +config +SeedOssConfig +decoder +dense +layers +64 +hidden +4,096 +intermediate +27,648 +heads / kv +80 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +155,136 +max_pos +524,288 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/segformer.diff.svg b/segformer.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..f86c6408ee044e2481b489c46b356ecb3bb0fa4e --- /dev/null +++ b/segformer.diff.svg @@ -0,0 +1,211 @@ + + + + +segformer +diff vs vit (+swin) · 5 overridden · 52 added · 0 deleted · 14 new · 1 inherited-as-is + +SegformerModel · base model +4 × SegformerLayerSegformerLayer× 4 +SegformerForImageClassification · task head +Self-Attention · SegformerAttention +MLP · SegformerMixMLP +sequence_reduction · SegformerSequenceReducti… +dwconv · SegformerDepthWiseConv + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [32→32]q_proj [32→32] +k_proj: Linear [32→32]k_proj [32→32] +v_proj: Linear [32→32]v_proj [32→32] +o_proj: Linear [32→32]o_proj [32→32] +sequence_reduction: Conv2dsequence_reduction Conv2d +layer_norm: LayerNorm 32layer_norm LayerNorm 32 +scaled dot-product attention(1, 2, 5, 8) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +fc1: Linear [32→128]fc1 [32→128] +dwconv: Conv2ddwconv Conv2d +activation_fn: GELUActivationactivation_fn GELU +fc2: Linear [128→32]fc2 [128→32] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, ?] +SegformerForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +SegformerForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +ByteDance-Seed/Seed-OSS-36B-In +parent +vit +classes +17 +overridden +5 +added +52 +new classes +14 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SegformerAttention +ovr __init__,forward + +SegformerPreTrainedModel +ovr _init_weights; 2 attr + +SegFormerImageClassifierOutput +4 attr + +SegformerDecodeHead +add __init__,forward + +SegformerDepthWiseConv +add __init__,forward + +SegformerForImageClassification +add __init__,forward + +SegformerForSemanticSegmentation +add __init__,forward + +SegformerImageProcessor +add _preprocess,_preprocess_image_like_input… + +SegformerImageProcessorPil +add _preprocess,_preprocess_image_like_input… + +SegformerLayer +add __init__,forward + +SegformerMLP +add __init__,forward + +SegformerMixMLP +add __init__,forward + +SegformerModel +add __init__,forward + +SegformerOverlapPatchEmbeddings +add __init__,forward + +SegformerSequenceReduction +add __init__,forward + +SegformerStage +add __init__,forward + \ No newline at end of file diff --git a/segformer.svg b/segformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..9a8d0ab098859f59022aec400bb231a19171460f --- /dev/null +++ b/segformer.svg @@ -0,0 +1,178 @@ + + + + +segformer +dense · 4× MHA + +SegformerModel · base model +4 × SegformerLayerSegformerLayer× 4 +SegformerForImageClassification · task head +Self-Attention · SegformerAttention +MLP · SegformerMixMLP +sequence_reduction · SegformerSequenceReducti… +dwconv · SegformerDepthWiseConv + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [32→32]q_proj [32→32] +k_proj: Linear [32→32]k_proj [32→32] +v_proj: Linear [32→32]v_proj [32→32] +o_proj: Linear [32→32]o_proj [32→32] +sequence_reduction: Conv2dsequence_reduction Conv2d +layer_norm: LayerNorm 32layer_norm LayerNorm 32 +scaled dot-product attention(1, 2, 5, 8) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +fc1: Linear [32→128]fc1 [32→128] +dwconv: Conv2ddwconv Conv2d +activation_fn: GELUActivationactivation_fn GELU +fc2: Linear [128→32]fc2 [128→32] +dropout: Dropoutdropout Dropout +residual add+ +Final LayerNorm[1, 6, ?] +SegformerForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +SegformerForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +ByteDance-Seed/Seed-OSS-36B-I… +model_type +segformer +config +SegformerConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +(1, 2, 5, 8) / (1, 2, 5, 8) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/seggpt.svg b/seggpt.svg new file mode 100644 index 0000000000000000000000000000000000000000..decb960b3041c3c6a021384b25d86cf00bc87105 --- /dev/null +++ b/seggpt.svg @@ -0,0 +1,174 @@ + + + + +seggpt +dense · 24× MHA + +SegGptModel · base model +24 × SegGptLayerSegGptLayer× 24 +Self-Attention · SegGptAttention +MLP · SegGptMlp + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +qkv: Linear [1024→3072]qkv [1024→3072] +proj: Linear [1024→1024]proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +lin1: Linear [1024→4096]lin1 [1024→4096] +lin2: Linear [4096→1024]lin2 [4096→1024] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +BAAI/seggpt-vit-large +model_type +seggpt +config +SegGptConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/sew.diff.svg b/sew.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d4ac9c71b4e62aea730ba639bcc1cb8c19f46ed7 --- /dev/null +++ b/sew.diff.svg @@ -0,0 +1,174 @@ + + + + +sew +diff vs wav2vec2 · 0 overridden · 20 added · 0 deleted · 5 new · 10 inherited-as-is + +SEWModel · base model +12 × SEWEncoderLayerSEWEncoderLayer× 12 +SEWForSequenceClassification · task head +Self-Attention · Wav2Vec2Attention ↩ inherited +MLP · Wav2Vec2FeedForward ↩ inherited + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +SEWForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +SEWForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +BAAI/seggpt-vit-large +parent +wav2vec2 +classes +15 +overridden +0 +added +20 +new classes +5 +inherited as-is +10 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SEWEncoder +add __init__,forward + +SEWModel +add __init__,_mask_hidden_states,forward + +SEWPositionalConvEmbedding +add __init__,forward + +SEWPreTrainedModel +add _get_feat_extract_output_lengths,_get_fe… + +SEWUpsampling +add __init__,forward + \ No newline at end of file diff --git a/sew.svg b/sew.svg new file mode 100644 index 0000000000000000000000000000000000000000..a3d0f899f9cca57d49bcd54aab902cd21d8dc440 --- /dev/null +++ b/sew.svg @@ -0,0 +1,174 @@ + + + + +sew +dense · 12× MHA + +SEWModel · base model +12 × SEWEncoderLayerSEWEncoderLayer× 12 +SEWForSequenceClassification · task head +Self-Attention · SEWAttention +MLP · SEWFeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +SEWForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +SEWForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +BAAI/seggpt-vit-large +model_type +sew +config +SEWConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/sew_d.svg b/sew_d.svg new file mode 100644 index 0000000000000000000000000000000000000000..84aa76bd347417edf2bf87a92ee13467a70203eb --- /dev/null +++ b/sew_d.svg @@ -0,0 +1,171 @@ + + + + +sew_d +dense · 12× MHA + +SEWDModel · base model +12 × SEWDLayerSEWDLayer× 12 +SEWDForSequenceClassification · task head +Self-Attention · SEWDAttention +self · DisentangledSelfAttention +output · SEWDSelfOutput + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +Normpre-attention [1, 6, 768] +query_proj: Linear [768→768]query_proj [768→768] +key_proj: Linear [768→768]key_proj [768→768] +value_proj: Linear [768→768]value_proj [768→768] +pos_dropout: StableDropoutpos_dropout StableDropout +dropout: StableDropoutdropout StableDropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +SEWDForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +SEWDForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +BAAI/seggpt-vit-large +model_type +sew-d +config +SEWDConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +512 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/shieldgemma2.svg b/shieldgemma2.svg new file mode 100644 index 0000000000000000000000000000000000000000..2986d73d7c375a1b9658484271f84f6485e93dcd --- /dev/null +++ b/shieldgemma2.svg @@ -0,0 +1,216 @@ + + + + +shieldgemma2 +dense · 22× sliding + 4× full + +Gemma3ForConditionalGeneration · base model +26 × Gemma3DecoderLayerGemma3DecoderLayer× 26 +Gemma3ForConditionalGeneration · task head +layers (idx) +Self-Attention · Gemma3Attention (2 layer types — same modules, mask differs) +MLP · Gemma3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262208 × 2304] → [1, 6, 2304] +Gemma3RMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +q_norm: Gemma3RMSNorm 256q_norm Gemma3RMSNorm 256 +k_norm: Gemma3RMSNorm 256k_norm Gemma3RMSNorm 256 +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Gemma3RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +Gemma3ForConditionalGenerationLM HeadLinear [2304→262208] · tied +Softmax +logits[1, 6, 262208] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 + +model id +google/shieldgemma-2-4b-it +model_type +shieldgemma2 +config +ShieldGemma2Config +decoder +dense +layers +26 +hidden +2,304 +intermediate +9,216 +heads / kv +8 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +262,208 +max_pos +131,072 +sliding_window +4,096 +tie_embeddings +True +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/siglip.svg b/siglip.svg new file mode 100644 index 0000000000000000000000000000000000000000..669918455b6c1d8c0d16dabf7bb14e4bbf7fe73d --- /dev/null +++ b/siglip.svg @@ -0,0 +1,220 @@ + + + + +siglip +multimodal · vision+vision → projector → LLM · dense + +SiglipModel · base model +12 × SiglipEncoderLayerSiglipEncoderLayer× 12 +SiglipForImageClassification · task head +image ⊕ text attention +Vision encoder · SiglipTextModel×12 +Vision encoder · SiglipVisionMo…×12 +Self-Attention · SiglipAttention +SiglipEncoderLayer×12 +SiglipEncoderLayer×12 +MLP · SiglipMLP +self_attn · SiglipAttention +self_attn · SiglipAttention +mlp · SiglipMLP +mlp · SiglipMLP + + + + + + + + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +SiglipForImageClassificationLM HeadLinear [768→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/siglip-base-patch16-224 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +siglip +config +SiglipConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32,000 +max_pos +64 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/siglip2.diff.svg b/siglip2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..9a794e5f1623c39f5a8ce2d6b878972422434a59 --- /dev/null +++ b/siglip2.diff.svg @@ -0,0 +1,227 @@ + + + + +siglip2 +diff vs siglip · 9 overridden · 6 added · 0 deleted · 5 new · 4 inherited-as-is + +Siglip2Model · base model +12 × Siglip2EncoderLayerSiglip2EncoderLayer× 12 +Siglip2ForImageClassification · task head +image ⊕ text attention +Vision encoder · SiglipTextMod…×12 +Vision encoder · Siglip2VisionM…×12 +Self-Attention · SiglipAttention ↩ inherited +SiglipEncoderLayer ↩ inheri…×12 +SiglipEncoderLayer ↩ inheri…×12 +MLP · SiglipMLP ↩ inherited +self_attn · SiglipAttention ↩ inhe… +self_attn · SiglipAttention ↩ inhe… +mlp · SiglipMLP ↩ inherited +mlp · SiglipMLP ↩ inherited + + + + + + + + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +Siglip2ForImageClassificationLM HeadLinear [768→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/siglip2-base-patch16-na +parent +siglip +classes +14 +overridden +9 +added +6 +new classes +5 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Siglip2ForImageClassification +ovr forward + +Siglip2Model +ovr forward,get_image_features + +Siglip2MultiheadAttentionPoolingHead +ovr __init__,forward + +Siglip2PreTrainedModel +2 attr + +Siglip2VisionModel +ovr __init__,forward + +Siglip2Config +rename only + +Siglip2TextConfig +rename only + +Siglip2Tokenizer +add __init__ + +Siglip2VisionConfig +2 attr + +Siglip2VisionEmbeddings +add __init__,forward,resize_positional_embed… + \ No newline at end of file diff --git a/siglip2.svg b/siglip2.svg new file mode 100644 index 0000000000000000000000000000000000000000..c9073e70e421bf7b8cfd5cd154d3ee4716399da6 --- /dev/null +++ b/siglip2.svg @@ -0,0 +1,220 @@ + + + + +siglip2 +multimodal · vision+vision → projector → LLM · dense + +Siglip2Model · base model +12 × Siglip2EncoderLayerSiglip2EncoderLayer× 12 +Siglip2ForImageClassification · task head +image ⊕ text attention +Vision encoder · Siglip2TextMo…×12 +Vision encoder · Siglip2VisionM…×12 +Self-Attention · Siglip2Attention +Siglip2EncoderLayer×12 +Siglip2EncoderLayer×12 +MLP · Siglip2MLP +self_attn · Siglip2Attention +self_attn · Siglip2Attention +mlp · Siglip2MLP +mlp · Siglip2MLP + + + + + + + + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +Siglip2ForImageClassificationLM HeadLinear [768→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +google/siglip2-base-patch16-n… +inputs +input_ids, pixel_values +built via +AutoModel +model_type +siglip2 +config +Siglip2Config +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32,000 +max_pos +64 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/slanet.diff.svg b/slanet.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e18ae9263e110fc7cc3f32417a69cd782cd1b3bc --- /dev/null +++ b/slanet.diff.svg @@ -0,0 +1,188 @@ + + + + +slanet +diff vs slanext (+pp_lcnet) · 4 overridden · 21 added · 0 deleted · 6 new · 2 inherited-as-is + +SLANetForTableRecognition · base model +6 × SLANetSLAHeadSLANetSLAHead× 6 +Self-Attention · SLANeXtAttentionGRUCell ↩ inherited +MLP · SLANeXtMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +input_to_hidden: Linear [96→256]input_to_hidden [96→256] +hidden_to_hidden: Linear [256→256]hidden_to_hidden [256→256] +score: Linear [256→1]score [256→1] +rnn: GRUCellrnn GRUCell +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 256] +fc1: Linear [256→256]fc1 [256→256] +fc2: Linear [256→50]fc2 [256→50] +act_fn: Identityact_fn Identity +residual add+ +Final BatchNorm2d[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +PaddlePaddle/SLANet_plus_safet +parent +slanext +classes +11 +overridden +4 +added +21 +new classes +6 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SLANetDepthwiseSeparableConvLayer +ovr __init__ + +SLANetPreTrainedModel +ovr _init_weights; 1 attr + +SLANetBackbone +add __init__,forward + +SLANetBottleneck +add __init__,forward + +SLANetCSPLayer +add __init__,forward + +SLANetCSPPAN +add __init__,forward + +SLANetConfig +add __post_init__; 9 attr + +SLANetForTableRecognition +ovr forward; 1 attr + +SLANetForTableRecognitionOutput +2 attr + \ No newline at end of file diff --git a/slanet.svg b/slanet.svg new file mode 100644 index 0000000000000000000000000000000000000000..25dc0f1803045d8b9493b2065a028717fdce702f --- /dev/null +++ b/slanet.svg @@ -0,0 +1,176 @@ + + + + +slanet +dense · 6× Attention + +SLANetForTableRecognition · base model +6 × SLANetSLAHeadSLANetSLAHead× 6 +Self-Attention · SLANetAttentionGRUCell +MLP · SLANetMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +input_to_hidden: Linear [96→256]input_to_hidden [96→256] +hidden_to_hidden: Linear [256→256]hidden_to_hidden [256→256] +score: Linear [256→1]score [256→1] +rnn: GRUCellrnn GRUCell +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 256] +fc1: Linear [256→256]fc1 [256→256] +fc2: Linear [256→50]fc2 [256→50] +act_fn: Identityact_fn Identity +residual add+ +Final BatchNorm2d[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +PaddlePaddle/SLANet_plus_safe… +model_type +slanet +config +SLANetConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/slanext.diff.svg b/slanext.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..ccdea852606f9615a9371432451cd857485a1919 --- /dev/null +++ b/slanext.diff.svg @@ -0,0 +1,189 @@ + + + + +slanext +diff vs got_ocr2 · 0 overridden · 45 added · 0 deleted · 10 new · 2 inherited-as-is + +SLANeXtForTableRecognition · base model +12 × SLANeXtVisionLayerSLANeXtVisionLayer× 12 +Self-Attention · GotOcr2VisionAttention ↩ inherited +MLP · SLANeXtMLPBlock + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→?] +Softmax +logits[1, 6, ?] + +model id +PaddlePaddle/SLANeXt_wired_saf +parent +got_ocr2 +classes +12 +overridden +0 +added +45 +new classes +10 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SLANeXtAttentionGRUCell +add __init__,forward + +SLANeXtBackbone +add __init__,forward + +SLANeXtConfig +add __post_init__; 8 attr + +SLANeXtForTableRecognition +add __init__,forward + +SLANeXtForTableRecognitionOutput +2 attr + +SLANeXtImageProcessor +add __init__,_preprocess,_resize,init_decode… + +SLANeXtMLP +add __init__,forward + +SLANeXtPreTrainedModel +add _init_weights; 6 attr + +SLANeXtSLAHead +add __init__,forward; 1 attr + +SLANeXtVisionConfig +1 attr + \ No newline at end of file diff --git a/slanext.svg b/slanext.svg new file mode 100644 index 0000000000000000000000000000000000000000..a7ae747795b5ebcb36d0bd6cc5fd0579a0f95d76 --- /dev/null +++ b/slanext.svg @@ -0,0 +1,174 @@ + + + + +slanext +dense · 12× Attention + +SLANeXtForTableRecognition · base model +12 × SLANeXtVisionLayerSLANeXtVisionLayer× 12 +Self-Attention · SLANeXtVisionAttention +MLP · SLANeXtMLPBlock + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +lin1: Linear [768→3072]lin1 [768→3072] +lin2: Linear [3072→768]lin2 [3072→768] +act: GELUActivationact GELU +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→?] +Softmax +logits[1, 6, ?] + +model id +PaddlePaddle/SLANeXt_wired_sa… +model_type +slanext +config +SLANeXtConfig +decoder +dense +layers +12 +hidden +512 +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/smollm3.diff.svg b/smollm3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..bfff70d6c82fe7d88c877da27a3701a83995d4d8 --- /dev/null +++ b/smollm3.diff.svg @@ -0,0 +1,171 @@ + + + + +smollm3 +diff vs llama (+qwen2) · 2 overridden · 30 added · 0 deleted · 1 new · 8 inherited-as-is + +SmolLM3Model · base model +36 × SmolLM3DecoderLayerSmolLM3DecoderLayer× 36 +SmolLM3ForCausalLM · task head +Self-Attention · SmolLM3Attention +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 2048] → [1, 6, 2048] +SmolLM3RMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +SmolLM3RMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→11008]gate_proj [2048→11008] +up_proj: Linear [2048→11008]up_proj [2048→11008] +down_proj: Linear [11008→2048]down_proj [11008→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +SmolLM3ForCausalLMLM HeadLinear [2048→128256] · tied +Softmax +logits[1, 6, 128256] + +model id +HuggingFaceTB/SmolLM3-3B +parent +llama +classes +10 +overridden +2 +added +30 +new classes +1 +inherited as-is +8 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SmolLM3Attention +ovr __init__,forward + +SmolLM3Config +add __post_init__; 29 attr + \ No newline at end of file diff --git a/smollm3.svg b/smollm3.svg new file mode 100644 index 0000000000000000000000000000000000000000..bf9b5970068ef67c84d61f72d27b6522a7a0f22d --- /dev/null +++ b/smollm3.svg @@ -0,0 +1,180 @@ + + + + +smollm3 +dense · 36× full + +SmolLM3Model · base model +36 × SmolLM3DecoderLayerSmolLM3DecoderLayer× 36 +SmolLM3ForCausalLM · task head +Self-Attention · SmolLM3Attention +MLP · SmolLM3MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 2048] → [1, 6, 2048] +SmolLM3RMSNormpre-attention [1, 6, 2048] +q_proj: Linear [2048→2048]q_proj [2048→2048] +k_proj: Linear [2048→512]k_proj [2048→512] +v_proj: Linear [2048→512]v_proj [2048→512] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 128 · GQA 16:4 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +SmolLM3RMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→11008]gate_proj [2048→11008] +up_proj: Linear [2048→11008]up_proj [2048→11008] +down_proj: Linear [11008→2048]down_proj [11008→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +SmolLM3ForCausalLMLM HeadLinear [2048→128256] · tied +Softmax +logits[1, 6, 128256] + +model id +HuggingFaceTB/SmolLM3-3B +model_type +smollm3 +config +SmolLM3Config +decoder +dense +layers +36 +hidden +2,048 +intermediate +11,008 +heads / kv +16 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +128,256 +max_pos +32,768 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/smolvlm.diff.svg b/smolvlm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..48be1f58a2e213c154f9750c857ad2988a7a12a7 --- /dev/null +++ b/smolvlm.diff.svg @@ -0,0 +1,208 @@ + + + + +smolvlm +diff vs idefics3 · 6 overridden · 2 added · 0 deleted · 4 new · 3 inherited-as-is + +SmolVLMModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +SmolVLMForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · Idefics3VisionT…×12 +Self-Attention · LlamaAttention +Idefics3EncoderLayer ↩ inh…×12 +MLP · LlamaMLP +self_attn · Idefics3VisionAttentio… +mlp · Idefics3VisionMLP ↩ inher… +Projector · Idefics3Connector ↩ inherit… +modality_projection · Idefics3Simpl… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128259 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +SmolVLMForConditionalGenerationLM HeadLinear [4096→128259] +Softmax +logits[1, 6, 128259] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→3072]fc1 [1152→3072] +fc2: Linear [3072→1152]fc2 [3072→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +proj: Linear [4608→4096]proj [4608→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +HuggingFaceTB/SmolVLM2-2.2B-In +parent +idefics3 +classes +9 +overridden +6 +added +2 +new classes +4 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SmolVLMForConditionalGeneration +ovr __init__,forward; 1 attr + +SmolVLMModel +ovr forward,get_image_features,inputs_merger + +SmolVLMConfig +1 attr + +SmolVLMImageProcessor +rename only + +SmolVLMImageProcessorPil +rename only + +SmolVLMVisionConfig +1 attr + \ No newline at end of file diff --git a/smolvlm.svg b/smolvlm.svg new file mode 100644 index 0000000000000000000000000000000000000000..aa1ce5824de605204c913f5320608684d350d0a9 --- /dev/null +++ b/smolvlm.svg @@ -0,0 +1,213 @@ + + + + +smolvlm +multimodal · vision → projector → LLM · dense + +SmolVLMModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +SmolVLMForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · SmolVLMVisio…×12 +Self-Attention · LlamaAttention +SmolVLMEncoderLayer×12 +MLP · LlamaMLP +self_attn · SmolVLMVisionAttenti… +mlp · SmolVLMVisionMLP +Projector · SmolVLMConnector +modality_projection · SmolVLMSim… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128259 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +SmolVLMForConditionalGenerationLM HeadLinear [4096→128259] +Softmax +logits[1, 6, 128259] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1152→1152]k_proj [1152→1152] +v_proj: Linear [1152→1152]v_proj [1152→1152] +q_proj: Linear [1152→1152]q_proj [1152→1152] +out_proj: Linear [1152→1152]out_proj [1152→1152] +layer_norm1: LayerNorm 1152layer_norm1 LayerNorm 1152 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [1152→3072]fc1 [1152→3072] +fc2: Linear [3072→1152]fc2 [3072→1152] +layer_norm2: LayerNorm 1152layer_norm2 LayerNorm 1152 +proj: Linear [4608→4096]proj [4608→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +HuggingFaceTB/SmolVLM2-2.2B-I… +inputs +input_ids, pixel_values +built via +AutoModel, AutoModelForImageTextToText +model_type +smolvlm +config +SmolVLMConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +128,259 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/solar_open.diff.svg b/solar_open.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..000f327e71405c6981204cbfedda165537533f72 --- /dev/null +++ b/solar_open.diff.svg @@ -0,0 +1,176 @@ + + + + +solar_open +diff vs glm4_moe (+llama) · 3 overridden · 13 added · 0 deleted · 1 new · 4 inherited-as-is + +SolarOpenModel · base model +48 × SolarOpenDecoderLayerSolarOpenDecoderLayer× 48 +SolarOpenForCausalLM · task head +Self-Attention · SolarOpenAttention +Sparse MoE · Glm4MoeMoE ↩ inheritedMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [196608 × 4096] → [1, 6, 4096] +SolarOpenRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→8192]q_proj [4096→8192] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [8192→4096]o_proj [8192→4096] +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +SolarOpenRMSNormpre-FFN [1, 6, 4096] +experts: SolarOpenNaiveMoeexperts NaiveMoe +gate: SolarOpenTopkRouter 128×4096gate TopkRouter 128×4096 +shared_experts: SolarOpenMLPshared_experts MLP +residual add+ +Final RMSNorm[1, 6, 4096] +SolarOpenForCausalLMLM HeadLinear [4096→196608] +Softmax +logits[1, 6, 196608] + +model id +upstage/Solar-Open-100B +parent +glm4_moe +classes +8 +overridden +3 +added +13 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SolarOpenAttention +ovr __init__ + +SolarOpenDecoderLayer +ovr __init__ + +SolarOpenPreTrainedModel +1 attr + +SolarOpenConfig +add __post_init__; 12 attr + \ No newline at end of file diff --git a/solar_open.svg b/solar_open.svg new file mode 100644 index 0000000000000000000000000000000000000000..5c8b429b3d3bb5adecd56658715c6070580a930d --- /dev/null +++ b/solar_open.svg @@ -0,0 +1,181 @@ + + + + +solar_open +sparse-moe · 48× GQA +MoE + +SolarOpenModel · base model +48 × SolarOpenDecoderLayerSolarOpenDecoderLayer× 48 +SolarOpenForCausalLM · task head +Self-Attention · SolarOpenAttention +Sparse MoE · SolarOpenMoEMoE + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [196608 × 4096] → [1, 6, 4096] +SolarOpenRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→8192]q_proj [4096→8192] +k_proj: Linear [4096→1024]k_proj [4096→1024] +v_proj: Linear [4096→1024]v_proj [4096→1024] +o_proj: Linear [8192→4096]o_proj [8192→4096] +scaled dot-product attention64 heads · head_dim 128 · GQA 64:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +SolarOpenRMSNormpre-FFN [1, 6, 4096] +experts: SolarOpenNaiveMoeexperts NaiveMoe +gate: SolarOpenTopkRouter 128×4096gate TopkRouter 128×4096 +shared_experts: SolarOpenMLPshared_experts MLP +residual add+ +Final RMSNorm[1, 6, 4096] +SolarOpenForCausalLMLM HeadLinear [4096→196608] +Softmax +logits[1, 6, 196608] + +model id +upstage/Solar-Open-100B +model_type +solar_open +config +SolarOpenConfig +decoder +sparse-moe +layers +48 +hidden +4,096 +intermediate +— +heads / kv +64 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +196,608 +max_pos +131,072 +experts (top-k) +128 (top-8) +tie_embeddings +False +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/speech_encoder_decoder.svg b/speech_encoder_decoder.svg new file mode 100644 index 0000000000000000000000000000000000000000..a5cdba25f98499dbc426b36bde135c74c0d89a8a --- /dev/null +++ b/speech_encoder_decoder.svg @@ -0,0 +1,155 @@ + + + + +speech_encoder_decoder +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +speech_encoder_decoder +model_type +speech-encoder-decoder +config +SpeechEncoderDecoderConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +— +vocab +— +max_pos +— +tie_embeddings +None +status +failed +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/speech_to_text.svg b/speech_to_text.svg new file mode 100644 index 0000000000000000000000000000000000000000..db3b31906dbd17f09fd0175e33c7dac721e97801 --- /dev/null +++ b/speech_to_text.svg @@ -0,0 +1,172 @@ + + + + +speech_to_text +dense · 12× MHA + +Speech2TextModel · base model +12 × Speech2TextEncoderLayerSpeech2TextEncoderLayer× 12 +Self-Attention · Speech2TextAttention + +input_idstokenize("Hey, how are you?") → [1, 9] +token 0: '␣'␣0 +token 1: '<unk>'<…1 +token 2: 'e'e2 +token 3: 'y'y3 +token 4: '<unk>'<…4 +token 5: '␣how'␣…5 +token 6: '␣are'␣…6 +token 7: '␣you'␣…7 +token 8: '<unk>'<…8 +Token Embeddingweight [10000 × 256] → [1, 9, 256] +LayerNormpre-attention [1, 9, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +out_proj: Linear [256→256]out_proj [256→256] +scaled dot-product attention4 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 9, 256] +LM HeadLinear [256→10000] · tied +Softmax +logits[1, 9, 10000] + +model id +facebook/s2t-small-librispeec… +model_type +speech_to_text +config +Speech2TextConfig +decoder +dense +layers +12 +hidden +256 +intermediate +— +heads / kv +4 / 4 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +10,000 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/speecht5.svg b/speecht5.svg new file mode 100644 index 0000000000000000000000000000000000000000..a77ff52deeb6da00c230e73d0a2220f017c54830 --- /dev/null +++ b/speecht5.svg @@ -0,0 +1,178 @@ + + + + +speecht5 +dense · 12× MHA + +SpeechT5Model · base model +12 × SpeechT5EncoderLayerSpeechT5EncoderLayer× 12 +Self-Attention · SpeechT5Attention +MLP · SpeechT5FeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [81 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→81] · tied +Softmax +logits[1, 6, 81] + +model id +microsoft/speecht5_asr +model_type +speecht5 +config +SpeechT5Config +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +81 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/splinter.svg b/splinter.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a43995f91931a1f941c4ae069fbc44486964804 --- /dev/null +++ b/splinter.svg @@ -0,0 +1,175 @@ + + + + +splinter +dense · 12× MHA + +SplinterModel · base model +12 × SplinterLayerSplinterLayer× 12 +SplinterForPreTraining · task head +Self-Attention · SplinterAttention +output · SplinterSelfOutput +self · SplinterSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: 'how'how2 +token 3: 'are'are3 +token 4: 'you'you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +SplinterForPreTrainingLM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] + +model id +tau/splinter-base +model_type +splinter +config +SplinterConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/squeezebert.svg b/squeezebert.svg new file mode 100644 index 0000000000000000000000000000000000000000..83546ead3a5cb8a87dd065e5a9c2195c493366d3 --- /dev/null +++ b/squeezebert.svg @@ -0,0 +1,174 @@ + + + + +squeezebert +dense · 12× MHA + +SqueezeBertModel · base model +12 × SqueezeBertModuleSqueezeBertModule× 12 +SqueezeBertForMaskedLM · task head +Self-Attention · SqueezeBertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +ConvDropoutLayerNormpre-attention [1, 6, 768] +query: Conv1d 768×192×1query Conv1d 768×192×1 +key: Conv1d 768×192×1key Conv1d 768×192×1 +value: Conv1d 768×192×1value Conv1d 768×192×1 +dropout: Dropoutdropout Dropout +softmax: Softmaxsoftmax Softmax +matmul_qk: MatMulWrappermatmul_qk MatMulWrapper +matmul_qkv: MatMulWrappermatmul_qkv MatMulWrapper +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +SqueezeBertForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +SqueezeBertForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +squeezebert/squeezebert-uncas… +model_type +squeezebert +config +SqueezeBertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/stablelm.svg b/stablelm.svg new file mode 100644 index 0000000000000000000000000000000000000000..a1a5c9efb25065ad00fd958decc2d867d0cefac9 --- /dev/null +++ b/stablelm.svg @@ -0,0 +1,180 @@ + + + + +stablelm +dense · 32× MHA + +StableLmModel · base model +32 × StableLmDecoderLayerStableLmDecoderLayer× 32 +StableLmForCausalLM · task head +Self-Attention · StableLmAttention +MLP · StableLmMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 2560] → [1, 6, 2560] +LayerNormpre-attention [1, 6, 2560] +q_proj: Linear [2560→2560]q_proj [2560→2560] +k_proj: Linear [2560→2560]k_proj [2560→2560] +v_proj: Linear [2560→2560]v_proj [2560→2560] +o_proj: Linear [2560→2560]o_proj [2560→2560] +scaled dot-product attention32 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 2560] +gate_proj: Linear [2560→6912]gate_proj [2560→6912] +up_proj: Linear [2560→6912]up_proj [2560→6912] +down_proj: Linear [6912→2560]down_proj [6912→2560] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final LayerNorm[1, 6, 2560] +StableLmForCausalLMLM HeadLinear [2560→50304] +Softmax +logits[1, 6, 50304] + +model id +stabilityai/stablelm-3b-4e1t +model_type +stablelm +config +StableLmConfig +decoder +dense +layers +32 +hidden +2,560 +intermediate +6,912 +heads / kv +32 / 32 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +50,304 +max_pos +4,096 +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/starcoder2.diff.svg b/starcoder2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b9a60110c09fe655c3b9241d1ba94f19068faf05 --- /dev/null +++ b/starcoder2.diff.svg @@ -0,0 +1,176 @@ + + + + +starcoder2 +diff vs mistral · 5 overridden · 2 added · 0 deleted · 1 new · 3 inherited-as-is + +Starcoder2Model · base model +30 × Starcoder2DecoderLayerStarcoder2DecoderLayer× 30 +Starcoder2ForCausalLM · task head +Self-Attention · Starcoder2Attention +MLP · Starcoder2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49152 × 3072] → [1, 6, 3072] +LayerNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→3072]q_proj [3072→3072] +k_proj: Linear [3072→256]k_proj [3072→256] +v_proj: Linear [3072→256]v_proj [3072→256] +o_proj: Linear [3072→3072]o_proj [3072→3072] +scaled dot-product attention24 heads · head_dim 128 · GQA 24:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 3072] +c_fc: Linear [3072→12288]c_fc [3072→12288] +c_proj: Linear [12288→3072]c_proj [12288→3072] +act: GELUTanhact GELUTanh +residual add+ +Final LayerNorm[1, 6, 3072] +Starcoder2ForCausalLMLM HeadLinear [3072→49152] · tied +Softmax +logits[1, 6, 49152] + +model id +bigcode/starcoder2-7b +parent +mistral +classes +7 +overridden +5 +added +2 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Starcoder2Attention +ovr __init__,forward + +Starcoder2DecoderLayer +ovr __init__ + +Starcoder2Model +ovr __init__,forward + +Starcoder2MLP +add __init__,forward + \ No newline at end of file diff --git a/starcoder2.svg b/starcoder2.svg new file mode 100644 index 0000000000000000000000000000000000000000..5dd32680541d9217be7d42f7d837a9b54e9bedbb --- /dev/null +++ b/starcoder2.svg @@ -0,0 +1,179 @@ + + + + +starcoder2 +dense · 30× GQA + +Starcoder2Model · base model +30 × Starcoder2DecoderLayerStarcoder2DecoderLayer× 30 +Starcoder2ForCausalLM · task head +Self-Attention · Starcoder2Attention +MLP · Starcoder2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49152 × 3072] → [1, 6, 3072] +LayerNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→3072]q_proj [3072→3072] +k_proj: Linear [3072→256]k_proj [3072→256] +v_proj: Linear [3072→256]v_proj [3072→256] +o_proj: Linear [3072→3072]o_proj [3072→3072] +scaled dot-product attention24 heads · head_dim 128 · GQA 24:2 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 3072] +c_fc: Linear [3072→12288]c_fc [3072→12288] +c_proj: Linear [12288→3072]c_proj [12288→3072] +act: GELUTanhact GELUTanh +residual add+ +Final LayerNorm[1, 6, 3072] +Starcoder2ForCausalLMLM HeadLinear [3072→49152] · tied +Softmax +logits[1, 6, 49152] + +model id +bigcode/starcoder2-7b +model_type +starcoder2 +config +Starcoder2Config +decoder +dense +layers +30 +hidden +3,072 +intermediate +12,288 +heads / kv +24 / 2 +attention +GQA +norm +LayerNorm +positional +RoPE +vocab +49,152 +max_pos +4,096 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/superglue.svg b/superglue.svg new file mode 100644 index 0000000000000000000000000000000000000000..cfbd5f02c44010741db33f2f2f31816d812c4e0c --- /dev/null +++ b/superglue.svg @@ -0,0 +1,181 @@ + + + + +superglue +dense · 18× MHA + +SuperGlueForKeypointMatching · base model +18 × SuperGlueAttentionalPropagationSuperGlueAttentionalPropagation× 18 +Self-Attention · SuperGlueAttention +MLP · ModuleList +0 · SuperGlueMultiLayerPerceptron +self · SuperGlueSelfAttention +output · SuperGlueSelfOutput + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +Normpre-attention [1, 6, 256] +query: Linear [256→256]query [256→256] +key: Linear [256→256]key [256→256] +value: Linear [256→256]value [256→256] +dropout: Dropoutdropout Dropout +dense: Linear [256→256]dense [256→256] +scaled dot-product attention4 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 256] +linear: Linear [512→512]linear [512→512] +batch_norm: BatchNorm1d 512batch_norm BatchNorm1d 512 +activation: ReLUactivation ReLU +1: Linear [512→256]1 [512→256] +residual add+ +Final BatchNorm1d[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +magic-leap-community/superglu… +model_type +superglue +config +SuperGlueConfig +decoder +dense +layers +18 +hidden +256 +intermediate +— +heads / kv +4 / 4 +attention +MHA +norm +BatchNorm1d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/superpoint.svg b/superpoint.svg new file mode 100644 index 0000000000000000000000000000000000000000..dc6a693c491c4d87831b4b0f0b381f7dc569b1e4 --- /dev/null +++ b/superpoint.svg @@ -0,0 +1,154 @@ + + + + +superpoint +⚠ no transformer block (conv backbone) — shown from config · dense · 4× Attention + +input_ids[1, S] +Token Embedding[? × ?] +SuperPointConvBlockNorm → attentionNorm → MLP×4 +Final Norm +LM Head→ logits [1, S, ?] + +model id +magic-leap-community/superpoi… +model_type +superpoint +config +SuperPointConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/swiftformer.svg b/swiftformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..042cc8e72f0b0589c13e96d4ed68474508cb661a --- /dev/null +++ b/swiftformer.svg @@ -0,0 +1,174 @@ + + + + +swiftformer +dense · 7× Attention + +SwiftFormerModel · base model +7 × SwiftFormerEncoderBlockSwiftFormerEncoderBlock× 7 +SwiftFormerForImageClassification · task head +Self-Attention · SwiftFormerEfficientAdditiveAttention +MLP · SwiftFormerMlp + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, ?]+ position embeddings +Normpre-attention [1, 6, ?] +to_query: Linear [48→48]to_query [48→48] +to_key: Linear [48→48]to_key [48→48] +proj: Linear [48→48]proj [48→48] +final: Linear [48→48]final [48→48] +scaled dot-product attention? heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Normpre-FFN [1, 6, ?] +norm1: BatchNorm2d 48norm1 BatchNorm2d 48 +fc1: Conv2dfc1 Conv2d +act: GELUActivationact GELU +fc2: Conv2dfc2 Conv2d +drop: Dropoutdrop Dropout +residual add+ +Final BatchNorm2d[1, 6, ?] +SwiftFormerForImageClassificationPool (CLS / mean)[1, 6, ?] → [1, ?] +SwiftFormerForImageClassificationClassifier headLinear [?→2] +Softmax +class logits[1, 2] (2 classes) + +model id +MBZUAI/swiftformer-xs +model_type +swiftformer +config +SwiftFormerConfig +decoder +dense +layers +7 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/swin.diff.svg b/swin.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..e0793d2ab78aa7604ff50c4d04b76c8e784634ed --- /dev/null +++ b/swin.diff.svg @@ -0,0 +1,215 @@ + + + + +swin +diff vs vit · 11 overridden · 53 added · 0 deleted · 15 new · 0 inherited-as-is + +SwinModel · base model +4 × SwinLayerSwinLayer× 4 +SwinForImageClassification · task head +Self-Attention · SwinAttention +MLP · SwinMLP + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [96→96]q_proj [96→96] +k_proj: Linear [96→96]k_proj [96→96] +v_proj: Linear [96→96]v_proj [96→96] +o_proj: Linear [96→96]o_proj [96→96] +relative_position_bias: SwinRelativePositionBiasrelative_position_bias RelativePositionBias +scaled dot-product attention(3, 6, 12, 24) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [96→384]fc1 [96→384] +fc2: Linear [384→96]fc2 [384→96] +residual add+ +Final LayerNorm[1, 6, 768] +SwinForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +SwinForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/swin-tiny-patch4-win +parent +vit +classes +19 +overridden +11 +added +53 +new classes +15 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SwinAttention +ovr __init__,forward + +SwinMLP +ovr __init__ + +SwinBackbone +add __init__,forward; 1 attr + +SwinDropPath +add __init__,extra_repr,forward + +SwinEmbeddings +add __init__,forward,interpolate_pos_encoding + +SwinEncoder +add __init__,forward + +SwinEncoderOutput +4 attr + +SwinForImageClassification +add __init__,forward + +SwinForMaskedImageModeling +add __init__,forward + +SwinImageClassifierOutput +5 attr + +SwinLayer +ovr __init__,forward; add cyclic_shift,get_a… + +SwinMaskedImageModelingOutput +5 attr + +SwinModel +add __init__,forward + +SwinModelOutput +5 attr + +SwinPatchEmbeddings +add __init__,forward,maybe_pad + +SwinPatchMerging +add __init__,forward,maybe_pad + +SwinPreTrainedModel +ovr _init_weights; 6 attr + +SwinRelativePositionBias +add __init__,_create_relative_position_index… + +SwinStage +add __init__,forward,get_reshaped_hidden_sta… + \ No newline at end of file diff --git a/swin.svg b/swin.svg new file mode 100644 index 0000000000000000000000000000000000000000..9f937947ef76b826fb9c7a20ba339fa59771845f --- /dev/null +++ b/swin.svg @@ -0,0 +1,173 @@ + + + + +swin +dense · 4× MHA + +SwinModel · base model +4 × SwinLayerSwinLayer× 4 +SwinForImageClassification · task head +Self-Attention · SwinAttention +MLP · SwinMLP + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [96→96]q_proj [96→96] +k_proj: Linear [96→96]k_proj [96→96] +v_proj: Linear [96→96]v_proj [96→96] +o_proj: Linear [96→96]o_proj [96→96] +relative_position_bias: SwinRelativePositionBiasrelative_position_bias RelativePositionBias +scaled dot-product attention(3, 6, 12, 24) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [96→384]fc1 [96→384] +fc2: Linear [384→96]fc2 [384→96] +residual add+ +Final LayerNorm[1, 6, 768] +SwinForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +SwinForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/swin-tiny-patch4-wi… +model_type +swin +config +SwinConfig +decoder +dense +layers +4 +hidden +768 +intermediate +— +heads / kv +(3, 6, 12, 24) / (3, 6, 12, 24) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/swin2sr.svg b/swin2sr.svg new file mode 100644 index 0000000000000000000000000000000000000000..11efca6e81a5530ede656fa4dc44238ef6adc3a6 --- /dev/null +++ b/swin2sr.svg @@ -0,0 +1,177 @@ + + + + +swin2sr +dense · 6× MHA + +Swin2SRModel · base model +6 × Swin2SRLayerSwin2SRLayer× 6 +Self-Attention · Swin2SRAttention +self · Swin2SRSelfAttention +continuous_position_bias_mlp · Sequential +output · Swin2SRSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 180] → [1, 6, 180] +LayerNormpre-attention [1, 6, 180] +0: Linear [2→512]0 [2→512] +1: ReLU1 ReLU +2: Linear [512→6]2 [512→6] +query: Linear [180→180]query [180→180] +key: Linear [180→180]key [180→180] +value: Linear [180→180]value [180→180] +dropout: Dropoutdropout Dropout +dense: Linear [180→180]dense [180→180] +dropout: Dropoutdropout Dropout +scaled dot-product attention(6, 6, 6, 6, 6, 6) heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 180] +LM HeadLinear [180→?] +Softmax +logits[1, 6, ?] + +model id +caidas/swin2sr-classicalsr-x2… +model_type +swin2sr +config +Swin2SRConfig +decoder +dense +layers +6 +hidden +180 +intermediate +— +heads / kv +(6, 6, 6, 6, 6, 6) / (6, 6, 6, 6, 6, 6) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/swinv2.svg b/swinv2.svg new file mode 100644 index 0000000000000000000000000000000000000000..734b9e834e64acf6335021ce13d766c21c322bc5 --- /dev/null +++ b/swinv2.svg @@ -0,0 +1,173 @@ + + + + +swinv2 +dense · 4× MHA + +Swinv2Model · base model +4 × Swinv2LayerSwinv2Layer× 4 +Swinv2ForImageClassification · task head +Self-Attention · Swinv2Attention +self · Swinv2SelfAttention +continuous_position_bias_mlp · Sequential +output · Swinv2SelfOutput + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +0: Linear [2→512]0 [2→512] +1: ReLU1 ReLU +2: Linear [512→3]2 [512→3] +query: Linear [96→96]query [96→96] +key: Linear [96→96]key [96→96] +value: Linear [96→96]value [96→96] +dropout: Dropoutdropout Dropout +dense: Linear [96→96]dense [96→96] +dropout: Dropoutdropout Dropout +scaled dot-product attention(3, 6, 12, 24) heads · head_dim ? +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +Swinv2ForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +Swinv2ForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/swinv2-tiny-patch4-… +model_type +swinv2 +config +Swinv2Config +decoder +dense +layers +4 +hidden +768 +intermediate +— +heads / kv +(3, 6, 12, 24) / (3, 6, 12, 24) +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/switch_transformers.diff.svg b/switch_transformers.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..48084709ff1389dc371b21887b884a7be5fc85e6 --- /dev/null +++ b/switch_transformers.diff.svg @@ -0,0 +1,188 @@ + + + + +switch_transformers +diff vs t5 · 0 overridden · 37 added · 0 deleted · 10 new · 5 inherited-as-is + +SwitchTransformersModel · base model +12 × ModuleListModuleList× 12 +SwitchTransformersForConditionalGeneration · task head +Self-Attention · T5LayerSelfAttention ↩ inherited +SelfAttention · T5Attention ↩ inherited + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32128 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +q: Linear [768→768]q [768→768] +k: Linear [768→768]k [768→768] +v: Linear [768→768]v [768→768] +o: Linear [768→768]o [768→768] +layer_norm: SwitchTransformersLayerNorm 768layer_norm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +SwitchTransformersForConditionalGenerationLM HeadLinear [768→32128] · tied +Softmax +logits[1, 6, 32128] + +model id +google/switch-base-8 +parent +t5 +classes +15 +overridden +0 +added +37 +new classes +10 +inherited as-is +5 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +SwitchTransformersBlock +add __init__,forward + +SwitchTransformersEncoderModel +add __init__,forward,get_input_embeddings,se… + +SwitchTransformersExperts +add __init__,forward + +SwitchTransformersForConditionalGeneration +add __init__,_unpack_router_logits,forward,g… + +SwitchTransformersLayerFF +add __init__,forward + +SwitchTransformersModel +add __init__,forward,set_input_embeddings; 2… + +SwitchTransformersPreTrainedModel +add _init_weights,_shift_right; 5 attr + +SwitchTransformersSparseMLP +add __init__,forward + +SwitchTransformersStack +add __init__,forward; 1 attr + +SwitchTransformersTop1Router +add __init__,forward + \ No newline at end of file diff --git a/switch_transformers.svg b/switch_transformers.svg new file mode 100644 index 0000000000000000000000000000000000000000..62c714ba703328542643525a5720b2a87c0980b0 --- /dev/null +++ b/switch_transformers.svg @@ -0,0 +1,175 @@ + + + + +switch_transformers +sparse-moe · 12× MHA +MoE + +SwitchTransformersModel · base model +12 × ModuleListModuleList× 12 +SwitchTransformersForConditionalGeneration · task head +Self-Attention · SwitchTransformersLayerSelfAttention +SelfAttention · SwitchTransformersAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32128 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +q: Linear [768→768]q [768→768] +k: Linear [768→768]k [768→768] +v: Linear [768→768]v [768→768] +o: Linear [768→768]o [768→768] +layer_norm: SwitchTransformersLayerNorm 768layer_norm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +SwitchTransformersForConditionalGenerationLM HeadLinear [768→32128] · tied +Softmax +logits[1, 6, 32128] + +model id +google/switch-base-8 +model_type +switch_transformers +config +SwitchTransformersConfig +decoder +sparse-moe +layers +12 +hidden +768 +intermediate +2,048 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32,128 +max_pos +— +experts (top-k) +8 (top-None) +tie_embeddings +True +legend + +self-attention + +MoE / experts + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/t5.svg b/t5.svg new file mode 100644 index 0000000000000000000000000000000000000000..b09ae763aced06a550e9ca451072a5da306cb9f4 --- /dev/null +++ b/t5.svg @@ -0,0 +1,174 @@ + + + + +t5 +dense · 6× MHA + +T5Model · base model +6 × ModuleListModuleList× 6 +T5ForConditionalGeneration · task head +Self-Attention · T5LayerSelfAttention +SelfAttention · T5Attention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32128 × 512] → [1, 6, 512] +Normpre-attention [1, 6, 512] +q: Linear [512→512]q [512→512] +k: Linear [512→512]k [512→512] +v: Linear [512→512]v [512→512] +o: Linear [512→512]o [512→512] +relative_attention_bias: Embedding 32×8relative_attention_bias Embedding 32×8 +layer_norm: T5LayerNorm 512layer_norm LayerNorm 512 +dropout: Dropoutdropout Dropout +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 512] +T5ForConditionalGenerationLM HeadLinear [512→32128] · tied +Softmax +logits[1, 6, 32128] + +model id +google-t5/t5-small +model_type +t5 +config +T5Config +decoder +dense +layers +6 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32,128 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/t5gemma.diff.svg b/t5gemma.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..d6a99c96fe578074ba2d15297b7b84258cecc98f --- /dev/null +++ b/t5gemma.diff.svg @@ -0,0 +1,245 @@ + + + + +t5gemma +diff vs gemma2 · 11 overridden · 54 added · 0 deleted · 13 new · 2 inherited-as-is + +T5GemmaModel · base model +26 × T5GemmaEncoderLayerT5GemmaEncoderLayer× 26 +T5GemmaForConditionalGeneration · task head +layers (idx) +Self-Attention · T5GemmaSelfAttention (2 layer types — same modules, mask differs) +MLP · T5GemmaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 2304] → [1, 6, 2304] +T5GemmaRMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +T5GemmaRMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +dropout: Dropoutdropout Dropout +residual add+ +Final RMSNorm[1, 6, 2304] +T5GemmaForConditionalGenerationLM HeadLinear [2304→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: full_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: full_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: full_attention25 + +model id +google/t5_gemma_module-7b +parent +gemma2 +classes +19 +overridden +11 +added +54 +new classes +13 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +T5GemmaCrossAttention +ovr __init__,forward + +T5GemmaMLP +ovr __init__,forward + +T5GemmaSelfAttention +ovr __init__ + +T5GemmaClassificationHead +add __init__,forward + +T5GemmaConfig +add __post_init__; 11 attr + +T5GemmaDecoder +add __init__,forward; 1 attr + +T5GemmaDecoderLayer +add __init__,forward + +T5GemmaEncoder +add __init__,forward; 1 attr + +T5GemmaEncoderLayer +add __init__,forward + +T5GemmaEncoderModel +add __init__,forward,get_input_embeddings,se… + +T5GemmaForConditionalGeneration +add __init__,_prepare_cache_for_generation,f… + +T5GemmaForSequenceClassification +add __init__,forward,get_input_embeddings,se… + +T5GemmaForTokenClassification +add __init__,forward,get_input_embeddings,se… + +T5GemmaLMHead +add __init__,forward + +T5GemmaModel +add __init__,forward,get_input_embeddings,se… + +T5GemmaModuleConfig +2 attr + +T5GemmaPreTrainedModel +ovr _init_weights; add _shift_right; 5 attr + \ No newline at end of file diff --git a/t5gemma.svg b/t5gemma.svg new file mode 100644 index 0000000000000000000000000000000000000000..45cf86eed5c6f73a4bfa66a18d65624938283458 --- /dev/null +++ b/t5gemma.svg @@ -0,0 +1,215 @@ + + + + +t5gemma +dense · 13× sliding + 13× full + +T5GemmaModel · base model +26 × T5GemmaEncoderLayerT5GemmaEncoderLayer× 26 +T5GemmaForConditionalGeneration · task head +layers (idx) +Self-Attention · T5GemmaSelfAttention (2 layer types — same modules, mask differs) +MLP · T5GemmaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 2304] → [1, 6, 2304] +T5GemmaRMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +T5GemmaRMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +dropout: Dropoutdropout Dropout +residual add+ +Final RMSNorm[1, 6, 2304] +T5GemmaForConditionalGenerationLM HeadLinear [2304→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: full_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: full_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: full_attention25 + +model id +google/t5_gemma_module-7b +model_type +t5gemma +config +T5GemmaConfig +decoder +dense +layers +26 +hidden +2,304 +intermediate +9,216 +heads / kv +8 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +sliding_window +4,096 +tie_embeddings +True +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/t5gemma2.diff.svg b/t5gemma2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..8fafbb5f3892241d9472d06a8656f393d904f414 --- /dev/null +++ b/t5gemma2.diff.svg @@ -0,0 +1,253 @@ + + + + +t5gemma2 +diff vs gemma3 (+t5gemma) · 20 overridden · 69 added · 0 deleted · 11 new · 4 inherited-as-is + +T5Gemma2Model · base model +26 × T5Gemma2EncoderLayerT5Gemma2EncoderLayer× 26 +T5Gemma2ForConditionalGeneration · task head +layers (idx) +Self-Attention · T5Gemma2SelfAttention (2 layer types — same modules, mask differs) +MLP · T5Gemma2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262208 × 2304] → [1, 6, 2304] +T5Gemma2RMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +q_norm: T5Gemma2RMSNorm 256q_norm RMSNorm 256 +k_norm: T5Gemma2RMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +T5Gemma2RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +dropout: Dropoutdropout Dropout +residual add+ +Final RMSNorm[1, 6, 2304] +T5Gemma2ForConditionalGenerationLM HeadLinear [2304→262208] · tied +Softmax +logits[1, 6, 262208] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 + +model id +google/t5gemma-2-270m-270m +parent +gemma3 +classes +23 +overridden +20 +added +69 +new classes +11 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +T5Gemma2DecoderLayer +ovr __init__,forward + +T5Gemma2MLP +ovr __init__,forward + +T5Gemma2MergedAttention +ovr __init__,forward + +T5Gemma2MultiModalProjector +ovr __init__ + +T5Gemma2RotaryEmbedding +ovr __init__,compute_default_rope_parameters + +T5Gemma2SelfAttention +ovr __init__ + +T5Gemma2TextScaledWordEmbedding +ovr __init__,forward + +T5Gemma2Config +add __post_init__,validate_architecture; 14 … + +T5Gemma2Decoder +add __init__,forward; 2 attr + +T5Gemma2DecoderConfig +add __post_init__; 2 attr + +T5Gemma2Encoder +add __init__,forward,get_image_features,get_… + +T5Gemma2EncoderConfig +2 attr + +T5Gemma2ForConditionalGeneration +add __init__,_prepare_cache_for_generation,f… + +T5Gemma2ForSequenceClassification +add __init__,forward,get_input_embeddings,se… + +T5Gemma2ForTokenClassification +add __init__,forward,get_input_embeddings,se… + +T5Gemma2Model +add __init__,forward,get_decoder,get_encoder… + +T5Gemma2PreTrainedModel +ovr _init_weights; add prepare_decoder_input… + +T5Gemma2TextConfig +add __post_init__; 2 attr + +T5Gemma2TextEncoder +add __init__,forward; 2 attr + \ No newline at end of file diff --git a/t5gemma2.svg b/t5gemma2.svg new file mode 100644 index 0000000000000000000000000000000000000000..38cf4b0a8963b7c8acf0c79091a2a91a78d03e6d --- /dev/null +++ b/t5gemma2.svg @@ -0,0 +1,217 @@ + + + + +t5gemma2 +dense · 22× sliding + 4× full + +T5Gemma2Model · base model +26 × T5Gemma2EncoderLayerT5Gemma2EncoderLayer× 26 +T5Gemma2ForConditionalGeneration · task head +layers (idx) +Self-Attention · T5Gemma2SelfAttention (2 layer types — same modules, mask differs) +MLP · T5Gemma2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [262208 × 2304] → [1, 6, 2304] +T5Gemma2RMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +q_norm: T5Gemma2RMSNorm 256q_norm RMSNorm 256 +k_norm: T5Gemma2RMSNorm 256k_norm RMSNorm 256 +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +T5Gemma2RMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +dropout: Dropoutdropout Dropout +residual add+ +Final RMSNorm[1, 6, 2304] +T5Gemma2ForConditionalGenerationLM HeadLinear [2304→262208] · tied +Softmax +logits[1, 6, 262208] +layer 0: sliding_attention0 +layer 1: sliding_attention1 +layer 2: sliding_attention2 +layer 3: sliding_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: sliding_attention7 +layer 8: sliding_attention8 +layer 9: sliding_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: sliding_attention13 +layer 14: sliding_attention14 +layer 15: sliding_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: sliding_attention19 +layer 20: sliding_attention20 +layer 21: sliding_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: sliding_attention25 + +model id +google/t5gemma-2-270m-270m +model_type +t5gemma2 +config +T5Gemma2Config +decoder +dense +layers +26 +hidden +2,304 +intermediate +9,216 +heads / kv +8 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +262,208 +max_pos +131,072 +sliding_window +4,096 +tie_embeddings +True +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/table_transformer.svg b/table_transformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..ebe85b30104f54dcb65d129cfe98e41dabe39917 --- /dev/null +++ b/table_transformer.svg @@ -0,0 +1,169 @@ + + + + +table_transformer +dense · 6× MHA + +TableTransformerModel · base model +6 × TableTransformerEncoderLayerTableTransformerEncoderLayer× 6 +Self-Attention · TableTransformerAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 256] → [1, 6, 256] +LayerNormpre-attention [1, 6, 256] +k_proj: Linear [256→256]k_proj [256→256] +v_proj: Linear [256→256]v_proj [256→256] +q_proj: Linear [256→256]q_proj [256→256] +out_proj: Linear [256→256]out_proj [256→256] +scaled dot-product attention8 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 256] +LM HeadLinear [256→?] +Softmax +logits[1, 6, ?] + +model id +microsoft/table-transformer-d… +model_type +table-transformer +config +TableTransformerConfig +decoder +dense +layers +6 +hidden +256 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/tapas.svg b/tapas.svg new file mode 100644 index 0000000000000000000000000000000000000000..63ffc1adb8d3f219b8ce09b2643d62e2c422aceb --- /dev/null +++ b/tapas.svg @@ -0,0 +1,176 @@ + + + + +tapas +dense · 12× MHA + +TapasModel · base model +12 × TapasLayerTapasLayer× 12 +TapasForMaskedLM · task head +Self-Attention · TapasAttention +output · TapasSelfOutput +self · TapasSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +TapasForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +TapasForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +google/tapas-base-finetuned-s… +model_type +tapas +config +TapasConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +1,024 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/textnet.svg b/textnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..502ab411bc3cfa8aa230b265cfb177b1086aff66 --- /dev/null +++ b/textnet.svg @@ -0,0 +1,154 @@ + + + + +textnet +⚠ no transformer block (conv backbone) — shown from config · dense · 4× Attention + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +TextNetStageBatchNorm2d → attentionBatchNorm2d → MLP×4 +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +czczup/textnet-base +model_type +textnet +config +TextNetConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/time_series_transformer.svg b/time_series_transformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..7e53837bfa79476bb37215b54d2869d23031aacd --- /dev/null +++ b/time_series_transformer.svg @@ -0,0 +1,169 @@ + + + + +time_series_transformer +dense · 2× MHA + +TimeSeriesTransformerModel · base model +2 × TimeSeriesTransformerEncoderLayerTimeSeriesTransformerEncoderLayer× 2 +Self-Attention · TimeSeriesTransformerAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 64] → [1, 6, 64] +LayerNormpre-attention [1, 6, 64] +k_proj: Linear [64→64]k_proj [64→64] +v_proj: Linear [64→64]v_proj [64→64] +q_proj: Linear [64→64]q_proj [64→64] +out_proj: Linear [64→64]out_proj [64→64] +scaled dot-product attention2 heads · head_dim 32 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 64] +LM HeadLinear [64→?] +Softmax +logits[1, 6, ?] + +model id +huggingface/time-series-trans… +model_type +time_series_transformer +config +TimeSeriesTransformerConfig +decoder +dense +layers +2 +hidden +64 +intermediate +— +heads / kv +2 / 2 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/timesfm.diff.svg b/timesfm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..beab037749cbaa63bb76035d900199285f8804a2 --- /dev/null +++ b/timesfm.diff.svg @@ -0,0 +1,191 @@ + + + + +timesfm +diff vs llama · 0 overridden · 36 added · 0 deleted · 10 new · 1 inherited-as-is + +TimesFmModel · base model +50 × TimesFmDecoderLayerTimesFmDecoderLayer× 50 +Self-Attention · TimesFmAttention +MLP · TimesFmMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1280] → [1, 6, 1280] +TimesFmRMSNormpre-attention [1, 6, 1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +scaled dot-product attention16 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +residual add+ +TimesFmRMSNormpre-FFN [1, 6, 1280] +gate_proj: Linear [1280→1280]gate_proj [1280→1280] +down_proj: Linear [1280→1280]down_proj [1280→1280] +layer_norm: LayerNorm 1280layer_norm LayerNorm 1280 +residual add+ +Final RMSNorm[1, 6, 1280] +LM HeadLinear [1280→?] +Softmax +logits[1, 6, ?] + +model id +google/timesfm-2.0-500m-pytorc +parent +llama +classes +11 +overridden +0 +added +36 +new classes +10 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +TimesFmAttention +add __init__,_scale_query,forward + +TimesFmDecoderLayer +add __init__,forward + +TimesFmMLP +add __init__,forward + +TimesFmModel +add __init__,_forward_transform,_prepare_4d_… + +TimesFmModelForPrediction +add __init__,_postprocess_output,_preprocess… + +TimesFmOutput +2 attr + +TimesFmOutputForPrediction +3 attr + +TimesFmPositionalEmbedding +add __init__,forward + +TimesFmPreTrainedModel +add _init_weights; 7 attr + +TimesFmResidualBlock +add __init__,forward + \ No newline at end of file diff --git a/timesfm.svg b/timesfm.svg new file mode 100644 index 0000000000000000000000000000000000000000..8076ff4daaec794de5381291d39dc2b68210c024 --- /dev/null +++ b/timesfm.svg @@ -0,0 +1,176 @@ + + + + +timesfm +dense · 50× MHA + +TimesFmModel · base model +50 × TimesFmDecoderLayerTimesFmDecoderLayer× 50 +Self-Attention · TimesFmAttention +MLP · TimesFmMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1280] → [1, 6, 1280] +TimesFmRMSNormpre-attention [1, 6, 1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +scaled dot-product attention16 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +residual add+ +TimesFmRMSNormpre-FFN [1, 6, 1280] +gate_proj: Linear [1280→1280]gate_proj [1280→1280] +down_proj: Linear [1280→1280]down_proj [1280→1280] +layer_norm: LayerNorm 1280layer_norm LayerNorm 1280 +residual add+ +Final RMSNorm[1, 6, 1280] +LM HeadLinear [1280→?] +Softmax +logits[1, 6, ?] + +model id +google/timesfm-2.0-500m-pytor… +model_type +timesfm +config +TimesFmConfig +decoder +dense +layers +50 +hidden +1,280 +intermediate +1,280 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/timesfm2_5.diff.svg b/timesfm2_5.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b1a0ee206a92b2fcb02e8f9a518a29d604b3f988 --- /dev/null +++ b/timesfm2_5.diff.svg @@ -0,0 +1,192 @@ + + + + +timesfm2_5 +diff vs timesfm (+llama,apertus,clip) · 12 overridden · 29 added · 0 deleted · 2 new · 3 inherited-as-is + +TimesFm2_5Model · base model +20 × TimesFm2_5DecoderLayerTimesFm2_5DecoderLayer× 20 +Self-Attention · TimesFm2_5Attention +MLP · TimesFm2_5MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1280] → [1, 6, 1280] +TimesFm2_5RMSNormpre-attention [1, 6, 1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +q_norm: TimesFm2_5RMSNorm 80q_norm RMSNorm 80 +k_norm: TimesFm2_5RMSNorm 80k_norm RMSNorm 80 +scaled dot-product attention16 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +TimesFm2_5RMSNormpre-FFN [1, 6, 1280] +activation_fn: SiLUactivation_fn SiLU +fc1: Linear [1280→1280]fc1 [1280→1280] +fc2: Linear [1280→1280]fc2 [1280→1280] +residual add+ +Final RMSNorm[1, 6, 1280] +LM HeadLinear [1280→?] +Softmax +logits[1, 6, ?] + +model id +google/timesfm-2.5-200m-transf +parent +timesfm +classes +12 +overridden +12 +added +29 +new classes +2 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +TimesFm2_5Attention +ovr __init__,forward + +TimesFm2_5DecoderLayer +ovr __init__,forward + +TimesFm2_5MLP +ovr __init__ + +TimesFm2_5ResidualBlock +ovr __init__,forward + +TimesFm2_5Config +19 attr + +TimesFm2_5Model +add __init__,_revin,_update_running_stats,fo… + +TimesFm2_5ModelForPrediction +ovr __init__,forward; add _decode_and_project + +TimesFm2_5Output +2 attr + +TimesFm2_5PreTrainedModel +6 attr + \ No newline at end of file diff --git a/timesfm2_5.svg b/timesfm2_5.svg new file mode 100644 index 0000000000000000000000000000000000000000..2d1f7dd9d45a8805555a071a5d27942509e9669c --- /dev/null +++ b/timesfm2_5.svg @@ -0,0 +1,180 @@ + + + + +timesfm2_5 +dense · 20× MHA + +TimesFm2_5Model · base model +20 × TimesFm2_5DecoderLayerTimesFm2_5DecoderLayer× 20 +Self-Attention · TimesFm2_5Attention +MLP · TimesFm2_5MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1280] → [1, 6, 1280] +TimesFm2_5RMSNormpre-attention [1, 6, 1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +o_proj: Linear [1280→1280]o_proj [1280→1280] +q_norm: TimesFm2_5RMSNorm 80q_norm RMSNorm 80 +k_norm: TimesFm2_5RMSNorm 80k_norm RMSNorm 80 +scaled dot-product attention16 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +TimesFm2_5RMSNormpre-FFN [1, 6, 1280] +activation_fn: SiLUactivation_fn SiLU +fc1: Linear [1280→1280]fc1 [1280→1280] +fc2: Linear [1280→1280]fc2 [1280→1280] +residual add+ +Final RMSNorm[1, 6, 1280] +LM HeadLinear [1280→?] +Softmax +logits[1, 6, ?] + +model id +google/timesfm-2.5-200m-trans… +model_type +timesfm2_5 +config +TimesFm2_5Config +decoder +dense +layers +20 +hidden +1,280 +intermediate +1,280 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +— +max_pos +16,384 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/timesformer.svg b/timesformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..0b4c87e45f3c961d0cfc3357488783118aa3aaae --- /dev/null +++ b/timesformer.svg @@ -0,0 +1,171 @@ + + + + +timesformer +dense · 12× MHA + +TimesformerModel · base model +12 × TimesformerLayerTimesformerLayer× 12 +Self-Attention · TimeSformerAttention +attention · TimesformerSelfAttention +output · TimesformerSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +qkv: Linear [768→2304]qkv [768→2304] +attn_drop: Dropoutattn_drop Dropout +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +facebook/timesformer-base-fin… +model_type +timesformer +config +TimesformerConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/timm_backbone.svg b/timm_backbone.svg new file mode 100644 index 0000000000000000000000000000000000000000..4f0fe48f7d4f6c9111910ab01b24aa24599477f6 --- /dev/null +++ b/timm_backbone.svg @@ -0,0 +1,153 @@ + + + + +timm_backbone +⚠ no transformer block (conv backbone) — shown from config · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +timm_backbone +model_type +timm_backbone +config +TimmBackboneConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/timm_wrapper.svg b/timm_wrapper.svg new file mode 100644 index 0000000000000000000000000000000000000000..7ca3fd763c7cd97b1cee3ca97164c7b54d4b503f --- /dev/null +++ b/timm_wrapper.svg @@ -0,0 +1,153 @@ + + + + +timm_wrapper +⚠ no transformer block (conv backbone) — shown from config · dense · + +input imagepixel_values [1, 3, H, W] +Patch Embedding→ [1, S, ?] +Final BatchNorm2d +Pool + Classifier head→ class logits [1, 2] + +model id +timm/resnet50.a1_in1k +model_type +timm_wrapper +config +TimmWrapperConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/trocr.svg b/trocr.svg new file mode 100644 index 0000000000000000000000000000000000000000..64835cda35c39db5dd69c5c8aee6efc284eb85e8 --- /dev/null +++ b/trocr.svg @@ -0,0 +1,170 @@ + + + + +trocr +dense · 12× MHA + +TrOCRForCausalLM · base model +12 × TrOCRDecoderLayerTrOCRDecoderLayer× 12 +TrOCRForCausalLM · task head +Self-Attention · TrOCRAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +TrOCRForCausalLMLM HeadLinear [1024→50265] · tied +Softmax +logits[1, 6, 50265] + +model id +microsoft/trocr-base-handwrit… +model_type +trocr +config +TrOCRConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/tvp.svg b/tvp.svg new file mode 100644 index 0000000000000000000000000000000000000000..f086ff235352497c581c7dc60edfd28250fc1bba --- /dev/null +++ b/tvp.svg @@ -0,0 +1,172 @@ + + + + +tvp +dense · 12× MHA + +TvpModel · base model +12 × TvpEncodeLayerTvpEncodeLayer× 12 +Self-Attention · TvpAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +attn_dropout: Dropoutattn_dropout Dropout +dense: Linear [768→768]dense [768→768] +layer_norm: LayerNorm 768layer_norm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] +Softmax +logits[1, 6, 30522] + +model id +Intel/tvp-base +model_type +tvp +config +TvpConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/udop.svg b/udop.svg new file mode 100644 index 0000000000000000000000000000000000000000..075b1dd69896c26a265cd98b4be30e96cc0921f3 --- /dev/null +++ b/udop.svg @@ -0,0 +1,174 @@ + + + + +udop +dense · 24× MHA + +UdopModel · base model +24 × ModuleListModuleList× 24 +UdopForConditionalGeneration · task head +Self-Attention · UdopLayerSelfAttention +SelfAttention · UdopAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [33201 × 1024] → [1, 6, 1024] +Normpre-attention [1, 6, 1024] +q: Linear [1024→1024]q [1024→1024] +k: Linear [1024→1024]k [1024→1024] +v: Linear [1024→1024]v [1024→1024] +o: Linear [1024→1024]o [1024→1024] +relative_attention_bias: Embedding 32×16relative_attention_bias Embedding 32×16 +layer_norm: UdopLayerNorm 1024layer_norm LayerNorm 1024 +dropout: Dropoutdropout Dropout +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +UdopForConditionalGenerationLM HeadLinear [1024→33201] · tied +Softmax +logits[1, 6, 33201] + +model id +microsoft/udop-large +model_type +udop +config +UdopConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +33,201 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/umt5.svg b/umt5.svg new file mode 100644 index 0000000000000000000000000000000000000000..6e7e2acef3a2d18b910c90daaacb995d2cce0c50 --- /dev/null +++ b/umt5.svg @@ -0,0 +1,174 @@ + + + + +umt5 +dense · 8× MHA + +UMT5Model · base model +8 × ModuleListModuleList× 8 +UMT5ForConditionalGeneration · task head +Self-Attention · UMT5LayerSelfAttention +SelfAttention · UMT5Attention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250112 × 512] → [1, 6, 512] +Normpre-attention [1, 6, 512] +q: Linear [512→384]q [512→384] +k: Linear [512→384]k [512→384] +v: Linear [512→384]v [512→384] +o: Linear [384→512]o [384→512] +relative_attention_bias: Embedding 32×6relative_attention_bias Embedding 32×6 +layer_norm: UMT5LayerNorm 512layer_norm LayerNorm 512 +dropout: Dropoutdropout Dropout +scaled dot-product attention6 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 512] +UMT5ForConditionalGenerationLM HeadLinear [512→250112] · tied +Softmax +logits[1, 6, 250112] + +model id +google/umt5-small +model_type +umt5 +config +UMT5Config +decoder +dense +layers +8 +hidden +512 +intermediate +1,024 +heads / kv +6 / 6 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +250,112 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/unispeech.diff.svg b/unispeech.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..1aeb6a9cf6a321bbf2f6f6f206caa51f9e182e4d --- /dev/null +++ b/unispeech.diff.svg @@ -0,0 +1,174 @@ + + + + +unispeech +diff vs wav2vec2 · 4 overridden · 22 added · 1 deleted · 3 new · 7 inherited-as-is + +UniSpeechModel · base model +12 × UniSpeechEncoderLayerUniSpeechEncoderLayer× 12 +UniSpeechForSequenceClassification · task head +Self-Attention · Wav2Vec2Attention ↩ inherited +MLP · Wav2Vec2FeedForward ↩ inherited + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +UniSpeechForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +UniSpeechForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/unispeech-large-1500 +parent +wav2vec2 +classes +12 +overridden +4 +added +22 +new classes +3 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +UniSpeechModel +ovr __init__,forward; del freeze_feature_enc… + +UniSpeechGumbelVectorQuantizer +ovr _compute_perplexity,forward + +UniSpeechForPreTraining +add __init__,compute_contrastive_logits,forw… + +UniSpeechForPreTrainingOutput +6 attr + +UniSpeechPreTrainedModel +add _get_feat_extract_output_lengths,_get_fe… + \ No newline at end of file diff --git a/unispeech.svg b/unispeech.svg new file mode 100644 index 0000000000000000000000000000000000000000..0e5f8bd2f5959308c3263bead155ae661e5d52f8 --- /dev/null +++ b/unispeech.svg @@ -0,0 +1,174 @@ + + + + +unispeech +dense · 12× MHA + +UniSpeechModel · base model +12 × UniSpeechEncoderLayerUniSpeechEncoderLayer× 12 +UniSpeechForSequenceClassification · task head +Self-Attention · UniSpeechAttention +MLP · UniSpeechFeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +UniSpeechForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +UniSpeechForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/unispeech-large-150… +model_type +unispeech +config +UniSpeechConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/unispeech_sat.diff.svg b/unispeech_sat.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..03afd16e157aecbf4cb2cd2c21a25dd4bff30a01 --- /dev/null +++ b/unispeech_sat.diff.svg @@ -0,0 +1,174 @@ + + + + +unispeech_sat +diff vs wav2vec2 · 5 overridden · 23 added · 1 deleted · 3 new · 9 inherited-as-is + +UniSpeechSatModel · base model +12 × UniSpeechSatEncoderLayerUniSpeechSatEncoderLayer× 12 +UniSpeechSatForSequenceClassification · task head +Self-Attention · Wav2Vec2Attention ↩ inherited +MLP · Wav2Vec2FeedForward ↩ inherited + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +UniSpeechSatForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +UniSpeechSatForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/unispeech-sat-base-1 +parent +wav2vec2 +classes +14 +overridden +5 +added +23 +new classes +3 +inherited as-is +9 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +UniSpeechSatModel +ovr __init__,forward; del freeze_feature_enc… + +UniSpeechSatGumbelVectorQuantizer +ovr __init__,_compute_perplexity,forward + +UniSpeechSatForPreTraining +add __init__,compute_contrastive_logits,forw… + +UniSpeechSatForPreTrainingOutput +7 attr + +UniSpeechSatPreTrainedModel +add _get_feat_extract_output_lengths,_get_fe… + \ No newline at end of file diff --git a/unispeech_sat.svg b/unispeech_sat.svg new file mode 100644 index 0000000000000000000000000000000000000000..22c9927aaf6a9038995b5c422c55e3a5647942ca --- /dev/null +++ b/unispeech_sat.svg @@ -0,0 +1,174 @@ + + + + +unispeech_sat +dense · 12× MHA + +UniSpeechSatModel · base model +12 × UniSpeechSatEncoderLayerUniSpeechSatEncoderLayer× 12 +UniSpeechSatForSequenceClassification · task head +Self-Attention · UniSpeechSatAttention +MLP · UniSpeechSatFeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +UniSpeechSatForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +UniSpeechSatForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/unispeech-sat-base-… +model_type +unispeech-sat +config +UniSpeechSatConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/univnet.svg b/univnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..462e6b39968bfed6a59fbe03d88c45df9198b7a5 --- /dev/null +++ b/univnet.svg @@ -0,0 +1,154 @@ + + + + +univnet +⚠ no transformer block (conv backbone) — shown from config · dense · 4× Attention + +input_ids[1, S] +Token Embedding[? × ?] +UnivNetLvcResidualBlockNorm → attentionNorm → MLP×4 +Final Norm +LM Head→ logits [1, S, ?] + +model id +dg845/univnet-dev +model_type +univnet +config +UnivNetConfig +decoder +dense +layers +4 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/upernet.svg b/upernet.svg new file mode 100644 index 0000000000000000000000000000000000000000..99790d6aad7668e72906c780709a817a09013a06 --- /dev/null +++ b/upernet.svg @@ -0,0 +1,154 @@ + + + + +upernet +⚠ no transformer block (conv backbone) — shown from config · dense · 4× Attention + +input_ids[1, S] +Token Embedding[? × 512] +ResNetStageBatchNorm2d → attentionBatchNorm2d → MLP×4 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +openmmlab/upernet-convnext-ti… +model_type +upernet +config +UperNetConfig +decoder +dense +layers +4 +hidden +512 +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/uvdoc.diff.svg b/uvdoc.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..1e88aac691635c35a0d0abfcc213efa259e9f2ed --- /dev/null +++ b/uvdoc.diff.svg @@ -0,0 +1,177 @@ + + + + +uvdoc +diff vs pp_lcnet (+pp_ocrv5_server_det) · 1 overridden · 46 added · 0 deleted · 12 new · 0 inherited-as-is + +input_ids[1, S] +Token Embedding[? × ?] +UVDocResidualBlockBatchNorm2d → attentionBatchNorm2d → MLP×6 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/UVDoc_safetensors +parent +pp_lcnet +classes +14 +overridden +1 +added +46 +new classes +12 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +UVDocConvLayer +ovr __init__ + +UVDocBackbone +add __init__,forward; 2 attr + +UVDocBackboneConfig +add __post_init__; 7 attr + +UVDocBridge +add __init__,forward + +UVDocBridgeBlock +add __init__,forward + +UVDocConfig +add __post_init__; 8 attr + +UVDocHead +add __init__,forward + +UVDocImageProcessor +add _preprocess,post_process_document_rectif… + +UVDocModel +add __init__,forward + +UVDocPointPositions2D +add __init__,forward + +UVDocPreTrainedModel +add _init_weights; 2 attr + +UVDocResNet +add __init__,forward + +UVDocResNetStage +add __init__,forward + +UVDocResidualBlock +add __init__,forward + \ No newline at end of file diff --git a/uvdoc.svg b/uvdoc.svg new file mode 100644 index 0000000000000000000000000000000000000000..4e7239284288aa0c9028ea478f31a64dda4a2ce6 --- /dev/null +++ b/uvdoc.svg @@ -0,0 +1,154 @@ + + + + +uvdoc +⚠ no transformer block (conv backbone) — shown from config · dense · 6× Attention + +input_ids[1, S] +Token Embedding[? × ?] +UVDocResidualBlockBatchNorm2d → attentionBatchNorm2d → MLP×6 +Final BatchNorm2d +LM Head→ logits [1, S, ?] + +model id +PaddlePaddle/UVDoc_safetensors +model_type +uvdoc +config +UVDocConfig +decoder +dense +layers +6 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +BatchNorm2d +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/vaultgemma.diff.svg b/vaultgemma.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..c0af29361d593cd976d4fc77086e7e1d112bf62e --- /dev/null +++ b/vaultgemma.diff.svg @@ -0,0 +1,202 @@ + + + + +vaultgemma +diff vs gemma2 · 3 overridden · 1 added · 0 deleted · 1 new · 3 inherited-as-is + +VaultGemmaModel · base model +26 × VaultGemmaDecoderLayerVaultGemmaDecoderLayer× 26 +VaultGemmaForCausalLM · task head +layers (idx) +Self-Attention · VaultGemmaAttention (2 layer types — same modules, mask differs) +MLP · Gemma2MLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 2304] → [1, 6, 2304] +VaultGemmaRMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +VaultGemmaRMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +VaultGemmaForCausalLMLM HeadLinear [2304→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: full_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: full_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: full_attention25 + +model id +google/vaultgemma-1b +parent +gemma2 +classes +6 +overridden +3 +added +1 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VaultGemmaAttention +ovr __init__ + +VaultGemmaDecoderLayer +ovr __init__,forward + +VaultGemmaConfig +1 attr + \ No newline at end of file diff --git a/vaultgemma.svg b/vaultgemma.svg new file mode 100644 index 0000000000000000000000000000000000000000..741e625728be9e4288490409b1cb109e261afc1f --- /dev/null +++ b/vaultgemma.svg @@ -0,0 +1,214 @@ + + + + +vaultgemma +dense · 13× sliding + 13× full + +VaultGemmaModel · base model +26 × VaultGemmaDecoderLayerVaultGemmaDecoderLayer× 26 +VaultGemmaForCausalLM · task head +layers (idx) +Self-Attention · VaultGemmaAttention (2 layer types — same modules, mask differs) +MLP · VaultGemmaMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256000 × 2304] → [1, 6, 2304] +VaultGemmaRMSNormpre-attention [1, 6, 2304] +q_proj: Linear [2304→2048]q_proj [2304→2048] +k_proj: Linear [2304→1024]k_proj [2304→1024] +v_proj: Linear [2304→1024]v_proj [2304→1024] +o_proj: Linear [2048→2304]o_proj [2048→2304] +scaled dot-product attention8 heads · head_dim 256 · GQA 8:4 +sliding_attention attention mask (q↓ × k→)sliding mask +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +VaultGemmaRMSNormpre-FFN [1, 6, 2304] +gate_proj: Linear [2304→9216]gate_proj [2304→9216] +up_proj: Linear [2304→9216]up_proj [2304→9216] +down_proj: Linear [9216→2304]down_proj [9216→2304] +act_fn: GELUTanhact_fn GELUTanh +residual add+ +Final RMSNorm[1, 6, 2304] +VaultGemmaForCausalLMLM HeadLinear [2304→256000] · tied +Softmax +logits[1, 6, 256000] +layer 0: sliding_attention0 +layer 1: full_attention1 +layer 2: sliding_attention2 +layer 3: full_attention3 +layer 4: sliding_attention4 +layer 5: full_attention5 +layer 6: sliding_attention6 +layer 7: full_attention7 +layer 8: sliding_attention8 +layer 9: full_attention9 +layer 10: sliding_attention10 +layer 11: full_attention11 +layer 12: sliding_attention12 +layer 13: full_attention13 +layer 14: sliding_attention14 +layer 15: full_attention15 +layer 16: sliding_attention16 +layer 17: full_attention17 +layer 18: sliding_attention18 +layer 19: full_attention19 +layer 20: sliding_attention20 +layer 21: full_attention21 +layer 22: sliding_attention22 +layer 23: full_attention23 +layer 24: sliding_attention24 +layer 25: full_attention25 + +model id +google/vaultgemma-1b +model_type +vaultgemma +config +VaultGemmaConfig +decoder +dense +layers +26 +hidden +2,304 +intermediate +9,216 +heads / kv +8 / 4 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +256,000 +max_pos +8,192 +sliding_window +4,096 +tie_embeddings +True +legend + +self-attention + +sliding + +full + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vibevoice_acoustic_tokenizer.diff.svg b/vibevoice_acoustic_tokenizer.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..c93e688947dcab67fd0744af4a23ae3408e0789d --- /dev/null +++ b/vibevoice_acoustic_tokenizer.diff.svg @@ -0,0 +1,203 @@ + + + + +vibevoice_acoustic_tokenizer +diff vs llama (+voxtral_realtime) · 0 overridden · 38 added · 0 deleted · 15 new · 2 inherited-as-is + +VibeVoiceAcousticTokenizerModel · base model +8 × VibeVoiceAcousticTokenizerConvNext1dLayerVibeVoiceAcousticTokenizerConvNext1dLayer× 8 +Token Mixer (SSM) · VibeVoiceAcousticTokenizerCau… +MLP · VibeVoiceAcousticTokenizerFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 64] → [1, 6, 64] +VibeVoiceAcousticTokenizerRMSNormpre-mixer [1, 6, 64] +conv: Conv1d 2048×1×7conv Conv1d 2048×1×7 +selective state-space scan (SSM) +causal attention mask (q↓ × k→)causal mask +residual add+ +VibeVoiceAcousticTokenizerRMSNormpre-FFN [1, 6, 64] +linear1: Linear [2048→8192]linear1 [2048→8192] +activation: GELUActivationactivation GELU +linear2: Linear [8192→2048]linear2 [8192→2048] +residual add+ +Final RMSNorm[1, 6, 64] +LM HeadLinear [64→?] +Softmax +logits[1, 6, ?] + +model id +microsoft/VibeVoice-1.5B +parent +llama +classes +17 +overridden +0 +added +38 +new classes +15 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VibeVoiceAcousticTokenizerCausalConv1d +add __init__,forward + +VibeVoiceAcousticTokenizerCausalConvTranspose1d +add __init__,forward + +VibeVoiceAcousticTokenizerConvNext1dLayer +add __init__,forward + +VibeVoiceAcousticTokenizerDecoderLayer +add __init__,forward + +VibeVoiceAcousticTokenizerDecoderModel +add __init__,forward; 1 attr + +VibeVoiceAcousticTokenizerDecoderOutput +2 attr + +VibeVoiceAcousticTokenizerDecoderStem +add __init__,forward + +VibeVoiceAcousticTokenizerEncoderLayer +add __init__,forward + +VibeVoiceAcousticTokenizerEncoderModel +add __init__,forward; 1 attr + +VibeVoiceAcousticTokenizerEncoderOutput +2 attr + +VibeVoiceAcousticTokenizerEncoderStem +add __init__,forward + +VibeVoiceAcousticTokenizerFeedForward +add __init__,forward + +VibeVoiceAcousticTokenizerModel +add __init__,decode,encode,forward + +VibeVoiceAcousticTokenizerOutput +3 attr + +VibeVoiceAcousticTokenizerPreTrainedModel +add _init_weights; 4 attr + \ No newline at end of file diff --git a/vibevoice_acoustic_tokenizer.svg b/vibevoice_acoustic_tokenizer.svg new file mode 100644 index 0000000000000000000000000000000000000000..34cf0005b06d6c14baaccaa841a6e28ea3f7fad3 --- /dev/null +++ b/vibevoice_acoustic_tokenizer.svg @@ -0,0 +1,173 @@ + + + + +vibevoice_acoustic_tokenizer +dense · 8× Attention + +VibeVoiceAcousticTokenizerModel · base model +8 × VibeVoiceAcousticTokenizerConvNext1dLayerVibeVoiceAcousticTokenizerConvNext1dLayer× 8 +Token Mixer (SSM) · VibeVoiceAcousticTokenizerCau… +MLP · VibeVoiceAcousticTokenizerFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 64] → [1, 6, 64] +VibeVoiceAcousticTokenizerRMSNormpre-mixer [1, 6, 64] +conv: Conv1d 2048×1×7conv Conv1d 2048×1×7 +selective state-space scan (SSM) +causal attention mask (q↓ × k→)causal mask +residual add+ +VibeVoiceAcousticTokenizerRMSNormpre-FFN [1, 6, 64] +linear1: Linear [2048→8192]linear1 [2048→8192] +activation: GELUActivationactivation GELU +linear2: Linear [8192→2048]linear2 [8192→2048] +residual add+ +Final RMSNorm[1, 6, 64] +LM HeadLinear [64→?] +Softmax +logits[1, 6, ?] + +model id +microsoft/VibeVoice-1.5B +model_type +vibevoice_acoustic_tokenizer +config +VibeVoiceAcousticTokenizerConfig +decoder +dense +layers +8 +hidden +64 +intermediate +— +heads / kv +None / None +attention +— +norm +RMSNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vibevoice_asr.diff.svg b/vibevoice_asr.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0f3c59e642e5c69eeebb1b75dd5cb6c4ec59cdbe --- /dev/null +++ b/vibevoice_asr.diff.svg @@ -0,0 +1,186 @@ + + + + +vibevoice_asr +diff vs qwen2 (+vibevoice_acoustic_tokenizer) · 4 overridden · 36 added · 0 deleted · 6 new · 1 inherited-as-is + +VibeVoiceAsrModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +VibeVoiceAsrForConditionalGeneration · task head +Self-Attention · Qwen2Attention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +VibeVoiceAsrForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] + +model id +microsoft/VibeVoice-ASR-HF +parent +qwen2 +classes +8 +overridden +4 +added +36 +new classes +6 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VibeVoiceAsrCausalLMOutputWithPast +6 attr + +VibeVoiceAsrConfig +add __post_init__; 10 attr + +VibeVoiceAsrForConditionalGeneration +add __init__,forward,get_audio_features,prep… + +VibeVoiceAsrModel +add __init__,forward,get_audio_features,get_… + +VibeVoiceAsrModelOutputWithPast +1 attr + +VibeVoiceAsrMultiModalProjector +add __init__,forward + +VibeVoiceAsrPreTrainedModel +10 attr + \ No newline at end of file diff --git a/vibevoice_asr.svg b/vibevoice_asr.svg new file mode 100644 index 0000000000000000000000000000000000000000..3a7a62efb0b7a121278645240edfcf899be498b0 --- /dev/null +++ b/vibevoice_asr.svg @@ -0,0 +1,180 @@ + + + + +vibevoice_asr +dense · 32× full + +VibeVoiceAsrModel · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +VibeVoiceAsrForConditionalGeneration · task head +Self-Attention · Qwen2Attention +MLP · Qwen2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +VibeVoiceAsrForConditionalGenerationLM HeadLinear [4096→151936] · tied +Softmax +logits[1, 6, 151936] + +model id +microsoft/VibeVoice-ASR-HF +model_type +vibevoice_asr +config +VibeVoiceAsrConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/video_llama_3.diff.svg b/video_llama_3.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..8fa9c8ac82d378d6ce6285d6a7b7cd28ff115051 --- /dev/null +++ b/video_llama_3.diff.svg @@ -0,0 +1,252 @@ + + + + +video_llama_3 +diff vs qwen2_vl (+siglip) · 18 overridden · 70 added · 4 deleted · 14 new · 2 inherited-as-is + +VideoLlama3Model · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +VideoLlama3ForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +Vision encoder · VideoLlama3Vi…×12 +VideoLlama3VisionEncoderL…×12 +MLP · Qwen2MLP +Projector · VideoLlama3Projector +self_attn · VideoLlama3VisionAtt… +readout · Sequential +mlp · Qwen2VLVisionMLP ↩ inh… + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +VideoLlama3ForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +0: Linear [768→4096]0 [768→4096] +1: GELU1 GELU +2: Linear [4096→4096]2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +lkhl/VideoLLaMA3-2B-Image-HF +parent +qwen2_vl +classes +22 +overridden +18 +added +70 +new classes +14 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VideoLlama3ForConditionalGeneration +ovr __init__,_expand_inputs_for_generation,_… + +VideoLlama3Model +ovr __init__,forward,get_image_features,get_… + +VideoLlama3PreTrainedModel +ovr _init_weights; 2 attr + +VideoLlama3VisionAttention +ovr __init__,forward + +VideoLlama3VisionEncoder +ovr __init__,forward + +VideoLlama3VisionEncoderLayer +ovr __init__,forward + +VideoLlama3CausalLMOutputWithPast +7 attr + +VideoLlama3Config +add __post_init__; 8 attr + +VideoLlama3ImageProcessor +add _preprocess; 6 attr + +VideoLlama3ImageProcessorKwargs +rename only + +VideoLlama3ImageProcessorPil +add _preprocess; 6 attr + +VideoLlama3ModelOutputWithPast +6 attr + +VideoLlama3Processor +add __init__,_calculate_timestamps,model_inp… + +VideoLlama3ProcessorKwargs +1 attr + +VideoLlama3Projector +add __init__,forward + +VideoLlama3VideoProcessor +add _get_compression_mask,_preprocess; 8 attr + +VideoLlama3VideoProcessorInitKwargs +1 attr + +VideoLlama3VisionConfig +4 attr + +VideoLlama3VisionEmbeddings +add __init__,forward + +VideoLlama3VisionModel +add __init__,forward,get_input_embeddings,pi… + \ No newline at end of file diff --git a/video_llama_3.svg b/video_llama_3.svg new file mode 100644 index 0000000000000000000000000000000000000000..f35e4bd5ceeb1ca53775e5d16dc9443991edf274 --- /dev/null +++ b/video_llama_3.svg @@ -0,0 +1,215 @@ + + + + +video_llama_3 +multimodal · vision → projector → LLM · dense + +VideoLlama3Model · base model +32 × Qwen2DecoderLayerQwen2DecoderLayer× 32 +VideoLlama3ForConditionalGeneration · task head +image ⊕ text attention +Self-Attention · Qwen2Attention +Vision encoder · VideoLlama3Vi…×12 +VideoLlama3VisionEncoderL…×12 +MLP · Qwen2MLP +Projector · VideoLlama3Projector +self_attn · VideoLlama3VisionAtt… +readout · Sequential +mlp · VideoLlama3VisionMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [151936 × 4096] → [1, 6, 4096] +Qwen2RMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +full_attention attention mask (q↓ × k→)full mask +RoPErotary positions → Q, K +residual add+ +Qwen2RMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→22016]gate_proj [4096→22016] +up_proj: Linear [4096→22016]up_proj [4096→22016] +down_proj: Linear [22016→4096]down_proj [22016→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +VideoLlama3ForConditionalGenerationLM HeadLinear [4096→151936] +Softmax +logits[1, 6, 151936] +example image +pixel_values[1, 3, 336, 336] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +activation_fn: GELUTanhactivation_fn GELUTanh +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +0: Linear [768→4096]0 [768→4096] +1: GELU1 GELU +2: Linear [4096→4096]2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · prefix-LM: i… + +model id +lkhl/VideoLLaMA3-2B-Image-HF +inputs +input_ids, pixel_values +built via +AutoModel +model_type +video_llama_3 +config +VideoLlama3Config +decoder +dense +layers +32 +hidden +4,096 +intermediate +22,016 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +151,936 +max_pos +32,768 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/video_llava.svg b/video_llava.svg new file mode 100644 index 0000000000000000000000000000000000000000..6e3a5a712b5432032219a4131d4f4ee98edde71a --- /dev/null +++ b/video_llava.svg @@ -0,0 +1,232 @@ + + + + +video_llava +multimodal · vision+vision → projector → LLM · dense + +VideoLlavaModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +VideoLlavaForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · CLIPVisionMod…×24 +Vision encoder · CLIPVisionMod…×24 +Self-Attention · LlamaAttention +CLIPEncoderLayer×24 +CLIPEncoderLayer×24 +MLP · LlamaMLP +self_attn · CLIPAttention +self_attn · CLIPAttention +Projector · VideoLlavaMultiModalProje… +mlp · CLIPMLP +mlp · CLIPMLP + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +VideoLlavaForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +linear_1: Linear [1024→4096]linear_1 [1024→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +LanguageBind/Video-LLaVA-7B-hf +inputs +input_ids, pixel_values +built via +AutoModel +model_type +video_llava +config +VideoLlavaConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/videomae.svg b/videomae.svg new file mode 100644 index 0000000000000000000000000000000000000000..301eaa635c420bc7244eed603c8435e23fff496d --- /dev/null +++ b/videomae.svg @@ -0,0 +1,173 @@ + + + + +videomae +dense · 12× MHA + +VideoMAEModel · base model +12 × VideoMAELayerVideoMAELayer× 12 +VideoMAEForPreTraining · task head +Self-Attention · VideoMAEAttention +attention · VideoMAESelfAttention +output · VideoMAESelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +VideoMAEForPreTrainingLM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +MCG-NJU/videomae-base +model_type +videomae +config +VideoMAEConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/videomt.diff.svg b/videomt.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..234ddda301977069fbab8101e51075850cb3e5d5 --- /dev/null +++ b/videomt.diff.svg @@ -0,0 +1,179 @@ + + + + +videomt +diff vs eomt · 9 overridden · 7 added · 1 deleted · 2 new · 7 inherited-as-is + +VideomtForUniversalSegmentation · base model +24 × VideomtLayerVideomtLayer× 24 +Self-Attention · EomtAttention ↩ inherited +MLP · EomtMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +fc1: Linear [1024→4096]fc1 [1024→4096] +activation: GELUActivationactivation GELU +fc2: Linear [4096→1024]fc2 [4096→1024] +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +tue-mps/videomt-dinov2-small-y +parent +eomt +classes +13 +overridden +9 +added +7 +new classes +2 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VideomtForUniversalSegmentation +ovr __init__,forward; del _disable_attention… + +VideomtEmbeddings +ovr __init__,forward + +VideomtPatchEmbeddings +ovr forward + +VideomtPreTrainedModel +ovr _init_weights; 2 attr + +VideomtConfig +1 attr + +VideomtForUniversalSegmentationOutput +6 attr + \ No newline at end of file diff --git a/videomt.svg b/videomt.svg new file mode 100644 index 0000000000000000000000000000000000000000..5facb94aaddbed32763860074be59df2d5c19c3d --- /dev/null +++ b/videomt.svg @@ -0,0 +1,176 @@ + + + + +videomt +dense · 24× MHA + +VideomtForUniversalSegmentation · base model +24 × VideomtLayerVideomtLayer× 24 +Self-Attention · VideomtAttention +MLP · VideomtMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +fc1: Linear [1024→4096]fc1 [1024→4096] +activation: GELUActivationactivation GELU +fc2: Linear [4096→1024]fc2 [4096→1024] +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +tue-mps/videomt-dinov2-small-… +model_type +videomt +config +VideomtConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vilt.svg b/vilt.svg new file mode 100644 index 0000000000000000000000000000000000000000..20b32d36b086291b0ad5ea5c1d5fc195632b97a6 --- /dev/null +++ b/vilt.svg @@ -0,0 +1,173 @@ + + + + +vilt +dense · 12× MHA + +ViltModel · base model +12 × ViltLayerViltLayer× 12 +Self-Attention · ViltAttention +attention · ViltSelfAttention +output · ViltSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +dandelin/vilt-b32-mlm +model_type +vilt +config +ViltConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +40 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vipllava.diff.svg b/vipllava.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..335351f978a6bbc77ab0db94d391a37e028982b6 --- /dev/null +++ b/vipllava.diff.svg @@ -0,0 +1,201 @@ + + + + +vipllava +diff vs llava · 4 overridden · 2 added · 0 deleted · 1 new · 3 inherited-as-is + +VipLlavaModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +VipLlavaForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · CLIPVisionMod…×24 +Self-Attention · LlamaAttention +CLIPEncoderLayer×24 +MLP · LlamaMLP +Projector · VipLlavaMultiModalProject… +self_attn · CLIPAttention +mlp · CLIPMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +VipLlavaForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +projector_layernorm: LayerNorm 5120projector_layernormLayerNorm 5120 +linear_1: Linear [5120→4096]linear_1 [5120→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +llava-hf/vip-llava-7b-hf +parent +llava +classes +6 +overridden +4 +added +2 +new classes +1 +inherited as-is +3 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VipLlavaForConditionalGeneration +ovr forward,get_image_features + +VipLlavaModel +ovr forward,get_image_features + +VipLlavaMultiModalProjector +add __init__,forward + \ No newline at end of file diff --git a/vipllava.svg b/vipllava.svg new file mode 100644 index 0000000000000000000000000000000000000000..9ef7d1d928d5f3659fe8989c4c0bce2939939273 --- /dev/null +++ b/vipllava.svg @@ -0,0 +1,215 @@ + + + + +vipllava +multimodal · vision → projector → LLM · dense + +VipLlavaModel · base model +32 × LlamaDecoderLayerLlamaDecoderLayer× 32 +VipLlavaForConditionalGeneration · task head +image ⊕ text attention +Vision encoder · CLIPVisionMod…×24 +Self-Attention · LlamaAttention +CLIPEncoderLayer×24 +MLP · LlamaMLP +Projector · VipLlavaMultiModalProject… +self_attn · CLIPAttention +mlp · CLIPMLP + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 4096] → [1, 6, 4096] +LlamaRMSNormpre-attention [1, 6, 4096] +q_proj: Linear [4096→4096]q_proj [4096→4096] +k_proj: Linear [4096→4096]k_proj [4096→4096] +v_proj: Linear [4096→4096]v_proj [4096→4096] +o_proj: Linear [4096→4096]o_proj [4096→4096] +scaled dot-product attention32 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 4096] +gate_proj: Linear [4096→11008]gate_proj [4096→11008] +up_proj: Linear [4096→11008]up_proj [4096→11008] +down_proj: Linear [11008→4096]down_proj [11008→4096] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +VipLlavaForConditionalGenerationLM HeadLinear [4096→32000] +Softmax +logits[1, 6, 32000] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +layer_norm1: LayerNorm 1024layer_norm1 LayerNorm 1024 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +layer_norm2: LayerNorm 1024layer_norm2 LayerNorm 1024 +projector_layernorm: LayerNorm 5120projector_layernormLayerNorm 5120 +linear_1: Linear [5120→4096]linear_1 [5120→4096] +act: GELUActivationact GELU +linear_2: Linear [4096→4096]linear_2 [4096→4096] +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +llava-hf/vip-llava-7b-hf +inputs +input_ids, pixel_values +built via +AutoModel +model_type +vipllava +config +VipLlavaConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +11,008 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +2,048 +tie_embeddings +False +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/vision_encoder_decoder.svg b/vision_encoder_decoder.svg new file mode 100644 index 0000000000000000000000000000000000000000..0a2e924aa1548aab0b2b0e0af2b3106051dca787 --- /dev/null +++ b/vision_encoder_decoder.svg @@ -0,0 +1,155 @@ + + + + +vision_encoder_decoder +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +vision_encoder_decoder +model_type +vision-encoder-decoder +config +VisionEncoderDecoderConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +— +vocab +— +max_pos +— +tie_embeddings +None +status +failed +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/vision_text_dual_encoder.svg b/vision_text_dual_encoder.svg new file mode 100644 index 0000000000000000000000000000000000000000..1655e32dfe20f04c5b8a8d4e2c3dceef698f0a6c --- /dev/null +++ b/vision_text_dual_encoder.svg @@ -0,0 +1,155 @@ + + + + +vision_text_dual_encoder +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +vision_text_dual_encoder +model_type +vision-text-dual-encoder +config +VisionTextDualEncoderConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +— +vocab +— +max_pos +— +tie_embeddings +None +status +failed +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/visual_bert.svg b/visual_bert.svg new file mode 100644 index 0000000000000000000000000000000000000000..fec65f985e3b026e533b774ea9d122baa8c13bfa --- /dev/null +++ b/visual_bert.svg @@ -0,0 +1,175 @@ + + + + +visual_bert +dense · 12× MHA + +VisualBertModel · base model +12 × VisualBertLayerVisualBertLayer× 12 +VisualBertForPreTraining · task head +Self-Attention · VisualBertAttention +output · VisualBertSelfOutput +self · VisualBertSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +VisualBertForPreTrainingLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +uclanlp/visualbert-vqa-coco-p… +model_type +visual_bert +config +VisualBertConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vit.svg b/vit.svg new file mode 100644 index 0000000000000000000000000000000000000000..cc36c054cd58ced79d462e7ac5f5176bd0e764f3 --- /dev/null +++ b/vit.svg @@ -0,0 +1,172 @@ + + + + +vit +dense · 12× MHA + +ViTModel · base model +12 × ViTLayerViTLayer× 12 +ViTForImageClassification · task head +Self-Attention · ViTAttention +MLP · ViTMLP + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +ViTForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +ViTForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +google/vit-base-patch16-224 +model_type +vit +config +ViTConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vit_mae.diff.svg b/vit_mae.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..43e9eec319f19c6b987b825b1923dc4e1b555791 --- /dev/null +++ b/vit_mae.diff.svg @@ -0,0 +1,186 @@ + + + + +vit_mae +diff vs vit · 7 overridden · 24 added · 0 deleted · 5 new · 4 inherited-as-is + +ViTMAEModel · base model +12 × ViTMAELayerViTMAELayer× 12 +ViTMAEForPreTraining · task head +Self-Attention · ViTAttention ↩ inherited +MLP · ViTMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +ViTMAEForPreTrainingLM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +facebook/vit-mae-base +parent +vit +classes +12 +overridden +7 +added +24 +new classes +5 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ViTMAEModel +ovr __init__,forward + +ViTMAEPreTrainedModel +ovr _init_weights; 2 attr + +ViTMAEDecoder +add __init__,forward,initialize_weights,inte… + +ViTMAEDecoderOutput +3 attr + +ViTMAEEmbeddings +ovr __init__,forward; add initialize_weights… + +ViTMAEForPreTraining +add __init__,forward,patchify,unpatchify + +ViTMAEForPreTrainingOutput +6 attr + +ViTMAEModelOutput +5 attr + \ No newline at end of file diff --git a/vit_mae.svg b/vit_mae.svg new file mode 100644 index 0000000000000000000000000000000000000000..c616435dafd1b1a3ac82f90ae829c9cf9e3b2646 --- /dev/null +++ b/vit_mae.svg @@ -0,0 +1,177 @@ + + + + +vit_mae +dense · 12× MHA + +ViTMAEModel · base model +12 × ViTMAELayerViTMAELayer× 12 +ViTMAEForPreTraining · task head +Self-Attention · ViTMAEAttention +MLP · ViTMAEMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +ViTMAEForPreTrainingLM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +facebook/vit-mae-base +model_type +vit_mae +config +ViTMAEConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vit_msn.diff.svg b/vit_msn.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..76fb3fc4c1232c3f3d8a40c108375f3548aa05c6 --- /dev/null +++ b/vit_msn.diff.svg @@ -0,0 +1,169 @@ + + + + +vit_msn +diff vs vit · 5 overridden · 2 added · 0 deleted · 1 new · 4 inherited-as-is + +ViTMSNModel · base model +12 × ViTMSNLayerViTMSNLayer× 12 +ViTMSNForImageClassification · task head +Self-Attention · ViTAttention ↩ inherited +MLP · ViTMLP ↩ inherited + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +ViTMSNForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +ViTMSNForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/vit_msn_base +parent +vit +classes +8 +overridden +5 +added +2 +new classes +1 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +ViTMSNEmbeddings +ovr __init__ + +ViTMSNModel +ovr __init__,forward + +ViTMSNPreTrainedModel +ovr _init_weights; 1 attr + +ViTMSNForImageClassification +add __init__,forward + \ No newline at end of file diff --git a/vit_msn.svg b/vit_msn.svg new file mode 100644 index 0000000000000000000000000000000000000000..3e6fa9a83284f190d58baa63941fc318119a9022 --- /dev/null +++ b/vit_msn.svg @@ -0,0 +1,172 @@ + + + + +vit_msn +dense · 12× MHA + +ViTMSNModel · base model +12 × ViTMSNLayerViTMSNLayer× 12 +ViTMSNForImageClassification · task head +Self-Attention · ViTMSNAttention +MLP · ViTMSNMLP + + +input imagepixel_values [1, 3, H, W] +Patch Embeddingconv patches → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +ViTMSNForImageClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +ViTMSNForImageClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/vit_msn_base +model_type +vit_msn +config +ViTMSNConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vitdet.svg b/vitdet.svg new file mode 100644 index 0000000000000000000000000000000000000000..0b2a70d2ce5ac818ca17fb8245a167981fbbded6 --- /dev/null +++ b/vitdet.svg @@ -0,0 +1,175 @@ + + + + +vitdet +dense · 12× MHA + +VitDetModel · base model +12 × VitDetLayerVitDetLayer× 12 +Self-Attention · VitDetAttention +MLP · VitDetMlp + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +qkv: Linear [768→2304]qkv [768→2304] +proj: Linear [768→768]proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +fc1: Linear [768→3072]fc1 [768→3072] +act: GELUActivationact GELU +fc2: Linear [3072→768]fc2 [3072→768] +drop: Dropoutdrop Dropout +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +google/vitdet-base-patch16-224 +model_type +vitdet +config +VitDetConfig +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vitmatte.svg b/vitmatte.svg new file mode 100644 index 0000000000000000000000000000000000000000..9c8575418fcd54b14b4973957cbc0cd9e9443244 --- /dev/null +++ b/vitmatte.svg @@ -0,0 +1,155 @@ + + + + +vitmatte +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × 384] +Final Norm +LM Head→ logits [1, S, ?] + +model id +hustvl/vitmatte-small-composi… +model_type +vitmatte +config +VitMatteConfig +decoder +dense +layers +— +hidden +384 +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/vitpose.svg b/vitpose.svg new file mode 100644 index 0000000000000000000000000000000000000000..d9784af57cad5b217cfb3522a880ad45ab69c0c1 --- /dev/null +++ b/vitpose.svg @@ -0,0 +1,155 @@ + + + + +vitpose +⚠ config-only — built from config (weights not instantiable on meta) · dense · + +input_ids[1, S] +Token Embedding[? × ?] +Final Norm +LM Head→ logits [1, S, ?] + +model id +usyd-community/vitpose-base-s… +model_type +vitpose +config +VitPoseConfig +decoder +dense +layers +— +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/vitpose_backbone.svg b/vitpose_backbone.svg new file mode 100644 index 0000000000000000000000000000000000000000..8de7dd4b073318f6ff30af6686973d558da5496e --- /dev/null +++ b/vitpose_backbone.svg @@ -0,0 +1,156 @@ + + + + +vitpose_backbone +⚠ config-only — built from config (weights not instantiable on meta) · dense · 12× MHA + +input_ids[1, S] +Token Embedding[? × 768] +VitPoseBackboneDecoderLayerNorm → MHANorm → MLP×12 +Final Norm +LM Head→ logits [1, S, ?] + +model id +usyd-community/vitpose-base-s… +model_type +vitpose_backbone +config +VitPoseBackboneConfig +decoder +dense +layers +12 +hidden +768 +intermediate +— +heads / kv +12 / 12 +attention +MHA +norm +— +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +status +config-only +legend + +attention + +Mamba / SSM + +linear-attn + +MoE + +MLP + +embedding + +head + \ No newline at end of file diff --git a/vits.svg b/vits.svg new file mode 100644 index 0000000000000000000000000000000000000000..ff8949ccf88e5b503327d7f5a033a0798056010d --- /dev/null +++ b/vits.svg @@ -0,0 +1,177 @@ + + + + +vits +dense · 6× MHA + +VitsModel · base model +6 × VitsEncoderLayerVitsEncoderLayer× 6 +Self-Attention · VitsAttention +MLP · VitsFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [38 × 192] → [1, 6, 192] +LayerNormpre-attention [1, 6, 192] +k_proj: Linear [192→192]k_proj [192→192] +v_proj: Linear [192→192]v_proj [192→192] +q_proj: Linear [192→192]q_proj [192→192] +out_proj: Linear [192→192]out_proj [192→192] +scaled dot-product attention2 heads · head_dim 96 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 192] +conv_1: Conv1d 768×192×3conv_1 Conv1d 768×192×3 +conv_2: Conv1d 192×768×3conv_2 Conv1d 192×768×3 +dropout: Dropoutdropout Dropout +act_fn: ReLUact_fn ReLU +residual add+ +Final LayerNorm[1, 6, 192] +LM HeadLinear [192→38] +Softmax +logits[1, 6, 38] + +model id +facebook/mms-tts-eng +model_type +vits +config +VitsConfig +decoder +dense +layers +6 +hidden +192 +intermediate +768 +heads / kv +2 / 2 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +38 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vivit.diff.svg b/vivit.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..cf4fa2e5f53b0cd5dff9cbf189a7e0cb6ba0a57e --- /dev/null +++ b/vivit.diff.svg @@ -0,0 +1,176 @@ + + + + +vivit +diff vs vit · 10 overridden · 4 added · 0 deleted · 2 new · 4 inherited-as-is + +VivitModel · base model +12 × VivitLayerVivitLayer× 12 +Self-Attention · ViTAttention ↩ inherited +MLP · ViTMLP ↩ inherited + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: FastGELUActivationactivation_fn FastGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +google/vivit-b-16x2-kinetics40 +parent +vit +classes +9 +overridden +10 +added +4 +new classes +2 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VivitEmbeddings +ovr __init__,forward,interpolate_pos_encoding + +VivitModel +ovr __init__,forward + +VivitPreTrainedModel +ovr _init_weights; 4 attr + +VivitForVideoClassification +add __init__,forward + +VivitTubeletEmbeddings +add __init__,forward + \ No newline at end of file diff --git a/vivit.svg b/vivit.svg new file mode 100644 index 0000000000000000000000000000000000000000..d8c7ef52239e89f58c8d62262546003c5b41e66a --- /dev/null +++ b/vivit.svg @@ -0,0 +1,176 @@ + + + + +vivit +dense · 12× MHA + +VivitModel · base model +12 × VivitLayerVivitLayer× 12 +Self-Attention · VivitAttention +MLP · VivitMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +q_proj: Linear [768→768]q_proj [768→768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +o_proj: Linear [768→768]o_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +activation_fn: FastGELUActivationactivation_fn FastGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +google/vivit-b-16x2-kinetics4… +model_type +vivit +config +VivitConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/vjepa2.svg b/vjepa2.svg new file mode 100644 index 0000000000000000000000000000000000000000..9b1f5dd0f78b0ed6326bbdf37b3662b06aac9e33 --- /dev/null +++ b/vjepa2.svg @@ -0,0 +1,179 @@ + + + + +vjepa2 +dense · 24× MHA + +VJEPA2Model · base model +24 × VJEPA2LayerVJEPA2Layer× 24 +Self-Attention · VJEPA2RopeAttention +MLP · VJEPA2MLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +query: Linear [1024→1024]query [1024→1024] +key: Linear [1024→1024]key [1024→1024] +value: Linear [1024→1024]value [1024→1024] +proj: Linear [1024→1024]proj [1024→1024] +dropout: Dropoutdropout Dropout +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LayerNormpre-FFN [1, 6, 1024] +fc1: Linear [1024→4096]fc1 [1024→4096] +activation: GELUActivationactivation GELU +fc2: Linear [4096→1024]fc2 [4096→1024] +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +facebook/vjepa2-vitl-fpc64-256 +model_type +vjepa2 +config +VJEPA2Config +decoder +dense +layers +24 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +RoPE +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/voxtral.diff.svg b/voxtral.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..10d00e2caa4f67e4589c8c71662edc3fd4c3fc33 --- /dev/null +++ b/voxtral.diff.svg @@ -0,0 +1,204 @@ + + + + +voxtral +diff vs qwen2_audio · 3 overridden · 17 added · 0 deleted · 4 new · 2 inherited-as-is + +VoxtralModel · base model +30 × LlamaDecoderLayerLlamaDecoderLayer× 30 +VoxtralForConditionalGeneration · task head +Audio encoder · VoxtralEncoder×32 +Self-Attention · LlamaAttention +VoxtralEncoderLayer×32 +MLP · LlamaMLP +self_attn · Qwen2AudioAttention… +Projector · VoxtralMultiModalProjector + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 3072] → [1, 6, 3072] +LlamaRMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→4096]q_proj [3072→4096] +k_proj: Linear [3072→1024]k_proj [3072→1024] +v_proj: Linear [3072→1024]v_proj [3072→1024] +o_proj: Linear [4096→3072]o_proj [4096→3072] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 3072] +gate_proj: Linear [3072→8192]gate_proj [3072→8192] +up_proj: Linear [3072→8192]up_proj [3072→8192] +down_proj: Linear [8192→3072]down_proj [8192→3072] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +VoxtralForConditionalGenerationLM HeadLinear [3072→131072] · tied +Softmax +logits[1, 6, 131072] +input_features[1, 128, 3000] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +out_proj: Linear [1280→1280]out_proj [1280→1280] +self_attn_layer_norm: LayerNorm 1280self_attn_layer_normLayerNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +final_layer_norm: LayerNorm 1280final_layer_normLayerNorm 1280 +linear_1: Linear [5120→3072]linear_1 [5120→3072] +act: GELUActivationact GELU +linear_2: Linear [3072→3072]linear_2 [3072→3072] +merge at modality tokens + +model id +mistralai/Voxtral-Mini-3B-2507 +parent +qwen2_audio +classes +8 +overridden +3 +added +17 +new classes +4 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VoxtralEncoder +ovr forward; 1 attr + +VoxtralForConditionalGeneration +add __init__,forward,get_audio_features,prep… + +VoxtralModel +add __init__,forward,get_audio_features,get_… + +VoxtralModelOutputWithPast +1 attr + +VoxtralMultiModalProjector +add __init__,forward + +VoxtralPreTrainedModel +5 attr + \ No newline at end of file diff --git a/voxtral.svg b/voxtral.svg new file mode 100644 index 0000000000000000000000000000000000000000..6e57441340fc850bef7af756b221a4d7a54909d5 --- /dev/null +++ b/voxtral.svg @@ -0,0 +1,209 @@ + + + + +voxtral +multimodal · audio → projector → LLM · dense + +VoxtralModel · base model +30 × LlamaDecoderLayerLlamaDecoderLayer× 30 +VoxtralForConditionalGeneration · task head +Audio encoder · VoxtralEncoder×32 +Self-Attention · LlamaAttention +VoxtralEncoderLayer×32 +MLP · LlamaMLP +self_attn · VoxtralAttention +Projector · VoxtralMultiModalProjector + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 3072] → [1, 6, 3072] +LlamaRMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→4096]q_proj [3072→4096] +k_proj: Linear [3072→1024]k_proj [3072→1024] +v_proj: Linear [3072→1024]v_proj [3072→1024] +o_proj: Linear [4096→3072]o_proj [4096→3072] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +LlamaRMSNormpre-FFN [1, 6, 3072] +gate_proj: Linear [3072→8192]gate_proj [3072→8192] +up_proj: Linear [3072→8192]up_proj [3072→8192] +down_proj: Linear [8192→3072]down_proj [8192→3072] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +VoxtralForConditionalGenerationLM HeadLinear [3072→131072] · tied +Softmax +logits[1, 6, 131072] +input_features[1, 128, 3000] +k_proj: Linear [1280→1280]k_proj [1280→1280] +v_proj: Linear [1280→1280]v_proj [1280→1280] +q_proj: Linear [1280→1280]q_proj [1280→1280] +out_proj: Linear [1280→1280]out_proj [1280→1280] +self_attn_layer_norm: LayerNorm 1280self_attn_layer_normLayerNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1280→5120]fc1 [1280→5120] +fc2: Linear [5120→1280]fc2 [5120→1280] +final_layer_norm: LayerNorm 1280final_layer_normLayerNorm 1280 +linear_1: Linear [5120→3072]linear_1 [5120→3072] +act: GELUActivationact GELU +linear_2: Linear [3072→3072]linear_2 [3072→3072] +merge at modality tokens + +model id +mistralai/Voxtral-Mini-3B-2507 +inputs +input_ids, input_features +built via +AutoModel +model_type +voxtral +config +VoxtralConfig +decoder +dense +layers +30 +hidden +3,072 +intermediate +8,192 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +131,072 +max_pos +131,072 +tie_embeddings +True +legend + +audio encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/voxtral_realtime.diff.svg b/voxtral_realtime.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b059d457507d28c029056423fc195e408b3a9380 --- /dev/null +++ b/voxtral_realtime.diff.svg @@ -0,0 +1,246 @@ + + + + +voxtral_realtime +diff vs mistral (+voxtral,llama) · 7 overridden · 48 added · 0 deleted · 13 new · 4 inherited-as-is + +VoxtralRealtimeModel · base model +26 × VoxtralRealtimeTextDecoderLayerVoxtralRealtimeTextDecoderLayer× 26 +VoxtralRealtimeForConditionalGeneration · task head +Audio encoder · VoxtralRealtim…×32 +VoxtralRealtimeEncoderLay…×32 +Self-Attention · MistralTextAttention ↩ inherited +MLP · MistralTextMLP ↩ inherited +self_attn · VoxtralRealtimeAttenti… +mlp · VoxtralRealtimeMLP +Projector · VoxtralRealtimeMultiModal… + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 3072] → [1, 6, 3072] +VoxtralRealtimeRMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→4096]q_proj [3072→4096] +k_proj: Linear [3072→1024]k_proj [3072→1024] +v_proj: Linear [3072→1024]v_proj [3072→1024] +o_proj: Linear [4096→3072]o_proj [4096→3072] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +VoxtralRealtimeRMSNormpre-FFN [1, 6, 3072] +gate_proj: Linear [3072→9216]gate_proj [3072→9216] +up_proj: Linear [3072→9216]up_proj [3072→9216] +down_proj: Linear [9216→3072]down_proj [9216→3072] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +VoxtralRealtimeForConditionalGenerationLM HeadLinear [3072→131072] · tied +Softmax +logits[1, 6, 131072] +input_features[1, 128, 3000] +q_proj: Linear [1280→2048]q_proj [1280→2048] +k_proj: Linear [1280→2048]k_proj [1280→2048] +v_proj: Linear [1280→2048]v_proj [1280→2048] +o_proj: Linear [2048→1280]o_proj [2048→1280] +self_attn_layer_norm: VoxtralRealtimeRMSNorm 1280self_attn_layer_normRMSNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +final_layer_norm: VoxtralRealtimeRMSNorm 1280final_layer_norm RMSNorm 128… +gate_proj: Linear [1280→5120]gate_proj [1280→5120] +up_proj: Linear [1280→5120]up_proj [1280→5120] +down_proj: Linear [5120→1280]down_proj [5120→1280] +act_fn: SiLUActivationact_fn SiLU +linear_1: Linear [5120→3072]linear_1 [5120→3072] +act: GELUActivationact GELU +linear_2: Linear [3072→3072]linear_2 [3072→3072] +merge at modality tokens + +model id +mistralai/Voxtral-Mini-4B-Real +parent +mistral +classes +23 +overridden +7 +added +48 +new classes +13 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +VoxtralRealtimeAttention +ovr __init__ + +VoxtralRealtimeMLP +ovr __init__ + +VoxtralRealtimeMultiModalProjector +ovr __init__ + +VoxtralRealtimeTextDecoderLayer +ovr __init__,forward + +VoxtralRealtimeTextModel +ovr __init__ + +VoxtralRealtimeCausalConv1d +add __init__,forward,left_pad + +VoxtralRealtimeCausalLMOutputWithPast +2 attr + +VoxtralRealtimeConv1dCacheLayer +add __init__,lazy_initialization,update + +VoxtralRealtimeConv1dPaddingCache +add __init__,update + +VoxtralRealtimeEmbedder +add __init__,forward + +VoxtralRealtimeEncoder +add __init__,forward; 5 attr + +VoxtralRealtimeEncoderLayer +add __init__,forward + +VoxtralRealtimeEncoderOutput +1 attr + +VoxtralRealtimeForConditionalGeneration +add __init__,_get_encoder_cache,_has_unfinis… + +VoxtralRealtimeModel +add __init__,forward,get_audio_features,get_… + +VoxtralRealtimeModelOutputWithPast +3 attr + +VoxtralRealtimePreTrainedModel +add _init_weights; 2 attr + +VoxtralRealtimeTextAdaRmsNorm +add __init__,forward + +VoxtralRealtimeTimeEmbedding +add __init__,forward + \ No newline at end of file diff --git a/voxtral_realtime.svg b/voxtral_realtime.svg new file mode 100644 index 0000000000000000000000000000000000000000..d74410149bd9db98f7a689eee99c23b4efab1f06 --- /dev/null +++ b/voxtral_realtime.svg @@ -0,0 +1,212 @@ + + + + +voxtral_realtime +multimodal · audio → projector → LLM · dense + +VoxtralRealtimeModel · base model +26 × VoxtralRealtimeTextDecoderLayerVoxtralRealtimeTextDecoderLayer× 26 +VoxtralRealtimeForConditionalGeneration · task head +Audio encoder · VoxtralRealtim…×32 +VoxtralRealtimeEncoderLay…×32 +Self-Attention · VoxtralRealtimeTextAttention +MLP · VoxtralRealtimeTextMLP +self_attn · VoxtralRealtimeAttenti… +mlp · VoxtralRealtimeMLP +Projector · VoxtralRealtimeMultiModal… + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [131072 × 3072] → [1, 6, 3072] +VoxtralRealtimeRMSNormpre-attention [1, 6, 3072] +q_proj: Linear [3072→4096]q_proj [3072→4096] +k_proj: Linear [3072→1024]k_proj [3072→1024] +v_proj: Linear [3072→1024]v_proj [3072→1024] +o_proj: Linear [4096→3072]o_proj [4096→3072] +scaled dot-product attention32 heads · head_dim 128 · GQA 32:8 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +VoxtralRealtimeRMSNormpre-FFN [1, 6, 3072] +gate_proj: Linear [3072→9216]gate_proj [3072→9216] +up_proj: Linear [3072→9216]up_proj [3072→9216] +down_proj: Linear [9216→3072]down_proj [9216→3072] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 3072] +VoxtralRealtimeForConditionalGenerationLM HeadLinear [3072→131072] · tied +Softmax +logits[1, 6, 131072] +input_features[1, 128, 3000] +q_proj: Linear [1280→2048]q_proj [1280→2048] +k_proj: Linear [1280→2048]k_proj [1280→2048] +v_proj: Linear [1280→2048]v_proj [1280→2048] +o_proj: Linear [2048→1280]o_proj [2048→1280] +self_attn_layer_norm: VoxtralRealtimeRMSNorm 1280self_attn_layer_normRMSNorm 1280 +activation_fn: GELUActivationactivation_fn GELU +final_layer_norm: VoxtralRealtimeRMSNorm 1280final_layer_norm RMSNorm 128… +gate_proj: Linear [1280→5120]gate_proj [1280→5120] +up_proj: Linear [1280→5120]up_proj [1280→5120] +down_proj: Linear [5120→1280]down_proj [5120→1280] +act_fn: SiLUActivationact_fn SiLU +linear_1: Linear [5120→3072]linear_1 [5120→3072] +act: GELUActivationact GELU +linear_2: Linear [3072→3072]linear_2 [3072→3072] +merge at modality tokens + +model id +mistralai/Voxtral-Mini-4B-Rea… +inputs +input_ids, input_features +model_type +voxtral_realtime +config +VoxtralRealtimeConfig +decoder +dense +layers +26 +hidden +3,072 +intermediate +9,216 +heads / kv +32 / 8 +attention +GQA +norm +RMSNorm +positional +RoPE +vocab +131,072 +max_pos +131,072 +sliding_window +8,192 +tie_embeddings +True +legend + +audio encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/wav2vec2.svg b/wav2vec2.svg new file mode 100644 index 0000000000000000000000000000000000000000..768da0206fe80cf821a1f0fb9fd502c3b42bce5f --- /dev/null +++ b/wav2vec2.svg @@ -0,0 +1,174 @@ + + + + +wav2vec2 +dense · 12× MHA + +Wav2Vec2Model · base model +12 × Wav2Vec2EncoderLayerWav2Vec2EncoderLayer× 12 +Wav2Vec2ForSequenceClassification · task head +Self-Attention · Wav2Vec2Attention +MLP · Wav2Vec2FeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 10, 768]+ position embeddings +LayerNormpre-attention [1, 10, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 10, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 10, 768] +Wav2Vec2ForSequenceClassificationPool (CLS / mean)[1, 10, 768] → [1, 768] +Wav2Vec2ForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/wav2vec2-base-960h +model_type +wav2vec2 +config +Wav2Vec2Config +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/wav2vec2_bert.diff.svg b/wav2vec2_bert.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..3ebb6cc22db54a04739456f6f0f591f58c1484cf --- /dev/null +++ b/wav2vec2_bert.diff.svg @@ -0,0 +1,203 @@ + + + + +wav2vec2_bert +diff vs wav2vec2_conformer (+wav2vec2) · 15 overridden · 21 added · 5 deleted · 7 new · 1 inherited-as-is + +Wav2Vec2BertModel · base model +24 × Wav2Vec2BertEncoderLayerWav2Vec2BertEncoderLayer× 24 +Wav2Vec2BertForSequenceClassification · task head +Self-Attention · Wav2Vec2BertSelfAttention +MLP · Wav2Vec2BertFeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 1024]+ position embeddings +LayerNormpre-attention [1, 6, 1024] +linear_q: Linear [1024→1024]linear_q [1024→1024] +linear_k: Linear [1024→1024]linear_k [1024→1024] +linear_v: Linear [1024→1024]linear_v [1024→1024] +linear_out: Linear [1024→1024]linear_out [1024→1024] +dropout: Dropoutdropout Dropout +distance_embedding: Embedding 73×64distance_embedding Embedding 73×64 +scaled dot-product attention16 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +swish +down_proj +residual add+ +Final LayerNorm[1, 6, 1024] +Wav2Vec2BertForSequenceClassificationPool (CLS / mean)[1, 6, 1024] → [1, 1024] +Wav2Vec2BertForSequenceClassificationClassifier headLinear [1024→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/wav2vec2-bert-rel-pos +parent +wav2vec2_conformer +classes +16 +overridden +15 +added +21 +new classes +7 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Wav2Vec2BertForAudioFrameClassification +ovr __init__,forward; del freeze_feature_enc… + +Wav2Vec2BertForCTC +ovr __init__,forward; del freeze_feature_enc… + +Wav2Vec2BertForSequenceClassification +ovr __init__,forward,freeze_base_model; del … + +Wav2Vec2BertForXVector +ovr __init__,forward; del freeze_feature_enc… + +Wav2Vec2BertModel +ovr __init__,forward; del freeze_feature_enc… + +Wav2Vec2BertFeedForward +ovr __init__ + +Wav2Vec2BertRotaryPositionalEmbedding +ovr __init__ + +Wav2Vec2BertSelfAttention +ovr __init__,forward + +Wav2Vec2BertAdapter +add __init__,_compute_sub_sample_lengths_fro… + +Wav2Vec2BertAdapterLayer +add __init__,forward + +Wav2Vec2BertConvolutionModule +add __init__,forward + +Wav2Vec2BertEncoder +add __init__,forward + +Wav2Vec2BertEncoderLayer +add __init__,forward + +Wav2Vec2BertFeatureProjection +add __init__,forward + +Wav2Vec2BertPreTrainedModel +add _get_feat_extract_output_lengths,_get_fe… + \ No newline at end of file diff --git a/wav2vec2_bert.svg b/wav2vec2_bert.svg new file mode 100644 index 0000000000000000000000000000000000000000..46f4b78b2219546c5a7e5a1f4765c7c757e75ca3 --- /dev/null +++ b/wav2vec2_bert.svg @@ -0,0 +1,173 @@ + + + + +wav2vec2_bert +dense · 24× MHA + +Wav2Vec2BertModel · base model +24 × Wav2Vec2BertEncoderLayerWav2Vec2BertEncoderLayer× 24 +Wav2Vec2BertForSequenceClassification · task head +Self-Attention · Wav2Vec2BertSelfAttention +MLP · Wav2Vec2BertFeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 1024]+ position embeddings +LayerNormpre-attention [1, 6, 1024] +linear_q: Linear [1024→1024]linear_q [1024→1024] +linear_k: Linear [1024→1024]linear_k [1024→1024] +linear_v: Linear [1024→1024]linear_v [1024→1024] +linear_out: Linear [1024→1024]linear_out [1024→1024] +dropout: Dropoutdropout Dropout +distance_embedding: Embedding 73×64distance_embedding Embedding 73×64 +scaled dot-product attention16 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +swish +down_proj +residual add+ +Final LayerNorm[1, 6, 1024] +Wav2Vec2BertForSequenceClassificationPool (CLS / mean)[1, 6, 1024] → [1, 1024] +Wav2Vec2BertForSequenceClassificationClassifier headLinear [1024→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/wav2vec2-bert-rel-po… +model_type +wav2vec2-bert +config +Wav2Vec2BertConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/wav2vec2_conformer.diff.svg b/wav2vec2_conformer.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..3559a14888df086d0cd12cba069cf326517752c8 --- /dev/null +++ b/wav2vec2_conformer.diff.svg @@ -0,0 +1,200 @@ + + + + +wav2vec2_conformer +diff vs wav2vec2 · 6 overridden · 31 added · 2 deleted · 8 new · 7 inherited-as-is + +Wav2Vec2ConformerModel · base model +12 × Wav2Vec2ConformerEncoderLayerWav2Vec2ConformerEncoderLayer× 12 +Wav2Vec2ConformerForSequenceClassification · task head +Self-Attention · Wav2Vec2ConformerSelfAttention +MLP · Wav2Vec2FeedForward ↩ inherited + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +linear_q: Linear [768→768]linear_q [768→768] +linear_k: Linear [768→768]linear_k [768→768] +linear_v: Linear [768→768]linear_v [768→768] +linear_out: Linear [768→768]linear_out [768→768] +dropout: Dropoutdropout Dropout +linear_pos: Linear [768→768]linear_pos [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +gelu +down_proj +residual add+ +Final LayerNorm[1, 6, 768] +Wav2Vec2ConformerForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +Wav2Vec2ConformerForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/wav2vec2-conformer-re +parent +wav2vec2 +classes +21 +overridden +6 +added +31 +new classes +8 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Wav2Vec2ConformerForCTC +ovr __init__; del freeze_base_model,tie_weig… + +Wav2Vec2ConformerForAudioFrameClassification +ovr __init__ + +Wav2Vec2ConformerForPreTraining +ovr __init__ + +Wav2Vec2ConformerForSequenceClassification +ovr __init__ + +Wav2Vec2ConformerForXVector +ovr __init__ + +Wav2Vec2ConformerModel +ovr __init__ + +Wav2Vec2ConformerConvolutionModule +add __init__,forward + +Wav2Vec2ConformerEncoder +add __init__,forward + +Wav2Vec2ConformerEncoderLayer +add __init__,forward + +Wav2Vec2ConformerForPreTrainingOutput +8 attr + +Wav2Vec2ConformerPreTrainedModel +add _get_feat_extract_output_lengths,_get_fe… + +Wav2Vec2ConformerRelPositionalEmbedding +add __init__,extend_pe,forward + +Wav2Vec2ConformerRotaryPositionalEmbedding +add __init__,forward + +Wav2Vec2ConformerSelfAttention +add __init__,_apply_relative_embeddings,_app… + \ No newline at end of file diff --git a/wav2vec2_conformer.svg b/wav2vec2_conformer.svg new file mode 100644 index 0000000000000000000000000000000000000000..cd9be256896c28d1533ef3d024c13aac9dc7bce6 --- /dev/null +++ b/wav2vec2_conformer.svg @@ -0,0 +1,173 @@ + + + + +wav2vec2_conformer +dense · 12× MHA + +Wav2Vec2ConformerModel · base model +12 × Wav2Vec2ConformerEncoderLayerWav2Vec2ConformerEncoderLayer× 12 +Wav2Vec2ConformerForSequenceClassification · task head +Self-Attention · Wav2Vec2ConformerSelfAttention +MLP · Wav2Vec2ConformerFeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +linear_q: Linear [768→768]linear_q [768→768] +linear_k: Linear [768→768]linear_k [768→768] +linear_v: Linear [768→768]linear_v [768→768] +linear_out: Linear [768→768]linear_out [768→768] +dropout: Dropoutdropout Dropout +linear_pos: Linear [768→768]linear_pos [768→768] +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +gelu +down_proj +residual add+ +Final LayerNorm[1, 6, 768] +Wav2Vec2ConformerForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +Wav2Vec2ConformerForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +facebook/wav2vec2-conformer-r… +model_type +wav2vec2-conformer +config +Wav2Vec2ConformerConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/wavlm.diff.svg b/wavlm.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..45c42a590a886a04642c9f5c4757f84a848f4d9b --- /dev/null +++ b/wavlm.diff.svg @@ -0,0 +1,182 @@ + + + + +wavlm +diff vs wav2vec2 · 9 overridden · 16 added · 3 deleted · 6 new · 8 inherited-as-is + +WavLMModel · base model +12 × WavLMEncoderLayerWavLMEncoderLayer× 12 +WavLMForSequenceClassification · task head +Self-Attention · WavLMAttention +MLP · Wav2Vec2FeedForward ↩ inherited + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +gru_rel_pos_linear: Linear [64→8]gru_rel_pos_linear [64→8] +rel_attn_embed: Embedding 320×12rel_attn_embed Embedding 320×12 +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +WavLMForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +WavLMForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/wavlm-base +parent +wav2vec2 +classes +15 +overridden +9 +added +16 +new classes +6 +inherited as-is +8 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +WavLMPreTrainedModel +ovr _init_weights; del _get_adapters,init_ad… + +WavLMAttention +add __init__,_relative_positions_bucket,comp… + +WavLMEncoder +add __init__,forward + +WavLMEncoderLayer +add __init__,forward + +WavLMEncoderLayerStableLayerNorm +add __init__,forward + +WavLMEncoderStableLayerNorm +add __init__,forward + +WavLMGumbelVectorQuantizer +add __init__,_compute_perplexity,forward + \ No newline at end of file diff --git a/wavlm.svg b/wavlm.svg new file mode 100644 index 0000000000000000000000000000000000000000..e5ea6866f109f2439eff38ea2ff5101e96535e05 --- /dev/null +++ b/wavlm.svg @@ -0,0 +1,176 @@ + + + + +wavlm +dense · 12× MHA + +WavLMModel · base model +12 × WavLMEncoderLayerWavLMEncoderLayer× 12 +WavLMForSequenceClassification · task head +Self-Attention · WavLMAttention +MLP · WavLMFeedForward + + +input audioinput_features [1, n_mels, T] +Feature Projectionconv/linear → [1, 6, 768]+ position embeddings +LayerNormpre-attention [1, 6, 768] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +gru_rel_pos_linear: Linear [64→8]gru_rel_pos_linear [64→8] +rel_attn_embed: Embedding 320×12rel_attn_embed Embedding 320×12 +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +LayerNormpre-FFN [1, 6, 768] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 768] +WavLMForSequenceClassificationPool (CLS / mean)[1, 6, 768] → [1, 768] +WavLMForSequenceClassificationClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +microsoft/wavlm-base +model_type +wavlm +config +WavLMConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32 +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/whisper.svg b/whisper.svg new file mode 100644 index 0000000000000000000000000000000000000000..84f89fa98e34c21a8963fccb313601df7de30be7 --- /dev/null +++ b/whisper.svg @@ -0,0 +1,170 @@ + + + + +whisper +dense · 4× MHA + +WhisperModel · base model +4 × WhisperEncoderLayerWhisperEncoderLayer× 4 +WhisperForCausalLM · task head +Self-Attention · WhisperAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [51865 × 384] → [1, 6, 384] +LayerNormpre-attention [1, 6, 384] +k_proj: Linear [384→384]k_proj [384→384] +v_proj: Linear [384→384]v_proj [384→384] +q_proj: Linear [384→384]q_proj [384→384] +out_proj: Linear [384→384]out_proj [384→384] +scaled dot-product attention6 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 384] +WhisperForCausalLMLM HeadLinear [384→51865] · tied +Softmax +logits[1, 6, 51865] + +model id +openai/whisper-tiny +model_type +whisper +config +WhisperConfig +decoder +dense +layers +4 +hidden +384 +intermediate +— +heads / kv +6 / 6 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +51,865 +max_pos +— +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/x_clip.diff.svg b/x_clip.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..fd7ebec96caa988c6a57eab2a33b995d7c140526 --- /dev/null +++ b/x_clip.diff.svg @@ -0,0 +1,305 @@ + + + + +x_clip +diff vs clip (+altclip,beit) · 26 overridden · 11 added · 3 deleted · 3 new · 1 inherited-as-is + +XCLIPModel · base model +12 × XCLIPEncoderLayerXCLIPEncoderLayer× 12 +image ⊕ text attention +Vision encoder · XCLIPVisionMo…×12 +XCLIPVisionEncoderLayer×12 +Vision encoder · XCLIPPromptG…×12 +Vision encoder · XCLIPTextModel×12 +Vision encoder · XCLIPMultifra…×12 +PromptGeneratorLayer×2 +Self-Attention · XCLIPAttention +XCLIPEncoderLayer×12 +XCLIPEncoderLayer×1 +MLP · XCLIPMLP +cross_attn · XCLIPCrossAttention +self_attn · XCLIPAttention +self_attn · XCLIPAttention +message_attn · XCLIPAttention +self_attn · XCLIPAttention +mlp · Sequential +mlp · XCLIPMLP +mlp · XCLIPMLP +mlp · XCLIPMLP + + + + + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +message_fc: Linear [768→768]message_fc [768→768] +message_ln: LayerNorm 768message_ln LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +drop_path: Identitydrop_path Identity +example image +pixel_values[1, 3, 336, 336] +Vision encoder · LayerNormLayerNorm · via AutoModelxclip_vision_model · 12 layers · h=768×12 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +proj: Linear [512→512]proj [512→512] +proj_drop: Dropoutproj_drop Dropout +norm1: LayerNorm 512norm1 LayerNorm 512 +norm3: LayerNorm 512norm3 LayerNorm 512 +0: Linear [512→2048]0 [512→2048] +1: QuickGELUActivation1 QuickGELU +2: Dropout2 Dropout +3: Linear [2048→512]3 [2048→512] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +microsoft/xclip-base-patch32 +parent +clip +classes +18 +overridden +26 +added +11 +new classes +3 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +XCLIPModel +ovr __init__,forward,get_text_features; add … + +XCLIPOutput +ovr to_tuple; 3 attr + +XCLIPAttention +ovr __init__ + +XCLIPCrossAttention +ovr __init__,forward + +XCLIPEncoder +ovr __init__ + +XCLIPEncoderLayer +ovr __init__ + +XCLIPMLP +ovr __init__ + +XCLIPPreTrainedModel +ovr _init_weights; 4 attr + +XCLIPTextEmbeddings +ovr __init__ + +XCLIPTextModel +ovr __init__,forward; 1 attr + +XCLIPVisionEmbeddings +ovr __init__ + +XCLIPVisionEncoder +ovr __init__ + +XCLIPVisionEncoderLayer +ovr __init__,forward + +XCLIPVisionModel +ovr __init__,forward; 1 attr + +PromptGeneratorLayer +add __init__,forward + +XCLIPMultiframeIntegrationTransformer +add __init__,forward + +XCLIPPromptGenerator +add __init__,forward + \ No newline at end of file diff --git a/x_clip.svg b/x_clip.svg new file mode 100644 index 0000000000000000000000000000000000000000..3bb8eb51b15190fafea9e4675ee01b724c3eee35 --- /dev/null +++ b/x_clip.svg @@ -0,0 +1,277 @@ + + + + +x_clip +multimodal · vision+vision+vision+vision+vision → projector → LLM · dense + +XCLIPModel · base model +12 × XCLIPEncoderLayerXCLIPEncoderLayer× 12 +image ⊕ text attention +Vision encoder · XCLIPVisionMo…×12 +XCLIPVisionEncoderLayer×12 +Vision encoder · XCLIPPromptG…×12 +Vision encoder · XCLIPTextModel×12 +Vision encoder · XCLIPMultifra…×12 +PromptGeneratorLayer×2 +Self-Attention · XCLIPAttention +XCLIPEncoderLayer×12 +XCLIPEncoderLayer×1 +MLP · XCLIPMLP +cross_attn · XCLIPCrossAttention +self_attn · XCLIPAttention +self_attn · XCLIPAttention +message_attn · XCLIPAttention +self_attn · XCLIPAttention +mlp · Sequential +mlp · XCLIPMLP +mlp · XCLIPMLP +mlp · XCLIPMLP + + + + + + + + + + + + + + + + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [49408 × 512] → [1, 6, 512] +LayerNormpre-attention [1, 6, 512] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +scaled dot-product attention8 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 512] +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +residual add+ +Final LayerNorm[1, 6, 512] +LM HeadLinear [512→49408] +Softmax +logits[1, 6, 49408] +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +layer_norm1: LayerNorm 768layer_norm1 LayerNorm 768 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [768→3072]fc1 [768→3072] +fc2: Linear [3072→768]fc2 [3072→768] +layer_norm2: LayerNorm 768layer_norm2 LayerNorm 768 +message_fc: Linear [768→768]message_fc [768→768] +message_ln: LayerNorm 768message_ln LayerNorm 768 +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +drop_path: Identitydrop_path Identity +example image +pixel_values[1, 3, 336, 336] +Vision encoder · LayerNormLayerNorm · via AutoModelxclip_vision_model · 12 layers · h=768×12 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +out_proj: Linear [512→512]out_proj [512→512] +layer_norm1: LayerNorm 512layer_norm1 LayerNorm 512 +activation_fn: QuickGELUActivationactivation_fn QuickGELU +fc1: Linear [512→2048]fc1 [512→2048] +fc2: Linear [2048→512]fc2 [2048→512] +layer_norm2: LayerNorm 512layer_norm2 LayerNorm 512 +example image +pixel_values[1, 3, 336, 336] +k_proj: Linear [512→512]k_proj [512→512] +v_proj: Linear [512→512]v_proj [512→512] +q_proj: Linear [512→512]q_proj [512→512] +proj: Linear [512→512]proj [512→512] +proj_drop: Dropoutproj_drop Dropout +norm1: LayerNorm 512norm1 LayerNorm 512 +norm3: LayerNorm 512norm3 LayerNorm 512 +0: Linear [512→2048]0 [512→2048] +1: QuickGELUActivation1 QuickGELU +2: Dropout2 Dropout +3: Linear [2048→512]3 [2048→512] +Projector · Linearalign features → text hidden dim +merge at modality tokens +image↓text query × image|text key5 img + 7 text · fully causal + +model id +microsoft/xclip-base-patch32 +inputs +input_ids, pixel_values +built via +AutoModel +model_type +xclip +config +XCLIPConfig +decoder +dense +layers +12 +hidden +512 +intermediate +2,048 +heads / kv +8 / 8 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +49,408 +max_pos +77 +tie_embeddings +None +legend + +vision encoder + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + +projector / fusion + \ No newline at end of file diff --git a/xcodec.svg b/xcodec.svg new file mode 100644 index 0000000000000000000000000000000000000000..b003569431f4ace81cd4e8e4e5fa85e67e7af41f --- /dev/null +++ b/xcodec.svg @@ -0,0 +1,178 @@ + + + + +xcodec +dense · 12× Attention + +XcodecModel · base model +12 × HubertEncoderLayerHubertEncoderLayer× 12 +Self-Attention · HubertAttention +MLP · HubertFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [768→768]k_proj [768→768] +v_proj: Linear [768→768]v_proj [768→768] +q_proj: Linear [768→768]q_proj [768→768] +out_proj: Linear [768→768]out_proj [768→768] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, 1024] +intermediate_dropout: Dropoutintermediate_dropout Dropout +intermediate_dense: Linear [768→3072]intermediate_dense [768→3072] +intermediate_act_fn: GELUActivationintermediate_act_fn GELU +output_dense: Linear [3072→768]output_dense [3072→768] +output_dropout: Dropoutoutput_dropout Dropout +residual add+ +Final LayerNorm[1, 6, 1024] +LM HeadLinear [1024→?] +Softmax +logits[1, 6, ?] + +model id +Manel/X-Codec +model_type +xcodec +config +XcodecConfig +decoder +dense +layers +12 +hidden +1,024 +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/xglm.svg b/xglm.svg new file mode 100644 index 0000000000000000000000000000000000000000..55245e93309b1dbf91ed18d300aa7f0a435ca7b8 --- /dev/null +++ b/xglm.svg @@ -0,0 +1,170 @@ + + + + +xglm +dense · 24× MHA + +XGLMModel · base model +24 × XGLMDecoderLayerXGLMDecoderLayer× 24 +XGLMForCausalLM · task head +Self-Attention · XGLMAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [256008 × 1024] → [1, 6, 1024] +LayerNormpre-attention [1, 6, 1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +q_proj: Linear [1024→1024]q_proj [1024→1024] +out_proj: Linear [1024→1024]out_proj [1024→1024] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 1024] +XGLMForCausalLMLM HeadLinear [1024→256008] · tied +Softmax +logits[1, 6, 256008] + +model id +facebook/xglm-564M +model_type +xglm +config +XGLMConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +4,096 +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +256,008 +max_pos +2,048 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/xlm.svg b/xlm.svg new file mode 100644 index 0000000000000000000000000000000000000000..6a958f4bcb4f1cdb49b05956062c948f0f568925 --- /dev/null +++ b/xlm.svg @@ -0,0 +1,170 @@ + + + + +xlm +dense · 12× MHA + +XLMModel · base model +12 × ModuleListModuleList× 12 +XLMWithLMHeadModel · task head +Self-Attention · MultiHeadAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [30145 × 2048] → [1, 6, 2048] +Normpre-attention [1, 6, 2048] +q_lin: Linear [2048→2048]q_lin [2048→2048] +k_lin: Linear [2048→2048]k_lin [2048→2048] +v_lin: Linear [2048→2048]v_lin [2048→2048] +out_lin: Linear [2048→2048]out_lin [2048→2048] +scaled dot-product attention16 heads · head_dim 128 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 2048] +XLMWithLMHeadModelLM HeadLinear [2048→30145] · tied +Softmax +logits[1, 6, 30145] + +model id +FacebookAI/xlm-mlm-en-2048 +model_type +xlm +config +XLMConfig +decoder +dense +layers +12 +hidden +2,048 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,145 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/xlm_roberta.diff.svg b/xlm_roberta.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..65af845d3a012616ef0ef00dad98cd36bf63dd22 --- /dev/null +++ b/xlm_roberta.diff.svg @@ -0,0 +1,181 @@ + + + + +xlm_roberta +diff vs roberta · 15 overridden · 0 added · 0 deleted · 0 new · 1 inherited-as-is + +XLMRobertaModel · base model +12 × XLMRobertaLayerXLMRobertaLayer× 12 +XLMRobertaForCausalLM · task head +Self-Attention · RobertaAttention ↩ inherited +output · RobertaSelfOutput ↩ inherited +self · RobertaSelfAttention ↩ inherited + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +XLMRobertaForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +FacebookAI/xlm-mlm-en-2048 +parent +roberta +classes +8 +overridden +15 +added +0 +new classes +0 +inherited as-is +1 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +XLMRobertaForCausalLM +ovr __init__,forward; 1 attr + +XLMRobertaForMaskedLM +ovr __init__,forward; 1 attr + +XLMRobertaForMultipleChoice +ovr __init__,forward + +XLMRobertaForQuestionAnswering +ovr __init__,forward + +XLMRobertaForSequenceClassification +ovr __init__,forward + +XLMRobertaForTokenClassification +ovr __init__,forward + +XLMRobertaPreTrainedModel +1 attr + \ No newline at end of file diff --git a/xlm_roberta.svg b/xlm_roberta.svg new file mode 100644 index 0000000000000000000000000000000000000000..090cf0b351559a017f0c32cf411602760b6ed5b1 --- /dev/null +++ b/xlm_roberta.svg @@ -0,0 +1,175 @@ + + + + +xlm_roberta +dense · 12× MHA + +XLMRobertaModel · base model +12 × XLMRobertaLayerXLMRobertaLayer× 12 +XLMRobertaForCausalLM · task head +Self-Attention · XLMRobertaAttention +output · XLMRobertaSelfOutput +self · XLMRobertaSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'hey</w>'hey<…0 +token 1: ',</w>',</w>1 +token 2: 'how</w>'how<…2 +token 3: 'are</w>'are<…3 +token 4: 'you</w>'you<…4 +token 5: '?</w>'?</w>5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +XLMRobertaForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +FacebookAI/xlm-mlm-en-2048 +model_type +xlm-roberta +config +XLMRobertaConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/xlm_roberta_xl.diff.svg b/xlm_roberta_xl.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..b2d678336e657a239c5ed4976d35ceb464cfbe97 --- /dev/null +++ b/xlm_roberta_xl.diff.svg @@ -0,0 +1,202 @@ + + + + +xlm_roberta_xl +diff vs bert (+roberta) · 7 overridden · 26 added · 0 deleted · 10 new · 4 inherited-as-is + +XLMRobertaXLModel · base model +36 × XLMRobertaXLLayerXLMRobertaXLLayer× 36 +XLMRobertaXLForCausalLM · task head +Self-Attention · XLMRobertaXLAttention +self · BertSelfAttention ↩ inherited +output · XLMRobertaXLSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250880 × 2560] → [1, 6, 2560] +LayerNormpre-attention [1, 6, 2560] +query: Linear [2560→2560]query [2560→2560] +key: Linear [2560→2560]key [2560→2560] +value: Linear [2560→2560]value [2560→2560] +dropout: Dropoutdropout Dropout +dense: Linear [2560→2560]dense [2560→2560] +dropout: Dropoutdropout Dropout +self_attn_layer_norm: LayerNorm 2560self_attn_layer_norm LayerNorm 2560 +scaled dot-product attention32 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 2560] +XLMRobertaXLForCausalLMLM HeadLinear [2560→250880] · tied +Softmax +logits[1, 6, 250880] + +model id +FacebookAI/xlm-roberta-xl +parent +bert +classes +18 +overridden +7 +added +26 +new classes +10 +inherited as-is +4 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +XLMRobertaXLAttention +ovr __init__,forward + +XLMRobertaXLEmbeddings +ovr __init__,forward + +XLMRobertaXLLayer +ovr __init__,feed_forward_chunk + +XLMRobertaXLPreTrainedModel +1 attr + +XLMRobertaXLEncoder +add __init__,forward + +XLMRobertaXLForCausalLM +add __init__,forward,get_output_embeddings,s… + +XLMRobertaXLForMaskedLM +add __init__,forward,get_output_embeddings,s… + +XLMRobertaXLForMultipleChoice +add __init__,forward + +XLMRobertaXLForQuestionAnswering +add __init__,forward + +XLMRobertaXLForSequenceClassification +add __init__,forward + +XLMRobertaXLForTokenClassification +add __init__,forward + +XLMRobertaXLLMHead +add __init__,forward + +XLMRobertaXLOutput +add __init__,forward + +XLMRobertaXLSelfOutput +add __init__,forward + \ No newline at end of file diff --git a/xlm_roberta_xl.svg b/xlm_roberta_xl.svg new file mode 100644 index 0000000000000000000000000000000000000000..cdc58405d8a452a56f2ef18318ef6125f54e6b1f --- /dev/null +++ b/xlm_roberta_xl.svg @@ -0,0 +1,175 @@ + + + + +xlm_roberta_xl +dense · 36× MHA + +XLMRobertaXLModel · base model +36 × XLMRobertaXLLayerXLMRobertaXLLayer× 36 +XLMRobertaXLForCausalLM · task head +Self-Attention · XLMRobertaXLAttention +self · XLMRobertaXLSelfAttention +output · XLMRobertaXLSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [250880 × 2560] → [1, 6, 2560] +LayerNormpre-attention [1, 6, 2560] +query: Linear [2560→2560]query [2560→2560] +key: Linear [2560→2560]key [2560→2560] +value: Linear [2560→2560]value [2560→2560] +dropout: Dropoutdropout Dropout +dense: Linear [2560→2560]dense [2560→2560] +dropout: Dropoutdropout Dropout +self_attn_layer_norm: LayerNorm 2560self_attn_layer_norm LayerNorm 2560 +scaled dot-product attention32 heads · head_dim 80 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 2560] +XLMRobertaXLForCausalLMLM HeadLinear [2560→250880] · tied +Softmax +logits[1, 6, 250880] + +model id +FacebookAI/xlm-roberta-xl +model_type +xlm-roberta-xl +config +XLMRobertaXLConfig +decoder +dense +layers +36 +hidden +2,560 +intermediate +10,240 +heads / kv +32 / 32 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +250,880 +max_pos +514 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/xlnet.svg b/xlnet.svg new file mode 100644 index 0000000000000000000000000000000000000000..0e191ff5de22397bd444c1c9566f9aac0fddba68 --- /dev/null +++ b/xlnet.svg @@ -0,0 +1,174 @@ + + + + +xlnet +dense · 24× MHA + +XLNetModel · base model +24 × XLNetLayerXLNetLayer× 24 +XLNetLMHeadModel · task head +Self-Attention · XLNetRelativeAttention +MLP · XLNetFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 1024] → [1, 6, 1024] +Normpre-attention [1, 6, 1024] +layer_norm: LayerNorm 1024layer_norm LayerNorm 1024 +dropout: Dropoutdropout Dropout +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Normpre-FFN [1, 6, 1024] +SiLU +down_proj +residual add+ +Final LayerNorm[1, 6, 1024] +XLNetLMHeadModelLM HeadLinear [1024→32000] · tied +Softmax +logits[1, 6, 32000] + +model id +xlnet/xlnet-large-cased +model_type +xlnet +config +XLNetConfig +decoder +dense +layers +24 +hidden +1,024 +intermediate +— +heads / kv +16 / 16 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +32,000 +max_pos +-1 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/xlstm.svg b/xlstm.svg new file mode 100644 index 0000000000000000000000000000000000000000..a8d0ce8db78108c388ac47c1d6ddc7ed753510ba --- /dev/null +++ b/xlstm.svg @@ -0,0 +1,172 @@ + + + + +xlstm +dense · 32× MHA + +xLSTMModel · base model +32 × xLSTMBlockxLSTMBlock× 32 +xLSTMForCausalLM · task head +MLP · xLSTMFeedForward + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50304 × 4096] → [1, 6, 4096] +xLSTMRMSNormpre-attention [1, 6, 4096] +Token Mixing (linear-attention / SSM)xLSTMBlock +residual add+ +xLSTMRMSNormpre-FFN [1, 6, 4096] +proj_up_gate: Linear [4096→10944]proj_up_gate [4096→10944] +proj_up: Linear [4096→10944]proj_up [4096→10944] +proj_down: Linear [10944→4096]proj_down [10944→4096] +act_fn: SiLUact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 4096] +xLSTMForCausalLMLM HeadLinear [4096→50304] +Softmax +logits[1, 6, 50304] + +model id +NX-AI/xLSTM-7b +model_type +xlstm +config +xLSTMConfig +decoder +dense +layers +32 +hidden +4,096 +intermediate +— +heads / kv +8 / 8 +attention +MHA +norm +RMSNorm +positional +n/a +vocab +50,304 +max_pos +— +tie_embeddings +False +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/xmod.svg b/xmod.svg new file mode 100644 index 0000000000000000000000000000000000000000..5cd86e22914c07c0da1b1900832acbf035f32386 --- /dev/null +++ b/xmod.svg @@ -0,0 +1,175 @@ + + + + +xmod +dense · 12× MHA + +XmodModel · base model +12 × XmodLayerXmodLayer× 12 +XmodForCausalLM · task head +Self-Attention · XmodAttention +output · XmodSelfOutput +self · XmodSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: '␣Hey'␣Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [30522 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +XmodForCausalLMLM HeadLinear [768→30522] · tied +Softmax +logits[1, 6, 30522] + +model id +facebook/xmod-base +model_type +xmod +config +XmodConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +30,522 +max_pos +512 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/yolos.diff.svg b/yolos.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0968b621dc2426d224ea95bc72c3035af20afbd2 --- /dev/null +++ b/yolos.diff.svg @@ -0,0 +1,163 @@ + + + + +yolos +diff vs None · 0 overridden · 10 added · 0 deleted · 2 new · 0 inherited-as-is + +YolosModel · base model +12 × YolosLayerYolosLayer× 12 +Self-Attention · YolosAttention +attention · YolosSelfAttention +output · YolosSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +hustvl/yolos-base +parent +— +classes +2 +overridden +0 +added +10 +new classes +2 +inherited as-is +0 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +YolosImageProcessor +add post_process_instance_segmentation,post_… + +YolosImageProcessorPil +add post_process_instance_segmentation,post_… + \ No newline at end of file diff --git a/yolos.svg b/yolos.svg new file mode 100644 index 0000000000000000000000000000000000000000..ce8b68e8728999cdd79838b7093ecd3a7f98b47a --- /dev/null +++ b/yolos.svg @@ -0,0 +1,172 @@ + + + + +yolos +dense · 12× MHA + +YolosModel · base model +12 × YolosLayerYolosLayer× 12 +Self-Attention · YolosAttention +attention · YolosSelfAttention +output · YolosSelfOutput + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × 768] → [1, 6, 768] +LayerNormpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dense: Linear [768→768]dense [768→768] +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +residual add+ +Final LayerNorm[1, 6, 768] +LM HeadLinear [768→?] +Softmax +logits[1, 6, ?] + +model id +hustvl/yolos-base +model_type +yolos +config +YolosConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/yoso.svg b/yoso.svg new file mode 100644 index 0000000000000000000000000000000000000000..85bfe7bb9f06310a18da5806f9ab5ab3b5feeda2 --- /dev/null +++ b/yoso.svg @@ -0,0 +1,176 @@ + + + + +yoso +dense · 12× MHA + +YosoModel · base model +12 × YosoLayerYosoLayer× 12 +YosoForMaskedLM · task head +Self-Attention · YosoAttention +output · YosoSelfOutput +self · YosoSelfAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [50265 × 768] → [1, 6, 768] +Normpre-attention [1, 6, 768] +query: Linear [768→768]query [768→768] +key: Linear [768→768]key [768→768] +value: Linear [768→768]value [768→768] +dropout: Dropoutdropout Dropout +dense: Linear [768→768]dense [768→768] +LayerNorm: LayerNorm 768LayerNorm LayerNorm 768 +dropout: Dropoutdropout Dropout +scaled dot-product attention12 heads · head_dim 64 +bidirectional attention mask (q↓ × k→)bidirectional mask +residual add+ +Final LayerNorm[1, 6, 768] +YosoForMaskedLMPool (CLS / mean)[1, 6, 768] → [1, 768] +YosoForMaskedLMClassifier headLinear [768→2] +Softmax +class logits[1, 2] (2 classes) + +model id +uw-madison/yoso-4096 +model_type +yoso +config +YosoConfig +decoder +dense +layers +12 +hidden +768 +intermediate +3,072 +heads / kv +12 / 12 +attention +MHA +norm +LayerNorm +positional +n/a +vocab +50,265 +max_pos +4,096 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/youtu.diff.svg b/youtu.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..0d634be12e8e574d93f0e3889524d7c33bb0ca59 --- /dev/null +++ b/youtu.diff.svg @@ -0,0 +1,174 @@ + + + + +youtu +diff vs llama (+deepseek_v3,qwen3) · 0 overridden · 28 added · 0 deleted · 1 new · 7 inherited-as-is + +YoutuModel · base model +32 × YoutuDecoderLayerYoutuDecoderLayer× 32 +YoutuForCausalLM · task head +Self-Attention · LlamaAttention ↩ inherited +MLP · LlamaMLP ↩ inherited + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 2048] → [1, 6, 2048] +YoutuRMSNormpre-attention [1, 6, 2048] +q_a_proj: Linear [2048→1536]q_a_proj [2048→1536] +q_a_layernorm: YoutuRMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→3072]q_b_proj [1536→3072] +kv_a_proj_with_mqa: Linear [2048→576]kv_a_proj_with_mqa [2048→576] +kv_a_layernorm: YoutuRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→4096]kv_b_proj [512→4096] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +YoutuRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→6144]gate_proj [2048→6144] +up_proj: Linear [2048→6144]up_proj [2048→6144] +down_proj: Linear [6144→2048]down_proj [6144→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +YoutuForCausalLMLM HeadLinear [2048→128256] · tied +Softmax +logits[1, 6, 128256] + +model id +tencent/Youtu-LLM-2B +parent +llama +classes +9 +overridden +0 +added +28 +new classes +1 +inherited as-is +7 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +YoutuConfig +add __post_init__; 26 attr + +YoutuPreTrainedModel +add _init_weights + \ No newline at end of file diff --git a/youtu.svg b/youtu.svg new file mode 100644 index 0000000000000000000000000000000000000000..f4f923fdf0c72305b672e6d2ccd083e68aee2411 --- /dev/null +++ b/youtu.svg @@ -0,0 +1,183 @@ + + + + +youtu +dense · 32× MLA + +YoutuModel · base model +32 × YoutuDecoderLayerYoutuDecoderLayer× 32 +YoutuForCausalLM · task head +Self-Attention · YoutuAttention +MLP · YoutuMLP + + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [128256 × 2048] → [1, 6, 2048] +YoutuRMSNormpre-attention [1, 6, 2048] +q_a_proj: Linear [2048→1536]q_a_proj [2048→1536] +q_a_layernorm: YoutuRMSNorm 1536q_a_layernorm RMSNorm 1536 +q_b_proj: Linear [1536→3072]q_b_proj [1536→3072] +kv_a_proj_with_mqa: Linear [2048→576]kv_a_proj_with_mqa [2048→576] +kv_a_layernorm: YoutuRMSNorm 512kv_a_layernorm RMSNorm 512 +kv_b_proj: Linear [512→4096]kv_b_proj [512→4096] +o_proj: Linear [2048→2048]o_proj [2048→2048] +scaled dot-product attention16 heads · head_dim 64 +causal attention mask (q↓ × k→)causal mask +RoPErotary positions → Q, K +residual add+ +YoutuRMSNormpre-FFN [1, 6, 2048] +gate_proj: Linear [2048→6144]gate_proj [2048→6144] +up_proj: Linear [2048→6144]up_proj [2048→6144] +down_proj: Linear [6144→2048]down_proj [6144→2048] +act_fn: SiLUActivationact_fn SiLU +residual add+ +Final RMSNorm[1, 6, 2048] +YoutuForCausalLMLM HeadLinear [2048→128256] · tied +Softmax +logits[1, 6, 128256] + +model id +tencent/Youtu-LLM-2B +model_type +youtu +config +YoutuConfig +decoder +dense +layers +32 +hidden +2,048 +intermediate +6,144 +heads / kv +16 / 16 +attention +MLA +norm +RMSNorm +positional +RoPE +vocab +128,256 +max_pos +131,072 +tie_embeddings +True +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/zamba.svg b/zamba.svg new file mode 100644 index 0000000000000000000000000000000000000000..c39ee333faadc995dc818bc1a1c6a3d74490302b --- /dev/null +++ b/zamba.svg @@ -0,0 +1,259 @@ + + + + +zamba +hybrid · 63× Mamba + 13× MHA + +ZambaModel · base model +76 × ZambaHybridLayerZambaHybridLayer× 76 +ZambaForCausalLM · task head +layers (idx) +Self-Attention · ZambaAttentionDecoderLayer +feed_forward · ZambaMLP +self_attn · ZambaAttention + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 3712] → [1, 6, 3712] +Normpre-attention [1, 6, 3712] +q_proj: Linear [7424→7424]q_proj [7424→7424] +k_proj: Linear [7424→7424]k_proj [7424→7424] +v_proj: Linear [7424→7424]v_proj [7424→7424] +o_proj: Linear [7424→3712]o_proj [7424→3712] +gate_proj: Linear [3712→14848]gate_proj [3712→14848] +up_proj: Linear [3712→14848]up_proj [3712→14848] +down_proj: Linear [14848→3712]down_proj [14848→3712] +act_fn: GELUActivationact_fn GELU +input_layernorm: ZambaRMSNorm 7424input_layernorm RMSNorm 7424 +pre_ff_layernorm: ZambaRMSNorm 3712pre_ff_layernorm RMSNorm 3712 +scaled dot-product attention16 heads · head_dim 464 +mamba attention mask (q↓ × k→)mamba mask +residual add+ +Final RMSNorm[1, 6, 3712] +ZambaForCausalLMLM HeadLinear [3712→32000] · tied +Softmax +logits[1, 6, 32000] +layer 0: mamba0 +layer 1: mamba1 +layer 2: hybrid2 +layer 3: mamba3 +layer 4: mamba4 +layer 5: mamba5 +layer 6: mamba6 +layer 7: hybrid7 +layer 8: mamba8 +layer 9: mamba9 +layer 10: mamba10 +layer 11: mamba11 +layer 12: mamba12 +layer 13: hybrid13 +layer 14: mamba14 +layer 15: mamba15 +layer 16: mamba16 +layer 17: mamba17 +layer 18: mamba18 +layer 19: hybrid19 +layer 20: mamba20 +layer 21: mamba21 +layer 22: mamba22 +layer 23: mamba23 +layer 24: mamba24 +layer 25: hybrid25 +layer 26: mamba26 +layer 27: mamba27 +layer 28: mamba28 +layer 29: mamba29 +layer 30: mamba30 +layer 31: hybrid31 +layer 32: mamba32 +layer 33: mamba33 +layer 34: mamba34 +layer 35: mamba35 +layer 36: mamba36 +layer 37: hybrid37 +layer 38: mamba38 +layer 39: mamba39 +layer 40: mamba40 +layer 41: mamba41 +layer 42: mamba42 +layer 43: hybrid43 +layer 44: mamba44 +layer 45: mamba45 +layer 46: mamba46 +layer 47: mamba47 +layer 48: mamba48 +layer 49: hybrid49 +layer 50: mamba50 +layer 51: mamba51 +layer 52: mamba52 +layer 53: mamba53 +layer 54: mamba54 +layer 55: hybrid55 +layer 56: mamba56 +layer 57: mamba57 +layer 58: mamba58 +layer 59: mamba59 +layer 60: mamba60 +layer 61: hybrid61 +layer 62: mamba62 +layer 63: mamba63 +layer 64: mamba64 +layer 65: mamba65 +layer 66: mamba66 +layer 67: hybrid67 +layer 68: mamba68 +layer 69: mamba69 +layer 70: mamba70 +layer 71: mamba71 +layer 72: mamba72 +layer 73: hybrid73 +layer 74: mamba74 +layer 75: mamba75 + +model id +Zyphra/Zamba-7B-v1 +model_type +zamba +config +ZambaConfig +decoder +hybrid +layers +76 +hidden +3,712 +intermediate +14,848 +heads / kv +16 / 16 +attention +MHA +norm +RMSNorm +positional +n/a +vocab +32,000 +max_pos +4,096 +tie_embeddings +True +legend + +self-attention + +mamba + +hybrid + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/zamba2.diff.svg b/zamba2.diff.svg new file mode 100644 index 0000000000000000000000000000000000000000..1e47e35330e3fbf8b90bc6dfb281e6852a2b976f --- /dev/null +++ b/zamba2.diff.svg @@ -0,0 +1,262 @@ + + + + +zamba2 +diff vs zamba (+llama) · 12 overridden · 20 added · 0 deleted · 4 new · 2 inherited-as-is + +Zamba2Model · base model +54 × Zamba2HybridLayerZamba2HybridLayer× 54 +Zamba2ForCausalLM · task head +layers (idx) +Self-Attention · Zamba2AttentionDecoderLayer +feed_forward · Zamba2MLP +gate_up_proj_adapter_list · ModuleList +self_attn · Zamba2Attention + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2560] → [1, 6, 2560] +Normpre-attention [1, 6, 2560] +q_proj: Linear [5120→5120]q_proj [5120→5120] +k_proj: Linear [5120→5120]k_proj [5120→5120] +v_proj: Linear [5120→5120]v_proj [5120→5120] +o_proj: Linear [5120→2560]o_proj [5120→2560] +gate_up_proj: Linear [2560→20480]gate_up_proj [2560→20480] +down_proj: Linear [10240→2560]down_proj [10240→2560] +act_fn: GELUActivationact_fn GELU +0: Sequential0 Sequential +1: Sequential1 Sequential +2: Sequential2 Sequential +3: Sequential3 Sequential +4: Sequential4 Sequential +5: Sequential5 Sequential +6: Sequential6 Sequential +7: Sequential7 Sequential +8: Sequential8 Sequential +input_layernorm: Zamba2RMSNorm 5120input_layernorm RMSNorm 5120 +pre_ff_layernorm: Zamba2RMSNorm 2560pre_ff_layernorm RMSNorm 2560 +scaled dot-product attention32 heads · head_dim 160 +mamba attention mask (q↓ × k→)mamba mask +RoPErotary positions → Q, K +residual add+ +Final RMSNorm[1, 6, 2560] +Zamba2ForCausalLMLM HeadLinear [2560→32000] · tied +Softmax +logits[1, 6, 32000] +layer 0: mamba0 +layer 1: mamba1 +layer 2: mamba2 +layer 3: mamba3 +layer 4: mamba4 +layer 5: mamba5 +layer 6: hybrid6 +layer 7: mamba7 +layer 8: mamba8 +layer 9: mamba9 +layer 10: mamba10 +layer 11: mamba11 +layer 12: hybrid12 +layer 13: mamba13 +layer 14: mamba14 +layer 15: mamba15 +layer 16: mamba16 +layer 17: mamba17 +layer 18: hybrid18 +layer 19: mamba19 +layer 20: mamba20 +layer 21: mamba21 +layer 22: mamba22 +layer 23: mamba23 +layer 24: hybrid24 +layer 25: mamba25 +layer 26: mamba26 +layer 27: mamba27 +layer 28: mamba28 +layer 29: mamba29 +layer 30: hybrid30 +layer 31: mamba31 +layer 32: mamba32 +layer 33: mamba33 +layer 34: mamba34 +layer 35: mamba35 +layer 36: hybrid36 +layer 37: mamba37 +layer 38: mamba38 +layer 39: mamba39 +layer 40: mamba40 +layer 41: mamba41 +layer 42: hybrid42 +layer 43: mamba43 +layer 44: mamba44 +layer 45: mamba45 +layer 46: mamba46 +layer 47: hybrid47 +layer 48: mamba48 +layer 49: mamba49 +layer 50: mamba50 +layer 51: hybrid51 +layer 52: mamba52 +layer 53: mamba53 + +model id +Zyphra/Zamba2-2.7B +parent +zamba +classes +13 +overridden +12 +added +20 +new classes +4 +inherited as-is +2 +legend + +new submodule (vs parent) + +changed / redefined + +deleted + +inherited / copy-pasted +changes by class + +Zamba2Attention +ovr __init__,forward + +Zamba2AttentionDecoderLayer +ovr __init__,forward + +Zamba2ForCausalLM +ovr __init__ + +Zamba2ForSequenceClassification +ovr __init__,forward + +Zamba2HybridLayer +ovr __init__,forward + +Zamba2MambaDecoderLayer +ovr __init__ + +Zamba2MLP +add __init__,forward + +Zamba2MambaMixer +add __init__,cuda_kernels_forward,forward,to… + +Zamba2Model +ovr __init__,forward; add get_layers + +Zamba2PreTrainedModel +add _init_weights; 10 attr + +Zamba2RMSNormGated +add __init__,forward + \ No newline at end of file diff --git a/zamba2.svg b/zamba2.svg new file mode 100644 index 0000000000000000000000000000000000000000..6dc8a2ef3f04b4e237452907564672dc585451bf --- /dev/null +++ b/zamba2.svg @@ -0,0 +1,248 @@ + + + + +zamba2 +hybrid · 45× Mamba + 9× MHA + +Zamba2Model · base model +54 × Zamba2HybridLayerZamba2HybridLayer× 54 +Zamba2ForCausalLM · task head +layers (idx) +Self-Attention · Zamba2AttentionDecoderLayer +feed_forward · Zamba2MLP +gate_up_proj_adapter_list · ModuleList +self_attn · Zamba2Attention + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [32000 × 2560] → [1, 6, 2560] +Normpre-attention [1, 6, 2560] +q_proj: Linear [5120→5120]q_proj [5120→5120] +k_proj: Linear [5120→5120]k_proj [5120→5120] +v_proj: Linear [5120→5120]v_proj [5120→5120] +o_proj: Linear [5120→2560]o_proj [5120→2560] +gate_up_proj: Linear [2560→20480]gate_up_proj [2560→20480] +down_proj: Linear [10240→2560]down_proj [10240→2560] +act_fn: GELUActivationact_fn GELU +0: Sequential0 Sequential +1: Sequential1 Sequential +2: Sequential2 Sequential +3: Sequential3 Sequential +4: Sequential4 Sequential +5: Sequential5 Sequential +6: Sequential6 Sequential +7: Sequential7 Sequential +8: Sequential8 Sequential +input_layernorm: Zamba2RMSNorm 5120input_layernorm RMSNorm 5120 +pre_ff_layernorm: Zamba2RMSNorm 2560pre_ff_layernorm RMSNorm 2560 +scaled dot-product attention32 heads · head_dim 160 +mamba attention mask (q↓ × k→)mamba mask +RoPErotary positions → Q, K +residual add+ +Final RMSNorm[1, 6, 2560] +Zamba2ForCausalLMLM HeadLinear [2560→32000] · tied +Softmax +logits[1, 6, 32000] +layer 0: mamba0 +layer 1: mamba1 +layer 2: mamba2 +layer 3: mamba3 +layer 4: mamba4 +layer 5: mamba5 +layer 6: hybrid6 +layer 7: mamba7 +layer 8: mamba8 +layer 9: mamba9 +layer 10: mamba10 +layer 11: mamba11 +layer 12: hybrid12 +layer 13: mamba13 +layer 14: mamba14 +layer 15: mamba15 +layer 16: mamba16 +layer 17: mamba17 +layer 18: hybrid18 +layer 19: mamba19 +layer 20: mamba20 +layer 21: mamba21 +layer 22: mamba22 +layer 23: mamba23 +layer 24: hybrid24 +layer 25: mamba25 +layer 26: mamba26 +layer 27: mamba27 +layer 28: mamba28 +layer 29: mamba29 +layer 30: hybrid30 +layer 31: mamba31 +layer 32: mamba32 +layer 33: mamba33 +layer 34: mamba34 +layer 35: mamba35 +layer 36: hybrid36 +layer 37: mamba37 +layer 38: mamba38 +layer 39: mamba39 +layer 40: mamba40 +layer 41: mamba41 +layer 42: hybrid42 +layer 43: mamba43 +layer 44: mamba44 +layer 45: mamba45 +layer 46: mamba46 +layer 47: hybrid47 +layer 48: mamba48 +layer 49: mamba49 +layer 50: mamba50 +layer 51: hybrid51 +layer 52: mamba52 +layer 53: mamba53 + +model id +Zyphra/Zamba2-2.7B +model_type +zamba2 +config +Zamba2Config +decoder +hybrid +layers +54 +hidden +2,560 +intermediate +10,240 +heads / kv +32 / 32 +attention +MHA +norm +RMSNorm +positional +RoPE +vocab +32,000 +max_pos +4,096 +tie_embeddings +True +legend + +self-attention + +mamba + +hybrid + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file diff --git a/zoedepth.svg b/zoedepth.svg new file mode 100644 index 0000000000000000000000000000000000000000..2eb2a4562048050bb31f4ca7268e9862c1bb31f7 --- /dev/null +++ b/zoedepth.svg @@ -0,0 +1,176 @@ + + + + +zoedepth +dense · 24× Attention + +ZoeDepthForDepthEstimation · base model +24 × BeitLayerBeitLayer× 24 +Self-Attention · BeitAttention +MLP · BeitMLP + + +input_idstokenize("Hey, how are you?") → [1, 6] +token 0: 'Hey'Hey0 +token 1: ',',1 +token 2: '␣how'␣how2 +token 3: '␣are'␣are3 +token 4: '␣you'␣you4 +token 5: '?'?5 +Token Embeddingweight [? × ?] → [1, 6, ?] +LayerNormpre-attention [1, 6, ?] +q_proj: Linear [1024→1024]q_proj [1024→1024] +k_proj: Linear [1024→1024]k_proj [1024→1024] +v_proj: Linear [1024→1024]v_proj [1024→1024] +o_proj: Linear [1024→1024]o_proj [1024→1024] +scaled dot-product attention? heads · head_dim ? +causal attention mask (q↓ × k→)causal mask +residual add+ +LayerNormpre-FFN [1, 6, ?] +activation_fn: GELUActivationactivation_fn GELU +fc1: Linear [1024→4096]fc1 [1024→4096] +fc2: Linear [4096→1024]fc2 [4096→1024] +residual add+ +Final LayerNorm[1, 6, ?] +LM HeadLinear [?→?] +Softmax +logits[1, 6, ?] + +model id +Intel/zoedepth-nyu +model_type +zoedepth +config +ZoeDepthConfig +decoder +dense +layers +24 +hidden +— +intermediate +— +heads / kv +None / None +attention +— +norm +LayerNorm +positional +n/a +vocab +— +max_pos +— +tie_embeddings +None +legend + +self-attention + +MLP / feed-forward + +RoPE + +normalization + +residual / skip + \ No newline at end of file