| | |
| | | Benchmark [Paraformer-large](https://www.modelscope.cn/models/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/summary) based on Aishell1 test set , the total audio duration is 36108.919 seconds. |
| | | # Benchmark |
| | | |
| | | (Note: The service has been fully warm up.) |
| | | Aishell1 test set , the total audio duration is 36108.919 seconds. (Note: The service has been fully warm up.) |
| | | |
| | | ## [Paraformer-large](https://www.modelscope.cn/models/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/summary) |
| | | |
| | | ### Intel(R) Xeon(R) Platinum 8369B CPU @ 2.90GHz 16core-32processor with avx512_vnni |
| | | |
| | |
| | | | 64 (onnx fp32) | 153 | 0.0042 | 235.9 | |
| | | | 64 (onnx int8) | 103 | 0.0029 | 349.9 | |
| | | | 96 (onnx fp32) | 146 | 0.0041 | 247.0 | |
| | | | 96 (onnx int8) | 108 | 0.0030 | 334.1 | |
| | | | 96 (onnx int8) | 108 | 0.0030 | 334.1 | |
| | | |
| | | ## [Paraformer](https://modelscope.cn/models/damo/speech_paraformer_asr_nat-zh-cn-16k-common-vocab8358-tensorflow1/summary) |
| | |
| | | import time |
| | | import sys |
| | | import librosa |
| | | backend=sys.argv[1] |
| | | model_dir=sys.argv[2] |
| | | wav_file=sys.argv[3] |
| | | |
| | | |
| | | import argparse |
| | | parser = argparse.ArgumentParser() |
| | | parser.add_argument('--model_dir', type=str, required=True) |
| | | parser.add_argument('--backend', type=str, default='onnx', help='["onnx", "torch"]') |
| | | parser.add_argument('--wav_file', type=int, default=0, help='amp fallback number') |
| | | parser.add_argument('--quantize', type=bool, default=False, help='quantized model') |
| | | args = parser.parse_args() |
| | | |
| | | |
| | | from torch_paraformer import Paraformer |
| | | if backend == "onnxruntime": |
| | | if args.backend == "onnxruntime": |
| | | from rapid_paraformer import Paraformer |
| | | |
| | | model = Paraformer(model_dir, batch_size=1, device_id="-1") |
| | | model = Paraformer(args.model_dir, batch_size=1, quantize=args.quantize) |
| | | |
| | | wav_file_f = open(wav_file, 'r') |
| | | wav_file_f = open(args.wav_file, 'r') |
| | | wav_files = wav_file_f.readlines() |
| | | |
| | | # warm-up |
| | |
| | | backend=libtorch |
| | | model_dir="/nfs/zhifu.gzf/export/damo/amp_int8/libtorch" |
| | | tag=${backend}_fp32 |
| | | quantize='False' |
| | | ! |
| | | |
| | | :<<! |
| | | backend=libtorch |
| | | model_dir="/nfs/zhifu.gzf/export/damo/amp_int8/libtorch_fb20" |
| | | tag=${backend}_amp_fb20 |
| | | quantize='True' |
| | | ! |
| | | |
| | | :<<! |
| | | backend=onnxruntime |
| | | model_dir="/nfs/zhifu.gzf/export/damo/amp_int8/onnx" |
| | | tag=${backend}_fp32 |
| | | quantize='False' |
| | | ! |
| | | |
| | | :<<! |
| | | backend=onnxruntime |
| | | model_dir="/nfs/zhifu.gzf/export/damo/amp_int8/onnx_dynamic" |
| | | tag=${backend}_fp32 |
| | | quantize='True' |
| | | ! |
| | | |
| | | #scp=/nfs/haoneng.lhn/funasr_data/aishell-1/data/test/wav.scp |
| | | scp="/nfs/zhifu.gzf/data_debug/test/wav_1500.scp" |
| | | scp=/nfs/haoneng.lhn/funasr_data/aishell-1/data/test/wav.scp |
| | | local_scp_dir=/nfs/zhifu.gzf/data_debug/test/${tag}/split$nj |
| | | |
| | | rtf_tool=test_rtf.py |
| | |
| | | for JOB in $(seq ${nj}); do |
| | | { |
| | | core_id=`expr $JOB - 1` |
| | | taskset -c ${core_id} python ${rtf_tool} ${backend} ${model_dir} ${local_scp_dir}/wav.$JOB.scp &> ${local_scp_dir}/log.$JOB.txt |
| | | taskset -c ${core_id} python ${rtf_tool} --backend ${backend} --model_dir ${model_dir} --wav_file ${local_scp_dir}/wav.$JOB.scp --quantize ${quantize} &> ${local_scp_dir}/log.$JOB.txt |
| | | }& |
| | | |
| | | done |