Repository navigation
151 lines (129 loc) · 4.9 KB
/
Copy pathci.yml
File metadata and controls
151 lines (129 loc) · 4.9 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
name: CI
on:
push:
branches: [main, master]
paths:
- 'librocketnpu/**'
- 'openrknn/**'
- '.github/workflows/ci.yml'
pull_request:
workflow_dispatch:
inputs:
run_hw_tests:
description: 'Run self-hosted hardware tests (orangepi5plus)'
type: boolean
default: true
defaults:
run:
working-directory: librocketnpu
jobs:
build-and-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libdrm-dev libprotobuf-c-dev
- name: Build library
run: make librocketnpu.so
- name: Build tests
run: make test_sw_ops test_rknpu_abi test_onnx_parse test_fc
- name: Run sw_ops tests
run: LD_LIBRARY_PATH=. ./test_sw_ops
- name: Run rknpu_abi tests
run: LD_LIBRARY_PATH=. ./test_rknpu_abi
cross-compile-aarch64:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install cross-compilation toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu libdrm-dev
- name: Cross-compile object files for aarch64
run: |
for f in src/rnpu_drm.c src/rnpu_tflite.c src/rnpu_coefs.c src/rnpu_task.c \
src/rnpu_regcmd.c src/rnpu_convert.c src/rnpu_sw_ops.c src/rnpu_rknn.c \
src/rnpu_model.c; do
aarch64-linux-gnu-gcc -O2 -Wall -Wno-unused-function \
-Isrc -Iinclude -march=armv8-a -fPIC -c -o /dev/null "$f"
done
hw-test:
# Hardware tests on Orange Pi 5 Plus — only on push (not PRs from forks)
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.run_hw_tests)
needs: build-and-test
runs-on: [self-hosted, orangepi5plus]
timeout-minutes: 5
# Serialize all self-hosted NPU jobs so they don't fight for the
# single physical NPU on the board. cancel-in-progress=false queues
# rather than cancels.
concurrency:
group: orangepi5plus-npu
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- name: Run hardware smoke tests
run: bash tests/ci_hw_smoke.sh
openrknn-build:
# Cross-compile openrknn for aarch64 on the Ubuntu runner —
# catches build breakages without needing the board.
runs-on: ubuntu-24.04
defaults:
run:
working-directory: openrknn
steps:
- uses: actions/checkout@v4
- name: Install cross-compiler
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Cross-compile librknn_api.so for aarch64
run: make CC=aarch64-linux-gnu-gcc
- name: Verify shared library
run: |
file librknn_api.so
aarch64-linux-gnu-objdump -T librknn_api.so | grep -E 'rknn_(init|query|run|inputs_set|outputs_get|destroy)' | sort
openrknn-segments-verify:
# Pure-Python regression check on the FB-derived segmentation rule.
# Runs on every PR (no self-hosted runner needed). Loads each
# committed ground-truth artifact and asserts that dump_segments.py's
# derive_segments() reproduces the exact (flags, sc_start, sc_count)
# tuples the vendor emitted at capture time. Fails fast on any drift
# in the f[10] extraction, LUT_OPS set, or segment-grouping algorithm
# — long before the hardware-dependent openrknn-hw-test even runs.
runs-on: ubuntu-24.04
defaults:
run:
working-directory: openrknn
steps:
- uses: actions/checkout@v4
- name: Verify FB-derived segmentation matches ground truth
run: python3 tests/dump_segments.py --verify tests/segmentation_ground_truth/
openrknn-hw-test:
# Real-image accuracy validation on Orange Pi 5 Plus — only on push.
# Exercises the full openrknn pipeline (init, query, inputs_set, run,
# outputs_get) with real test images and semantic post-processing
# (softmax + top-k, YOLOv5/v8 NMS, DeepLabv3 argmax) against the
# vendor library baseline.
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.run_hw_tests)
needs: openrknn-build
runs-on: [self-hosted, orangepi5plus]
timeout-minutes: 15
# Same concurrency group as hw-test so they serialize on the single
# physical NPU.
concurrency:
group: orangepi5plus-npu
cancel-in-progress: false
defaults:
run:
working-directory: openrknn
steps:
- uses: actions/checkout@v4
- name: Brief NPU cooldown
# If the previous self-hosted job left the NPU in a stuck state
# (e.g. hw-test submit timeout), give it a moment to recover and
# free any stale /dev/dri/* handles before opening the device.
run: sleep 3
- name: Run openrknn real-image validation
run: bash tests/ci_validate.sh