| { |
| "architecture": { |
| "attention_variant": "MHA", |
| "family": "seq2seq", |
| "is_moe": false, |
| "mixer": "attention", |
| "positional": "learned", |
| "tie_word_embeddings": true, |
| "view": "enc_dec" |
| }, |
| "capabilities": { |
| "attention_backends": [ |
| "eager", |
| "sdpa", |
| "flash_attention", |
| "flex_attention" |
| ], |
| "attention_patterns": [ |
| "bidirectional", |
| "causal" |
| ], |
| "attention_schedule": null, |
| "task_heads": [ |
| "causal_lm", |
| "masked_lm", |
| "pretraining", |
| "question_answering", |
| "seq_to_seq_causal_lm", |
| "sequence_classification" |
| ], |
| "tensor_parallel": false |
| }, |
| "components": [ |
| { |
| "children": [ |
| "shared", |
| "encoder", |
| "decoder" |
| ], |
| "class_name": "BartModel", |
| "id": "model", |
| "kind": "model", |
| "path_pattern": "model" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size", |
| "tied_lm_head": true |
| }, |
| "class_name": "BartScaledWordEmbedding", |
| "id": "shared", |
| "kind": "embedding", |
| "path_pattern": "model.shared" |
| }, |
| { |
| "children": [ |
| "encoder.embed_tokens", |
| "encoder.embed_positions", |
| "encoder_layers", |
| "encoder.layernorm_embedding" |
| ], |
| "class_name": "BartEncoder", |
| "id": "encoder", |
| "kind": "encoder", |
| "path_pattern": "model.encoder" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size", |
| "tied_lm_head": true |
| }, |
| "class_name": "BartScaledWordEmbedding", |
| "id": "encoder.embed_tokens", |
| "kind": "embedding", |
| "path_pattern": "model.encoder.embed_tokens" |
| }, |
| { |
| "attributes": { |
| "max_position_embeddings": "config.hidden_size", |
| "scheme": "learned" |
| }, |
| "class_name": "BartLearnedPositionalEmbedding", |
| "id": "encoder.embed_positions", |
| "kind": "position", |
| "path_pattern": "model.encoder.embed_positions" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder.layernorm_embedding", |
| "kind": "normalization", |
| "path_pattern": "model.encoder.layernorm_embedding" |
| }, |
| { |
| "children": [ |
| "decoder.embed_tokens", |
| "decoder.embed_positions", |
| "decoder_layers", |
| "decoder.layernorm_embedding" |
| ], |
| "class_name": "BartDecoder", |
| "id": "decoder", |
| "kind": "decoder", |
| "path_pattern": "model.decoder" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size", |
| "tied_lm_head": true |
| }, |
| "class_name": "BartScaledWordEmbedding", |
| "id": "decoder.embed_tokens", |
| "kind": "embedding", |
| "path_pattern": "model.decoder.embed_tokens" |
| }, |
| { |
| "attributes": { |
| "max_position_embeddings": "config.hidden_size", |
| "scheme": "learned" |
| }, |
| "class_name": "BartLearnedPositionalEmbedding", |
| "id": "decoder.embed_positions", |
| "kind": "position", |
| "path_pattern": "model.decoder.embed_positions" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "decoder.layernorm_embedding", |
| "kind": "normalization", |
| "path_pattern": "model.decoder.layernorm_embedding" |
| } |
| ], |
| "config": { |
| "class_name": "BartConfig", |
| "model_type": "bart", |
| "module": "transformers.models.bart.configuration_bart", |
| "referenced_fields": { |
| "decoder_layers": 12, |
| "encoder_layers": 12 |
| }, |
| "salient_fields": { |
| "hidden_act": "gelu", |
| "hidden_size": 1024, |
| "intermediate_size": 4096, |
| "is_encoder_decoder": true, |
| "max_position_embeddings": 1024, |
| "num_attention_heads": 16, |
| "num_hidden_layers": 12, |
| "tie_word_embeddings": true, |
| "vocab_size": 50265 |
| } |
| }, |
| "edges": [ |
| { |
| "kind": "data", |
| "source": "shared", |
| "target": "encoder" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder", |
| "target": "decoder" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder.embed_tokens", |
| "target": "encoder_layers" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_layers", |
| "target": "encoder.layernorm_embedding" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.self_attn_layer_norm" |
| }, |
| { |
| "kind": "data", |
| "source": "decoder.embed_tokens", |
| "target": "decoder_layers" |
| }, |
| { |
| "kind": "data", |
| "source": "decoder_layers", |
| "target": "decoder.layernorm_embedding" |
| }, |
| { |
| "kind": "data", |
| "source": "decoder_layer.self_attn_layer_norm", |
| "target": "decoder_layer.encoder_attn" |
| }, |
| { |
| "kind": "data", |
| "source": "decoder_layer.encoder_attn", |
| "target": "decoder_layer.encoder_attn_layer_norm" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "decoder_layer.self_attn" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "decoder_layer.encoder_attn" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "residual", |
| "source": "decoder_layer", |
| "target": "decoder_layer.self_attn" |
| }, |
| { |
| "kind": "residual", |
| "source": "decoder_layer", |
| "target": "decoder_layer.encoder_attn" |
| }, |
| { |
| "kind": "position", |
| "source": "encoder.embed_positions", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "position", |
| "source": "decoder.embed_positions", |
| "target": "decoder_layer.self_attn" |
| }, |
| { |
| "kind": "position", |
| "source": "decoder.embed_positions", |
| "target": "decoder_layer.encoder_attn" |
| }, |
| { |
| "kind": "cross_attention", |
| "source": "encoder", |
| "target": "decoder_layer.encoder_attn" |
| }, |
| { |
| "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": "decoder_layer.self_attn", |
| "target": "decoder_layer.self_attn.k_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.self_attn", |
| "target": "decoder_layer.self_attn.v_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.self_attn", |
| "target": "decoder_layer.self_attn.q_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.self_attn.k_proj", |
| "target": "decoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.self_attn.v_proj", |
| "target": "decoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.self_attn.q_proj", |
| "target": "decoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.encoder_attn", |
| "target": "decoder_layer.encoder_attn.k_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.encoder_attn", |
| "target": "decoder_layer.encoder_attn.v_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.encoder_attn", |
| "target": "decoder_layer.encoder_attn.q_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.encoder_attn.k_proj", |
| "target": "decoder_layer.encoder_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.encoder_attn.v_proj", |
| "target": "decoder_layer.encoder_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "decoder_layer.encoder_attn.q_proj", |
| "target": "decoder_layer.encoder_attn.out_proj" |
| }, |
| { |
| "kind": "cache_read", |
| "source": "state:kv_cache", |
| "target": "decoder_layer.self_attn" |
| }, |
| { |
| "kind": "cache_write", |
| "source": "decoder_layer.self_attn", |
| "target": "state:kv_cache" |
| } |
| ], |
| "extends": null, |
| "model_type": "bart", |
| "provenance": { |
| "config_class": "BartConfig", |
| "config_module": "transformers.models.bart.configuration_bart", |
| "model_class": "BartModel", |
| "model_module": "transformers.models.bart.modeling_bart" |
| }, |
| "repeats": [ |
| { |
| "body": "encoder_layer", |
| "container_path_pattern": "model.encoder.layers", |
| "count": 12, |
| "count_expr": "config.encoder_layers", |
| "count_source": "config", |
| "id": "encoder_layers", |
| "index_symbol": "i", |
| "item_path_pattern": "model.encoder.layers.{i}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "BartEncoderLayer", |
| "container_path_pattern": "model.encoder.layers", |
| "item_path_pattern": "model.encoder.layers.{i}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "BartEncoderLayer" |
| }, |
| { |
| "body": "decoder_layer", |
| "container_path_pattern": "model.decoder.layers", |
| "count": 12, |
| "count_expr": "config.decoder_layers", |
| "count_source": "config", |
| "id": "decoder_layers", |
| "index_symbol": "i", |
| "item_path_pattern": "model.decoder.layers.{i}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "BartDecoderLayer", |
| "container_path_pattern": "model.decoder.layers", |
| "item_path_pattern": "model.decoder.layers.{i}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "BartDecoderLayer" |
| } |
| ], |
| "schema_version": "architecture-template-v0", |
| "templates": [ |
| { |
| "children": [ |
| "encoder_layer.self_attn", |
| "encoder_layer.self_attn_layer_norm", |
| "encoder_layer.final_layer_norm" |
| ], |
| "class_name": "BartEncoderLayer", |
| "id": "encoder_layer", |
| "kind": "transformer_block", |
| "path_pattern": "model.encoder.layers.{i}" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 16, |
| "n_kv_heads": 16, |
| "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": "BartAttention", |
| "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.self_attn_layer_norm", |
| "kind": "normalization", |
| "path_pattern": "model.encoder.layers.{i}.self_attn_layer_norm" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer.final_layer_norm", |
| "kind": "normalization", |
| "path_pattern": "model.encoder.layers.{i}.final_layer_norm" |
| }, |
| { |
| "children": [ |
| "decoder_layer.self_attn", |
| "decoder_layer.self_attn_layer_norm", |
| "decoder_layer.encoder_attn", |
| "decoder_layer.encoder_attn_layer_norm", |
| "decoder_layer.final_layer_norm" |
| ], |
| "class_name": "BartDecoderLayer", |
| "id": "decoder_layer", |
| "kind": "transformer_block", |
| "path_pattern": "model.decoder.layers.{i}" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 16, |
| "n_kv_heads": 16, |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "decoder_layer.self_attn.k_proj", |
| "decoder_layer.self_attn.v_proj", |
| "decoder_layer.self_attn.q_proj", |
| "decoder_layer.self_attn.out_proj" |
| ], |
| "class_name": "BartAttention", |
| "id": "decoder_layer.self_attn", |
| "kind": "attention", |
| "path_pattern": "model.decoder.layers.{i}.self_attn" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "decoder_layer.self_attn.k_proj", |
| "kind": "projection", |
| "path_pattern": "model.decoder.layers.{i}.self_attn.k_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "decoder_layer.self_attn.v_proj", |
| "kind": "projection", |
| "path_pattern": "model.decoder.layers.{i}.self_attn.v_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "decoder_layer.self_attn.q_proj", |
| "kind": "projection", |
| "path_pattern": "model.decoder.layers.{i}.self_attn.q_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "decoder_layer.self_attn.out_proj", |
| "kind": "projection", |
| "path_pattern": "model.decoder.layers.{i}.self_attn.out_proj" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "decoder_layer.self_attn_layer_norm", |
| "kind": "normalization", |
| "path_pattern": "model.decoder.layers.{i}.self_attn_layer_norm" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 16, |
| "n_kv_heads": 16, |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "decoder_layer.encoder_attn.k_proj", |
| "decoder_layer.encoder_attn.v_proj", |
| "decoder_layer.encoder_attn.q_proj", |
| "decoder_layer.encoder_attn.out_proj" |
| ], |
| "class_name": "BartAttention", |
| "id": "decoder_layer.encoder_attn", |
| "kind": "cross_attention", |
| "path_pattern": "model.decoder.layers.{i}.encoder_attn" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "decoder_layer.encoder_attn.k_proj", |
| "kind": "projection", |
| "path_pattern": "model.decoder.layers.{i}.encoder_attn.k_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "decoder_layer.encoder_attn.v_proj", |
| "kind": "projection", |
| "path_pattern": "model.decoder.layers.{i}.encoder_attn.v_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "decoder_layer.encoder_attn.q_proj", |
| "kind": "projection", |
| "path_pattern": "model.decoder.layers.{i}.encoder_attn.q_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "decoder_layer.encoder_attn.out_proj", |
| "kind": "projection", |
| "path_pattern": "model.decoder.layers.{i}.encoder_attn.out_proj" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "decoder_layer.encoder_attn_layer_norm", |
| "kind": "normalization", |
| "path_pattern": "model.decoder.layers.{i}.encoder_attn_layer_norm" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "decoder_layer.final_layer_norm", |
| "kind": "normalization", |
| "path_pattern": "model.decoder.layers.{i}.final_layer_norm" |
| } |
| ] |
| } |
|
|