Back to Paddleocr

TIPC Linux端Benchmark测试文档

test_tipc/docs/benchmark_train.md

3.5.06.3 KB
Original Source

TIPC Linux端Benchmark测试文档

该文档为Benchmark测试说明,Benchmark预测功能测试的主程序为benchmark_train.sh,用于验证监控模型训练的性能。

1. 测试流程

1.1 准备数据和环境安装

运行test_tipc/prepare.sh,完成训练数据准备和安装环境流程。

shell
# 运行格式:bash test_tipc/prepare.sh  train_benchmark.txt  mode
bash test_tipc/prepare.sh test_tipc/configs/det_mv3_db_v2_0/train_infer_python.txt benchmark_train

1.2 功能测试

执行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

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_fp32_DP_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_infer_python.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": "samples/s", "device_num": "N1C1", "model_run_time": "0", "frame_commit": "8cc09552473b842c651ead3b9848d41827a3dbab", "frame_version": "0.0.0"}

训练日志和日志解析结果保存在benchmark_log目录下,文件组织格式如下:

train_log/
├── index
│   ├── PaddleOCR_det_mv3_db_v2_0_bs8_fp32_SingleP_DP_N1C1_speed
│   └── PaddleOCR_det_mv3_db_v2_0_bs8_fp32_SingleP_DP_N1C4_speed
├── profiling_log
│   └── PaddleOCR_det_mv3_db_v2_0_bs8_fp32_SingleP_DP_N1C1_profiling
└── train_log
    ├── PaddleOCR_det_mv3_db_v2_0_bs8_fp32_SingleP_DP_N1C1_log
    └── PaddleOCR_det_mv3_db_v2_0_bs8_fp32_SingleP_DP_N1C4_log

3. 各模型单卡性能数据一览

*注:本节中的速度指标均使用单卡(1块Nvidia V100 16G GPU)测得。通常情况下。

模型名称配置文件大数据集 float32 fps小数据集 float32 fpsdiff大数据集 float16 fps小数据集 float16 fpsdiff大数据集大小小数据集大小
ch_ppocr_mobile_v2.0_detconfig53.83653.343 / 53.914 / 52.7850.02094075845.57445.57 / 46.292 / 46.2130.01559664710,0002,000
ch_ppocr_mobile_v2.0_recconfig2083.3112043.194 / 2066.372 / 2093.3170.0239442952153.2612167.561 / 2165.726 / 2155.6140.005511725600,000160,000
ch_ppocr_server_v2.0_detconfig20.71620.739 / 20.807 / 20.7550.00326813120.59220.498 / 20.993 / 20.750.02357928810,0002,000
ch_ppocr_server_v2.0_recconfig528.56528.386 / 528.991 / 528.3910.0011436871189.7881190.007 / 1176.332 / 1192.0840.013213834600,000160,000
ch_PP-OCRv2_detconfig13.8713.386 / 13.529 / 13.4280.01056988717.84717.746 / 17.908 / 17.960.01191536710,0002,000
ch_PP-OCRv2_recconfig109.248106.32 / 106.318 / 108.5870.020895687117.491117.62 / 117.757 / 117.7260.001163413140,00040,000
det_mv3_db_v2.0config61.80262.078 / 61.802 / 62.0080.0044460282.94784.294 / 84.457 / 84.0050.00535183610,0002,000
det_r50_vd_db_v2.0config29.95529.092 / 29.31 / 28.8440.01589901151.09750.367 / 50.879 / 50.2270.01281471710,0002,000
det_r50_vd_east_v2.0config42.48542.624 / 42.663 / 42.5610.0023908367.6167.825/ 68.299/ 68.510.0099985410,0002,000
det_r50_vd_pse_v2.0config16.45516.517 / 16.555 / 16.3530.01220175227.0227.288 / 27.152 / 27.4080.00934033910,0002,000
rec_mv3_none_bilstm_ctc_v2.0config2288.3582291.906 / 2293.725 / 2290.050.0016021972336.172327.042 / 2328.093 / 2344.9150.007622025600,000160,000
layoutxlm_serconfig18.00118.114 / 18.107 / 18.3070.01092478321.98221.507 / 21.116 / 21.4060.01818012714901490
PP-Structure-tableconfig14.15114.077 / 14.23 / 14.250.01214035116.28516.595 / 16.878 / 16.5310.02055930820,0005,000
det_r50_dcn_fce_ctw_v2.0config14.05714.029 / 14.02 / 14.0140.00106921418.29818.411 / 18.376 / 18.3310.00434522810,0002,000
ch_PP-OCRv3_detconfig8.6228.431 / 8.423 / 8.4790.00660455214.20314.346 14.468 14.230.01645009710,0002,000
PP-OCRv3_mobile_recconfig90.23990.077 / 91.513 / 91.3250.01569176160,00040,000