Flash attention #35
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: Build and Test | |
on: | |
pull_request: | |
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 | |
- 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=rocblas.hdf | |
sudo pkill -f gemm-bench | |
deactivate | |
- name: Run IREE Benchmarks | |
run: | | |
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=iree.hdf | |
sudo pkill -f gemm-bench | |
deactivate | |
- name: Upload IREE benchmark results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: iree-benchmark-results | |
path: iree.hdf | |
- name: Upload RocBLAS benchmark results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rocblas-benchmark-results | |
path: rocblas.hdf |