Skip to content

Commit

Permalink
[UT] add skiplist for PVC w/ rolling driver
Browse files Browse the repository at this point in the history
  • Loading branch information
AshburnLee committed May 11, 2024
1 parent 0ba7fae commit 33298aa
Show file tree
Hide file tree
Showing 4 changed files with 1,014 additions and 0 deletions.
47 changes: 47 additions & 0 deletions scripts/capture-hw-details.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,50 @@ if [ "$QUIET" = false ]; then
echo "AGAMA_VERSION=$AGAMA_VERSION"
echo "GPU_DEVICE=$GPU_DEVICE"
fi

agama_to_driver_type() {
local lts=(803)
local rolling=(821 775)

local agama=$1
local found="false"

for item in "${lts[@]}"; do
if [[ "$agama" -eq "$item" ]]; then
echo "ltd"
found="true"
break
fi
done

if [[ "$found" == "false" ]]; then
for item in "${rolling[@]}"; do
if [[ "$agama" -eq "$item" ]]; then
echo "rolling"
found="true"
break
fi
done
fi

if [ "$found" == "false" ]; then
echo "Driver type is unknown"
fi
}

xpu_is_pvc() {
local lables=("GPU Max 1100" "GPU Max 1550")
local xpu=$1
local found="false"

for device in "${lables[@]}"; do
if echo "$xpu" | grep -q "$device"; then
found="true"
break
fi
done
echo "$found"
}

GPU_DRIVER_TYPE=$(agama_to_driver_type "$AGAMA_VERSION")
IS_PVC=$(xpu_is_pvc "$GPU_DEVICE")
12 changes: 12 additions & 0 deletions scripts/pytest-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ TRITON_TEST_SKIPLIST_DIR="$(cd "$TRITON_TEST_SKIPLIST_DIR" && pwd)"
# absolute path for the current skip list
CURRENT_SKIPLIST_DIR="$SCRIPTS_DIR/skiplist/current"

PVC_DRIVER_SKIPLIST_DIR=""
source $SCRIPTS_DIR/capture-hw-details.sh -q
if [[ "$GPU_DRIVER_TYPE" == "rolling" && "$IS_PVC" == "true" ]]; then
PVC_DRIVER_SKIPLIST_DIR="$SCRIPTS_DIR/skiplist/pvc_rolling"
fi

pytest() {
pytest_extra_args=()

Expand All @@ -34,6 +40,12 @@ pytest() {
mkdir -p "$CURRENT_SKIPLIST_DIR"
# skip comments in the skiplist
sed -e '/^#/d' "$TRITON_TEST_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt" > "$CURRENT_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt"

# put skiplist/pvc_{rolling/lts}/language.txt to the current skiplist
if [[ $TRITON_TEST_SUITE == "language" && ! -z $PVC_DRIVER_SKIPLIST_DIR ]]; then
sed -e '/^#/d' "$PVC_DRIVER_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt" >> "$CURRENT_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt"
fi

pytest_extra_args+=(
"--deselect-from-file=$CURRENT_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt"
"--select-fail-on-missing"
Expand Down
Empty file.
Loading

0 comments on commit 33298aa

Please sign in to comment.