3
3
pip_packages=' numpy'
4
4
target_dir=./internal_tools
5
5
6
- LOG1=" dali_legacy.log"
7
- LOG2=" dali_nvimgcodec.log"
6
+ LOG=" dali.log"
8
7
function CLEAN_AND_EXIT {
9
- rm -rf ${LOG1}
10
- rm -rf ${LOG2}
8
+ rm -rf ${LOG}
11
9
exit $1
12
10
}
13
11
@@ -17,61 +15,28 @@ test_body() {
17
15
# Hopper
18
16
MIN_PERF=19000;
19
17
# use taskset to avoid inefficient data migration between cores we don't want to use
20
- taskset --cpu-list 0-127 python hw_decoder_bench.py --width_hint 6000 --height_hint 6000 -b 408 -d 0 -g gpu -w 100 -t 100000 -i ${DALI_EXTRA_PATH} /db/single/jpeg -p rn50 -j 70 --hw_load 0.12 | tee ${LOG1}
21
- taskset --cpu-list 0-127 python hw_decoder_bench.py --width_hint 6000 --height_hint 6000 -b 408 -d 0 -g gpu -w 100 -t 100000 -i ${DALI_EXTRA_PATH} /db/single/jpeg -p rn50 -j 70 --hw_load 0.12 --experimental_decoder | tee ${LOG2}
18
+ taskset --cpu-list 0-127 python hw_decoder_bench.py --width_hint 6000 --height_hint 6000 -b 408 -d 0 -g gpu -w 100 -t 100000 -i ${DALI_EXTRA_PATH} /db/single/jpeg -p rn50 -j 70 --hw_load 0.12 | tee ${LOG}
22
19
23
20
else
24
21
# GraceHopper
25
22
MIN_PERF=29000;
26
23
# use taskset to avoid inefficient data migration between cores we don't want to use
27
- taskset --cpu-list 0-71 python hw_decoder_bench.py --width_hint 6000 --height_hint 6000 -b 408 -d 0 -g gpu -w 100 -t 100000 -i ${DALI_EXTRA_PATH} /db/single/jpeg -p rn50 -j 72 --hw_load 0.11 | tee ${LOG1}
28
- taskset --cpu-list 0-71 python hw_decoder_bench.py --width_hint 6000 --height_hint 6000 -b 408 -d 0 -g gpu -w 100 -t 100000 -i ${DALI_EXTRA_PATH} /db/single/jpeg -p rn50 -j 72 --hw_load 0.11 --experimental_decoder | tee ${LOG2}
24
+ taskset --cpu-list 0-71 python hw_decoder_bench.py --width_hint 6000 --height_hint 6000 -b 408 -d 0 -g gpu -w 100 -t 100000 -i ${DALI_EXTRA_PATH} /db/single/jpeg -p rn50 -j 72 --hw_load 0.11 | tee ${LOG}
29
25
fi
30
26
31
27
# Regex Explanation:
32
28
# Total Throughput: : Matches the literal string "Total Throughput: ".
33
29
# \K: Resets the start of the match, so anything before \K is not included in the output.
34
30
# [0-9]+(\.[0-9]+)?: Matches the number, with an optional decimal part.
35
31
# (?= frames/sec): ensures " frames/sec" follows the number, but doesn't include it.
36
- PERF1=$( grep -oP ' Total Throughput: \K[0-9]+(\.[0-9]+)?(?= frames/sec)' ${LOG1} )
37
- PERF2=$( grep -oP ' Total Throughput: \K[0-9]+(\.[0-9]+)?(?= frames/sec)' ${LOG2} )
32
+ PERF=$( grep -oP ' Total Throughput: \K[0-9]+(\.[0-9]+)?(?= frames/sec)' ${LOG} )
33
+ PERF_RESULT=$( echo " $PERF $MIN_PERF " | awk ' {if ($1>=$2) {print "OK"} else { print "FAIL" }}' )
34
+ echo " PERF_RESULT=${PERF_RESULT} "
38
35
39
- PERF_RESULT1=$( echo " $PERF1 $MIN_PERF " | awk ' {if ($1>=$2) {print "OK"} else { print "FAIL" }}' )
40
- PERF_RESULT2=$( echo " $PERF2 $MIN_PERF " | awk ' {if ($1>=$2) {print "OK"} else { print "FAIL" }}' )
41
- # Ensure that PERF2 is no less than 5% smaller than PERF1
42
- PERF_RESULT3=$( echo " $PERF2 $PERF1 " | awk ' {if ($1 >= $2 * 0.95) {print "OK"} else { print "FAIL" }}' )
43
-
44
- echo " PERF_RESULT1=${PERF_RESULT1} "
45
- echo " PERF_RESULT2=${PERF_RESULT2} "
46
- echo " PERF_RESULT3=${PERF_RESULT3} "
47
-
48
- # If nvImageCodec>=0.5.0 enforce the performance requirements. Otherwise, we check only the legacy decoder
49
- if pip show nvidia-nvimgcodec-cu12 > /dev/null 2>&1 ; then
50
- NVIMGCODEC_VERSION=$( pip show nvidia-nvimgcodec-cu12 | grep ^Version: | awk ' {print $2}' )
51
- elif pip show nvidia-nvimgcodec-cu11 > /dev/null 2>&1 ; then
52
- NVIMGCODEC_VERSION=$( pip show nvidia-nvimgcodec-cu11 | grep ^Version: | awk ' {print $2}' )
53
- else
54
- echo " Neither nvidia-nvimgcodec-cu11 nor nvidia-nvimgcodec-cu12 is installed"
55
- exit 1
56
- fi
57
- NVIMGCODEC_VERSION_WITHOUT_EXTRA=$( echo " $NVIMGCODEC_VERSION " | awk -F ' .' ' {print $1 "." $2 "." $3}' )
58
- if [[ " $NVIMGCODEC_VERSION_WITHOUT_EXTRA " =~ ^([0-9]+)\. ([0-9]+)\. ([0-9]+)$ ]]; then
59
- IFS=' .' read -r MAJOR MINOR PATCH <<< " $NVIMGCODEC_VERSION_WITHOUT_EXTRA"
60
- if [[ $MAJOR -gt 0 || ($MAJOR -eq 0 && $MINOR -ge 5) ]]; then
61
- if [[ " $PERF_RESULT1 " == " OK" && " $PERF_RESULT2 " == " OK" && " $PERF_RESULT3 " == " OK" ]]; then
62
- CLEAN_AND_EXIT 0
63
- else
64
- CLEAN_AND_EXIT 4
65
- fi
66
- else
67
- if [[ " $PERF_RESULT1 " == " OK" ]]; then
68
- CLEAN_AND_EXIT 0
69
- else
70
- CLEAN_AND_EXIT 4
71
- fi
72
- fi
36
+ if [[ " $PERF_RESULT " == " OK" ]]; then
37
+ CLEAN_AND_EXIT 0
73
38
else
74
- CLEAN_AND_EXIT 3
39
+ CLEAN_AND_EXIT 4
75
40
fi
76
41
}
77
42
pushd ../..
0 commit comments