Skip to content

Building wheel for mamba-ssm (pyproject.toml) did not run successfully. #731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
adib3552 opened this issue May 22, 2025 · 3 comments
Open

Comments

@adib3552
Copy link

I am getting this error:

`error: subprocess-exited-with-error

× Building wheel for mamba-ssm (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for mamba-ssm (pyproject.toml) ... error
ERROR: Failed building wheel for mamba-ssm
Successfully built causal-conv1d
Failed to build mamba-ssm
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (mamba-ssm)`

I have tried to manually download the wheel from releases but then i get

`ImportError Traceback (most recent call last)
/tmp/ipykernel_35/3881790.py in <cell line: 0>()
3 import torch.nn as nn
4 import torch.nn.functional as F
----> 5 from mamba_ssm.modules.mamba_simple import Mamba
6 from torch.optim import Adam
7 import torch.optim as optim

/usr/local/lib/python3.11/dist-packages/mamba_ssm/init.py in
1 version = "2.2.4"
2
----> 3 from mamba_ssm.ops.selective_scan_interface import selective_scan_fn, mamba_inner_fn
4 from mamba_ssm.modules.mamba_simple import Mamba
5 from mamba_ssm.modules.mamba2 import Mamba2

/usr/local/lib/python3.11/dist-packages/mamba_ssm/ops/selective_scan_interface.py in
16 from mamba_ssm.ops.triton.layer_norm import _layer_norm_fwd
17
---> 18 import selective_scan_cuda
19
20

ImportError: libcudart.so.11.0: cannot open shared object file: No such file or directory
`
I am using kaggle. I get same error on Colab. How to fix it?

@YVSemlani
Copy link

I was able to fix this issue by downloading Mamba git repo, merging PR #729 into my local repo, and downloading from source. Commands are:

pip install "causal-conv1d>=1.4.0"
git clone https://github.com/state-spaces/mamba.git
cd mamba
CAUSAL_CONV1D_FORCE_BUILD=TRUE CAUSAL_CONV1D_SKIP_CUDA_BUILD=TRUE CAUSAL_CONV1D_FORCE_CXX11_ABI=TRUE pip install --no-build-isolation .

I tried this using CUDA 12.8 and PyTorch 2.7.0 which did not work. Switched to CUDA 12.4 and PyTorch 2.4.1 and it worked.

(********) root@*********:~# pip show torch
Name: torch
Version: 2.4.1+cu124
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: [email protected]
License: BSD-3
Location: /usr/local/lib/python3.11/dist-packages
Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvtx-cu12, sympy, triton, typing-extensions
Required-by: causal-conv1d, lm_eval, mamba-ssm, peft, torchaudio, torchvision

(**********) root@**********:~# nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131
Build cuda_12.4.r12.4/compiler.34097967_0


Referenced these two threads to solve:

#719
#634

@adib3552
Copy link
Author

adib3552 commented May 24, 2025

I was able to fix this issue by downloading Mamba git repo, merging PR #729 into my local repo, and downloading from source. Commands are:

pip install "causal-conv1d>=1.4.0"
git clone https://github.com/state-spaces/mamba.git
cd mamba
CAUSAL_CONV1D_FORCE_BUILD=TRUE CAUSAL_CONV1D_SKIP_CUDA_BUILD=TRUE CAUSAL_CONV1D_FORCE_CXX11_ABI=TRUE pip install --no-build-isolation .

I tried this using CUDA 12.8 and PyTorch 2.7.0 which did not work. Switched to CUDA 12.4 and PyTorch 2.4.1 and it worked.

(********) root@*********:~# pip show torch
Name: torch
Version: 2.4.1+cu124
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: [email protected]
License: BSD-3
Location: /usr/local/lib/python3.11/dist-packages
Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvtx-cu12, sympy, triton, typing-extensions
Required-by: causal-conv1d, lm_eval, mamba-ssm, peft, torchaudio, torchvision

(**********) root@**********:~# nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131
Build cuda_12.4.r12.4/compiler.34097967_0

Referenced these two threads to solve:

#719 #634

i have tried it but i get error when trying to import Mamba from mamba_ssm

ImportError Traceback (most recent call last)
/tmp/ipykernel_35/299548030.py in <cell line: 0>()
3 import torch.nn as nn
4 import torch.nn.functional as F
----> 5 from mamba_ssm import Mamba
6 from torch.optim import Adam
7 import torch.optim as optim

/kaggle/working/mamba/mamba_ssm/init.py in
1 version = "2.2.4"
2
----> 3 from mamba_ssm.ops.selective_scan_interface import selective_scan_fn, mamba_inner_fn
4 from mamba_ssm.modules.mamba_simple import Mamba
5 from mamba_ssm.modules.mamba2 import Mamba2

/kaggle/working/mamba/mamba_ssm/ops/selective_scan_interface.py in
16 from mamba_ssm.ops.triton.layer_norm import _layer_norm_fwd
17
---> 18 import selective_scan_cuda
19
20

ImportError: /usr/local/lib/python3.11/dist-packages/selective_scan_cuda.cpython-311-x86_64-linux-gnu.so: undefined symbol: _ZN3c107WarningC1ESt7variantIJNS0_11UserWarningENS0_18DeprecationWarningEEERKNS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb

@MaximilienLC
Copy link

hey @tridao, any chance you could build the torch 2.7 wheels for causal_conv1d and mamba_ssm?
and if you have access to an AMD GPU, ROCm wheels would also be welcomed :)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants