This PR - Fix numWarps>1 hang issue - add existing test cases in test_gemm.py to CI, and add a common flag `valid_on_Volta` to determine whether the test case should be activated on Volta or just skip. - Currently, the column-major cases are disabled. - Add test_core.py and other tests to Volta CI - the `test_printf.py` failed.
106 lines
3.4 KiB
YAML
106 lines
3.4 KiB
YAML
name: Integration Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- triton-mlir
|
|
|
|
jobs:
|
|
Runner-Preparation:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
steps:
|
|
- name: Prepare runner matrix
|
|
id: set-matrix
|
|
run: |
|
|
if [ x"${{ github.repository }}" == x"openai/triton" ]; then
|
|
echo '::set-output name=matrix::[["self-hosted", "A10"], ["self-hosted", "V100"], "macos-10.15"]'
|
|
else
|
|
echo '::set-output name=matrix::["ubuntu-latest", "macos-10.15"]'
|
|
fi
|
|
|
|
Integration-Tests:
|
|
needs: Runner-Preparation
|
|
|
|
runs-on: ${{ matrix.runner }}
|
|
|
|
strategy:
|
|
matrix:
|
|
runner: ${{fromJson(needs.Runner-Preparation.outputs.matrix)}}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Clear cache
|
|
run: |
|
|
rm -rf ~/.triton/cache/
|
|
|
|
- name: Check imports
|
|
if: startsWith(matrix.runner, 'ubuntu')
|
|
run: |
|
|
pip install isort
|
|
isort -c ./python || ( echo '::error title=Imports not sorted::Please run \"isort ./python\"' ; exit 1 )
|
|
|
|
- name: Check python style
|
|
if: startsWith(matrix.runner, 'ubuntu')
|
|
run: |
|
|
pip install autopep8
|
|
autopep8 -a -r -d --exit-code ./python || ( echo '::error title=Style issues::Please run \"autopep8 -a -r -i ./python\"' ; exit 1 )
|
|
|
|
- name: Check cpp style
|
|
if: startsWith(matrix.runner, 'ubuntu')
|
|
run: |
|
|
pip install clang-format
|
|
find . -regex '.*\.\(cpp\|hpp\|h\|cc\)' -not -path "./python/build/*" -not -path "./include/triton/external/*" -print0 | xargs -0 -n1 clang-format -style=file --dry-run -Werror -i ||
|
|
(echo '::error title=Style issues:: Please run `find . -regex ".*\.\(cpp\|hpp\|h\|cc\)" -not -path "./python/build/*" -not -path "./include/triton/external/*" -print0 | xargs -0 -n1 clang-format -style=file -i`' ; exit 1)
|
|
|
|
- name: Flake8
|
|
if: startsWith(matrix.runner, 'ubuntu')
|
|
run: |
|
|
pip install flake8
|
|
flake8 --config ./python/setup.cfg ./python || ( echo '::error::Flake8 failed; see logs for errors.' ; exit 1 )
|
|
|
|
- name: Install Triton
|
|
run: |
|
|
cd python
|
|
TRITON_USE_ASSERT_ENABLED_LLVM=TRUE pip3 install -e '.[tests]'
|
|
|
|
- name: Run lit tests
|
|
run: |
|
|
cd python
|
|
LIT_TEST_DIR="build/$(ls build)/test"
|
|
if [ ! -d "$LIT_TEST_DIR" ]; then
|
|
echo "Not found `$LIT_TEST_DIR`. Did you change an installation method?" ; exit -1
|
|
fi
|
|
lit -v "$LIT_TEST_DIR"
|
|
|
|
- name: Run python tests
|
|
if: ${{matrix.runner[0] == 'self-hosted' && matrix.runner[1] == 'A10'}}
|
|
run: |
|
|
cd python/tests
|
|
pytest
|
|
|
|
# TODO[Superjomn] Enable all the tests on V100 if available
|
|
- name: Run python tests on V100
|
|
if: ${{matrix.runner[0] == 'self-hosted' && matrix.runner[1] == 'V100'}}
|
|
run: |
|
|
cd python/tests
|
|
pytest -k "not test_where_broadcast and not test_dot" test_core.py
|
|
pytest test_gemm.py
|
|
pytest test_backend.py
|
|
pytest test_reduce.py
|
|
pytest test_vecadd.py
|
|
pytest test_elementwise.py
|
|
pytest test_ext_elemwise.py
|
|
pytest test_transpose.py
|
|
|
|
- name: Run CXX unittests
|
|
run: |
|
|
cd python/
|
|
cd "build/$(ls build)"
|
|
ctest
|