Mamba2 instance failed
Hi! When I run the mamba2 usage case provided by the author, an error message says:
File "test.py", line 9, in
Can anyone solve this problem. I would greatly appreciate it
Set dim = 32
Like so
import torch
from mamba_ssm.modules.mamba2 import Mamba2
batch, length, dim = 2, 64, 32
x = torch.randn(batch, length, dim).to('cuda')
model = Mamba2(
# This module uses roughly 3 * expand * d_model^2 parameters
d_model=dim, # Model dimension d_model
d_state=64, # SSM state expansion factor, typically 64 or 128
d_conv=4, # Local convolution width
expand=2, # Block expansion factor
).to("cuda")
y = model(x)
assert y.shape == x.shape
What is your causal_conv1d version? Is there a pytorch version? I still get an error: RuntimeError: causal_conv1d with channel last layout requires strides (x.stride(0) and x.stride(2)) to be multiples of 8
What is your causal_conv1d version? Is there a pytorch version? I still get an error: RuntimeError: causal_conv1d with channel last layout requires strides (x.stride(0) and x.stride(2)) to be multiples of 8
I also have this issue, have you fixed this issue?
Set dim = 32
Like so
import torch from mamba_ssm.modules.mamba2 import Mamba2 batch, length, dim = 2, 64, 32 x = torch.randn(batch, length, dim).to('cuda') model = Mamba2( # This module uses roughly 3 * expand * d_model^2 parameters d_model=dim, # Model dimension d_model d_state=64, # SSM state expansion factor, typically 64 or 128 d_conv=4, # Local convolution width expand=2, # Block expansion factor ).to("cuda") y = model(x) assert y.shape == x.shape
$ pip install -U causal_con1d $ python
import torch from mamba_ssm.modules.mamba2 import Mamba2 Traceback (most recent call last): File "
", line 1, in ModuleNotFoundError: No module named 'mamba_ssm.modules.mamba2'
Set dim = 32 Like so
import torch from mamba_ssm.modules.mamba2 import Mamba2 batch, length, dim = 2, 64, 32 x = torch.randn(batch, length, dim).to('cuda') model = Mamba2( # This module uses roughly 3 * expand * d_model^2 parameters d_model=dim, # Model dimension d_model d_state=64, # SSM state expansion factor, typically 64 or 128 d_conv=4, # Local convolution width expand=2, # Block expansion factor ).to("cuda") y = model(x) assert y.shape == x.shape$ pip install -U causal_con1d $ python
import torch from mamba_ssm.modules.mamba2 import Mamba2 Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'mamba_ssm.modules.mamba2'
I used 'dim=256 * n' to successfully run Mamba2. Anyway, thanks for the info.
File "/home/dl/anaconda3/envs/mypogevon/lib/python3.8/site-packages/mamba_ssm/ops/triton/ssd_combined.py", line 762, in forward causal_conv1d_cuda.causal_conv1d_fwd(rearrange(xBC, "b s d -> b d s"), RuntimeError: causal_conv1d with channel last layout requires strides (x.stride(0) and x.stride(2)) to be multiples of 8 I also have this problem when d_model=32,and after setting d_model = 256, successfully run Mamba2 too
Set dim = 32
Like so
import torch from mamba_ssm.modules.mamba2 import Mamba2 batch, length, dim = 2, 64, 32 x = torch.randn(batch, length, dim).to('cuda') model = Mamba2( # This module uses roughly 3 * expand * d_model^2 parameters d_model=dim, # Model dimension d_model d_state=64, # SSM state expansion factor, typically 64 or 128 d_conv=4, # Local convolution width expand=2, # Block expansion factor ).to("cuda") y = model(x) assert y.shape == x.shape
AttributeError: 'NoneType' object has no attribute 'causal_conv1d_fwd'
Set dim = 32 Like so
import torch from mamba_ssm.modules.mamba2 import Mamba2 batch, length, dim = 2, 64, 32 x = torch.randn(batch, length, dim).to('cuda') model = Mamba2( # This module uses roughly 3 * expand * d_model^2 parameters d_model=dim, # Model dimension d_model d_state=64, # SSM state expansion factor, typically 64 or 128 d_conv=4, # Local convolution width expand=2, # Block expansion factor ).to("cuda") y = model(x) assert y.shape == x.shapeAttributeError: 'NoneType' object has no attribute 'causal_conv1d_fwd'
install mamba from the source code, and i recommand u to install mamba2.2.2 and causal-conv1d1.4.0. you will find you can run mamba. if you want to run mamba2. i am also trying to solve the problems.