Skip to content

Commit 6614df4

Browse files
authored
Add --extra-skip-list-suffixes options into test-triton.sh (#5093)
`pytest-skip==0.2.0` allows to specify multiple skiplists via semicolon (for details: https://github.com/vlad-penkin/pytest-skip/releases/tag/v0.2.0). This pull request adds minimal support for this change. Tested locally: `./scripts/test-triton.sh --interpreter --skip-pytorch-install --skip-pip-install --extra-skip-list-suffixes sort,sort2`. For this I created 3 files in `skiplist/default` folder: `interpreter.txt`, `interpreter-sort.txt` and `interpreter-sort2.txt`. If there is no file matching the suffix, the script will show an error: ```bash ./scripts/test-triton.sh --interpreter --skip-pytorch-install --skip-pip-install --extra-skip-list-suffixes sort,sort3 **** Skipping installation of pip dependencies **** **** Skipping installation of pytorch **** *************************************************** ****** Running Triton Interpreter tests ****** *************************************************** ERROR: /home/jovyan/intel-xpu-backend-for-triton/scripts/skiplist/default/interpreter-sort3.txt not found ``` Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 250566a commit 6614df4

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

.github/workflows/auto-update-translator-cid.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Install test dependencies
6060
if: ${{ env.TARGET_PRID == null }}
6161
run: |
62-
pip install pytest pytest-xdist pytest-rerunfailures pytest-skip pytest-timeout expecttest
62+
pip install pytest pytest-xdist pytest-rerunfailures 'pytest-skip>=0.2.0' pytest-timeout expecttest
6363
pip install git+https://github.com/kwasd/[email protected]
6464
6565
- name: Get commit ID from Triton's spirv-llvm-translator.conf

scripts/docs-triton.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export TRITON_PROJ=$BASE/intel-xpu-backend-for-triton
3636
export TRITON_PROJ_BUILD=$TRITON_PROJ/python/build
3737
export SCRIPTS_DIR=$(cd $(dirname "$0") && pwd)
3838

39-
python3 -m pip install lit pytest pytest-xdist pytest-rerunfailures pytest-skip
39+
python3 -m pip install lit pytest pytest-xdist pytest-rerunfailures 'pytest-skip>=0.2.0'
4040

4141
source $SCRIPTS_DIR/pytest-utils.sh
4242
$SCRIPTS_DIR/install-pytorch.sh $([ $VENV = true ] && echo "--venv")

scripts/pytest-utils.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SCRIPTS_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd
44
TRITON_TEST_REPORTS="${TRITON_TEST_REPORTS:-false}"
55
TRITON_TEST_REPORTS_DIR="${TRITON_TEST_REPORTS_DIR:-$HOME/reports/$TIMESTAMP}"
66
TRITON_TEST_SKIPLIST_DIR="${TRITON_TEST_SKIPLIST_DIR:-$SCRIPTS_DIR/skiplist/default}"
7+
TRITON_EXTRA_SKIPLIST_SUFFIXES="${TRITON_EXTRA_SKIPLIST_SUFFIXES:=}"
78
TRITON_TEST_SELECTFILE="${TRITON_TEST_SELECTFILE:=}"
89
TRITON_TEST_WARNING_REPORTS="${TRITON_TEST_WARNING_REPORTS:-false}"
910
TRITON_TEST_IGNORE_ERRORS="${TRITON_TEST_IGNORE_ERRORS:-false}"
@@ -41,8 +42,21 @@ pytest() {
4142

4243
if [[ ! -f $TRITON_TEST_SELECTFILE && -v TRITON_TEST_SUITE && -f $TRITON_TEST_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt ]]; then
4344
if [[ $TEST_UNSKIP = false ]]; then
45+
SKIPFILES="$TRITON_TEST_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt"
46+
if [[ -n "$TRITON_EXTRA_SKIPLIST_SUFFIXES" ]]; then
47+
IFS=',' read -ra SUFFIXES <<< "$TRITON_EXTRA_SKIPLIST_SUFFIXES"
48+
for SUFFIX in "${SUFFIXES[@]}"; do
49+
SKIPFILE="$TRITON_TEST_SKIPLIST_DIR/${TRITON_TEST_SUITE}-${SUFFIX}.txt"
50+
if [[ -f "$SKIPFILE" ]]; then
51+
SKIPFILES+=";$SKIPFILE"
52+
else
53+
echo "ERROR: $SKIPFILE not found"
54+
exit 1
55+
fi
56+
done
57+
fi
4458
pytest_extra_args+=(
45-
"--skip-from-file=$TRITON_TEST_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt"
59+
"--skip-from-file=$SKIPFILES"
4660
"--select-fail-on-missing"
4761
)
4862
else

scripts/requirements-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tabulate
1414
pytest-xdist
1515
pytest-forked
1616
pytest-rerunfailures
17-
pytest-skip
17+
pytest-skip>=0.2.0
1818
pytest-timeout
1919

2020
# To set the process title to the name of the test

scripts/test-triton.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ OPTION:
3737
--warning-reports
3838
--ignore-errors
3939
--skip-list SKIPLIST
40+
--extra-skip-list-suffixes SEMICOLON-SEPARATED LIST OF SUFFIXES
4041
--select-from-file SELECTFILE
4142
"
4243

@@ -221,6 +222,10 @@ while (( $# != 0 )); do
221222
TRITON_TEST_SKIPLIST_DIR="$(mkdir -p "$2" && cd "$2" && pwd)"
222223
shift 2
223224
;;
225+
--extra-skip-list-suffixes)
226+
TRITON_EXTRA_SKIPLIST_SUFFIXES="$2"
227+
shift 2
228+
;;
224229
--select-from-file)
225230
# Must be absolute
226231
TRITON_TEST_SELECTFILE="$(realpath "$2")"

0 commit comments

Comments
 (0)