DeepSpeed icon indicating copy to clipboard operation
DeepSpeed copied to clipboard

Run build_win.bat got error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.35.32215\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

Open micronetboy opened this issue 2 years ago • 2 comments

Describe the bug Run build_win.bat got error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe' failed with exit code 2

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

ds_report output Please run ds_report to give us details about your setup.

Screenshots csrc/transformer/inference/csrc/pt_binding.cpp(1570): error C2398: 元素“3”: 从“const size_t”转换为“_Ty”需要收缩转换 with [ _Ty=int64_t ] csrc/transformer/inference/csrc/pt_binding.cpp(1977): note: 查看对正在编译的函数 模板 实例化“std::vector<at::Tensor,std::allocatorat::Tensor> ds_rms_mlp_gemm(at::Tensor &,at::Tensor &,at::Tensor &,at::Tensor &,at::Tensor &,const float,at::Tensor &,at::Tensor &,bool,int,bool)”的引用 error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe' failed with exit code 2

System info (please complete the following information):

  • OS: win11
  • RTX 3060
  • Interconnects (if applicable) [e.g., two machines connected with 100 Gbps IB]
  • Python 3.10
  • Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215

Launcher context Are you launching your experiment with the deepspeed launcher, MPI, or something else?

Docker context Are you using a specific docker image that you can share?

Additional context Add any other context about the problem here.

micronetboy avatar May 06 '23 02:05 micronetboy

Hi @micronetboy - this looks to be the same issue as #3447, could you try the same thing I suggested there, re-installing python after you've installed the VS libraries. that way we can try to find if they are in the path?

loadams avatar May 08 '23 19:05 loadams

Also if you could try with python 3.8.10, I've seen anecdotally that has worked, though not sure why.

This StackOverflow post seems to be a similar issue albeit with another package, I'd try those steps as well: https://stackoverflow.com/questions/71242919/pip-install-results-in-this-error-cl-exe-failed-with-exit-code-2

loadams avatar May 08 '23 19:05 loadams

Going to close this issue and move discussion on this to 3447

loadams avatar May 12 '23 15:05 loadams

1 Install pytorch, such as pytorch 1.8 + cuda 11.1 2 Install visual cpp build tools, such as VS2019/2022 C++ x64/x86 build tools 3 Launch cmd console with Administrator privilege for creating required symlink folders 4 download deepspeed 0.9.4 5 Modify csrc/transformer/inference/csrc/pt_binding.cpp:

536:hidden_dim * (unsigned)InferenceContext
537:k * (int)InferenceContext
545:hidden_dim * (unsigned)InferenceContext
546:k * (int)InferenceContext
1570: input.size(1), (int)mlp_1_out_neurons

6 run build_win.bat 7 cd dist 8 pip install xxx.whl

pony86 avatar Jun 09 '23 01:06 pony86

This problem bothered me for a while, I'm so happy to finally be solved, thank you

LycoPan avatar Jun 14 '23 03:06 LycoPan