-
Notifications
You must be signed in to change notification settings - Fork 25
103 lines (89 loc) · 3.21 KB
/
ci_linux_x64_nogil-libshortfin.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# 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 - Python 3.13 Free-threaded
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/ci_linux_x64-libshortfin.yml'
- 'shortfin/**'
push:
branches:
- main
paths:
- '.github/workflows/ci_linux_x64-libshortfin.yml'
- 'shortfin/**'
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:
IREE_REPO_DIR: ${{ github.workspace }}/iree
LIBSHORTFIN_DIR: ${{ github.workspace }}/shortfin/
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install clang lld cmake ninja-build
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: false
- name: Checkout IREE repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: iree-org/iree
path: ${{ env.IREE_REPO_DIR }}
submodules: false
ref: candidate-20241025.1058
- name: Initalize IREE submodules
working-directory: ${{ env.IREE_REPO_DIR }}
run : |
git submodule update --init --depth 1 -- third_party/benchmark
git submodule update --init --depth 1 -- third_party/cpuinfo/
git submodule update --init --depth 1 -- third_party/flatcc
git submodule update --init --depth 1 -- third_party/googletest
git submodule update --init --depth 1 -- third_party/hip-build-deps/
- name: Setup Python
uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0
with:
python-version: "3.13-dev"
nogil : true
- name: Install Python packages
run: |
pip install -r ${{ env.LIBSHORTFIN_DIR }}/requirements-tests-nogil.txt
pip freeze
- name: Build shortfin (full)
working-directory: ${{ env.LIBSHORTFIN_DIR }}
run: |
mkdir build
cmake -GNinja \
-S. \
-Bbuild \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_LINKER_TYPE=LLD \
-DSHORTFIN_BUNDLE_DEPS=ON \
-DSHORTFIN_IREE_SOURCE_DIR="${{ env.IREE_REPO_DIR }}" \
-DSHORTFIN_BUILD_PYTHON_BINDINGS=ON
cmake --build build --target all
pip install -v -e build/
- name: Run shortfin Python tests (full)
working-directory: ${{ env.LIBSHORTFIN_DIR }}
run: |
pytest -s --ignore=tests/examples/fastapi_test.py --ignore=tests/apps/llm/components/cache_test.py
# TODO: Enable further tests and switch to
# pytest -s