Skip to content

Commit

Permalink
[UT] replace skip calls with skiplist once on a new platform
Browse files Browse the repository at this point in the history
  • Loading branch information
AshburnLee committed May 28, 2024
1 parent 6dbcb76 commit 822134d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
40 changes: 40 additions & 0 deletions scripts/replace_skipcall_to_skiplist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# generate skiplist for all test suite on a new platform
CORE_LOG=${TRITON_PROJ}/${GPU_TYPE}_${AGAMA_TYPE}_core.log
REGRESSION_LOG=${TRITON_PROJ}/${GPU_TYPE}_${AGAMA_TYPE}_regression.log

echo "Generating core test log ..."
run_core_tests > "${CORE_LOG}"
echo "Done generation"

echo "Generating regression test log ..."
run_regression_tests > "${REGRESSION_LOG}"
echo "Done generation"

mkdir -p "$TRITON_TEST_SKIPLIST_DIR"

parse_log() {
local keyword="$1"
local output_file="$2"
if grep -q "SKIPPED $keyword" "$CORE_LOG"; then
grep "SKIPPED $keyword" "$CORE_LOG" |
sed -E "s/^(.*)$keyword(.*)/test\/unit\/$keyword\2/g; s/ //g" > "$output_file"
fi
}

# language.txt & operators.txt
parse_log "language" "${TRITON_TEST_SKIPLIST_DIR}/language.txt"
parse_log "operators" "${TRITON_TEST_SKIPLIST_DIR}/operators.txt"

# subprocess.txt
if grep -q "test_subprocess.py" "${TRITON_TEST_SKIPLIST_DIR}/language.txt"; then
grep "test_subprocess.py" "${TRITON_TEST_SKIPLIST_DIR}/language.txt" > ${TRITON_TEST_SKIPLIST_DIR}/subprocess.txt
sed -i '/test_subprocess.py/d' ${TRITON_TEST_SKIPLIST_DIR}/language.txt
fi

# regression.txt
if grep -q "SKIPPED" ${REGRESSION_LOG}; then
grep "SKIPPED" ${REGRESSION_LOG} |
sed -E 's/^(.*)SKIPPED(.*)/test\/unit\/language\/\1/g; s/ //g' > ${TRITON_TEST_SKIPLIST_DIR}/regression.txt
fi

# DOTO: runtime.txt
11 changes: 11 additions & 0 deletions scripts/test-triton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ if [ "$TRITON_TEST_WARNING_REPORTS" == true ]; then
fi

source $SCRIPTS_DIR/pytest-utils.sh
# got GPU_TYPE & AGAMA_VERSION, example here
GPU_TYPE="pvc"
AGAMA_TYPE="TBD" # real value depends on the other PR
TRITON_TEST_SKIPLIST_DIR=$SCRIPTS_DIR/skiplist/${GPU_TYPE}_${AGAMA_TYPE}

$SKIP_DEPS || $SCRIPTS_DIR/compile-pytorch-ipex.sh --pinned $ARGS

if [ ! -d "$TRITON_PROJ_BUILD" ]
Expand Down Expand Up @@ -190,6 +195,12 @@ test_triton() {
run_unit_tests
fi
if [ "$TEST_CORE" = true ]; then
# only pre-run tests to replace when no skiplist dir exist.
if [ ! -d "${TRITON_TEST_SKIPLIST_DIR}" ]; then
# execute run_core_tests & run_regression_tests with NO skiplist
source ${SCRIPTS_DIR}/replace_skipcall_to_skiplist.sh
fi
# execute run_core_tests & run_regression_tests with skiplist
run_core_tests
run_regression_tests
fi
Expand Down

0 comments on commit 822134d

Please sign in to comment.