Mamba SSM 架构
Albert Gu*、Tri Dao*
论文: https://arxiv.org/abs/2312.00752
Mamba 是一种新的状态空间模型架构,在信息密集的数据(如语言模型)上表现出令人满意的性能,而之前的次方差模型却无法与 Transformer 相匹敌。它基于 结构化状态空间模型 的进展,具有高效的硬件感知设计和实现,遵循 FlashAttention 的精神。
| 安装模式 | 命令 | 行为 |
| 核心包 | pip install mamba-ssm --no-build-isolation | 无 selective_scan_cuda 而不编译 CUDA 扩展。 |
| 核心包加 causal-conv1d | pip install "mamba-ssm[causal-conv1d]" --no-build-isolation | 安装核心包和 causal-conv1d 扩展,仍然没有 selective_scan_cuda。 |
| 强制本地核心包构建 | MAMBA_FORCE_BUILD=TRUE pip install mamba-ssm --no-build-isolation | 在本地构建默认的纯 Python 轮,仍然没有 selective_scan_cuda。 |
| CUDA 选择性扫描选项 | MAMBA_KEEP_CUDA_BUILD=TRUE pip install mamba-ssm --no-build-isolation | 安装 selective_scan_cuda;pip 首先尝试匹配预构建的 CUDA/HIP 轮,然后在没有可用轮的情况下在本地编译。 |
| 强制本地 CUDA 选择性扫描构建 | MAMBA_FORCE_BUILD=TRUE MAMBA_KEEP_CUDA_BUILD=TRUE pip install mamba-ssm --no-build-isolation | 使用 MAMBA_FORCE_BUILD 选项,强制构建默认的纯 Python 轮,然后使用 MAMBA_KEEP_CUDA_BUILD 选项,强制构建 selective_scan_cuda。
在 Mamba 块中,当 bias 设置为 True 时,发生了反向传播错误
[错误] Mamba2 RMSNormGated 在张量并行模式下使用全局 ngroups 作为 group_size
在 Google Colab 上安装 `mamba_ssm` 包失败
Mamba3 的 step() 方法是非确定性的,不符合 forward() 方法
[][Mamba-3]四元数状态
apache-tvm-ffi<=0.1.12(在 #984 之后)与 pinned tilelang==0.1.8 不兼容 — 可用的最大版本为 0.1.9
Mamba3 MIMO 回退无法在低共享内存的 Blackwell SKU 上启动(请求 220 KB,限制为 99 KB)
序列长于~61K令牌(往往更少) 默默给出错误答案或崩溃
Mamba-3 增量解码出错: `step()` 接收 `(B, 1, D)`, 但 `_preprocess` 期望 2-D — `generate()` 在官方 1.5B 检查点中均出现 EinopsError
没有针对 sm_103 (B300) 和 sm_121 (GB10) 的预构建的驱动