[fusili] Dependency cleanup (remove IREE/LLVM/Catch2 source builds, bring in lit
& filecheck
standalone)
#5875
Workflow file for this run
This file contains hidden or 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
# Copyright 2024 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 - shortfin | |
on: | |
workflow_dispatch: | |
pull_request: | |
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: | |
LIBSHORTFIN_DIR: ${{ github.workspace }}/shortfin/ | |
jobs: | |
build-and-test: | |
name: "Unit tests :: ${{ matrix.name }} :: ${{ matrix.python-version }}" | |
runs-on: ${{ matrix.runs-on }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
name: ["Ubuntu (Clang)(full)", "Ubuntu (Clang)(host-only)", "Windows (MSVC)"] | |
python-version: ["3.10", "3.11", "3.12"] | |
include: | |
- name: Ubuntu (Clang)(full) | |
runs-on: ubuntu-24.04 | |
cmake-options: | |
-DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_LINKER_TYPE=LLD | |
additional-packages: clang lld | |
env: | |
SHORTFIN_ENABLE_TRACING: OFF | |
SHORTFIN_PY_RUNTIME: default | |
- name: Ubuntu (Clang)(host-only) | |
runs-on: ubuntu-24.04 | |
# In this configuration, also build static+dynamic in order to verify | |
# that path structurally works. | |
cmake-options: | |
-DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_LINKER_TYPE=LLD -DSHORTFIN_HAVE_AMDGPU=OFF -DSHORTFIN_BUILD_STATIC=ON -DSHORTFIN_BUILD_DYNAMIC=ON | |
additional-packages: clang lld | |
env: | |
SHORTFIN_ENABLE_TRACING: OFF | |
SHORTFIN_PY_RUNTIME: default | |
- name: Ubuntu (GCC 13) | |
runs-on: ubuntu-24.04 | |
# Only test with GCC 13 and Python 3.12 | |
python-version: "3.12" | |
cmake-options: | |
-DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13 | |
env: | |
SHORTFIN_ENABLE_TRACING: OFF | |
SHORTFIN_PY_RUNTIME: default | |
- name: Ubuntu (GCC 14) | |
runs-on: ubuntu-24.04 | |
# Only test with GCC 14 and Python 3.12 | |
python-version: "3.12" | |
cmake-options: | |
-DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 | |
env: | |
SHORTFIN_ENABLE_TRACING: OFF | |
SHORTFIN_PY_RUNTIME: default | |
- name: Ubuntu (GCC 14, tracing) | |
runs-on: ubuntu-24.04 | |
# Only test with GCC 14 and Python 3.12 | |
python-version: "3.12" | |
cmake-options: | |
-DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 -DSHORTFIN_ENABLE_TRACING=ON | |
tracing: true | |
env: | |
SHORTFIN_ENABLE_TRACING: ON | |
SHORTFIN_PY_RUNTIME: tracy | |
- name: Windows (MSVC) | |
runs-on: windows-2022 | |
env: | |
SHORTFIN_ENABLE_TRACING: OFF | |
SHORTFIN_PY_RUNTIME: default | |
exclude: | |
# TODO: Include additional Python versions for Windows after build got fixed | |
- name: Windows (MSVC) | |
python-version: "3.10" | |
- name: Windows (MSVC) | |
python-version: "3.11" | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Forward matrix environment variables | |
run: | | |
echo "SHORTFIN_ENABLE_TRACING=${{ matrix.env.SHORTFIN_ENABLE_TRACING }}" >> $GITHUB_ENV | |
echo "SHORTFIN_PY_RUNTIME=${{ matrix.env.SHORTFIN_PY_RUNTIME }}" >> $GITHUB_ENV | |
- name: (Linux) Install dependencies | |
if: "runner.os == 'Linux'" | |
run: | | |
sudo apt update | |
sudo apt install cmake ninja-build ${{matrix.additional-packages}} | |
- name: (Windows) Configure MSVC | |
if: "runner.os == 'Windows'" | |
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 | |
- name: "Setup Python ${{ matrix.python-version }}" | |
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: | | |
'shortfin/requirements-tests.txt' | |
'requirements-iree-pinned.txt' | |
- name: Install Python packages | |
working-directory: ${{ env.LIBSHORTFIN_DIR }} | |
run: | | |
pip install -r requirements-tests.txt | |
pip install -r ../requirements-iree-pinned.txt | |
pip freeze | |
- name: Build shortfin | |
working-directory: ${{ env.LIBSHORTFIN_DIR }} | |
run: | | |
mkdir build | |
cmake -GNinja \ | |
-S. \ | |
-Bbuild \ | |
-DSHORTFIN_BUILD_PYTHON_BINDINGS=ON \ | |
${{matrix.cmake-options}} | |
cmake --build build --target all | |
- name: pip install shortfin | |
if: ${{ matrix.name != 'Ubuntu (Clang)(host-only)' }} | |
working-directory: ${{ env.LIBSHORTFIN_DIR }} | |
run: | | |
pip install -v -e build/ | |
- name: Test shortfin | |
if: ${{ matrix.name != 'Ubuntu (Clang)(host-only)' && !matrix.tracing }} | |
working-directory: ${{ env.LIBSHORTFIN_DIR }} | |
run: | | |
ctest --timeout 30 --output-on-failure --test-dir build | |
pytest -s --durations=10 --timeout=30 | |
- name: Test tracing shortfin | |
if: matrix.tracing | |
working-directory: ${{ env.LIBSHORTFIN_DIR }} | |
run: | | |
pytest \ | |
--durations=0 \ | |
--timeout=30 \ | |
--log-cli-level=info \ | |
tests/invocation/mobilenet_tracing_test.py | |
# Depends on all other jobs to provide an aggregate job status. | |
ci_libshortfin_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 |