@@ -76,6 +76,8 @@ if not defined NIGHTLY_MODE set PRECISION_TEST=OFF
76
76
if not defined retry_times set retry_times = 3
77
77
if not defined PYTHON_ROOT set PYTHON_ROOT = C:\Python37
78
78
if not defined BUILD_DIR set BUILD_DIR = build
79
+ set task_name = %1
80
+ set UPLOAD_TP_FILE = OFF
79
81
80
82
rem ------initialize the python environment------
81
83
set PYTHON_EXECUTABLE = %PYTHON_ROOT% \python.exe
@@ -363,17 +365,24 @@ echo echo ${md5_content}^>md5.txt >> cache.sh
363
365
%cache_dir% \tools\busybox64.exe bash cache.sh
364
366
365
367
set /p md5 = < md5.txt
368
+ echo %task_name% | findstr build > nul && (
369
+ set THIRD_PARTY_HOME = %cache_dir:\ =/ % /third_party
370
+ set THIRD_PARTY_PATH = !THIRD_PARTY_HOME! /%md5%
371
+ echo %task_name% is a whl-build task, will only reuse local third_party cache.
372
+ goto :cmake_impl
373
+ ) || (
374
+ echo %task_name% is a PR-CI-Windows task, will try to reuse bos and local third_party cache both.
375
+ )
376
+
366
377
if " %WITH_GPU% " == " ON" (
367
- for /F " delims= " %% # in ('nvcc --version ^ |findstr V1 ') do set cuda_version = %% #
368
- set cuda_version = !cuda_version:~-7 , 4 !
378
+ for /F %% # in ('dir /b /d " C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\ " ') do set cuda_version = %% #
379
+ set cuda_version = !cuda_version:~-4 !
369
380
set sub_dir = cuda!cuda_version:. =!
370
381
) else (
371
382
set sub_dir = cpu
372
383
)
373
-
374
384
set THIRD_PARTY_HOME = %cache_dir:\ =/ % /third_party/%sub_dir%
375
385
set THIRD_PARTY_PATH = %THIRD_PARTY_HOME% /%md5%
376
- set UPLOAD_TP_FILE = OFF
377
386
378
387
if not exist %THIRD_PARTY_PATH% (
379
388
echo There is no usable third_party cache in %THIRD_PARTY_PATH% , will download from bos.
@@ -397,7 +406,7 @@ if not exist %THIRD_PARTY_PATH% (
397
406
if not exist %THIRD_PARTY_PATH% ( set UPLOAD_TP_FILE = ON )
398
407
cd %work_dir% \%BUILD_DIR%
399
408
) else (
400
- echo Found reusable third_party cache locally , will reuse it.
409
+ echo Found reusable third_party cache in %THIRD_PARTY_PATH% , will reuse it.
401
410
)
402
411
403
412
:cmake_impl
@@ -512,8 +521,8 @@ if %ERRORLEVEL% NEQ 0 (
512
521
)
513
522
)
514
523
515
- set BCE_FILE = %cache_dir% \bce-python-sdk-0.8.33\BosClient.py
516
- if %UPLOAD_TP_FILE% == ON (
524
+ if " %UPLOAD_TP_FILE% " == " ON " (
525
+ set BCE_FILE = %cache_dir% \bce-python-sdk-0.8.33\BosClient.py
517
526
echo Uploading third_party: checking bce ...
518
527
if not exist %cache_dir% \bce-python-sdk-0.8.33 (
519
528
echo There is no bce in this PC, will install bce.
0 commit comments