| { |
| "architecture": { |
| "attention_variant": "MHA", |
| "is_moe": false, |
| "mixer": "attention", |
| "positional": "learned", |
| "view": "encoder" |
| }, |
| "capabilities": { |
| "attention_backends": [ |
| "eager", |
| "sdpa", |
| "flash_attention", |
| "flex_attention" |
| ], |
| "attention_patterns": [ |
| "bidirectional" |
| ], |
| "attention_schedule": null, |
| "task_heads": [ |
| "text_encoding" |
| ], |
| "tensor_parallel": false |
| }, |
| "components": [ |
| { |
| "children": [ |
| "embeddings", |
| "encoder", |
| "final_layer_norm" |
| ], |
| "class_name": "CLIPTextModel", |
| "id": "model", |
| "kind": "model", |
| "path_pattern": "model" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size" |
| }, |
| "children": [ |
| "embeddings.token_embedding", |
| "embeddings.position_embedding" |
| ], |
| "class_name": "CLIPTextEmbeddings", |
| "id": "embeddings", |
| "kind": "embedding", |
| "path_pattern": "model.embeddings" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size" |
| }, |
| "class_name": "Embedding", |
| "id": "embeddings.token_embedding", |
| "kind": "embedding", |
| "path_pattern": "model.embeddings.token_embedding" |
| }, |
| { |
| "attributes": { |
| "max_position_embeddings": "config.max_position_embeddings", |
| "scheme": "learned" |
| }, |
| "class_name": "Embedding", |
| "id": "embeddings.position_embedding", |
| "kind": "position", |
| "path_pattern": "model.embeddings.position_embedding" |
| }, |
| { |
| "children": [ |
| "encoder_layers" |
| ], |
| "class_name": "CLIPEncoder", |
| "id": "encoder", |
| "kind": "encoder", |
| "path_pattern": "model.encoder" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "final_layer_norm", |
| "kind": "normalization", |
| "path_pattern": "model.final_layer_norm" |
| } |
| ], |
| "config": { |
| "class_name": "CLIPTextConfig", |
| "model_type": "clip_text_model", |
| "module": "transformers.models.clip.configuration_clip", |
| "referenced_fields": { |
| "num_hidden_layers": 12 |
| }, |
| "salient_fields": { |
| "hidden_act": "quick_gelu", |
| "hidden_size": 512, |
| "intermediate_size": 2048, |
| "is_encoder_decoder": false, |
| "max_position_embeddings": 77, |
| "num_attention_heads": 8, |
| "num_hidden_layers": 12, |
| "vocab_size": 49408 |
| } |
| }, |
| "dataflow": { |
| "input": { |
| "name": "input_ids", |
| "shape": [ |
| "B", |
| "S" |
| ] |
| }, |
| "output": { |
| "shape": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ] |
| }, |
| "shapes": { |
| "embeddings": { |
| "in": null, |
| "out": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ] |
| }, |
| "encoder": { |
| "in": null, |
| "out": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ] |
| }, |
| "encoder_layer.layer_norm1": { |
| "in": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ], |
| "out": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ] |
| }, |
| "encoder_layer.layer_norm2": { |
| "in": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ], |
| "out": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ] |
| }, |
| "encoder_layer.mlp": { |
| "in": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ], |
| "out": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ] |
| }, |
| "encoder_layer.self_attn": { |
| "in": null, |
| "out": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ] |
| }, |
| "final_layer_norm": { |
| "in": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ], |
| "out": [ |
| "B", |
| "S", |
| "config.hidden_size" |
| ] |
| } |
| }, |
| "source": "observed_forward_meta" |
| }, |
| "edges": [ |
| { |
| "kind": "data", |
| "source": "embeddings", |
| "target": "encoder" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder", |
| "target": "final_layer_norm" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.mlp" |
| }, |
| { |
| "kind": "position", |
| "source": "embeddings.position_embedding", |
| "target": "embeddings" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.self_attn.k_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.self_attn.v_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.self_attn.q_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn.k_proj", |
| "target": "encoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn.v_proj", |
| "target": "encoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn.q_proj", |
| "target": "encoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.mlp", |
| "target": "encoder_layer.mlp.fc1" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.mlp.fc1", |
| "target": "encoder_layer.mlp.fc2" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer.layer_norm1", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.layer_norm2" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer.layer_norm2", |
| "target": "encoder_layer.mlp" |
| } |
| ], |
| "extends": null, |
| "model_type": "clip_text_model", |
| "provenance": { |
| "config_class": "CLIPTextConfig", |
| "config_module": "transformers.models.clip.configuration_clip", |
| "model_class": "CLIPTextModel", |
| "model_module": "transformers.models.clip.modeling_clip" |
| }, |
| "repeats": [ |
| { |
| "body": "encoder_layer", |
| "container_path_pattern": "model.encoder.layers", |
| "count": 12, |
| "count_expr": "config.num_hidden_layers", |
| "count_source": "config", |
| "id": "encoder_layers", |
| "index_symbol": "i", |
| "item_path_pattern": "model.encoder.layers.{i}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "CLIPEncoderLayer", |
| "container_path_pattern": "model.encoder.layers", |
| "item_path_pattern": "model.encoder.layers.{i}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "CLIPEncoderLayer" |
| } |
| ], |
| "schema_version": "architecture-template-v0", |
| "templates": [ |
| { |
| "children": [ |
| "encoder_layer.self_attn", |
| "encoder_layer.layer_norm1", |
| "encoder_layer.mlp", |
| "encoder_layer.layer_norm2" |
| ], |
| "class_name": "CLIPEncoderLayer", |
| "id": "encoder_layer", |
| "kind": "transformer_block", |
| "path_pattern": "model.encoder.layers.{i}" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 8, |
| "n_kv_heads": 8, |
| "pattern": "bidirectional", |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "encoder_layer.self_attn.k_proj", |
| "encoder_layer.self_attn.v_proj", |
| "encoder_layer.self_attn.q_proj", |
| "encoder_layer.self_attn.out_proj" |
| ], |
| "class_name": "CLIPAttention", |
| "id": "encoder_layer.self_attn", |
| "kind": "attention", |
| "path_pattern": "model.encoder.layers.{i}.self_attn" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.self_attn.k_proj", |
| "kind": "projection", |
| "path_pattern": "model.encoder.layers.{i}.self_attn.k_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.self_attn.v_proj", |
| "kind": "projection", |
| "path_pattern": "model.encoder.layers.{i}.self_attn.v_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.self_attn.q_proj", |
| "kind": "projection", |
| "path_pattern": "model.encoder.layers.{i}.self_attn.q_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.self_attn.out_proj", |
| "kind": "projection", |
| "path_pattern": "model.encoder.layers.{i}.self_attn.out_proj" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer.layer_norm1", |
| "kind": "normalization", |
| "path_pattern": "model.encoder.layers.{i}.layer_norm1" |
| }, |
| { |
| "attributes": { |
| "activation": "quick_gelu", |
| "hidden_size": 512, |
| "intermediate_size": 2048 |
| }, |
| "children": [ |
| "encoder_layer.mlp.fc1", |
| "encoder_layer.mlp.fc2" |
| ], |
| "class_name": "CLIPMLP", |
| "id": "encoder_layer.mlp", |
| "kind": "feed_forward", |
| "path_pattern": "model.encoder.layers.{i}.mlp" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.intermediate_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.mlp.fc1", |
| "kind": "projection", |
| "path_pattern": "model.encoder.layers.{i}.mlp.fc1" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.intermediate_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.mlp.fc2", |
| "kind": "projection", |
| "path_pattern": "model.encoder.layers.{i}.mlp.fc2" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer.layer_norm2", |
| "kind": "normalization", |
| "path_pattern": "model.encoder.layers.{i}.layer_norm2" |
| } |
| ] |
| } |
|
|