[Triton-MLIR] add GitHub CI runners (#655)
This PR is to add GitHub Actions runners to the CI for better coverage.
This commit is contained in:
32
.github/workflows/integration-tests.yml
vendored
32
.github/workflows/integration-tests.yml
vendored
@@ -4,13 +4,33 @@ on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- triton-mlir
|
||||
|
||||
jobs:
|
||||
|
||||
Integration-Tests:
|
||||
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"], "macos-latest"]'
|
||||
else
|
||||
echo '::set-output name=matrix::["ubuntu-latest", "macos-latest"]'
|
||||
fi
|
||||
|
||||
runs-on: [self-hosted, A10]
|
||||
Integration-Tests:
|
||||
needs: Runner-Preparation
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
runner: ${{fromJson(needs.Runner-Preparation.outputs.matrix)}}
|
||||
|
||||
steps:
|
||||
|
||||
@@ -19,26 +39,29 @@ jobs:
|
||||
|
||||
- name: Clear cache
|
||||
run: |
|
||||
rm -r ~/.triton/cache/
|
||||
continue-on-error: true
|
||||
rm -rf ~/.triton/cache/
|
||||
|
||||
- name: Check imports
|
||||
if: ${{ matrix.runner != 'macos-latest' }}
|
||||
run: |
|
||||
pip install isort
|
||||
isort -c ./python || ( echo '::error title=Imports not sorted::Please run \"isort ./python\"' ; exit 1 )
|
||||
|
||||
- name: Check python style
|
||||
if: ${{ matrix.runner != 'macos-latest' }}
|
||||
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: ${{ matrix.runner != 'macos-latest' }}
|
||||
run: |
|
||||
sudo apt-get install -y 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: ${{ matrix.runner != 'macos-latest' }}
|
||||
run: |
|
||||
pip install flake8
|
||||
flake8 --config ./python/setup.cfg ./python || ( echo '::error::Flake8 failed; see logs for errors.' ; exit 1 )
|
||||
@@ -59,6 +82,7 @@ jobs:
|
||||
lit -v "$LIT_TEST_DIR"
|
||||
|
||||
- name: Run python tests
|
||||
if: ${{ matrix.runner[0] == 'self-hosted' }}
|
||||
run: |
|
||||
cd python/tests
|
||||
pytest
|
||||
|
@@ -123,7 +123,7 @@ struct PTXBuilder {
|
||||
|
||||
Operand *newAddrOperand(mlir::Value addr, StringRef constraint, int off = 0);
|
||||
|
||||
llvm::SmallVector<Operand *> getAllArgs() const;
|
||||
llvm::SmallVector<Operand *, 4> getAllArgs() const;
|
||||
|
||||
llvm::SmallVector<Value, 4> getAllMLIRArgs() const;
|
||||
|
||||
|
@@ -48,8 +48,15 @@ protected:
|
||||
initializer();
|
||||
if (cache == nullptr) {
|
||||
cache = dlsym(lib_h, name);
|
||||
if (cache == 0)
|
||||
if (cache == 0) {
|
||||
#ifdef __EXCEPTIONS
|
||||
throw std::runtime_error("dlsym unable to load function");
|
||||
#else
|
||||
std::cerr << "Triton: dlsym unable to load function `" << name << "`"
|
||||
<< std::endl;
|
||||
std::abort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
FunPtrT fptr;
|
||||
*reinterpret_cast<void **>(&fptr) = cache;
|
||||
|
@@ -66,7 +66,7 @@ llvm::SmallVector<Value, 4> PTXBuilder::getAllMLIRArgs() const {
|
||||
return res;
|
||||
}
|
||||
|
||||
SmallVector<PTXBuilder::Operand *> PTXBuilder::getAllArgs() const {
|
||||
SmallVector<PTXBuilder::Operand *, 4> PTXBuilder::getAllArgs() const {
|
||||
llvm::SmallVector<Operand *, 4> res;
|
||||
for (auto &x : argArchive)
|
||||
if (!x->isList())
|
||||
|
Reference in New Issue
Block a user