diff --git a/test_tipc/benchmark_train.sh b/test_tipc/benchmark_train.sh index bd3e8de4d36cbfb62ab8818a654f67892d06dfc1..a3d041e522a02e2ae654ba9b6170713396cfddfd 100644 --- a/test_tipc/benchmark_train.sh +++ b/test_tipc/benchmark_train.sh @@ -134,16 +134,16 @@ if [ ! -n "$PARAMS" ] ;then device_num_list=(N1C4) run_mode="DP" else - # parser params from input: modeltype_bs${bs_item}_${fp_item}_${run_process_type}_${run_mode}_${device_num} + # parser params from input: modeltype_bs${bs_item}_${fp_item}_${run_mode}_${device_num} IFS="_" params_list=(${PARAMS}) model_type=${params_list[0]} batch_size=${params_list[1]} batch_size=`echo ${batch_size} | tr -cd "[0-9]" ` precision=${params_list[2]} - run_process_type=${params_list[3]} - run_mode=${params_list[4]} - device_num=${params_list[5]} + # run_process_type=${params_list[3]} + run_mode=${params_list[3]} + device_num=${params_list[4]} IFS=";" if [ ${precision} = "null" ];then diff --git a/test_tipc/docs/benchmark_train.md b/test_tipc/docs/benchmark_train.md index 82de39020ab1be7933b899f57242050f5f7d9209..e8a978ce6815275dee052291c44f4de47f9ff0ef 100644 --- a/test_tipc/docs/benchmark_train.md +++ b/test_tipc/docs/benchmark_train.md @@ -19,27 +19,24 @@ bash test_tipc/prepare.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt # 运行格式:bash test_tipc/benchmark_train.sh train_benchmark.txt mode bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_infer_python.txt benchmark_train -# 单机多卡训练,MultiP 表示多进程;单卡训练用SingleP -# 运行格式:bash test_tipc/benchmark_train.sh train_benchmark.txt mode -bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_infer_python.txt benchmark_train ``` `test_tipc/benchmark_train.sh`支持根据传入的第三个参数实现只运行某一个训练配置,如下: ```shell # 运行格式:bash test_tipc/benchmark_train.sh train_benchmark.txt mode -bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_infer_python.txt benchmark_train dynamic_bs8_null_SingleP_DP_N1C1 +bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_infer_python.txt benchmark_train dynamic_bs8_fp32_DP_N1C1 ``` -dynamic_bs8_null_SingleP_DP_N1C1为test_tipc/benchmark_train.sh传入的参数,格式如下: -`${modeltype}_${batch_size}_${fp_item}_${run_process_type}_${run_mode}_${device_num}` -包含的信息有:模型类型、batchsize大小、训练精度如fp32,fp16等、分布式训练进程类型、分布式运行模式以及分布式训练使用的机器信息如单机单卡(N1C1)。 +dynamic_bs8_fp32_DP_N1C1为test_tipc/benchmark_train.sh传入的参数,格式如下: +`${modeltype}_${batch_size}_${fp_item}_${run_mode}_${device_num}` +包含的信息有:模型类型、batchsize大小、训练精度如fp32,fp16等、分布式运行模式以及分布式训练使用的机器信息如单机单卡(N1C1)。 ## 2. 日志输出 -运行后将输出模型的训练日志和日志解析日志,使用 `test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt` 参数文件的训练日志解析结果是: +运行后将保存模型的训练日志和解析日志,使用 `test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt` 参数文件的训练日志解析结果是: ``` -{"model_branch": "dygaph", "model_commit": "7c39a1996b19087737c05d883fd346d2f39dbcc0", "model_name": "det_mv3_db_v2_0_bs8_fp32_SingleP_DP", "batch_size": 8, "fp_item": "fp32", "run_process_type": "SingleP", "run_mode": "DP", "convergence_value": "5.413110", "convergence_key": "loss:", "ips": 19.333, "speed_unit": "images/s", "device_num": "N1C1", "model_run_time": "0", "frame_commit": "8cc09552473b842c651ead3b9848d41827a3dbab", "frame_version": "0.0.0"} +{"model_branch": "dygaph", "model_commit": "7c39a1996b19087737c05d883fd346d2f39dbcc0", "model_name": "det_mv3_db_v2_0_bs8_fp32_SingleP_DP", "batch_size": 8, "fp_item": "fp32", "run_process_type": "SingleP", "run_mode": "DP", "convergence_value": "5.413110", "convergence_key": "loss:", "ips": 19.333, "speed_unit": "samples/s", "device_num": "N1C1", "model_run_time": "0", "frame_commit": "8cc09552473b842c651ead3b9848d41827a3dbab", "frame_version": "0.0.0"} ``` 训练日志和日志解析结果保存在benchmark_log目录下,文件组织格式如下: diff --git a/tools/program.py b/tools/program.py index f253e5817840b3aa2ad9d647fd65bac402e2d88c..e7393f7de156333f469e4268c74b9b473e881143 100755 --- a/tools/program.py +++ b/tools/program.py @@ -283,7 +283,7 @@ def train(config, eta_sec_format = str(datetime.timedelta(seconds=int(eta_sec))) strs = 'epoch: [{}/{}], global_step: {}, {}, avg_reader_cost: ' \ '{:.5f} s, avg_batch_cost: {:.5f} s, avg_samples: {}, ' \ - 'ips: {:.5f} , eta: {}'.format( + 'ips: {:.5f} samples/s, eta: {}'.format( epoch, epoch_num, global_step, logs, train_reader_cost / print_batch_step, train_batch_cost / print_batch_step,