All models

Bamba-9B-v1 (ibm-ai-platform)

A decoder-only language model that intersperses full attention layers with Mamba2 layers.

Language · 2,283 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

This diagram has 2,283 operations (1.5 MB) and is drawn when you ask.

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
Bamba
Parameters
2.9M
Operations
2,283
Framework
PyTorch
Recurrent
Yes
Published
2024, Hugging Face blog
Authors
Linsong Chu, Divya Kumari, Tri Dao and others
Name in source
ibm-ai-platform:Bamba-9B-v1
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m11921
Graph hash
df3e185621eef84bf271915acea6edf65b248f241cd45be98de67c5e633fbf29
Skeleton hash
9f93220f1a7640045a71d606c4a1b4b95de6aa9b07feef601156e8ebebb0f25e
Architecture hash
543ad924b3cf8b37e400b95181b5d0dd1c43d50ad7af04cbe31a109bbf8e6759
Diagram SHA-256
b14f58022daee5c78481a4ea667294fd00d71b18430a4031fe4b773af41f3791
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

menagerie.classics.jamba:build_jamba: build({})

What it is

Bamba-9B-v1 was trained from scratch in two stages: 2 trillion tokens from the Dolma v1.7 dataset, then 200 billion tokens of a curated blend of high-quality data.

About this model's family

Bamba-9B is a decoder-only language model based on the Mamba-2 architecture and designed for a wide range of text generation tasks. It is a hybrid model: full attention layers are interspersed with Mamba2 layers.

The blog post that introduced the model names the root cause of the memory bottleneck in transformer inference: the increasing amount of memory required by the KV-cache as the context length increases. Mamba is among the architectures it lists as removing this bottleneck by making the KV-cache size constant. In the authors' vLLM benchmark against Meta Llama 3.1 8B on an NVIDIA H100 80GB GPU, Bamba-9B reached up to 2 to 2.5 times better throughput and latency as batch size and sequence length increased.

The model card lists 32 layers, a hidden dimension of 4096, 32 attention heads with GQA, 8 KV heads and a context length of 4096, and gives the parameter count as 9.78B. The architecture was designed jointly by Princeton, CMU, IBM and UIUC. Training was performed primarily by the IBM team, using the Mamba2 kernels and layer implementation from Tri Dao and Albert Gu.

Key idea. Bamba-9B is a hybrid Mamba2 language model trained on open data, for which the authors report 2.5x throughput improvement and 2x latency speedup over standard transformers in vLLM.

  • bamba
  • bamba-9b
  • hybrid mamba2
  • mamba2 language model
  • state space language model
  • inference-efficient language model
  • kv-cache
  • text generation

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@article{bamba2024,
  title = {Bamba: Inference-Efficient Hybrid Mamba2 Model},
  author = {Linsong Chu and Divya Kumari and Tri Dao and Albert Gu and Raghu Ganti and Dakshi Agrawal and Mudhakar Srivatsa and Davis Wertheimer and Yu Chin Fabian Lim and Antoni Viros},
  year = {2024},
  journal = {Hugging Face blog}
}