Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build-test-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ jobs:
export PYTEST_MAX_PROCESSES=4
${{ env.TRITON_TEST_CMD }} --triton-kernels

- name: Run triton kernels matmul tests
if: matrix.suite == 'triton-kernels'
run: |
export PYTEST_MAX_PROCESSES=4
${{ env.TRITON_TEST_CMD }} --triton-kernels-matmul

# FIXME: make sure new tutorials are added to one of the groups (scaled_dot, rest, tutorial-faX)
- name: Select tutorials to run (scaled_dot)
if: matrix.suite == 'scaled_dot'
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ jobs:
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --triton-kernels

- name: Run triton kernels matmul tests
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --triton-kernels-matmul

- name: Run interpreter tests
run: |
.venv\Scripts\activate.ps1
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pip-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ jobs:
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --triton-kernels

- name: Run triton kernels matmul tests
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --triton-kernels-matmul

- name: Run tutorials
run: |
.venv\Scripts\activate.ps1
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pip-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ jobs:
run: |
${{ env.TRITON_TEST_CMD }} --triton-kernels --skip-pip-install

- name: Run triton kernels matmul tests
run: |
${{ env.TRITON_TEST_CMD }} --triton-kernels-matmul --skip-pip-install

- name: Run Tutorials
run: |
${{ env.TRITON_TEST_CMD }} --tutorial --skip-pip-install
Expand Down
Empty file.
Empty file.
Empty file.
45 changes: 39 additions & 6 deletions scripts/test-triton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ HELP="\
Example usage: ./test-triton.sh [TEST]... [OPTION]...

TEST:
--unit default
--core default
--tutorial default
--microbench default
--triton-kernels default
--unit default
--core default
--tutorial default
--microbench default
--triton-kernels default
--triton-kernels-matmul default
--minicore part of core
--mxfp part of core
--scaled-dot part of core
Expand Down Expand Up @@ -79,6 +80,7 @@ INSTALL_LIGER=false
TEST_VLLM=false
INSTALL_VLLM=false
TEST_TRITON_KERNELS=false
TEST_TRITON_KERNELS_MATMUL=false
VENV=false
TRITON_TEST_REPORTS=false
TRITON_TEST_WARNING_REPORTS=false
Expand Down Expand Up @@ -229,6 +231,11 @@ while (( $# != 0 )); do
TEST_DEFAULT=false
shift
;;
--triton-kernels-matmul)
TEST_TRITON_KERNELS_MATMUL=true
TEST_DEFAULT=false
shift
;;
--venv)
VENV=true
shift
Expand Down Expand Up @@ -289,6 +296,7 @@ if [ "$TEST_DEFAULT" = true ]; then
TEST_TUTORIAL=true
TEST_MICRO_BENCHMARKS=true
TEST_TRITON_KERNELS=true
TEST_TRITON_KERNELS_MATMUL=true
fi

if [ "$VENV" = true ]; then
Expand Down Expand Up @@ -734,7 +742,29 @@ run_triton_kernels_tests() {
fi
# skipping mxfp, they are part of mxfp_tests suite
TRITON_TEST_SUITE=triton_kernels \
run_pytest_command -vvv -n $max_procs --device xpu . -k 'not test_mxfp'
run_pytest_command -vvv -n $max_procs --device xpu . -k 'not test_mxfp' --ignore=test_matmul.py
}

run_triton_kernels_matmul_tests() {
echo "***************************************************"
echo "**** Running Triton Kernels matmul tests ****"
echo "***************************************************"
cd $TRITON_PROJ/python/triton_kernels/tests

# available after `capture_runtime_env` call
gpu_file="$TRITON_TEST_REPORTS_DIR/gpu.txt"
# BMG, LNL, ARLs, A770
if [[ -f "$gpu_file" ]] && grep -Eq "(B580|64a0|7d6|7d5|770)" "$gpu_file"; then
# Using any other number of processes results in an error on small GPUs due to insufficient resources.
# FIXME: reconsider in the future
max_procs=1
else
# Using any other number of processes results in an error on the PVC due to insufficient resources.
# FIXME: reconsider in the future
max_procs=${PYTEST_MAX_PROCESSES:-4}
fi
TRITON_TEST_SUITE=triton_kernels_matmul \
run_pytest_command -vvv -n $max_procs --device xpu test_matmul.py
}

test_triton() {
Expand Down Expand Up @@ -811,6 +841,9 @@ test_triton() {
if [ "$TEST_TRITON_KERNELS" == true ]; then
run_triton_kernels_tests
fi
if [ "$TEST_TRITON_KERNELS_MATMUL" == true ]; then
run_triton_kernels_matmul_tests
fi
}

install_deps
Expand Down