inspector / ir /artifacts /falcon.json
lysandre's picture
lysandre HF Staff
Deploy architecture inspector
ed5700a verified
Raw
History Blame Contribute Delete
8.83 kB
{
"architecture": {
"attention_variant": "MHA",
"family": "causal_lm",
"is_moe": false,
"mixer": "attention",
"positional": "rope",
"tie_word_embeddings": true,
"view": "decoder"
},
"capabilities": {
"attention_backends": [
"eager",
"sdpa",
"flash_attention"
],
"attention_patterns": [
"causal"
],
"attention_schedule": null,
"task_heads": [
"causal_lm",
"question_answering",
"sequence_classification",
"token_classification"
],
"tensor_parallel": false
},
"components": [
{
"children": [
"word_embeddings",
"decoder_layers",
"ln_f",
"rotary_emb"
],
"class_name": "FalconModel",
"id": "model",
"kind": "model",
"path_pattern": "model"
},
{
"attributes": {
"embedding_dim": "config.hidden_size",
"num_embeddings": "config.vocab_size",
"tied_lm_head": true
},
"class_name": "Embedding",
"id": "word_embeddings",
"kind": "embedding",
"path_pattern": "model.word_embeddings"
},
{
"attributes": {
"norm_type": "layer"
},
"class_name": "LayerNorm",
"id": "ln_f",
"kind": "normalization",
"path_pattern": "model.ln_f"
},
{
"attributes": {
"head_dim": "config.head_dim",
"rope_theta": 10000.0,
"scheme": "rope"
},
"class_name": "FalconRotaryEmbedding",
"id": "rotary_emb",
"kind": "position",
"path_pattern": "model.rotary_emb"
}
],
"config": {
"class_name": "FalconConfig",
"model_type": "falcon",
"module": "transformers.models.falcon.configuration_falcon",
"referenced_fields": {
"num_hidden_layers": 32
},
"salient_fields": {
"head_dim": 64,
"hidden_size": 4544,
"is_encoder_decoder": false,
"max_position_embeddings": 2048,
"num_attention_heads": 71,
"num_hidden_layers": 32,
"num_key_value_heads": 71,
"tie_word_embeddings": true,
"vocab_size": 65024
}
},
"dataflow": {
"input": {
"name": "input_ids",
"shape": [
"B",
"S"
]
},
"output": {
"shape": [
"B",
"S",
"config.hidden_size"
]
},
"shapes": {
"decoder_layer.input_layernorm": {
"in": [
"B",
"S",
"config.hidden_size"
],
"out": [
"B",
"S",
"config.hidden_size"
]
},
"decoder_layer.mlp": {
"in": [
"B",
"S",
"config.hidden_size"
],
"out": [
"B",
"S",
"config.hidden_size"
]
},
"decoder_layer.self_attention": {
"in": [
"B",
"S",
"config.hidden_size"
],
"out": [
"B",
"S",
"config.hidden_size"
]
},
"decoder_layers": {
"in": [
"B",
"S",
"config.hidden_size"
],
"out": [
"B",
"S",
"config.hidden_size"
]
},
"ln_f": {
"in": [
"B",
"S",
"config.hidden_size"
],
"out": [
"B",
"S",
"config.hidden_size"
]
},
"rotary_emb": {
"in": [
"B",
"S",
"config.hidden_size"
],
"out": [
"B",
"S",
"config.head_dim"
]
},
"word_embeddings": {
"in": [
"B",
"S"
],
"out": [
"B",
"S",
"config.hidden_size"
]
}
},
"source": "observed_forward_meta"
},
"edges": [
{
"kind": "data",
"source": "word_embeddings",
"target": "decoder_layers"
},
{
"kind": "data",
"source": "decoder_layers",
"target": "ln_f"
},
{
"kind": "mask",
"source": "input:attention_mask",
"target": "decoder_layer.self_attention"
},
{
"kind": "residual",
"source": "decoder_layer",
"target": "decoder_layer.self_attention"
},
{
"kind": "residual",
"source": "decoder_layer",
"target": "decoder_layer.mlp"
},
{
"kind": "position",
"source": "rotary_emb",
"target": "decoder_layer.self_attention"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attention",
"target": "decoder_layer.self_attention.query_key_value"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attention",
"target": "decoder_layer.self_attention.dense"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.mlp",
"target": "decoder_layer.mlp.dense_h_to_4h"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.mlp.dense_h_to_4h",
"target": "decoder_layer.mlp.dense_4h_to_h"
},
{
"kind": "cache_read",
"source": "state:kv_cache",
"target": "decoder_layer.self_attention"
},
{
"kind": "cache_write",
"source": "decoder_layer.self_attention",
"target": "state:kv_cache"
},
{
"kind": "data",
"provenance": "observed_forward",
"source": "decoder_layer.input_layernorm",
"target": "decoder_layer.self_attention"
},
{
"kind": "data",
"provenance": "observed_forward",
"source": "decoder_layer.self_attention",
"target": "decoder_layer.mlp"
}
],
"extends": null,
"model_type": "falcon",
"provenance": {
"config_class": "FalconConfig",
"config_module": "transformers.models.falcon.configuration_falcon",
"model_class": "FalconModel",
"model_module": "transformers.models.falcon.modeling_falcon"
},
"repeats": [
{
"body": "decoder_layer",
"container_path_pattern": "model.h",
"count": 32,
"count_expr": "config.num_hidden_layers",
"count_source": "config",
"id": "decoder_layers",
"index_symbol": "i",
"item_path_pattern": "model.h.{i}",
"kind": "symbolic_repeat",
"provenance": {
"class_name": "FalconDecoderLayer",
"container_path_pattern": "model.h",
"item_path_pattern": "model.h.{i}",
"source": "module_tree_repeat_collapse"
},
"repeated_class_name": "FalconDecoderLayer"
}
],
"schema_version": "architecture-template-v0",
"templates": [
{
"children": [
"decoder_layer.self_attention",
"decoder_layer.mlp",
"decoder_layer.input_layernorm"
],
"class_name": "FalconDecoderLayer",
"id": "decoder_layer",
"kind": "transformer_block",
"path_pattern": "model.h.{i}"
},
{
"attributes": {
"head_dim": 64,
"n_heads": 71,
"n_kv_heads": 71,
"pattern": "causal",
"rope": true,
"variant": "MHA"
},
"children": [
"decoder_layer.self_attention.query_key_value",
"decoder_layer.self_attention.dense"
],
"class_name": "FalconAttention",
"id": "decoder_layer.self_attention",
"kind": "attention",
"path_pattern": "model.h.{i}.self_attention"
},
{
"class_name": "FalconLinear",
"id": "decoder_layer.self_attention.query_key_value",
"kind": "projection",
"path_pattern": "model.h.{i}.self_attention.query_key_value"
},
{
"class_name": "FalconLinear",
"id": "decoder_layer.self_attention.dense",
"kind": "projection",
"path_pattern": "model.h.{i}.self_attention.dense"
},
{
"attributes": {
"hidden_size": 4544
},
"children": [
"decoder_layer.mlp.dense_h_to_4h",
"decoder_layer.mlp.dense_4h_to_h"
],
"class_name": "FalconMLP",
"id": "decoder_layer.mlp",
"kind": "feed_forward",
"path_pattern": "model.h.{i}.mlp"
},
{
"class_name": "FalconLinear",
"id": "decoder_layer.mlp.dense_h_to_4h",
"kind": "projection",
"path_pattern": "model.h.{i}.mlp.dense_h_to_4h"
},
{
"class_name": "FalconLinear",
"id": "decoder_layer.mlp.dense_4h_to_h",
"kind": "projection",
"path_pattern": "model.h.{i}.mlp.dense_4h_to_h"
},
{
"attributes": {
"norm_type": "layer"
},
"class_name": "LayerNorm",
"id": "decoder_layer.input_layernorm",
"kind": "normalization",
"path_pattern": "model.h.{i}.input_layernorm"
}
]
}