Skip to content

Build and Test

Build and Test #128

Workflow file for this run

name: Build and Test
on:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 8 * * *"
jobs:
build:
runs-on: mi300
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: "true"
- name: Update IREE
run: |
cd $GITHUB_WORKSPACE/third_party/iree
git submodule update --init
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v1
- name: Set up Ninja
uses: ashutoshvarma/setup-ninja@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: Build LLVM Project
run: |
cd $GITHUB_WORKSPACE/third_party/llvm-project
cmake -G Ninja -B $GITHUB_WORKSPACE/third_party/llvm-project/build/ -S llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="mlir;clang"
cmake --build $GITHUB_WORKSPACE/third_party/llvm-project/build/
- name: Build IREE Kernels
run: |
cd $GITHUB_WORKSPACE/src/ireekernels
cmake -G Ninja -B $GITHUB_WORKSPACE/src/ireekernelsbuild
cmake --build $GITHUB_WORKSPACE/src/ireekernelsbuild
- name: Build Main Project
run: |
cd $GITHUB_WORKSPACE
CXX=hipcc meson setup build
cd $GITHUB_WORKSPACE/build
sudo ninja
cd $GITHUB_WORKSPACE
mkdir -p results
- name: Set up Python environment
run: |
python3 -m venv $GITHUB_WORKSPACE/venv
source $GITHUB_WORKSPACE/venv/bin/activate
pip install -r $GITHUB_WORKSPACE/gemmbench/requirements.txt
deactivate
- name: Run RocBLAS Benchmarks
run: |
sudo pkill -f gemm-bench
cd $GITHUB_WORKSPACE
source $GITHUB_WORKSPACE/venv/bin/activate
for device in $(seq 3 7); do (sudo $GITHUB_WORKSPACE/build/gemm-bench --device=$device &); done
./gb run --backends=rocblas --repeat=1 --output=results/rocblas.csv
sudo pkill -f gemm-bench
deactivate
- name: Run HipBLASLt Benchmarks
run: |
sudo pkill -f gemm-bench
cd $GITHUB_WORKSPACE
source $GITHUB_WORKSPACE/venv/bin/activate
for device in $(seq 3 7); do (sudo $GITHUB_WORKSPACE/build/gemm-bench --device=$device &); done
./gb run --backends=hipblaslt --repeat=1 --output=results/hipblaslt.csv
sudo pkill -f gemm-bench
deactivate
- name: Run IREE Benchmarks
run: |
sudo pkill -f gemm-bench
cd $GITHUB_WORKSPACE
source $GITHUB_WORKSPACE/venv/bin/activate
for device in $(seq 3 7); do (sudo $GITHUB_WORKSPACE/build/gemm-bench --device=$device &); done
./gb run --backends=iree --repeat=1 --output=results/iree.csv
sudo pkill -f gemm-bench
deactivate
- name: Run SHARK Attention Benchmarks
run: |
sudo pkill -f gemm-bench
cd $GITHUB_WORKSPACE
source $GITHUB_WORKSPACE/venv/bin/activate
for device in $(seq 3 7); do (sudo $GITHUB_WORKSPACE/build/gemm-bench --device=$device &); done
./gb run --backends=sharkfa --suite=flash_attention --repeat=1 --output=results/sharkfa_llama_sdxl_attention.csv
sudo pkill -f gemm-bench
deactivate
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: ./results/