From d7b099453ba16cbe4a8221b745e238b877a9b16c Mon Sep 17 00:00:00 2001 From: Whitney Tsang Date: Sat, 6 Dec 2025 21:26:28 +0000 Subject: [PATCH] Split test_matmul.py from triton_kernels Signed-off-by: Whitney Tsang --- .github/workflows/build-test-reusable.yml | 6 +++ .github/workflows/build-test-windows.yml | 7 +++ .github/workflows/pip-test-windows.yml | 7 +++ .github/workflows/pip-test.yml | 4 ++ ..._kernels.txt => triton_kernels_matmul.txt} | 0 ..._kernels.txt => triton_kernels_matmul.txt} | 0 ..._kernels.txt => triton_kernels_matmul.txt} | 0 scripts/skiplist/default/triton_kernels.txt | 0 scripts/skiplist/lts/triton_kernels.txt | 0 ..._kernels.txt => triton_kernels_matmul.txt} | 0 scripts/skiplist/xe2/triton_kernels.txt | 0 scripts/test-triton.sh | 45 ++++++++++++++++--- 12 files changed, 63 insertions(+), 6 deletions(-) rename scripts/skiplist/a770/{triton_kernels.txt => triton_kernels_matmul.txt} (100%) rename scripts/skiplist/arl-h/{triton_kernels.txt => triton_kernels_matmul.txt} (100%) rename scripts/skiplist/arl-s/{triton_kernels.txt => triton_kernels_matmul.txt} (100%) delete mode 100644 scripts/skiplist/default/triton_kernels.txt delete mode 100644 scripts/skiplist/lts/triton_kernels.txt rename scripts/skiplist/mtl/{triton_kernels.txt => triton_kernels_matmul.txt} (100%) delete mode 100644 scripts/skiplist/xe2/triton_kernels.txt diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index b12c009b87..e186624c63 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -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' diff --git a/.github/workflows/build-test-windows.yml b/.github/workflows/build-test-windows.yml index beadb7f8a4..269676bcd2 100644 --- a/.github/workflows/build-test-windows.yml +++ b/.github/workflows/build-test-windows.yml @@ -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 diff --git a/.github/workflows/pip-test-windows.yml b/.github/workflows/pip-test-windows.yml index 5d1a0d4974..eb5ade7e08 100644 --- a/.github/workflows/pip-test-windows.yml +++ b/.github/workflows/pip-test-windows.yml @@ -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 diff --git a/.github/workflows/pip-test.yml b/.github/workflows/pip-test.yml index 9f6f5b1d5a..db3562637c 100644 --- a/.github/workflows/pip-test.yml +++ b/.github/workflows/pip-test.yml @@ -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 diff --git a/scripts/skiplist/a770/triton_kernels.txt b/scripts/skiplist/a770/triton_kernels_matmul.txt similarity index 100% rename from scripts/skiplist/a770/triton_kernels.txt rename to scripts/skiplist/a770/triton_kernels_matmul.txt diff --git a/scripts/skiplist/arl-h/triton_kernels.txt b/scripts/skiplist/arl-h/triton_kernels_matmul.txt similarity index 100% rename from scripts/skiplist/arl-h/triton_kernels.txt rename to scripts/skiplist/arl-h/triton_kernels_matmul.txt diff --git a/scripts/skiplist/arl-s/triton_kernels.txt b/scripts/skiplist/arl-s/triton_kernels_matmul.txt similarity index 100% rename from scripts/skiplist/arl-s/triton_kernels.txt rename to scripts/skiplist/arl-s/triton_kernels_matmul.txt diff --git a/scripts/skiplist/default/triton_kernels.txt b/scripts/skiplist/default/triton_kernels.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/scripts/skiplist/lts/triton_kernels.txt b/scripts/skiplist/lts/triton_kernels.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/scripts/skiplist/mtl/triton_kernels.txt b/scripts/skiplist/mtl/triton_kernels_matmul.txt similarity index 100% rename from scripts/skiplist/mtl/triton_kernels.txt rename to scripts/skiplist/mtl/triton_kernels_matmul.txt diff --git a/scripts/skiplist/xe2/triton_kernels.txt b/scripts/skiplist/xe2/triton_kernels.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/scripts/test-triton.sh b/scripts/test-triton.sh index 18cecb4186..52935216ac 100755 --- a/scripts/test-triton.sh +++ b/scripts/test-triton.sh @@ -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 @@ -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 @@ -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 @@ -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 @@ -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() { @@ -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