From 78f9a6d1e11724ea6559e19ffd4a0599e4b00581 Mon Sep 17 00:00:00 2001 From: alinpahontu2912 Date: Fri, 12 Jan 2024 12:22:09 +0100 Subject: [PATCH 1/3] UPDATE SCCACHE VERSION --- .gitignore | 1 + conda/pytorch-nightly/bld.bat | 8 ++++---- windows/build_pytorch.bat | 3 +-- windows/internal/check_opts.bat | 4 ++-- windows/internal/setup.bat | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 362b3cd7a..a6219bf8a 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,4 @@ node_modules # Analytics cache folder cache/ .vscode/ +/.vs diff --git a/conda/pytorch-nightly/bld.bat b/conda/pytorch-nightly/bld.bat index 972df7e9c..ab11eceb3 100644 --- a/conda/pytorch-nightly/bld.bat +++ b/conda/pytorch-nightly/bld.bat @@ -44,8 +44,7 @@ echo libuv_ROOT=%libuv_ROOT% IF "%USE_SCCACHE%" == "1" ( mkdir %SRC_DIR%\tmp_bin - curl -k https://s3.amazonaws.com/ossci-windows/sccache.exe --output %SRC_DIR%\tmp_bin\sccache.exe - curl -k https://s3.amazonaws.com/ossci-windows/sccache-cl.exe --output %SRC_DIR%\tmp_bin\sccache-cl.exe + curl -k https://ossci-windows.s3.amazonaws.com/sccache-v0.7.4.exe --output %SRC_DIR%\tmp_bin\sccache.exe set "PATH=%SRC_DIR%\tmp_bin;%PATH%" set SCCACHE_IDLE_TIMEOUT=1500 ) @@ -87,8 +86,9 @@ sccache --stop-server sccache --start-server sccache --zero-stats -set CC=sccache-cl -set CXX=sccache-cl +set CMAKE_C_COMPILER_LAUNCHER=sccache +set CMAKE_CXX_COMPILER_LAUNCHER=sccache + :sccache_end diff --git a/windows/build_pytorch.bat b/windows/build_pytorch.bat index 37e19f933..9966531e1 100644 --- a/windows/build_pytorch.bat +++ b/windows/build_pytorch.bat @@ -91,8 +91,7 @@ if not "%CUDA_VERSION%" == "cpu" ( :: Install sccache if "%USE_SCCACHE%" == "1" ( mkdir %CD%\tmp_bin - curl -k https://s3.amazonaws.com/ossci-windows/sccache.exe --output %CD%\tmp_bin\sccache.exe - curl -k https://s3.amazonaws.com/ossci-windows/sccache-cl.exe --output %CD%\tmp_bin\sccache-cl.exe + curl -k https://ossci-windows.s3.amazonaws.com/sccache-v0.7.4.exe --output %CD%\tmp_bin\sccache.exe if not "%CUDA_VERSION%" == "" ( set ADDITIONAL_PATH=%CD%\tmp_bin set SCCACHE_IDLE_TIMEOUT=1500 diff --git a/windows/internal/check_opts.bat b/windows/internal/check_opts.bat index 5b8a67e25..022e39074 100755 --- a/windows/internal/check_opts.bat +++ b/windows/internal/check_opts.bat @@ -31,8 +31,8 @@ where /q sccache.exe IF NOT ERRORLEVEL 1 ( echo sccache found, using it to speed up builds - set CC=sccache cl - set CXX=sccache cl + set CMAKE_C_COMPILER_LAUNCHER=sccache + set CMAKE_CXX_COMPILER_LAUNCHER=sccache ) :sccache_end diff --git a/windows/internal/setup.bat b/windows/internal/setup.bat index 810d09db9..b4f6495a1 100755 --- a/windows/internal/setup.bat +++ b/windows/internal/setup.bat @@ -22,7 +22,7 @@ IF NOT exist "setup.py" ( cd %MODULE_NAME% ) -if "%CXX%"=="sccache cl" goto sccache_start +if "%CXX%"=="sccache" goto sccache_start if "%CXX%"=="sccache-cl" goto sccache_start goto sccache_end @@ -92,7 +92,7 @@ python setup.py bdist_wheel -d "%PYTORCH_FINAL_PACKAGE_DIR%" IF ERRORLEVEL 1 exit /b 1 IF NOT ERRORLEVEL 0 exit /b 1 -if "%CXX%"=="sccache cl" goto sccache_cleanup +if "%CXX%"=="sccache" goto sccache_cleanup if "%CXX%"=="sccache-cl" goto sccache_cleanup goto sccache_cleanup_end From 65f71b284658c753e85e9388b91441e19df063be Mon Sep 17 00:00:00 2001 From: alinpahontu2912 Date: Fri, 12 Jan 2024 13:05:44 +0100 Subject: [PATCH 2/3] resolved comments --- windows/internal/check_opts.bat | 10 ---------- windows/internal/setup.bat | 6 ++---- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/windows/internal/check_opts.bat b/windows/internal/check_opts.bat index 022e39074..0adeb6c5c 100755 --- a/windows/internal/check_opts.bat +++ b/windows/internal/check_opts.bat @@ -17,16 +17,6 @@ IF NOT ERRORLEVEL 1 ( set CXX=clcache ) -where /q sccache-cl.exe - -IF NOT ERRORLEVEL 1 ( - echo sccache-cl found, using it to speed up builds - set CC=sccache-cl - set CXX=sccache-cl -) - -IF "%CC%" == "sccache-cl" IF "%CXX%" == "sccache-cl" goto sccache_end - where /q sccache.exe IF NOT ERRORLEVEL 1 ( diff --git a/windows/internal/setup.bat b/windows/internal/setup.bat index b4f6495a1..4f2509e55 100755 --- a/windows/internal/setup.bat +++ b/windows/internal/setup.bat @@ -22,8 +22,7 @@ IF NOT exist "setup.py" ( cd %MODULE_NAME% ) -if "%CXX%"=="sccache" goto sccache_start -if "%CXX%"=="sccache-cl" goto sccache_start +if "%CMAKE_CXX_COMPILER_LAUNCHER%"=="sccache" goto sccache_start goto sccache_end :sccache_start @@ -92,8 +91,7 @@ python setup.py bdist_wheel -d "%PYTORCH_FINAL_PACKAGE_DIR%" IF ERRORLEVEL 1 exit /b 1 IF NOT ERRORLEVEL 0 exit /b 1 -if "%CXX%"=="sccache" goto sccache_cleanup -if "%CXX%"=="sccache-cl" goto sccache_cleanup +if "%CMAKE_CXX_COMPILER_LAUNCHER%"=="sccache" goto sccache_cleanup goto sccache_cleanup_end :sccache_cleanup From a0ca58a98b703be6b9cfdba9189946cb08307099 Mon Sep 17 00:00:00 2001 From: alinpahontu2912 Date: Fri, 26 Jan 2024 16:01:31 +0100 Subject: [PATCH 3/3] add sccache_region --- conda/pytorch-nightly/bld.bat | 1 + windows/build_pytorch.bat | 1 + 2 files changed, 2 insertions(+) diff --git a/conda/pytorch-nightly/bld.bat b/conda/pytorch-nightly/bld.bat index ab11eceb3..227dead0b 100644 --- a/conda/pytorch-nightly/bld.bat +++ b/conda/pytorch-nightly/bld.bat @@ -47,6 +47,7 @@ IF "%USE_SCCACHE%" == "1" ( curl -k https://ossci-windows.s3.amazonaws.com/sccache-v0.7.4.exe --output %SRC_DIR%\tmp_bin\sccache.exe set "PATH=%SRC_DIR%\tmp_bin;%PATH%" set SCCACHE_IDLE_TIMEOUT=1500 + set SCCACHE_REGION=us-east-1 ) IF "%build_with_cuda%" == "" goto cuda_end diff --git a/windows/build_pytorch.bat b/windows/build_pytorch.bat index 9966531e1..3f7694b85 100644 --- a/windows/build_pytorch.bat +++ b/windows/build_pytorch.bat @@ -95,6 +95,7 @@ if "%USE_SCCACHE%" == "1" ( if not "%CUDA_VERSION%" == "" ( set ADDITIONAL_PATH=%CD%\tmp_bin set SCCACHE_IDLE_TIMEOUT=1500 + set SCCACHE_REGION=us-east-1 :: randomtemp is used to resolve the intermittent build error related to CUDA. :: code: https://github.com/peterjc123/randomtemp-rust