Typo of dconv at Line 231 of modules/mamba2.py
@tridao I think there is a typo at line 231 of mamba2.py.
I think it should be self.d_conv instead of self.dconv
I got the following error when running mamba2 inference.
AttributeError: 'Mamba2' object has no attribute 'dconv'
I found that the dconv was introduced in commit 03a38fb
I have the same problem of self.dconv and I have solved by correcting self.dconv -> self.d_conv. Also, I corrected one more for slicing as '[:, -(self.dconv - 1):]' -> [:, (self.dconv - 1):].
Looks like this code is actually correct and this is an error which happens with an incompatible Python version. Switching from Python 3.10.14 to 3.10.13 fixed this for me.
also with 3.10.13 not working for me. changing self.dconv -> self.d_conv. resulted in this error File "/home/rswork/anaconda3/envs/ptllm/lib/python3.12/site-packages/torch/autograd/function.py", line 598, in apply return super().apply(*args, **kwargs) # type: ignore[misc] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rswork/anaconda3/envs/ptllm/lib/python3.12/site-packages/mamba_ssm/ops/triton/ssd_combined.py", line 540, in forward out, out_x, dt_out, dA_cumsum, states, final_states, *rest = _mamba_chunk_scan_combined_fwd(x, dt, A, B, C, chunk_size, D=D, z=z, dt_bias=dt_bias, initial_states=initial_states, seq_idx=seq_idx, cu_seqlens=cu_seqlens, dt_softplus=dt_softplus, dt_limit=dt_limit) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rswork/anaconda3/envs/ptllm/lib/python3.12/site-packages/mamba_ssm/ops/triton/ssd_combined.py", line 287, in _mamba_chunk_scan_combined_fwd assert dt.shape == (batch, seqlen, nheads) AssertionError
could not find the other '[:, -(self.dconv - 1):]' -> [:, (self.dconv - 1):]. in mamba2.py or ssd_combined.
ok, i found the problem - was missing one of dependencies:
causal-conv1d-1.4.0