Skip to content

Unify attention dispatching #579

Unify attention dispatching

Unify attention dispatching #579

Workflow file for this run

# Copyright 2025 Advanced Micro Devices, Inc.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: CI - sharkfuser
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit). The workflow name is prepended to avoid conflicts between
# different workflows.
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
env:
SHARKFUSER_DIR: ${{ github.workspace }}/sharkfuser
DOCKER_DIR: ${{ github.workspace }}/docker
jobs:
build-and-test:
name: "Build & Test :: ${{ matrix.name }}"
runs-on: ${{ matrix.runs-on }}
defaults:
run:
# github actions swaps the {0} at the end for your script
shell: bash --noprofile --norc -exo pipefail {0}
strategy:
fail-fast: false
matrix:
name: ["Ubuntu (Clang 18, Release)", "Ubuntu (Clang 18, Debug)", "Ubuntu (GCC 13, Code Coverage)"]
include:
- name: Ubuntu (Clang 18, Release)
runs-on: ubuntu-24.04
cmake-options:
-DCMAKE_C_COMPILER=clang-18
-DCMAKE_CXX_COMPILER=clang++-18
-DCMAKE_LINKER_TYPE=LLD
-DSHARKFUSER_DEBUG_BUILD=OFF
-DSHARKFUSER_CODE_COVERAGE=OFF
- name: Ubuntu (Clang 18, Debug)
runs-on: ubuntu-24.04
cmake-options:
-DCMAKE_C_COMPILER=clang-18
-DCMAKE_CXX_COMPILER=clang++-18
-DCMAKE_LINKER_TYPE=LLD
-DSHARKFUSER_DEBUG_BUILD=ON
-DSHARKFUSER_CODE_COVERAGE=OFF
- name: Ubuntu (GCC 13, Code Coverage)
runs-on: ubuntu-24.04
cmake-options:
-DCMAKE_C_COMPILER=gcc-13
-DCMAKE_CXX_COMPILER=g++-13
-DSHARKFUSER_DEBUG_BUILD=OFF
-DSHARKFUSER_CODE_COVERAGE=ON
steps:
- name: Checkout sharkfuser
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout docker
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: sjain-stanford/docker
path: docker
ref: 57e046162842b7784d52c3a80035ca2609f1557a
- name: Build sharkfuser
working-directory: ${{ env.SHARKFUSER_DIR }}
run: |
${{ env.DOCKER_DIR }}/exec_docker.sh \
bash -c "cmake -GNinja -S. -Bbuild ${{ matrix.cmake-options }} && \
cmake --build build --target all"
- name: Test sharkfuser
if: ${{ matrix.name != 'Ubuntu (GCC 13, Code Coverage)' }}
working-directory: ${{ env.SHARKFUSER_DIR }}
run: |
${{ env.DOCKER_DIR }}/exec_docker.sh \
ctest --test-dir build --output-on-failure --extra-verbose --timeout 30
- name: Code coverage sharkfuser
if: ${{ matrix.name == 'Ubuntu (GCC 13, Code Coverage)' }}
working-directory: ${{ env.SHARKFUSER_DIR }}
run: |
${{ env.DOCKER_DIR }}/exec_docker.sh \
bash -c "ctest --test-dir build -T test -T coverage --timeout 30 && \
lcov --capture --directory build --output-file build/coverage.info && \
lcov --remove build/coverage.info '/usr/*' --output-file build/coverage.info && \
genhtml build/coverage.info --output-directory coverage_report"
- name: Upload code coverage report
if: ${{ matrix.name == 'Ubuntu (GCC 13, Code Coverage)' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-report
path: ${{ env.SHARKFUSER_DIR }}/coverage_report
# Depends on all other jobs to provide an aggregate job status.
ci_sharkfuser_summary:
if: always()
runs-on: ubuntu-24.04
needs:
- build-and-test
steps:
- name: Getting failed jobs
run: |
echo '${{ toJson(needs) }}'
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
| jq --raw-output \
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
)"
if [[ "${FAILED_JOBS}" != "" ]]; then
echo "The following jobs failed: ${FAILED_JOBS}"
exit 1
fi