Skip to content

Commit 86d347b

Browse files
authored
add rocm test (PaddlePaddle#64639)
* add rocm test * add rocm test * fix * fix * fix * fix,test=ducoment_fix
1 parent 3c4cd69 commit 86d347b

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

paddle/scripts/paddle_build.sh

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ function card_test() {
14741474
if [ "${WITH_XPU}" == "ON" ];then
14751475
CUDA_DEVICE_COUNT=1
14761476
elif [ "${WITH_ROCM}" == "ON" ];then
1477-
CUDA_DEVICE_COUNT=$(rocm-smi -i | grep GPU | wc -l)
1477+
CUDA_DEVICE_COUNT=$(rocm-smi -i | grep DCU | wc -l)
14781478
elif [ "${WITH_IPU}" == "ON" ];then
14791479
CUDA_DEVICE_COUNT=1
14801480
else
@@ -1517,13 +1517,22 @@ function card_test() {
15171517
if [[ $cardnumber == $CUDA_DEVICE_COUNT ]]; then
15181518
(ctest -I $i,,$NUM_PROC -R "($testcases)" -E "($disable_ut_quickly)" ${run_label_mode} -V --timeout 120 -j $parallel_job | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
15191519
else
1520-
(env CUDA_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" -E "($disable_ut_quickly)" ${run_label_mode} --timeout 120 -V -j $parallel_job | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
1520+
if [ "$WITH_ROCM" == "ON" ];then
1521+
(env HIP_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" -E "($disable_ut_quickly)" ${run_label_mode} --timeout 120 -V -j $parallel_job | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
1522+
else
1523+
(env CUDA_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" -E "($disable_ut_quickly)" ${run_label_mode} --timeout 120 -V -j $parallel_job | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
1524+
fi
15211525
fi
15221526
else
15231527
if [[ $cardnumber == $CUDA_DEVICE_COUNT ]]; then
15241528
(ctest -I $i,,$NUM_PROC -R "($testcases)" -E "($disable_ut_quickly)" ${run_label_mode} --timeout 120 --output-on-failure -j $parallel_job | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
15251529
else
1526-
(env CUDA_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" -E "($disable_ut_quickly)" ${run_label_mode} --timeout 120 --output-on-failure -j $parallel_job | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
1530+
if [ "$WITH_ROCM" == "ON" ];then
1531+
(env HIP_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" -E "($disable_ut_quickly)" ${run_label_mode} --timeout 120 --output-on-failure -j $parallel_job | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
1532+
else
1533+
(env CUDA_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" -E "($disable_ut_quickly)" ${run_label_mode} --timeout 120 --output-on-failure -j $parallel_job | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
1534+
fi
1535+
15271536
fi
15281537
fi
15291538
done
@@ -2652,7 +2661,11 @@ set -x
26522661
fi
26532662
if [ -a "$PADDLE_ROOT/added_ut" ];then
26542663
added_uts=^$(awk BEGIN{RS=EOF}'{gsub(/\n/,"$|^");print}' $PADDLE_ROOT/added_ut)$
2655-
env CUDA_VISIBLE_DEVICES=0 ctest -R "(${added_uts})" -LE "RUN_TYPE=DIST|RUN_TYPE=EXCLUSIVE|RUN_TYPE=HYBRID" --output-on-failure --repeat-until-fail 3 --timeout 15;added_ut_error=$?
2664+
if [ "$WITH_ROCM" == "ON" ];then
2665+
env HIP_VISIBLE_DEVICES=0 ctest -R "(${added_uts})" -LE "RUN_TYPE=DIST|RUN_TYPE=EXCLUSIVE|RUN_TYPE=HYBRID" --output-on-failure --repeat-until-fail 3 --timeout 15;added_ut_error=$?
2666+
else
2667+
env CUDA_VISIBLE_DEVICES=0 ctest -R "(${added_uts})" -LE "RUN_TYPE=DIST|RUN_TYPE=EXCLUSIVE|RUN_TYPE=HYBRID" --output-on-failure --repeat-until-fail 3 --timeout 15;added_ut_error=$?
2668+
fi
26562669
ctest -R "(${added_uts})" -L "RUN_TYPE=DIST|RUN_TYPE=EXCLUSIVE" --output-on-failure --repeat-until-fail 3 --timeout 15;added_ut_error_1=$?
26572670
if [ "$added_ut_error" != 0 ] && [ "$added_ut_error_1" != 0 ];then
26582671
echo "========================================"
@@ -2826,7 +2839,9 @@ set +x
28262839
rerun_ut_endTime_s=`date +%s`
28272840
echo "ipipe_log_param_Rerun_TestCases_Total_Time: $[ $rerun_ut_endTime_s - $rerun_ut_startTime_s ]s"
28282841
echo "ipipe_log_param_Rerun_TestCases_Total_Time: $[ $rerun_ut_endTime_s - $rerun_ut_startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt
2829-
cp $PADDLE_ROOT/build/Testing/Temporary/CTestCostData.txt ${cfs_dir}/coverage/${AGILE_PULL_ID}/${AGILE_REVISION}/
2842+
if [ "$WITH_ROCM" != "ON" ];then
2843+
cp $PADDLE_ROOT/build/Testing/Temporary/CTestCostData.txt ${cfs_dir}/coverage/${AGILE_PULL_ID}/${AGILE_REVISION}/
2844+
fi
28302845
if [[ "$EXIT_CODE" != "0" ]]; then
28312846
show_ut_retry_result
28322847
fi
@@ -4475,6 +4490,9 @@ function main() {
44754490
export FLAGS_PIR_OPTEST=True
44764491
parallel_test true
44774492
;;
4493+
hyg_dcu_test)
4494+
parallel_test
4495+
;;
44784496
nv_cicheck_coverage)
44794497
parallel_test
44804498
nv_test

0 commit comments

Comments
 (0)