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

Update sccache version #1675

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ node_modules
# Analytics cache folder
cache/
.vscode/
/.vs
9 changes: 5 additions & 4 deletions conda/pytorch-nightly/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ 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
set SCCACHE_REGION=us-east-1
)

IF "%build_with_cuda%" == "" goto cuda_end
Expand Down Expand Up @@ -82,8 +82,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

Expand Down
4 changes: 2 additions & 2 deletions windows/build_pytorch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ 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
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
Expand Down
14 changes: 2 additions & 12 deletions windows/internal/check_opts.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,12 @@ 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 (
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
Expand Down
6 changes: 2 additions & 4 deletions windows/internal/setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ IF NOT exist "setup.py" (
cd %MODULE_NAME%
)

if "%CXX%"=="sccache cl" goto sccache_start
if "%CXX%"=="sccache-cl" goto sccache_start
if "%CMAKE_CXX_COMPILER_LAUNCHER%"=="sccache" goto sccache_start
goto sccache_end

:sccache_start
Expand Down Expand Up @@ -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 cl" 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
Expand Down