-
Notifications
You must be signed in to change notification settings - Fork 34
225 lines (189 loc) · 7.03 KB
/
run_ock_demo.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# Build, Run and Test OCK Demo EcoSystem
name: Build and Run OCK Demo
on:
pull_request:
paths:
- '.github/workflows/run_ock_demo.yml'
push:
branches:
- stable
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# build and run for RISCV
run_riscv_m1_ock_demo:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
# installs tools, ninja, installs llvm and sets up sccahe
- name: setup ubuntu
uses: ./.github/actions/setup_ubuntu_build
with:
llvm_version: 17
llvm_build_type: RelAssert
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install Python libraries and system dependencies
run: |
pip install --user requests numpy h5py Pillow
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install -y libblas-dev libopenblas64-dev libopenblas-dev libpthread-stubs0-dev libboost-all-dev
- name: Build riscv M1
uses: ./.github/actions/do_build_ock/do_build_m1
with:
build_type: Release
extra_flags: '-DCA_REFSI_M1_DEMO_MODE=ON'
- name: Create OCK install
run: |
ninja -C $(pwd)/build install
- name: Get Intel OneAPI Nightly Release
run: |
# Update the nightly release from intel/llvm from 2024-03-04 to daily once
# everything has stablized
wget "https://github.com/intel/llvm/releases/download/nightly-2024-03-04/sycl_linux.tar.gz"
mkdir linux_nightly_release
tar -xzf sycl_linux.tar.gz -C linux_nightly_release
- name: Test RSICV examples
run: |
# Set environment variables
export LD_LIBRARY_PATH=$(pwd)/install/lib:$(pwd)/linux_nightly_release/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++
export CMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang
export CA_HAL_DEBUG=1
export CA_PROFILE_LEVEL=3
export ONEAPI_DEVICE_SELECTOR=opencl:fpga
export OCL_ICD_FILENAMES=$(pwd)/install/lib/libCL.so
# As the oneAPI basetoolkit release has a whitelist of devices, it filters out RefSi.
# To override it, as a temporary solution we can point SYCL_CONFIG_FILE_NAME to ``.
# This way it doesn't set the default sycl.conf.
export SYCL_CONFIG_FILE_NAME=""
mkdir ock_example_tests
cmake -GNinja -Bock_example_tests -DCMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++ -DCMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang -DOpenCL_LIBRARY=$(pwd)/install/lib/libCL.so -DOpenCL_INCLUDE_DIR=$(pwd)/intel/oneapi/compiler/2024.0/include/sycl $(pwd)/examples/applications
ninja -C ock_example_tests
# Run tests
cd ock_example_tests
ctest bin/ --verbose
cd ..
mv ock_example_tests/bin install/tests
- name: Package build artifacts
run: |
mv install ock_install_dir
tar -cvzf ock_demo_artifacts.tar.gz ock_install_dir -C examples/technical_blogs/ock_demo_blog getting_started.md envvars
- name: Upload OCK artifacts
uses: actions/upload-artifact@v4
with:
name: ock_demo_build
path: ock_demo_artifacts.tar.gz
build_portBLAS:
runs-on: ubuntu-22.04
needs: run_riscv_m1_ock_demo
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Download OCK artifacts
uses: actions/download-artifact@v4
with:
name: ock_demo_build
- name: Untar artifacts
run: |
tar -xvzf ock_demo_artifacts.tar.gz
- name: Build portBLAS
uses: ./.github/actions/build_portBLAS_action
with:
workspace: ${{ github.workspace }}
build_portDNN:
runs-on: ubuntu-22.04
needs: run_riscv_m1_ock_demo
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Download OCK artifacts
uses: actions/download-artifact@v4
with:
name: ock_demo_build
- name: Untar artifacts
run: |
tar -xvzf ock_demo_artifacts.tar.gz
rm ock_demo_artifacts.tar.gz
df .
- name: Build portDNN
uses: ./.github/actions/build_portDNN_action
with:
workspace: ${{ github.workspace }}
build_and_run_networks:
runs-on: ubuntu-22.04
needs: [run_riscv_m1_ock_demo, build_portDNN]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Download OCK artifacts
uses: actions/download-artifact@v4
with:
name: ock_demo_build
- name: Download portDNN build artifacts
uses: actions/download-artifact@v4
with:
name: portDNN_build
- name: Untar artifacts
run: |
tar -xvzf ock_demo_artifacts.tar.gz
tar -xvzf portDNN_build.tar.gz
- name: Build vgg and resnet
uses: ./.github/actions/build_vgg_resnet_action
with:
workspace: ${{ github.workspace }}
publish_OCK_demo_artifacts:
runs-on: ubuntu-22.04
needs: [run_riscv_m1_ock_demo, build_portBLAS, build_portDNN, build_and_run_networks]
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Download OCK artifacts
uses: actions/download-artifact@v4
with:
name: ock_demo_build
- name: Download portDNN build artifacts
uses: actions/download-artifact@v4
with:
name: portDNN_build
- name: Download portBLAS build artifacts
uses: actions/download-artifact@v4
with:
name: portBLAS_build
- name: Download network artifacts
uses: actions/download-artifact@v4
with:
name: network_build
- name: Compute tag
id: tag
run: |
if [ "${{ github.event_name == 'schedule' }}" == "true" ]; then
echo "TAG=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
else
# TODO: Use date of the commit?
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
fi
- name: Concatenate the tars to create OCK components
run: |
tar -rf ock_demo_components.tar.gz portDNN_build.tar.gz portBLAS_build.tar.gz
- name: Create OCK demo release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
files: |
ock_demo_artifacts.tar.gz
ock_demo_components.tar.gz
network_artifacts.tar.gz
tag_name: ock-demo-${{ steps.tag.outputs.TAG }}
name: OCK Demo Package ${{ steps.tag.outputs.TAG }}
prerelease: true
body: "ock-demo build ${{ steps.tag.outputs.TAG }}"
target_commitish: ${{ github.sha }}