What problem does it solve? Transformers scale quadratically with sequence length and require large KV caches, making long-context inference slow and memory-hungry. This Skill guides you through installing, configuring, training, and benchmarking Mamba state-space models that achieve O(n) linear complexity with no KV cache. ## Core Features & Use Cases - Model Setup & Generation: Build Mamba-1 and Mamba-2 language models with MambaLMHeadModel, or load pretrained checkpoints (130M to 2.8B) from HuggingFace for text generation. - Training & Distributed Workflows: Configure mixed-precision training, gradient checkpointing, DDP multi-GPU setups, and long-context sequence length progression. - Benchmarking vs Transformers: Compare inference throughput, latency, memory usage, and perplexity against Transformer baselines using provided benchmark scripts. - Use Case: You need to run inference on 100K+ token DNA sequences. Use this Skill to configure a Mamba-2 model with d_state=128, load a pretrained checkpoint, and generate outputs with constant per-token memory instead of an exploding KV cache. ## Quick Start Install mamba-ssm and causal-conv1d with pip, then ask the AI to create a Mamba language model and generate text from a prompt on a CUDA GPU.