Skip to content

Commit

Permalink
Use sccache-cl instead of sccache (pytorch#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc123 committed Mar 24, 2020
1 parent 7ec2fd4 commit d5a1241
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions conda/pytorch-nightly/bld.bat
Expand Up @@ -38,6 +38,7 @@ set LIB=%SRC_DIR%\mkl\lib;%LIB%
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
copy %SRC_DIR%\tmp_bin\sccache.exe %SRC_DIR%\tmp_bin\nvcc.exe
set "PATH=%SRC_DIR%\tmp_bin;%PATH%"
set SCCACHE_IDLE_TIMEOUT=1500
Expand Down Expand Up @@ -74,8 +75,8 @@ sccache --stop-server
sccache --start-server
sccache --zero-stats

set CC=sccache cl
set CXX=sccache cl
set CC=sccache-cl
set CXX=sccache-cl

:sccache_end

Expand Down
1 change: 1 addition & 0 deletions windows/build_pytorch.bat
Expand Up @@ -94,6 +94,7 @@ if not "%CUDA_VERSION%" == "cpu" (
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
if not "%CUDA_VERSION%" == "" (
copy %CD%\tmp_bin\sccache.exe %CD%\tmp_bin\nvcc.exe

Expand Down
11 changes: 11 additions & 0 deletions windows/internal/check_opts.bat
Expand Up @@ -17,6 +17,15 @@ 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
goto sccache_end
)

where /q sccache.exe

IF NOT ERRORLEVEL 1 (
Expand All @@ -25,6 +34,8 @@ IF NOT ERRORLEVEL 1 (
set CXX=sccache cl
)

:sccache_end

IF exist "%MKLProductDir%\mkl\lib\intel64_win" (
echo MKL found, adding it to build
set "LIB=%MKLProductDir%\mkl\lib\intel64_win;%MKLProductDir%\compiler\lib\intel64_win;%LIB%";
Expand Down

0 comments on commit d5a1241

Please sign in to comment.