Model Visualization

from transformers import BatchEncoding, TextStreamer
from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="unsloth/gpt-oss-20b",
    dtype=None,  # torch.bfloat16,  # None for auto detection
    max_seq_length=1000,
    load_in_4bit=False,
    full_finetuning=False,
    low_cpu_mem_usage=True,
    device_map="cuda",  # Explicitly load to CUDA
)

VIsualization Codes

import torch
from rich.tree import Tree
from rich import print as rprint

def visualize_model_structure(model):
    # 1. Create root node
    tree = Tree(f"πŸ—οΈ [bold blue]Model: {getattr(model.config, '_name_or_path', 'Unknown')}[/bold blue]")
    
    # Dictionary to keep track of created nodes: {path_string: rich_tree_node}
    node_lookup = {"": tree}

    for name, module in model.named_modules():
        if name == "": continue
        
        # Split path: 'model.layers.0.self_attn' -> ['model', 'layers', '0', 'self_attn']
        parts = name.split('.')
        parent_path = ".".join(parts[:-1])
        current_part = parts[-1]

        # Calculate Size Info
        # Get parameter count for this specific module
        params_count = sum(p.numel() for p in module.parameters(recurse=False))
        
        # Get shape if it's a leaf layer (like Linear or Embedding)
        shape_info = ""
        if hasattr(module, 'weight') and isinstance(module.weight, torch.Tensor):
            shape_info = f" [yellow]({list(module.weight.shape)})[/yellow]"
        elif params_count > 0:
            shape_info = f" [green]({params_count:,} params)[/green]"

        # 2. Find or Create Node
        if parent_path in node_lookup:
            parent_node = node_lookup[parent_path]
            # Add new node with style and size info
            new_node = parent_node.add(f"[bold magenta]{current_part}[/bold magenta]{shape_info}")
            node_lookup[name] = new_node

    rprint(tree)

# Execution
visualize_model_structure(model)

here’s the result

πŸ—οΈ Model: unsloth/gpt-oss-20b
β”œβ”€β”€ model
β”‚   β”œβ”€β”€ embed_tokens ([201088, 2880])
β”‚   β”œβ”€β”€ layers
β”‚   β”‚   β”œβ”€β”€ 0
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 1
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 2
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 3
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 4
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 5
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 6
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 7
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 8
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 9
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 10
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 11
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 12
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 13
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 14
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 15
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 16
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 17
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 18
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 19
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 20
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 21
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   β”œβ”€β”€ 22
β”‚   β”‚   β”‚   β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚   β”‚   β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚   β”‚   β”œβ”€β”€ mlp
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚   β”‚   β”‚   └── experts (796,538,880 params)
β”‚   β”‚   β”‚   β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚   β”‚   └── post_attention_layernorm ([2880])
β”‚   β”‚   └── 23
β”‚   β”‚       β”œβ”€β”€ self_attn (64 params)
β”‚   β”‚       β”‚   β”œβ”€β”€ q_proj ([4096, 2880])
β”‚   β”‚       β”‚   β”œβ”€β”€ k_proj ([512, 2880])
β”‚   β”‚       β”‚   β”œβ”€β”€ v_proj ([512, 2880])
β”‚   β”‚       β”‚   └── o_proj ([2880, 4096])
β”‚   β”‚       β”œβ”€β”€ mlp
β”‚   β”‚       β”‚   β”œβ”€β”€ router ([32, 2880])
β”‚   β”‚       β”‚   └── experts (796,538,880 params)
β”‚   β”‚       β”œβ”€β”€ input_layernorm ([2880])
β”‚   β”‚       └── post_attention_layernorm ([2880])
β”‚   β”œβ”€β”€ norm ([2880])
β”‚   └── rotary_emb
└── lm_head ([201088, 2880])