Mamba-2 2.7B
Carnegie Mellon / Princeton · Mamba · open weights
- Mamba (SSM)
- Pre-norm
Facts and where they come from
| Released | 2024-05 | config.jsonconfig.jsonHugging Face repository creation date (api.createdAt) |
|---|---|---|
| Licence | apache-2.0 | config.jsonconfig.jsonREADME metadata: license |
| Total parameters | 2.7B | labmodel cardmodel name mamba2-2.7b |
| Active parameters | not disclosed | not disclosed |
| Context length | not disclosed | not disclosed |
| Norm placement | pre | codemodelling codemamba_ssm: one norm before each block |
| Norm type | RMSNorm | codemodelling codemamba_ssm: one norm before each block |
| QK-norm | no | codemodelling codeno q/k normalisation in the attention block |
| Positional encoding | none; all layers: the recurrence carries order | codemodelling codetransformers 5.18.0 mamba2_ssm: no positional encoding |
| Parallel attention and MLP | no | codemodelling codemamba_ssm: one norm before each block |
Architecture, drawn from the data
Mamba-2. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.
Modelled costs
From the cost model, batch size 1. Totals the lab states are in the table above; differences come from rounding, from what a lab counts, or from parts the model does not describe (listed on the about page).
| Parameters (modelled) | 2.7B |
|---|---|
| Active per token (modelled) | 2.7B |
| Without embeddings and output head | 2.57B total, 2.57B active |
| KV cache per token, BF16 (layers that grow with context) | 0 B |
| KV cache + state at 128K tokens, BF16 | 82 MiB |
| Decode FLOPs per token at 4K context | 5.66 GFLOP |
| Prefill FLOPs for a 4K prompt | 22.1 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 2,560 | config.jsonconfig.jsond_model |
| vocab | 50,277 | config.jsonconfig.jsonvocab_size |
| tied_embeddings | true | config.jsonconfig.jsontie_embeddings |
| mixers.mamba.type | mamba2 | codemodelling codeMamba-2 |
| mixers.mamba.heads | 80 | codemodelling codemamba_ssm Mamba2: d_inner = expand(2) * d_model; nheads = d_inner / headdim(64) |
| mixers.mamba.head_dim | 64 | codemodelling codemamba_ssm Mamba2 default headdim 64 |
| mixers.mamba.state | 128 | codemodelling codemamba_ssm Mamba2 default d_state 128 |
| mixers.mamba.groups | 1 | codemodelling codemamba_ssm Mamba2 default ngroups 1 |
| mixers.mamba.conv_kernel | 4 | codemodelling codemamba_ssm Mamba2 default d_conv 4 |
| layout | 64× mamba/none | config.jsonconfig.jsonn_layer |
| norms_per_layer | 1 | codemodelling codeone RMSNorm per block |
Sources
- config.json @ 99b226c
- model card
- arXiv 2405.21060
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision