Vim icon indicating copy to clipboard operation
Vim copied to clipboard

I also come to share my environment and methods

Open shabbyliu opened this issue 1 year ago • 1 comments

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 )

shabbyliu avatar Mar 13 '25 13:03 shabbyliu

这causal_conv1d_cuda你们怎么下载的,为什么我的下不下来

danwenxiu avatar Jul 31 '25 07:07 danwenxiu