hustvl / Vim

Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model
Apache License 2.0
2.55k stars 159 forks source link

is this code only running in the CUDA 11.8, can this code running in the 12.4 #51

Closed poult-lab closed 2 months ago

poult-lab commented 3 months ago

My cuda's version is 12.4, the bug appears when I try to install 'causal-conv1d'. it seems this code is only woking based on the cuda is 11.8. Dose anyone use 12.4 cuda running this code properly?

white-day commented 3 months ago

I have same problem.

poult-lab commented 3 months ago

I have same problem.

Actually, I have installed 'causal-conv1d' and 'mamba' based on the cuda 12.4. But I am not sure whether the program will working or not.

IamShubhamGupto commented 3 months ago

@poult-lab I found that just running the test code of mamba verifies If CUDA is being used or not

import torch
from mamba_ssm import Mamba

batch, length, dim = 2, 64, 16
x = torch.randn(batch, length, dim).to("cuda")
model = Mamba(
    # This module uses roughly 3 * expand * d_model^2 parameters
    d_model=dim, # Model dimension d_model
    d_state=16,  # SSM state expansion factor
    d_conv=4,    # Local convolution width
    expand=2,    # Block expansion factor
).to("cuda")
y = model(x)
assert y.shape == x.shape

if you don't have any errors, then it installed successfully

poult-lab commented 3 months ago

@poult-lab I found that just running the test code of mamba verifies If CUDA is being used or not

import torch
from mamba_ssm import Mamba

batch, length, dim = 2, 64, 16
x = torch.randn(batch, length, dim).to("cuda")
model = Mamba(
    # This module uses roughly 3 * expand * d_model^2 parameters
    d_model=dim, # Model dimension d_model
    d_state=16,  # SSM state expansion factor
    d_conv=4,    # Local convolution width
    expand=2,    # Block expansion factor
).to("cuda")
y = model(x)
assert y.shape == x.shape

if you don't have any errors, then it installed successfully

Thanks bro, it seems the vim is not working based on the CUDA 12 at all. I have to find a way to shift to the CUDA 11.8.

Medallion11 commented 3 months ago

Is it working only based on the CUDA 11.8?how about CUDA11.7?

poult-lab commented 3 months ago

Is it working only based on the CUDA 11.8?how about CUDA11.7?

it seems okay, CUDA 11.7

BmonsterYJ commented 2 months ago

how about CUDA 11.6?I can not find a causal-conv1d based on CUDA 11.6.

poult-lab commented 2 months ago

how about CUDA 11.6?I can not find a causal-conv1d based on CUDA 11.6.

probably you have to upgrade your CUDA's version.