Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when installing selective_scan on Windows using conda environment #95

Open
WqxLoveCoding opened this issue Mar 19, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@WqxLoveCoding
Copy link

Error (same with #84):
image

platform: Windows 10

pytorch install command (successful): conda install pytorch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 pytorch-cuda=12.1 -c pytorch -c nvidia

python version: 3.8.18

nvcc -V
image

nvidia-smi
image

@WqxLoveCoding WqxLoveCoding changed the title Error when installing selective_scan Error when installing selective_scan on Windows using conda environment Mar 19, 2024
@WqxLoveCoding
Copy link
Author

Note: I've found that following the given installation steps on Linux, all steps work fine, so I'm not sure if it's platform related, but I'm currently desperate to experiment on Windows...

@MzeroMiko
Copy link
Owner

MzeroMiko commented Mar 19, 2024

M_LOG2E is actually math_log_2{e}, which is approximately 1.4426950408889634. You can #define M_LOG2E 1.4426950408889634; to use it.

@WqxLoveCoding
Copy link
Author

M_LOG2E is actually math_log_2{e}, which is approximately 1.4426950408889634. You can #define M_LOG2E 1.4426950408889634; to use it.

I have added #define M_LOG2E 1.4426950408889634; to selective_scan_bwd_kernel.cuh, another error came up...
image

@MzeroMiko
Copy link
Owner

MzeroMiko commented Mar 19, 2024

Can you change constexpr bool in static_switch.h to static constexpr bool?

By the way, you can try changing all constexpr to static constexpr and install again.

@WqxLoveCoding
Copy link
Author

Can you change constexpr bool in static_switch.h to static constexpr bool?

By the way, you can try changing all constexpr to static constexpr and install again.

God, it finally worked! Also, the modifications that made the compilation process work are documented here in the hope that they may help others. I'll run training using any of the models to verify that the compilation is okay.

  1. Change constexpr bool in kernels/selective_scan/csrc/selective_scan/static_switch.h to static const bool;
  2. Add the following code
#ifndef M_LOG2E
#define M_LOG2E 1.4426950408889634074
#endif

to:

  • kernels/selective_scan/csrc/selective_scan/cus/selective_scan_bwd_kernel.cuh
  • kernels/selective_scan/csrc/selective_scan/cus/selective_scan_fwd_kernel.cuh
  • kernels/selective_scan/csrc/selective_scan/cusndstate/selective_scan_bwd_kernel_ndstate.cuh
  • kernels/selective_scan/csrc/selective_scan/cusndstate/selective_scan_fwd_kernel_ndstate.cuh
  • kernels/selective_scan/csrc/selective_scan/cusoflex/selective_scan_bwd_kernel_oflex.cuh
  • kernels/selective_scan/csrc/selective_scan/cusoflex/selective_scan_fwd_kernel_oflex.cuh

Useful links:

  1. This issue
  2. link 1
  3. link 2
  4. link 3

@MzeroMiko MzeroMiko added the enhancement New feature or request label Mar 19, 2024
@CosmoWood
Copy link

Can you change constexpr bool in static_switch.h to static constexpr bool?
By the way, you can try changing all constexpr to static constexpr and install again.

God, it finally worked! Also, the modifications that made the compilation process work are documented here in the hope that they may help others. I'll run training using any of the models to verify that the compilation is okay.

  1. Change constexpr bool in kernels/selective_scan/csrc/selective_scan/static_switch.h to static const bool;
  2. Add the following code
#ifndef M_LOG2E
#define M_LOG2E 1.4426950408889634074
#endif

to:

  • kernels/selective_scan/csrc/selective_scan/cus/selective_scan_bwd_kernel.cuh
  • kernels/selective_scan/csrc/selective_scan/cus/selective_scan_fwd_kernel.cuh
  • kernels/selective_scan/csrc/selective_scan/cusndstate/selective_scan_bwd_kernel_ndstate.cuh
  • kernels/selective_scan/csrc/selective_scan/cusndstate/selective_scan_fwd_kernel_ndstate.cuh
  • kernels/selective_scan/csrc/selective_scan/cusoflex/selective_scan_bwd_kernel_oflex.cuh
  • kernels/selective_scan/csrc/selective_scan/cusoflex/selective_scan_fwd_kernel_oflex.cuh

Useful links:

  1. This issue
  2. link 1
  3. link 2
  4. link 3

It worked Thanks

@wenqiuL
Copy link

wenqiuL commented Jul 24, 2024

oh my god! Finally solved! Very useful, thank you, successfully installed on Windows. my successful version:
1
2

@ddcx00
Copy link

ddcx00 commented Sep 9, 2024

错误(同#84): 图像

平台: Windows 10

pytorch install命令(成功): conda install pytorch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 pytorch-cuda=12.1 -c pytorch -c nvidia

python版本: 3.8.18

nvcc -V 图像

nvidia-smi 图像

Excuse me? I noticed that the environment you are using is Python 3.8 version,how do I install the Triton library on the Windows platform?

@Si1ive
Copy link

Si1ive commented Sep 18, 2024

我C!!!!牛逼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants