-
Notifications
You must be signed in to change notification settings - Fork 3.5k
192 lines (182 loc) · 6.5 KB
/
main.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# GH actions.
# We use it to cover windows and mac builds
# Jenkins is still the primary CI
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: CI-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
MacOS:
if: ${{ github.repository == 'apache/tvm' }}
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Conda Build
shell: bash -l {0}
run: >-
conda build --output-folder=conda/pkg conda/recipe &&
conda install tvm -c ./conda/pkg
- name: Build iOS RPC
run: |
IOS_VERSION="14.0"
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_SYSTEM_VERSION=${IOS_VERSION} \
-DCMAKE_OSX_SYSROOT=iphonesimulator \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON \
-DUSE_IOS_RPC=ON"
mkdir build-ios-simulator
cd build-ios-simulator
cmake .. ${CMAKE_FLAGS}
cmake --build . --target ios_rpc
- name: Test
shell: bash -l {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test
- name: Minimal Metal Compile-Only
shell: bash -l {0}
run: |
python -m pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum_compile'
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py::test_func_with_trailing_pod_params'
- name: Minimal Metal Compile-and-Run
shell: bash -l {0}
run: >-
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py'
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_gpu_common.py'
python -m pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum[dims0-metal]'
# - name: Test iOS RPC
# shell: bash -l {0}
# run: >-
# python -m pip install tornado psutil cloudpickle &&
# export PYTHONPATH=tests/python/contrib:${PYTHONPATH} &&
# export BUNDLE_ID=org.apache.tvmrpc &&
# export BUNDLE_PATH=build-ios-simulator/apps/ios_rpc/ios_rpc/src/ios_rpc-build/Release-iphonesimulator/tvmrpc.app &&
# python -m pytest -v tests/python/contrib/test_rpc_server_device.py
Windows:
if: ${{ github.repository == 'apache/tvm' }}
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Conda Build
shell: cmd /C call {0}
run: >-
conda build --output-folder=conda/pkg conda/recipe &&
conda install tvm -c ./conda/pkg
- name: Test
shell: cmd /C call {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test
# Disabled due to https://github.com/apache/tvm/issues/13950
# Windows-Static-Runtime:
# if: ${{ github.repository == 'apache/tvm' }}
# runs-on: windows-2019
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: 'recursive'
# - name: Set up environment
# uses: ./.github/actions/setup
# - name: Build static TVM runtime
# shell: bash -l {0}
# run: |
# tests/scripts/task_config_build_static.sh build
# cd build
# cmake .. -A x64 -DCMAKE_CONFIGURATION_TYPES="Release"
# cmake --build . --config Release --target runtime
Linux-Static-Runtime:
if: ${{ github.repository == 'apache/tvm' }}
runs-on: Ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Build static TVM runtime
shell: bash -l {0}
run: |
tests/scripts/task_config_build_static.sh build
cd build
cmake ..
cmake --build . --config Release --target runtime
Android:
if: ${{ github.repository == 'apache/tvm' }}
runs-on: Ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Set up java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Build TVM
shell: bash -l {0}
run: |
mkdir build
cd build
../tests/scripts/task_config_build_jvm.sh .
cmake ..
make
- name: Build TVM4J
run: |
make jvmpkg
- name: Build android_rpc
working-directory: apps/android_rpc
run: |
set -eux
export PATH="${ANDROID_NDK_LATEST_HOME}:$PATH"
gradle clean build
- name: Upload android_rpc APK
uses: actions/upload-artifact@v4
with:
name: android_rpc-debug.apk
path: ./apps/android_rpc/app/build/outputs/apk/debug/app-debug.apk
- name: Build android_deploy
working-directory: apps/android_deploy
run: |
set -eux
export PATH="${ANDROID_NDK_LATEST_HOME}:$PATH"
gradle clean build
- name: Upload android_deploy APK
uses: actions/upload-artifact@v4
with:
name: android_deploy-debug.apk
path: ./apps/android_deploy/app/build/outputs/apk/debug/app-debug.apk