2727# Test cases that needs to run quick cpu tests
2828NO_QUICK_CPU_TESTS=(
2929 " tests/ks_tests.py"
30- " tests/test_conv3d.py"
31- " tests/test_convolution_ops.py"
32- " tests/test_distribution_ops.py"
3330 " tests/test_enable_api.py"
3431 " tests/test_libentry.py"
3532 " tests/test_pointwise_type_promotion.py"
3633 " tests/test_quant.py"
3734 " tests/test_shape_utils.py"
3835 " tests/test_tensor_wrapper.py"
39- " tests/test_vllm_ops.py"
4036)
4137
4238# Extract test cases from CHANGED_FILES
4339TEST_CASES=()
40+ PERF_TEST_CASES=()
4441TEST_CASES_CPU=()
4542for item in $CHANGED_FILES ; do
4643 case $item in
47- # tests/test_DSA/*)
48- # skip DSA test for now
49- # ;;
5044 tests/test_quant.py)
5145 # skip because it always fail
5246 ;;
53- tests/* ) TEST_CASES+=($item )
47+ tests/* )
48+ TEST_CASES+=($item )
49+ ;;
50+ benchmark/* )
51+ PERF_TEST_CASES+=($item )
52+ ;;
5453 esac
5554
5655 # filter out tests that do not need quick CPU mode tests
@@ -69,7 +68,7 @@ for item in $CHANGED_FILES; do
6968done
7069
7170# Skip tests if no tests file is found
72- if [ ${# TEST_CASES[@]} -eq 0 ]; then
71+ if [ ${# TEST_CASES[@]} -eq 0 && ${ # PERF_TEST_CASES[@]} -eq 0 ]; then
7372 exit 0
7473fi
7574
@@ -78,13 +77,21 @@ coverage erase
7877
7978echo " Running unit tests for ${TEST_CASES[@]} "
8079# TODO(Qiming): Check if utils test should use a different data file
81- coverage run -m pytest -s ${EXTRA_OPTS} ${TEST_CASES[@]}
80+ for item in " ${TEST_CASES[@]} " ; do
81+ coverage run -m pytest -s ${EXTRA_OPTS} ${item}
82+ done
8283
8384# Run quick-cpu test if necessary
84- if [[ ${# TEST_CASES_CPU[@]} -ne 0 ]]; then
85- echo " Running quick-cpu mode unit tests for ${TEST_CASES_CPU[@]} "
86- coverage run -m pytest -s ${EXTRA_OPTS} ${TEST_CASES_CPU[@]} --ref=cpu --quick
87- fi
85+ for item in " ${TEST_CASES_CPU[@]} " ; do
86+ echo " Running quick-cpu mode unit tests for ${item} "
87+ coverage run -m pytest -s ${EXTRA_OPTS} ${item} --ref=cpu --quick
88+ done
89+
90+ # Run benchmark test if necessary
91+ for item in " ${PERF_TEST_CASES[@]} " ; do
92+ echo " Running benchmark tests for ${item} "
93+ pytest -s --level core --record log ${item}
94+ done
8895
8996# Process coverage data only when full-range testing
9097# Coverage data HTML dumped to `htmlcov/` by default
0 commit comments