Skip to content

Commit 4707db9

Browse files
[cherry-pick] enable remove grad op of linux/win compile scripts (#34295)
* Update paddle_build.bat to remove op grad when build windows inference lib (#33800) 1. check status of remove op grad shell scripts 2. Update paddle_build.bat to remove op grad when build windows inference lib 3. add inference demo test after build finish * Update paddle_build.sh for remove op grad when compile c++ inference lib (#33798) * fix zip inference library bug (#34025) Co-authored-by: Zhou Wei <[email protected]>
1 parent cc4a463 commit 4707db9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

paddle/scripts/paddle_build.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,12 @@ rem ------Build windows inference library------
202202
set ON_INFER=ON
203203
set WITH_PYTHON=OFF
204204
set CUDA_ARCH_NAME=All
205+
python %work_dir%\tools\remove_grad_op_and_kernel.py
206+
if %errorlevel% NEQ 0 exit /b 1
205207

206208
call :cmake || goto cmake_error
207209
call :build || goto build_error
210+
call :test_inference || goto test_inference_error
208211
call :zip_cc_file || goto zip_cc_file_error
209212
call :zip_c_file || goto zip_c_file_error
210213
goto:success
@@ -678,6 +681,7 @@ exit /b 1
678681

679682
rem ---------------------------------------------------------------------------------------------
680683
:zip_cc_file
684+
cd /d %work_dir%\build
681685
tree /F %cd%\paddle_inference_install_dir\paddle
682686
if exist paddle_inference.zip del paddle_inference.zip
683687
python -c "import shutil;shutil.make_archive('paddle_inference', 'zip', root_dir='paddle_inference_install_dir')"
@@ -695,6 +699,7 @@ exit /b 1
695699

696700
rem ---------------------------------------------------------------------------------------------
697701
:zip_c_file
702+
cd /d %work_dir%\build
698703
tree /F %cd%\paddle_inference_c_install_dir\paddle
699704
if exist paddle_inference_c.zip del paddle_inference_c.zip
700705
python -c "import shutil;shutil.make_archive('paddle_inference_c', 'zip', root_dir='paddle_inference_c_install_dir')"

paddle/scripts/paddle_build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,6 +1974,7 @@ function main() {
19741974
test_fluid_lib
19751975
;;
19761976
build_inference_lib)
1977+
python ${PADDLE_ROOT}/tools/remove_grad_op_and_kernel.py
19771978
cmake_gen ${PYTHON_ABI:-""}
19781979
gen_fluid_lib ${parallel_number}
19791980
;;

0 commit comments

Comments
 (0)