未验证 提交 3fd34a0e 编写于 作者: zhouweiwei2014's avatar zhouweiwei2014 提交者: GitHub

Polish sccache on windows (#34147)

上级 1b377635
...@@ -156,7 +156,7 @@ rem -------Caching strategy 1: End -------------------------------- ...@@ -156,7 +156,7 @@ rem -------Caching strategy 1: End --------------------------------
rem -------Caching strategy 2: sccache decorate compiler----------- rem -------Caching strategy 2: sccache decorate compiler-----------
if "%WITH_SCCACHE%"=="ON" ( if "%WITH_SCCACHE%"=="ON" (
rem cmd /C sccache -V || call :install_sccache cmd /C sccache -V || call :install_sccache
sccache --stop-server 2> NUL sccache --stop-server 2> NUL
if not exist D:\sccache mkdir D:\sccache if not exist D:\sccache mkdir D:\sccache
set SCCACHE_DIR=D:\sccache\.cache set SCCACHE_DIR=D:\sccache\.cache
...@@ -164,11 +164,10 @@ if "%WITH_SCCACHE%"=="ON" ( ...@@ -164,11 +164,10 @@ if "%WITH_SCCACHE%"=="ON" (
set SCCACHE_ERROR_LOG=D:\sccache\sccache_log.txt set SCCACHE_ERROR_LOG=D:\sccache\sccache_log.txt
set SCCACHE_LOG=quiet set SCCACHE_LOG=quiet
sccache --start-server sccache --start-server
if !errorlevel! NEQ 0 exit /b 1
sccache -z sccache -z
goto :CASE_%1 goto :CASE_%1
) else ( ) else (
del %PYTHON_ROOT%\sccache.exe del %PYTHON_ROOT%\sccache.exe 2> NUL
goto :CASE_%1 goto :CASE_%1
) )
...@@ -473,7 +472,7 @@ echo Build Paddle successfully! ...@@ -473,7 +472,7 @@ echo Build Paddle successfully!
echo 0 > %cache_dir%\error_code.txt echo 0 > %cache_dir%\error_code.txt
type %cache_dir%\error_code.txt type %cache_dir%\error_code.txt
:: ci will collect clcache hit rate :: ci will collect sccache hit rate
if "%WITH_SCCACHE%"=="ON" ( if "%WITH_SCCACHE%"=="ON" (
call :collect_sccache_hits call :collect_sccache_hits
) )
...@@ -809,11 +808,11 @@ type sccache_summary.txt ...@@ -809,11 +808,11 @@ type sccache_summary.txt
for /f "tokens=2,3" %%i in ('type sccache_summary.txt ^| findstr "requests hits" ^| findstr /V "executed C/C++ CUDA"') do set %%i=%%j for /f "tokens=2,3" %%i in ('type sccache_summary.txt ^| findstr "requests hits" ^| findstr /V "executed C/C++ CUDA"') do set %%i=%%j
if %requests% EQU 0 ( if %requests% EQU 0 (
echo "sccache hit rate: 0%" echo "sccache hit rate: 0%"
echo ipipe_log_param_Clcache_Hit_Hate: 0% echo ipipe_log_param_sccache_Hit_Hate: 0%
) else ( ) else (
set /a rate=!hits!*10000/!requests! set /a rate=!hits!*10000/!requests!
echo "sccache hit rate: !rate:~0,-2!.!rate:~-2!%%" echo "sccache hit rate: !rate:~0,-2!.!rate:~-2!%%"
echo ipipe_log_param_Clcache_Hit_Hate: !rate:~0,2!.!rate:~2,2!%% echo ipipe_log_param_sccache_Hit_Hate: !rate:~0,-2!.!rate:~-2!%%
) )
goto:eof goto:eof
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册