Open AliasChenYi opened 4 weeks ago
Have you tried install the selective_scan in folder kernel/selective_scan ?
Yes,and pip install .
---Original--- From: "Liu @.> Date: Tue, Jun 4, 2024 20:04 PM To: @.>; Cc: @.**@.>; Subject: Re: [MzeroMiko/VMamba] I do not have selective_scan_cuda_oflex buthave selective_scan_cuda_core. What should I do? (Issue #216)
Have you tried install the selective_scan in folder kernel/selective_scan ?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Can you show me the output you got?
Have you tried install the selective_scan in folder kernel/selective_scan ? Yes,First,I enter into kernel/selective_scan,Second, I execute pip install . Finally return success, and last but not least return the missing package
你能告诉我你得到的输出吗?
My last output forgot to save the screenshot, but I remember it returned successful.
ok. try excuting this line:
python -c "import torch; import selective_scan_cuda_oflex; print(123)"
wait, the version is "selective-scan 0.0.2" not 0.01.
ok. try excuting this line:
python -c "import torch; import selective_scan_cuda_oflex; print(123)" please look this.
wait, the version is "selective-scan 0.0.2" not 0.01.
ok. try excuting this line:
python -c "import torch; import selective_scan_cuda_oflex; print(123)" Ah,how can i upgrade.
Have you tried install the selective_scan in folder kernel/selective_scan ? Yes,First,I enter into kernel/selective_scan,Second, I execute pip install . Finally return success, and last but not least return the missing package
Do this again and show me what happens.
您是否尝试过在文件夹 kernel/selective_scan 中安装selective_scan?是的,首先,我进入内核/selective_scan,其次,我执行pip install。最后返回成功,最后但并非最不重要的一点是返回丢失的包
再做一次,告诉我会发生什么。 Ok, I'll do it right now. Please wait for me.
您是否尝试过在文件夹 kernel/selective_scan 中安装selective_scan?是的,首先,我进入内核/selective_scan,其次,我执行pip install。最后返回成功,最后但并非最不重要的一点是返回丢失的包
再做一次,告诉我会发生什么。 please see.
I also meet the same problem.
I also meet the same problem.
Have you solved it yet
I feel the install step in the readme may have some problem. After “pip install .”, the environment has the "selective-scan" package , not selective_scan_cuda_oflex or selective_scan_cuda_core
I see. Since we've update our code greatly in last several months, only change the model file is not working anymore. You may need to update the whole package.
I feel the install step in the readme may have some problem. After “pip install .”, the environment has the "selective-scan" package , not selective_scan_cuda_oflex or selective_scan_cuda_core
ok. try excuting this line: python -c "import torch; import selective_scan_cuda_oflex; print(123)"
I see. Since we've update our code greatly in last several months, only change the model file is not working anymore. You may need to update the whole package. Maybe I can change this to 0.0.2???
I feel the install step in the readme may have some problem. After “pip install .”, the environment has the "selective-scan" package , not selective_scan_cuda_oflex or selective_scan_cuda_core
ok. try excuting this line: python -c "import torch; import selective_scan_cuda_oflex; print(123)"
Thank you for your reply, but it shows that it cannot be imported selective_scan_cuda_oflex
明白了。由于我们在过去几个月中对代码进行了大量更新,因此仅更改模型文件不再起作用。您可能需要更新整个程序包。
Thank you for your help. I downloaded the update on May 18th
I feel the install step in the readme may have some problem. After “pip install .”, the environment has the "selective-scan" package , not selective_scan_cuda_oflex or selective_scan_cuda_core
ok. try excuting this line: python -c "import torch; import selective_scan_cuda_oflex; print(123)"
I want to know if in the author’s environment, the showed package is selective-scan-0.x.x or selective_scan_cuda_oflex... Because I find “import selective_scan_cuda_core” in the code, not "import selective-scan"
I upgread 0.0.2 and try excuting this line: python -c "import torch; import selective_scan_cuda_oflex; print(123)",still shows that it cannot be imported selective_scan_cuda_oflex.
I upgread 0.0.2 and try excuting this line: python -c "import torch; import selective_scan_cuda_oflex; print(123)",still shows that it cannot be imported selective_scan_cuda_oflex.
I solved it
In tne readme, “pip install -r requirements.txt cd kernels/selective_scan && pip install ." should be changed to “pip install -r requirements.txt cd kernels/selective_scan && python setup.py build && python setup.py install"
After that, you can import selective_scan_cuda_oflex sucessfully
我更新了 0.0.2 并尝试执行此行:python -c “import torch;进口selective_scan_cuda_oflex;print(123)“,仍然显示无法导入selective_scan_cuda_oflex。
我解决了 oh, you're amazing. What did you try? Can you share? It's been bothering me for 15 days.
@MzeroMiko @AliasChenYi In tne readme, “pip install -r requirements.txt cd kernels/selective_scan && pip install ." should be changed to “pip install -r requirements.txt cd kernels/selective_scan && python setup.py build && python setup.py install"
After that, you can import selective_scan_cuda_oflex sucessfully
In tne readme, “pip install -r requirements.txt cd kernels/selective_scan && pip install ." should be changed to “pip install -r requirements.txt cd kernels/selective_scan && python setup.py build && python setup.py install"
After that, you can import selective_scan_cuda_oflex sucessfully
Does the version need to be changed to 0.0.2
@MzeroMiko @AliasChenYi In tne readme, “pip install -r requirements.txt cd kernels/selective_scan && pip install ." should be changed to “pip install -r requirements.txt cd kernels/selective_scan && python setup.py build && python setup.py install" After that, you can import selective_scan_cuda_oflex sucessfully
In tne readme, “pip install -r requirements.txt cd kernels/selective_scan && pip install ." should be changed to “pip install -r requirements.txt cd kernels/selective_scan && python setup.py build && python setup.py install" After that, you can import selective_scan_cuda_oflex sucessfully
Does the version need to be changed to 0.0.2
I don't change
@MzeroMiko @AliasChenYi In tne readme, “pip install -r requirements.txt cd kernels/selective_scan && pip install ." should be changed to “pip install -r requirements.txt cd kernels/selective_scan && python setup.py build && python setup.py install" After that, you can import selective_scan_cuda_oflex sucessfully
In tne readme, “pip install -r requirements.txt cd kernels/selective_scan && pip install ." should be changed to “pip install -r requirements.txt cd kernels/selective_scan && python setup.py build && python setup.py install" After that, you can import selective_scan_cuda_oflex sucessfully
Does the version need to be changed to 0.0.2
I don't change
Thank you very much. I'll try it now
"pip install ." is ok. "python setup.py install" is ok too. but the later will throw a warning.
"pip install ." is ok. "python setup.py install" is ok too. but the later will throw a warning.
oh, I find the same... Sorry
“pip install .”是可以的。“python setup.py install”也可以。但后者会发出警告。
哦,我发现一样......不好意思 I tried, but it didn't work out
I'm very sad.
I want to know why selective_scan_cuda_oflex can import successfully, selective_scan_cuda_core can’t However,in csms6s.py,SelectiveScanCore class use selective_scan_cuda_core
I want to know why selective_scan_cuda_oflex can import successfully, selective_scan_cuda_core can’t However,in csms6s.py,SelectiveScanCore class use selective_scan_cuda_core
As selective_scan_core is not used now, and will not be used anymore in the future, I disable it in setup.py to raise the compiling speed.
You can re-enable it by change MODES = ["oflex"]
in line 40 in setup.py to MODES = ["oflex", "core"]
I get it.
I find my problem.
In the vmamba.py 485:
v2=partial(self.forward_corev2, force_fp32=(not self.disable_force32), SelectiveScan=SelectiveScanCore)
should be changed to
v2=partial(self.forward_corev2, force_fp32=(not self.disable_force32), SelectiveScan=SelectiveScanOflex)
because SelectiveScanCore has been droped
is it right? @MzeroMiko
Thank you very much
Yes, you are right.
I have also solved, thank you so much!!! ❥(^_-)
I get it. I find my problem. In the vmamba.py 485:
v2=partial(self.forward_corev2, force_fp32=(not self.disable_force32), SelectiveScan=SelectiveScanCore)
should be changed tov2=partial(self.forward_corev2, force_fp32=(not self.disable_force32), SelectiveScan=SelectiveScanOflex)
because SelectiveScanCore has been droped is it right? @MzeroMiko Thank you very much
Sorry, I don't quite understand why I need to replace it, I configured the environment on my PC today and ran the model of vmambav2_tiny_224.yaml configuration file, SelectiveScan=SelectiveScanCore works fine on my PC. And on github, the source code is still SelectiveScan=SelectiveScanCore
Like the author said, maybe in the latest selective-scan version, the SelectScanCore has been dropped considering the inference speed. So running it in your own pc, maybe install the old version selective-scan or mamba-ssm library?
@aifeixingdelv
Curiously, I saw the author's code in setup.py, which only contains "oflex", but with the configuration file set to "vmambav2_tiny_224.yaml", The command v2=partial(self.forward_corev2, force_fp32=(not self.disable_force32), SelectiveScan=SelectiveScanCore), I downloaded the source code this afternoon and set up the environment, and successfully run it, I do not seem to find the problem here, normally according to the author's words, my program can not be executed successfully.
https://github.com/MzeroMiko/VMamba/blob/32b2cbe07cf5e3c1234beffc549ab1c1e1080082/classification/configs/vssm/vmambav2_tiny_224.yaml#L1-L17 In the vmambav2_tiny_224.yaml, SSM_FORWARDTYPE is "v05_noz" https://github.com/MzeroMiko/VMamba/blob/32b2cbe07cf5e3c1234beffc549ab1c1e1080082/classification/models/vmamba.py#L455-L478 In the code, the v05_noz SSM_FORWARDTYPE will use SelectiveScanOflex. So, it's normal to run it successfully? do you get it?
In the vmambav2_tiny_224.yaml, SSM_FORWARDTYPE is "v05_noz" https://github.com/MzeroMiko/VMamba/blob/32b2cbe07cf5e3c1234beffc549ab1c1e1080082/classification/models/vmamba.py#L455-L478
In the code, the v05_noz SSM_FORWARDTYPE will use SelectiveScanOflex. So, it's normal to run it successfully? do you get it?
Ok, thank you very much, I didn't look at the parameters of the code, I thought V2= "V2"
I get it. I find my problem. In the vmamba.py 485:
v2=partial(self.forward_corev2, force_fp32=(not self.disable_force32), SelectiveScan=SelectiveScanCore)
should be changed tov2=partial(self.forward_corev2, force_fp32=(not self.disable_force32), SelectiveScan=SelectiveScanOflex)
because SelectiveScanCore has been droped is it right? @MzeroMiko Thank you very much
Sorry, I don't quite understand why I need to replace it, I configured the environment on my PC today and ran the model of vmambav2_tiny_224.yaml configuration file, SelectiveScan=SelectiveScanCore works fine on my PC. And on github, the source code is still SelectiveScan=SelectiveScanCore
You do not have to replace it, as we finally use forwardtype v05 rather than v2.
Like the author said, maybe in the latest selective-scan version, the SelectScanCore has been dropped considering the inference speed. So running it in your own pc, maybe install the old version selective-scan or mamba-ssm library?
The SelectScanCore has no relation with inference speed, but compiling speed (i.e. the time spend when running pip install .
). The more functions you compile, the more time you should spend.
I do not have selective_scan_cuda_oflex but have selective_scan_cuda_core. What should I do?
![image](https://github.com/MzeroMiko/VMamba/assets/91005746/39041ca1-0c72-4232-96e8-c4825846f5f6)