-
Notifications
You must be signed in to change notification settings - Fork 2
187 lines (163 loc) · 6.86 KB
/
Copy pathci.yml
File metadata and controls
187 lines (163 loc) · 6.86 KB
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
name: CI
on:
push:
branches: [main]
# Run CI on pull requests targeting any base branch, not just main.
# This is necessary for stacked PR workflows where a PR's base is
# another feature branch (e.g. an umbrella branch or a previous PR
# in a stack); without this, only the final umbrella -> main PR
# would get CI coverage.
pull_request:
jobs:
benchmark-khronos-mivisionx:
runs-on: ubuntu-latest
name: Khronos & MIVisionX - Build, Benchmark & Compare
steps:
- name: Checkout openvx-mark
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential
# --- Khronos Sample Implementation ---
- name: Build Khronos OpenVX sample
run: |
git clone --recursive --depth 1 https://github.com/KhronosGroup/OpenVX-sample-impl.git /tmp/openvx-khronos
cd /tmp/openvx-khronos
python Build.py --os=Linux --arch=64 --conf=Release
- name: Find Khronos libraries
id: khronos
run: |
LIB_DIR=$(dirname $(find /tmp/openvx-khronos -name "libopenvx.so" -not -path "*/build/*" | head -1))
echo "lib_dir=$LIB_DIR" >> "$GITHUB_OUTPUT"
echo "Found Khronos libraries in: $LIB_DIR"
ls -la "$LIB_DIR"/libopenvx* "$LIB_DIR"/libvxu* 2>/dev/null || true
- name: Build openvx-mark (Khronos)
run: |
mkdir build-khronos && cd build-khronos
cmake -DOPENVX_INCLUDES=/tmp/openvx-khronos/api-docs/include \
-DOPENVX_LIB_DIR=${{ steps.khronos.outputs.lib_dir }} ..
cmake --build . -j$(nproc)
- name: Run benchmark (Khronos)
run: |
cd build-khronos
export LD_LIBRARY_PATH=${{ steps.khronos.outputs.lib_dir }}:$LD_LIBRARY_PATH
./openvx-mark --resolution VGA --iterations 10 --warmup 3
- name: Run framework benchmarks (Khronos)
if: always()
run: |
cd build-khronos
export LD_LIBRARY_PATH=${{ steps.khronos.outputs.lib_dir }}:$LD_LIBRARY_PATH
./openvx-mark --feature-set framework --resolution VGA \
--iterations 10 --warmup 3 --quiet \
--output-dir framework_results 2>&1 | tee ../khronos-framework.log
# --- MIVisionX (AMD OpenVX) ---
- name: Build MIVisionX (CPU backend)
run: |
git clone --depth 1 --branch develop https://github.com/ROCm/MIVisionX.git /tmp/openvx-mivisionx
cd /tmp/openvx-mivisionx && mkdir build && cd build
cmake -DBACKEND=CPU -DNEURAL_NET=OFF -DLOOM=OFF -DMIGRAPHX=OFF \
-DCMAKE_INSTALL_PREFIX=/tmp/openvx-mivisionx/install ..
make -j$(nproc)
make install
- name: Find MIVisionX libraries
id: mivisionx
run: |
LIB_DIR=$(dirname $(find /tmp/openvx-mivisionx -name "libopenvx.so" -not -path "*/build/*" | head -1))
echo "lib_dir=$LIB_DIR" >> "$GITHUB_OUTPUT"
echo "Found MIVisionX libraries in: $LIB_DIR"
ls -la "$LIB_DIR"/libopenvx* "$LIB_DIR"/libvxu* 2>/dev/null || true
- name: Build openvx-mark (MIVisionX)
run: |
mkdir build-mivisionx && cd build-mivisionx
cmake -DOPENVX_INCLUDES=/tmp/openvx-mivisionx/install/include/mivisionx \
-DOPENVX_LIB_DIR=${{ steps.mivisionx.outputs.lib_dir }} ..
cmake --build . -j$(nproc)
- name: Run benchmark (MIVisionX)
run: |
cd build-mivisionx
export LD_LIBRARY_PATH=${{ steps.mivisionx.outputs.lib_dir }}:$LD_LIBRARY_PATH
./openvx-mark --resolution VGA --iterations 10 --warmup 3
- name: Run framework benchmarks (MIVisionX)
if: always()
run: |
cd build-mivisionx
export LD_LIBRARY_PATH=${{ steps.mivisionx.outputs.lib_dir }}:$LD_LIBRARY_PATH
./openvx-mark --feature-set framework --resolution VGA \
--iterations 10 --warmup 3 --quiet \
--output-dir framework_results 2>&1 | tee ../mivisionx-framework.log
# --- Compare Results ---
- name: Compare benchmark results
run: |
KHRONOS=build-khronos/benchmark_results/benchmark_results.json
MIVISIONX=build-mivisionx/benchmark_results/benchmark_results.json
if [ ! -f "$KHRONOS" ] || [ ! -f "$MIVISIONX" ]; then
echo "Skipping comparison — one or both benchmark results missing"
exit 0
fi
python3 scripts/compare_reports.py "$KHRONOS" "$MIVISIONX" \
--output comparison
- name: Post comparison to job summary
if: always()
run: |
if [ -f comparison.md ]; then
cat comparison.md >> "$GITHUB_STEP_SUMMARY"
fi
- name: Post framework benchmarks to job summary
if: always()
run: |
{
echo "## Framework Benchmarks"
echo ""
for vendor in khronos mivisionx; do
log="${vendor}-framework.log"
if [ -f "$log" ] && grep -q "Framework Benchmarks" "$log"; then
echo "### ${vendor}"
echo ""
echo '```'
# Print from the "Framework Benchmarks" header line through
# the closing ===== separator that the binary always emits.
awk '/Framework Benchmarks \([0-9]+\):/{flag=1} flag' "$log"
echo '```'
echo ""
else
echo "### ${vendor}"
echo ""
echo "_No framework benchmarks registered (or all skipped) at this commit._"
echo ""
fi
done
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload Khronos results
if: always()
uses: actions/upload-artifact@v4
with:
name: benchmark-results-khronos-sample
path: build-khronos/benchmark_results/
if-no-files-found: ignore
- name: Upload MIVisionX results
if: always()
uses: actions/upload-artifact@v4
with:
name: benchmark-results-mivisionx-cpu
path: build-mivisionx/benchmark_results/
if-no-files-found: ignore
- name: Upload Khronos framework results
if: always()
uses: actions/upload-artifact@v4
with:
name: framework-results-khronos-sample
path: build-khronos/framework_results/
if-no-files-found: ignore
- name: Upload MIVisionX framework results
if: always()
uses: actions/upload-artifact@v4
with:
name: framework-results-mivisionx-cpu
path: build-mivisionx/framework_results/
if-no-files-found: ignore
- name: Upload comparison report
if: always()
uses: actions/upload-artifact@v4
with:
name: benchmark-comparison-khronos-mivisionx
path: comparison.*
if-no-files-found: ignore