Skip to content

I also come to share my environment and methods #136

Open
@shabbyliu

Description

@shabbyliu

my version

cuda = 11.8
python = 3.10.13
gcc = (Ubuntu 11.4.0-9ubuntu1) 11.4.0
g++ = (Ubuntu 11.4.0-9ubuntu1) 11.4.0
Ninja = 1.11.1.git.kitware.jobserver-1
Ubuntu = 24.04

Make sure gcc, g++, and Ninja are installed

$ sudo apt update
$ sudo apt install build-essential
$ sudo apt install ninja-build
$ gcc --version
$ g++ --version
$ ninja --version

cmd input

$ conda create -n vim python=3.10.13

$ conda activate vim

$ pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118

$ cd ....../Vim-main/

$ pip install -r vim/vim_requirements.txt

$ pip install causal-conv1d==1.1.0

$ cd ....../Vim-main/mamba-1p1p1

$ pip install -e .

test in python

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

Modify function in selective_scan_interface.py on line 324

conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(
x, conv1d_weight, conv1d_bias, None, None, None, True
)
to
conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(
x, conv1d_weight, conv1d_bias, None, True
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions