Registry / ai-ml / mamba-ssm

mamba-ssm

JSON →
library2.3.2.post1pypypiunverified

Mamba is a state-space model architecture designed for efficient sequence modeling, offering linear-time inference and parallelizable training. Currently at version 2.3.1, it requires Python >=3.9 and is under active development with frequent releases focused on ROCm and CUDA compatibility.

pip install mamba-ssm
INSTALL
IMPORT
SIG · MAMBA-SSM
M
mamba-ssm
ai-mlpythonv2.3.2.post1
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Mamba
from mamba_ssm import Mamba
import mamba_ssm
Direct import of class is required; the top-level module does not expose the class automatically.
Mamba2
from mamba_ssm import Mamba2
Mamba2 is a variant and must be imported similarly.

Instantiate a Mamba model and run a forward pass on GPU with float16 precision.

import torch from mamba_ssm import Mamba batch, seq_len, dim = 2, 128, 16 model = Mamba( d_model=dim, d_state=16, d_conv=4, expand_factor=2, dt_rank='auto', bias=False, conv_bias=True, pscan=False, device='cuda', dtype=torch.float16 ) x = torch.randn(batch, seq_len, dim, device='cuda', dtype=torch.float16) y = model(x) print(y.shape) # Expected: (2, 128, 16)
Debug
Known issues
breakingMamba v2.x requires PyTorch >=2.0 and CUDA 11.8+ for GPU support. Older PyTorch versions will fail with missing ops.
fix
Upgrade PyTorch to 2.0+ and ensure CUDA toolkit 11.8+ is available.
affects: >=2.0.0
breakingThe causal-conv1d dependency is a separate package that may have ABI incompatibilities with different PyTorch versions. Mixing builds can cause silent incorrect results or crashes.
fix
Install causal-conv1d from the same source (PyPI with matching CUDA version) or build from source using the same PyTorch build.
affects: all
deprecatedThe 'pscan' parameter in Mamba is deprecated since v2.0 and will be removed in a future release. Setting pscan=True may lead to undefined behavior.
fix
Remove the 'pscan' argument or set it to False (default).
affects: >=2.0.0
gotchaThe Mamba model expects input shape (batch, seq_len, d_model). Transposing or using (seq_len, batch, d_model) will not raise an error but will produce incorrect outputs due to dimension mismatch.
fix
Ensure input shape is (B, L, D). Use x = x.transpose(0,1) if you have (L, B, D).
affects: all
gotchaWhen using torch.compile, the custom CUDA kernels may not be compatible. Expect failures or performance degradation.
fix
Avoid torch.compile with Mamba layers, or test thoroughly.
affects: all
Upgrade
Version history
2.3.2.post1latest on PyPI · released May 9, 2026
Audit
Dependencies
torchrequiredPyTorch is a core dependency for tensor operations and CUDA support.
causal-conv1doptionalOptional but recommended for faster causal convolution layers.
packagingrequiredUsed internally for version checks.
einopsrequiredRequired for rearranging tensors.
Agent activity
12 hits · last 30 days
node
8
Resources
mamba-ssm — pip install mamba-ssm · libregistry