This repository was archived by the owner on Feb 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +7
-36
lines changed
tftrt/benchmarking-python Expand file tree Collapse file tree 10 files changed +7
-36
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,7 @@ ELECTRA_MODELS=(
1212 " electra_large"
1313)
1414
15- MODEL_DIR=" /models/tf_hub/electra"
16- DATA_DIR=" /workspace/tensorflow_tensorrt/tftrt/benchmarking-python/tf_hub/electra/data"
17- TOKENIZER_DIR=" /models/tf_hub/electra/tokenizer"
18-
19- RUN_ARGS=" --input_saved_model_dir=${MODEL_DIR} --data_dir=${DATA_DIR} --tokenizer_dir=${TOKENIZER_DIR} --debug --batch_size=32 --display_every=1 --use_synthetic_data --num_iterations=1000"
15+ RUN_ARGS=" --input_saved_model_dir=/models/tf_hub/electra --data_dir=${BASE_DIR} /data --tokenizer_dir=/models/tf_hub/electra/tokenizer --debug --batch_size=32 --display_every=1 --use_synthetic_data --num_iterations=1000"
2016TF_TRT_ARGS=" --use_tftrt --use_dynamic_shape --num_calib_batches=10"
2117TF_XLA_ARGS=" --use_xla_auto_jit"
2218
Original file line number Diff line number Diff line change @@ -17,11 +17,7 @@ MOVINET_MODELS=(
1717 " a5"
1818)
1919
20- DATA_DIR=" /tmp"
21- INPUT_SAVED_MODEL_DIR=" /models/tf_hub/movinet"
22- BATCH_SIZE=32
23-
24- RUN_ARGS=" --data_dir=${DATA_DIR} --batch_size=${BATCH_SIZE} --display_every=50"
20+ BASE_RUN_ARGS=" --input_saved_model_dir=/models/tf_hub/movinet --data_dir=/tmp --batch_size=32 --display_every=50"
2521TF_TRT_ARGS=" --use_tftrt --use_dynamic_shape --num_calib_batches=10"
2622TF_XLA_ARGS=" --use_xla_auto_jit"
2723
@@ -30,8 +26,6 @@ export TF_TRT_SHOW_DETAILED_REPORT=1
3026for model_name in " ${MOVINET_MODELS[@]} " ; do
3127 echo " Processing Model: ${model_name} ..."
3228
33- RUN_ARGS=" ${RUN_ARGS} --input_saved_model_dir=${INPUT_SAVED_MODEL_DIR} "
34-
3529 MODEL_DATA_EXPORT_DIR=" ${BASE_BENCHMARK_DATA_EXPORT_DIR} /movinet_${model_name} "
3630 mkdir -p ${MODEL_DATA_EXPORT_DIR}
3731 echo " Running " ${BASE_DIR} /models/${model_name} /run_inference.sh" for the set of following benchmarks. "
Original file line number Diff line number Diff line change @@ -6,19 +6,12 @@ BASE_BENCHMARK_DATA_EXPORT_DIR="${BASE_DIR}/benchmark_data"
66rm -rf ${BASE_BENCHMARK_DATA_EXPORT_DIR}
77mkdir -p ${BASE_BENCHMARK_DATA_EXPORT_DIR}
88
9- # Default Argument Values
10- SAMPLES_PER_INPUT=" 128"
11- BYPASS_ARGUMENTS=" "
12- MODEL_DIR=" /models/tf_hub/spice"
13- DATA_DIR=" /tmp/"
14- NUM_ITERATIONS=" 1000"
15-
169# List of models. spice is a single implementation
1710MODELS=(
1811 " spice"
1912)
2013
21- RUN_ARGS=" --data_dir=${DATA_DIR} --input_saved_model_dir=${MODEL_DIR} --display_every=50 --samples_per_input=${SAMPLES_PER_INPUT} --num_iterations=${NUM_ITERATIONS} "
14+ RUN_ARGS=" --data_dir=/tmp/ --input_saved_model_dir=/models/tf_hub/spice --display_every=50 --samples_per_input=128 --num_iterations=1000 "
2215TF_TRT_ARGS=" --use_tftrt --use_dynamic_shape --num_calib_batches=10"
2316TF_XLA_ARGS=" --use_xla_auto_jit"
2417
@@ -32,7 +25,7 @@ for model_name in "${MODELS[@]}"; do
3225
3326 # ============================ TF NATIVE ============================ #
3427 # TF Native - FP32
35- echo " Running ${BASE_DIR} /run_inference.sh"
28+ echo " Running ${BASE_DIR} /run_inference.sh"
3629 script -q -c " ${BASE_DIR} /run_inference.sh ${RUN_ARGS} --precision=FP32" /dev/null | tee ${MODEL_DATA_EXPORT_DIR} /inference_tf_native_fp32.log
3730
3831 # TF Native - FP16
Original file line number Diff line number Diff line change @@ -18,10 +18,7 @@ SWIN_MODELS=(
1818 " swin_large_patch4_window12_384"
1919)
2020
21- MODEL_DIR=" /models/tf_hub/swin_transformers"
22- DATA_DIR=" /data/imagenet"
23-
24- RUN_ARGS=" --input_saved_model_dir=${MODEL_DIR} --data_dir=${DATA_DIR} --debug --batch_size=32 --display_every=1 --use_synthetic_data --num_iterations=1000"
21+ RUN_ARGS=" --input_saved_model_dir=/models/tf_hub/swin_transformers --data_dir=/data/imagenet --debug --batch_size=32 --display_every=1 --use_synthetic_data --num_iterations=1000"
2522TF_TRT_ARGS=" --use_tftrt --use_dynamic_shape --num_calib_batches=10"
2623TF_XLA_ARGS=" --use_xla_auto_jit"
2724
Original file line number Diff line number Diff line change @@ -17,10 +17,7 @@ vit_MODELS=(
1717 " vit_r50_l32_classification"
1818)
1919
20- MODEL_DIR=" /models/tf_hub/vision_transformers"
21- DATA_DIR=" /data/imagenet"
22-
23- RUN_ARGS=" --input_saved_model_dir=${MODEL_DIR} --data_dir=${DATA_DIR} --debug --batch_size=32 --display_every=1 --use_synthetic_data --num_iterations=1000"
20+ RUN_ARGS=" --input_saved_model_dir=/models/tf_hub/vision_transformers --data_dir=/data/imagenet --debug --batch_size=32 --display_every=1 --use_synthetic_data --num_iterations=1000"
2421TF_TRT_ARGS=" --use_tftrt --use_dynamic_shape --num_calib_batches=10"
2522TF_XLA_ARGS=" --use_xla_auto_jit"
2623
Original file line number Diff line number Diff line change @@ -6,18 +6,12 @@ BASE_BENCHMARK_DATA_EXPORT_DIR="${BASE_DIR}/benchmark_data"
66rm -rf ${BASE_BENCHMARK_DATA_EXPORT_DIR}
77mkdir -p ${BASE_BENCHMARK_DATA_EXPORT_DIR}
88
9- # Default Argument Values
10- BYPASS_ARGUMENTS=" "
11- MODEL_DIR=" /models/tf_hub/YAMNet"
12- DATA_DIR=" /tmp/"
13- FRAME_LENGTH=" 1"
14-
159# List of models. YAMNet is a single implementation
1610MODELS=(
1711 " YAMNet"
1812)
1913
20- RUN_ARGS=" --data_dir=${DATA_DIR} --input_saved_model_dir=${MODEL_DIR} --display_every=50 --frame_length=${FRAME_LENGTH} "
14+ RUN_ARGS=" --data_dir=/tmp/ --input_saved_model_dir=/models/tf_hub/YAMNet --display_every=50 --frame_length=1 "
2115TF_TRT_ARGS=" --use_tftrt --use_dynamic_shape --num_calib_batches=10"
2216TF_XLA_ARGS=" --use_xla_auto_jit"
2317
You can’t perform that action at this time.
0 commit comments