mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-08 01:50:27 +08:00
Update backend name
This commit is contained in:
@@ -28,8 +28,8 @@ def parse_arguments():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--backend",
|
"--backend",
|
||||||
type=str,
|
type=str,
|
||||||
default='pp',
|
default='paddle',
|
||||||
choices=['ort', 'pp', 'trt', 'pp-trt', 'openvino'],
|
choices=['ort', 'paddle', 'trt', 'paddle_trt', 'ov'],
|
||||||
help="The inference runtime backend.")
|
help="The inference runtime backend.")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--device_id", type=int, default=0, help="device(gpu) id")
|
"--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)
|
option.set_cpu_thread_num(args.cpu_num_threads)
|
||||||
else:
|
else:
|
||||||
option.use_gpu(args.device_id)
|
option.use_gpu(args.device_id)
|
||||||
if args.backend == 'pp':
|
if args.backend == 'paddle':
|
||||||
option.use_paddle_backend()
|
option.use_paddle_backend()
|
||||||
elif args.backend == 'ort':
|
elif args.backend == 'ort':
|
||||||
option.use_ort_backend()
|
option.use_ort_backend()
|
||||||
elif args.backend == 'openvino':
|
elif args.backend == 'ov':
|
||||||
option.use_openvino_backend()
|
option.use_openvino_backend()
|
||||||
else:
|
else:
|
||||||
option.use_trt_backend()
|
option.use_trt_backend()
|
||||||
if args.backend == 'pp-trt':
|
if args.backend == 'paddle_trt':
|
||||||
option.enable_paddle_to_trt()
|
option.enable_paddle_to_trt()
|
||||||
option.enable_paddle_trt_collect_shape()
|
option.enable_paddle_trt_collect_shape()
|
||||||
trt_file = os.path.join(args.model_dir, "infer.trt")
|
trt_file = os.path.join(args.model_dir, "infer.trt")
|
||||||
|
@@ -8,20 +8,20 @@ echo "[FastDeploy] Running UIE benchmark..."
|
|||||||
|
|
||||||
# GPU
|
# GPU
|
||||||
echo "-------------------------------GPU Benchmark---------------------------------------"
|
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 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 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
|
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 "-----------------------------------------------------------------------------------"
|
echo "-----------------------------------------------------------------------------------"
|
||||||
|
|
||||||
# CPU
|
# CPU
|
||||||
echo "-------------------------------CPU Benchmark---------------------------------------"
|
echo "-------------------------------CPU Benchmark---------------------------------------"
|
||||||
for cpu_num_threads in 1 2 4 8 16;
|
for cpu_num_threads in 1 8;
|
||||||
do
|
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 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
|
done
|
||||||
echo "-----------------------------------------------------------------------------------"
|
echo "-----------------------------------------------------------------------------------"
|
||||||
|
Reference in New Issue
Block a user