File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -93,12 +93,19 @@ if not "%cuda_compiler_version%" == "None" (
9393 set USE_NCCL = 0
9494 set USE_STATIC_NCCL = 0
9595
96- @ REM set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%desired_cuda%
97- @ REM set CUDA_BIN_PATH=%CUDA_PATH%\bin
98-
99- set " TORCH_CUDA_ARCH_LIST = 5.0;6.0;7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX"
10096 set " TORCH_NVCC_FLAGS = -Xfatbin -compress-all"
10197
98+ if " %cuda_compiler_version:~0 ,2 % " == " 12" (
99+ set " TORCH_CUDA_ARCH_LIST = 5.0;6.0;7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX"
100+ ) else if " %cuda_compiler_version% " == " 13.0" (
101+ set " TORCH_CUDA_ARCH_LIST = 7.5;8.0;8.6;9.0;10.0;11.0;12.0+PTX"
102+ REM c.f. https://github.com/pytorch/pytorch/pull/161316
103+ set " TORCH_NVCC_FLAGS = !TORCH_NVCC_FLAGS! -compress-mode=size"
104+ ) else (
105+ echo " unsupported cuda version. edit build_pytorch.bat"
106+ exit /b 1
107+ )
108+
102109 set MAGMA_HOME = %LIBRARY_PREFIX%
103110 set " PATH = %CUDA_BIN_PATH% ;%PATH% "
104111 set CUDNN_INCLUDE_DIR = %LIBRARY_PREFIX% \include
Original file line number Diff line number Diff line change @@ -212,6 +212,8 @@ elif [[ ${cuda_compiler_version} != "None" ]]; then
212212 export CUDAToolkit_TARGET_DIR=${PREFIX} /targets/${CUDA_TARGET}
213213 sed -i -e " s,@CUDA_TARGET@,${CUDA_TARGET} ," torch/_inductor/cpp_builder.py
214214
215+ export TORCH_NVCC_FLAGS=" -Xfatbin -compress-all"
216+
215217 # Compatibility matrix for update: https://en.wikipedia.org/wiki/CUDA#GPUs_supported
216218 # Warning from pytorch v1.12.1: In the future we will require one to
217219 # explicitly pass TORCH_CUDA_ARCH_LIST to cmake instead of implicitly
@@ -227,11 +229,16 @@ elif [[ ${cuda_compiler_version} != "None" ]]; then
227229 12.[89])
228230 export TORCH_CUDA_ARCH_LIST=" 5.0;6.0;7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX"
229231 ;;
232+ 13.0)
233+ export TORCH_CUDA_ARCH_LIST=" 7.5;8.0;8.6;9.0;10.0;11.0;12.0+PTX"
234+ # c.f. https://github.com/pytorch/pytorch/pull/161316
235+ export TORCH_NVCC_FLAGS=" $TORCH_NVCC_FLAGS -compress-mode=size"
236+ ;;
230237 * )
231238 echo " No CUDA architecture list exists for CUDA v${cuda_compiler_version} . See build.sh for information on adding one."
232239 exit 1
233240 esac
234- export TORCH_NVCC_FLAGS= " -Xfatbin -compress-all "
241+
235242 export NCCL_ROOT_DIR=$PREFIX
236243 export NCCL_INCLUDE_DIR=$PREFIX /include
237244 export USE_SYSTEM_NCCL=1
You can’t perform that action at this time.
0 commit comments