@@ -205,6 +205,33 @@ function execute_func_list(){
205205 echo -e " \033[31m $( printf ' \t' ) exit 250 tests(intermittent issue) : $exit_250_count \033"
206206}
207207
208+ function clean_file(){
209+ target_path=$1
210+ matching_data_dirs=$( find " $target_path " -maxdepth 1 -type d -name " *data*" )
211+ if [ -n " $matching_data_dirs " ]; then
212+ echo " cleaning data dirs:"
213+ echo $matching_data_dirs
214+ for dir in $matching_data_dirs ; do
215+ rm -rf " $dir "
216+ echo " deleted $dir "
217+ done
218+ else
219+ echo " $target_path no data dirs found"
220+ fi
221+
222+ matching_output_dirs=$( find " $target_path " -maxdepth 1 -type d -name " *output*" )
223+ if [ -n " $matching_output_dirs " ]; then
224+ echo " cleaning output dirs:"
225+ echo $matching_output_dirs
226+ for dir in $matching_output_dirs ; do
227+ rm -rf " $dir "
228+ echo " deleted $dir "
229+ done
230+ else
231+ echo " $target_path no output dirs found"
232+ fi
233+ }
234+
208235# ###################################
209236get_diff_TO_case # 获取待执行case列表
210237case_list=($( awk -v RS=' ' ' !a[$1]++' <<< ${case_list[*]} ) ) # 去重并将结果存储回原列表
@@ -231,6 +258,7 @@ if [[ ${#case_list[*]} -ne 0 ]];then
231258 execute_func_list $cmd llama_auto
232259 export FLAGS_download_data=" llama " " $FLAGS_download_data "
233260 let case_num++
261+ clean_file $nlp_dir /llm/auto_parallel/llama
234262 fi
235263 if [[ $( contain_case gpt-3_auto ${case_list[@]} ; echo $? ) -eq 1 ]]; then
236264 echo -e " \033[31m ---- running case $case_num /${# case_list[*]} : gpt-3_auto \033"
@@ -240,6 +268,7 @@ if [[ ${#case_list[*]} -ne 0 ]];then
240268 export FLAGS_install_deps=1
241269 export FLAGS_download_data=" gpt " " $FLAGS_download_data "
242270 let case_num++
271+ clean_file $nlp_dir /llm/auto_parallel/gpt-3
243272 fi
244273 if [[ $( contain_case gpt-3_dygraph ${case_list[@]} ; echo $? ) -eq 1 ]]; then
245274 echo -e " \033[31m ---- running case $case_num /${# case_list[*]} : gpt-3_dygraph \033"
@@ -249,6 +278,7 @@ if [[ ${#case_list[*]} -ne 0 ]];then
249278 export FLAGS_install_deps=1
250279 export FLAGS_download_data=" gpt " " $FLAGS_download_data "
251280 let case_num++
281+ clean_file $nlp_dir /slm/model_zoo/gpt-3
252282 fi
253283 echo -e " \033[31m ---- end run case \033"
254284
0 commit comments