Open ataa opened 1 year ago
Hi, i'm having a similar issue on linux, Running pytorch nightlies as well.
The build is failing with no particular message, which suggests that it is running out of memory. In your case, ninja is trying to do 16 compilations at a time, and we want to reduce this. Try setting the environment variable MAX_JOBS
to a small number like 1 or 2.
The build is failing with no particular message, which suggests that it is running out of memory. In your case, ninja is trying to do 16 compilations at a time, and we want to reduce this. Try setting the environment variable
MAX_JOBS
to a small number like 1 or 2.
I have 64GB of available memory and it barely reaches 4GB during the build with 16 jobs, but I set it to 1 and tried again, same issue. then I removed -DXFORMERS_MEM_EFF_ATTENTION_DISABLE_BACKWARD and finally been able to build it. not sure why adding that nvcc flag caused a failed build.
Additional information:
15 errors detected in the compilation of "C:/buildtemp/xformers/xformers/csrc/attention/cuda/fmha/kernels/backward_bf16_aligned_dropout_k128.cu".
[6/67] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc --generate-dependencies-with-compile --dependency-output C:\buildtemp\xfor
mers\build\temp.win-amd64-cpython-310\Release\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.obj.d --use-local-env -Xcompiler /MD
-Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EH
sc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dl
l_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Dxformers_EXPORTS -IC:\buildtemp\xformers\xfor
mers\csrc -IC:\buildtemp\xformers\third_party\sputnik -IC:\buildtemp\xformers\third_party\cutlass\include -IC:\buildtemp\xformers\third_party\cutla
ss\examples -IC:\buildtemp\xformers\venv\lib\site-packages\torch\include -IC:\buildtemp\xformers\venv\lib\site-packages\torch\include\torch\csrc\ap
i\include -IC:\buildtemp\xformers\venv\lib\site-packages\torch\include\TH -IC:\buildtemp\xformers\venv\lib\site-packages\torch\include\THC "-IC:\Pr
ogram Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IC:\buildtemp\xformers\venv\include -IC:\Users\Receiving\AppData\Local\Programs\Pytho
n\Python310\include -IC:\Users\Receiving\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\Bui
ldTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program
Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\um" "-IC:\Program Files (x
86)\Windows Kits\10\\include\10.0.20348.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\winrt" "-IC:\Program Files (x86
)\Windows Kits\10\\include\10.0.20348.0\\cppwinrt" -c C:\buildtemp\xformers\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.cu -o C
:\buildtemp\xformers\build\temp.win-amd64-cpython-310\Release\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.obj -D__CUDA_NO_HALF_
OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DHAS_PYTORCH
--use_fast_math -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ --extended-lambda -D_ENABLE_EXTENDED_ALIGNED_STORAGE --generate-line-in
fo -DNDEBUG --use_fast_math -arch=sm_86 -DXFORMERS_MEM_EFF_ATTENTION_DISABLE_BACKWARD --threads 4 --ptxas-options=-v -std=c++17 -Xcompiler /Zc:lamb
da -Xcompiler /Zc:preprocessor -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
FAILED: C:/buildtemp/xformers/build/temp.win-amd64-cpython-310/Release/xformers/csrc/attention/cuda/fmha/kernels/backward_bf16_aligned.obj
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc --generate-dependencies-with-compile --dependency-output C:\buildtemp\xformers\bu
ild\temp.win-amd64-cpython-310\Release\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.obj.d --use-local-env -Xcompiler /MD -Xcompi
ler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EHsc -Xcu
dafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_inter
face_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Dxformers_EXPORTS -IC:\buildtemp\xformers\xformers\cs
rc -IC:\buildtemp\xformers\third_party\sputnik -IC:\buildtemp\xformers\third_party\cutlass\include -IC:\buildtemp\xformers\third_party\cutlass\exam
ples -IC:\buildtemp\xformers\venv\lib\site-packages\torch\include -IC:\buildtemp\xformers\venv\lib\site-packages\torch\include\torch\csrc\api\inclu
de -IC:\buildtemp\xformers\venv\lib\site-packages\torch\include\TH -IC:\buildtemp\xformers\venv\lib\site-packages\torch\include\THC "-IC:\Program F
iles\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IC:\buildtemp\xformers\venv\include -IC:\Users\Receiving\AppData\Local\Programs\Python\Pytho
n310\include -IC:\Users\Receiving\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files
(x86)\Windows Kits\10\include\10.0.20348.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\um" "-IC:\Program Files (x86)\Win
dows Kits\10\\include\10.0.20348.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\winrt" "-IC:\Program Files (x86)\Windo
ws Kits\10\\include\10.0.20348.0\\cppwinrt" -c C:\buildtemp\xformers\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.cu -o C:\build
temp\xformers\build\temp.win-amd64-cpython-310\Release\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.obj -D__CUDA_NO_HALF_OPERATO
RS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DHAS_PYTORCH --use_f
ast_math -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ --extended-lambda -D_ENABLE_EXTENDED_ALIGNED_STORAGE --generate-line-info -DND
EBUG --use_fast_math -arch=sm_86 -DXFORMERS_MEM_EFF_ATTENTION_DISABLE_BACKWARD --threads 4 --ptxas-options=-v -std=c++17 -Xcompiler /Zc:lambda -Xco
mpiler /Zc:preprocessor -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
backward_bf16_aligned.cu
cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF_OPERATORS__' with '/U__CUDA_NO_HALF_OPERATORS__'
cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF_CONVERSIONS__' with '/U__CUDA_NO_HALF_CONVERSIONS__'
backward_bf16_aligned.cu
cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF_OPERATORS__' with '/U__CUDA_NO_HALF_OPERATORS__'
cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF_CONVERSIONS__' with '/U__CUDA_NO_HALF_CONVERSIONS__'
backward_bf16_aligned.cu
C:\buildtemp\xformers\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.cu(3): error: this declaration has no storage class or type s
pecifier
C:\buildtemp\xformers\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.cu(3): error: name followed by "::" must be a class or namesp
ace name
C:\buildtemp\xformers\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.cu(3): error: too many initializer values
C:\buildtemp\xformers\xformers\csrc\attention\cuda\fmha\kernels\backward_bf16_aligned.cu(4): error: this declaration has no storage class or type s
pecifier
@ataa thanks for the bugreport. That's a weird issue - I plan to change a bit how we instantiate kernels so it should hopefully go away soon
I built xformers 3 times in the past weeks successfully (for Torch 2.0 nightly), Today I tried to build it again in the same environment (no changes other than some unrelated windows updates) and after 2 minutes or so, I received this error. How can I debug this error?
Windows 10 Home, Cuda 11.8, Latest VS