Implemented tiling and fusion path for GPU #1389
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: check clang-tidy | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
jobs: | |
clang_tidy: | |
runs-on: "ubuntu-latest" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Install OpenMP | |
run: "sudo apt install -y libomp-dev opencl-c-headers" | |
- name: Fetch sources | |
uses: actions/checkout@v4 | |
with: | |
path: 'graph-compiler' | |
fetch-depth: 0 | |
submodules: true | |
- name: Fetch code tidy utils | |
uses: actions/checkout@v4 | |
with: | |
repository: 'llvm/llvm-project' | |
ref: 'main' | |
sparse-checkout: | | |
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | |
mlir/python/requirements.txt | |
mlir/.clang-tidy | |
sparse-checkout-cone-mode: false | |
path: llvm-project | |
- name: Read llvm version and run id | |
shell: bash | |
run: | | |
echo LLVM_HASH=$(cat graph-compiler/cmake/llvm-version.txt) >> $GITHUB_ENV | |
- name: Fetch llvm artifact | |
run: | | |
gh run download \ | |
--repo ${{ github.repository }} \ | |
-n "llvm-${{ env.LLVM_HASH }}" \ | |
--dir llvm | |
tar -zxf llvm/llvm.tgz | |
- name: Unwrap pre-built llvm | |
run: | | |
cd llvm | |
tar -zxf llvm.tgz | |
- name: Get merge base | |
run: | | |
cd graph-compiler | |
echo "MERGE_BASE=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV | |
- name: Get changed files | |
run: | | |
cd graph-compiler | |
echo "CHANGED_FILES=$(git diff --name-only --diff-filter=d $MERGE_BASE ${{ github.event.pull_request.head.sha }} | paste -sd' ')" >> $GITHUB_ENV | |
- name: Prepare Environment | |
shell: bash | |
run: | | |
python3 -m pip install -r llvm-project/mlir/python/requirements.txt | |
python3 -m pip install lit | |
- name: Prepare compile commands | |
shell: bash | |
run: | | |
mkdir build | |
cd build | |
cmake ../graph-compiler \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DMLIR_DIR=$(pwd)/../llvm/lib/cmake/mlir \ | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=True \ | |
-DCMAKE_C_COMPILER=$(which clang) \ | |
-DCMAKE_CXX_COMPILER=$(which clang++) \ | |
-DLLVM_EXTERNAL_LIT=$(which lit) \ | |
-DDNNL_USE_CLANG_SANITIZER="Undefined" | |
- name: Prepare inc file | |
run: | | |
cd build | |
for f in $(find ./include -name Makefile); do | |
set +e; | |
targets=$(make -f $f help |grep IncGen); | |
if [[ $? -eq 0 ]]; then | |
set -e; | |
for target in $targets; do | |
cd ${f%Makefile} && make ${target#...} && cd -; | |
done | |
fi ; | |
set -e; | |
done | |
- name: Perform clang-tidy check | |
shell: bash | |
run: | | |
cd build | |
python3 ../llvm-project/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -warnings-as-errors=* -p ./ -config-file ../llvm-project/mlir/.clang-tidy -clang-tidy-binary $(which clang-tidy-15) ${{ env.CHANGED_FILES }} |