-
Notifications
You must be signed in to change notification settings - Fork 0
/
trt_batch_onnx_build.sh
43 lines (32 loc) · 1.08 KB
/
trt_batch_onnx_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# ssh -p 2025 [email protected] nvidia
# /opt/deeproute/driver/config/starter/all_config.jsonnet
#!/bin/bash
data_pairs=(
"mnist.onnx,best"
# "BV_PSD_P01_V02_20240619_TEST.onnx,fp16"
#"BV_SEG_P01_V00_20240425.onnx,best"
#"bevf-160-200-20-20-1_simp.onnx,best"
#"bevf-320-400-20-20-1_simp.onnx,fp16"
#"bevf-320-400-20-20-1_simp_ops11_1_input.onnx,best"
#"bevf-64-160-20-20-1_poly.onnx,best"
#"bevformer_tiny_resnet18_poly.onnx,best"
#"mobilenetv2-sim.onnx,best"
#"yolov5s_poly.onnx,best"
)
ONNX_DIR=/ota
echo $ONNX_DIR
for pair in "${data_pairs[@]}"; do
IFS=',' read -r filename type <<< "$pair"
echo $filename, $type
sonfile_name=$(basename $filename)
prefix=$(echo "$sonfile_name" | awk -F'.' '{print $1}')
echo $prefix
base_name=$prefix
/usr/src/tensorrt/bin/trtexec --onnx=$ONNX_DIR/$filename \
--saveEngine=$ONNX_DIR/${base_name}.plan \
--verbose \
--$type \
--dumpProfile \
--noDataTransfers --useCudaGraph --useSpinWait --separateProfileRun \
2>&1 | tee $ONNX_DIR/${base_name}.log
done