Skip to content

Commit

Permalink
Fix test-triton.sh to work in any directory (#2254)
Browse files Browse the repository at this point in the history
Previously the script worked only if Triton was cloned to
intel-xpu-backend-for-triton.

Fixes #2253.
  • Loading branch information
pbchekin authored Sep 14, 2024
1 parent aa9353a commit c39e896
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions scripts/test-triton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,14 @@ if [ "$TEST_UNIT" = false ] && [ "$TEST_CORE" = false ] && [ "$TEST_INTERPRETER"
TEST_MICRO_BENCHMARKS=true
fi

if [ ! -v BASE ]; then
echo "**** BASE is not given ****"
BASE=$(cd $(dirname "$0")/../.. && pwd)
echo "**** Default BASE is set to $BASE ****"
fi

if [ "$VENV" = true ]; then
source .venv/bin/activate
fi

SCRIPTS_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

TRITON_PROJ="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && cd .. && pwd )"
SCRIPTS_DIR="$TRITON_PROJ/scripts"
source "$SCRIPTS_DIR/pytest-utils.sh"
TRITON_PROJ=$BASE/intel-xpu-backend-for-triton

if [ "$TRITON_TEST_REPORTS" == true ]; then
capture_runtime_env
Expand Down

0 comments on commit c39e896

Please sign in to comment.