mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 09:31:35 +08:00
Update backend name
This commit is contained in:
@@ -28,8 +28,8 @@ def parse_arguments():
|
||||
parser.add_argument(
|
||||
"--backend",
|
||||
type=str,
|
||||
default='pp',
|
||||
choices=['ort', 'pp', 'trt', 'pp-trt', 'openvino'],
|
||||
default='paddle',
|
||||
choices=['ort', 'paddle', 'trt', 'paddle_trt', 'ov'],
|
||||
help="The inference runtime backend.")
|
||||
parser.add_argument(
|
||||
"--device_id", type=int, default=0, help="device(gpu) id")
|
||||
@@ -67,15 +67,15 @@ def build_option(args):
|
||||
option.set_cpu_thread_num(args.cpu_num_threads)
|
||||
else:
|
||||
option.use_gpu(args.device_id)
|
||||
if args.backend == 'pp':
|
||||
if args.backend == 'paddle':
|
||||
option.use_paddle_backend()
|
||||
elif args.backend == 'ort':
|
||||
option.use_ort_backend()
|
||||
elif args.backend == 'openvino':
|
||||
elif args.backend == 'ov':
|
||||
option.use_openvino_backend()
|
||||
else:
|
||||
option.use_trt_backend()
|
||||
if args.backend == 'pp-trt':
|
||||
if args.backend == 'paddle_trt':
|
||||
option.enable_paddle_to_trt()
|
||||
option.enable_paddle_trt_collect_shape()
|
||||
trt_file = os.path.join(args.model_dir, "infer.trt")
|
||||
|
@@ -8,20 +8,20 @@ echo "[FastDeploy] Running UIE benchmark..."
|
||||
|
||||
# GPU
|
||||
echo "-------------------------------GPU Benchmark---------------------------------------"
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend pp --device_id $DEVICE_ID --device gpu --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend paddle --device_id $DEVICE_ID --device gpu --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend ort --device_id $DEVICE_ID --device gpu --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend pp-trt --device_id $DEVICE_ID --device gpu --enable_trt_fp16 False --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend paddle_trt --device_id $DEVICE_ID --device gpu --enable_trt_fp16 False --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend trt --device_id $DEVICE_ID --device gpu --enable_trt_fp16 False --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend pp-trt --device_id $DEVICE_ID --device gpu --enable_trt_fp16 True --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend paddle_trt --device_id $DEVICE_ID --device gpu --enable_trt_fp16 True --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend trt --device_id $DEVICE_ID --device gpu --enable_trt_fp16 True --enable_collect_memory_info True
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
|
||||
# CPU
|
||||
echo "-------------------------------CPU Benchmark---------------------------------------"
|
||||
for cpu_num_threads in 1 2 4 8 16;
|
||||
for cpu_num_threads in 1 8;
|
||||
do
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend pp --device cpu --cpu_num_threads ${cpu_num_threads} --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend paddle --device cpu --cpu_num_threads ${cpu_num_threads} --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend ort --device cpu --cpu_num_threads ${cpu_num_threads} --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend openvino --device cpu --cpu_num_threads ${cpu_num_threads} --enable_collect_memory_info True
|
||||
python benchmark_uie.py --epoch 5 --model_dir uie-base --data_path reimbursement_form_data.txt --backend ov --device cpu --cpu_num_threads ${cpu_num_threads} --enable_collect_memory_info True
|
||||
done
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
|
Reference in New Issue
Block a user