Skip to content

Commit 4926e16

Browse files
committed
update workflows: switch Android workflows to use a dedicated x86_64 CI configuration, remove ARM64-specific logic
1 parent d0aa17d commit 4926e16

2 files changed

Lines changed: 157 additions & 42 deletions

File tree

.github/workflows/e2e-android-test.yml

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,14 @@ jobs:
111111
rm -rf $HOME/ovmb_cache/models 2>/dev/null || true
112112
fi
113113
114-
# Determine if we should create AVD (not on Linux ARM64)
115-
CREATE_AVD="--create-avd"
116-
if [ "${{ runner.os }}" = "Linux" ] && [ "$(uname -m)" = "aarch64" ]; then
117-
echo "⚠️ Linux ARM64 detected - skipping emulator/AVD setup (not supported)"
118-
CREATE_AVD=""
119-
fi
114+
# Use x86_64 config for CI
115+
CONFIG_FILE="experiments/android_x86_64_ci.yaml"
116+
echo "📱 Using x86_64 configuration for CI: $CONFIG_FILE"
120117
121118
python -m ovmobilebench.cli setup-android \
122-
-c experiments/android_example.yaml \
119+
-c $CONFIG_FILE \
123120
--api ${{ matrix.android-api }} \
124-
$CREATE_AVD \
121+
--create-avd \
125122
--verbose
126123
127124
# Display cache stats
@@ -130,17 +127,9 @@ jobs:
130127
131128
# === PREPARE EMULATOR ===
132129
- name: Start Android Emulator
133-
if: runner.os != 'Linux' || !contains('aarch64 arm64', runner.arch)
134-
run: |
135-
python tests/e2e/test_emulator_helper.py -c experiments/android_example.yaml start-emulator &
136-
python tests/e2e/test_emulator_helper.py -c experiments/android_example.yaml wait-for-boot
137-
138-
- name: Skip emulator on Linux ARM64
139-
if: runner.os == 'Linux' && contains('aarch64 arm64', runner.arch)
140130
run: |
141-
echo "⚠️ Skipping emulator startup on Linux ARM64 (not supported)"
142-
echo " Tests requiring an emulator will be skipped"
143-
echo " Physical devices should be used for testing on this platform"
131+
python tests/e2e/test_emulator_helper.py -c experiments/android_x86_64_ci.yaml start-emulator &
132+
python tests/e2e/test_emulator_helper.py -c experiments/android_x86_64_ci.yaml wait-for-boot
144133
145134
- name: Setup ccache
146135
uses: hendrikmuhs/ccache-action@v1.2
@@ -153,7 +142,7 @@ jobs:
153142

154143
# === PREPARE MODEL ===
155144
- name: Download ResNet-50 model
156-
run: python tests/e2e/test_model_helper.py -c experiments/android_example.yaml download-resnet50
145+
run: python tests/e2e/test_model_helper.py -c experiments/android_x86_64_ci.yaml download-resnet50
157146

158147
# === OVMOBILEBENCH PIPELINE ===
159148
- name: List available devices
@@ -162,7 +151,7 @@ jobs:
162151
- name: Build OpenVINO for Android
163152
run: |
164153
python -m ovmobilebench.cli build \
165-
-c experiments/android_example.yaml \
154+
-c experiments/android_x86_64_ci.yaml \
166155
--verbose
167156
168157
- name: Show ccache statistics
@@ -173,61 +162,46 @@ jobs:
173162
- name: Package OpenVINO runtime and model
174163
run: |
175164
python -m ovmobilebench.cli package \
176-
-c experiments/android_example.yaml \
165+
-c experiments/android_x86_64_ci.yaml \
177166
--verbose
178167
179168
- name: Deploy to Android device
180-
if: runner.os != 'Linux' || !contains('aarch64 arm64', runner.arch)
181169
run: |
182170
python -m ovmobilebench.cli deploy \
183-
-c experiments/android_example.yaml \
171+
-c experiments/android_x86_64_ci.yaml \
184172
--verbose
185173
186-
- name: Skip deployment on Linux ARM64
187-
if: runner.os == 'Linux' && contains('aarch64 arm64', runner.arch)
188-
run: |
189-
echo "⚠️ Skipping deployment - no emulator available on Linux ARM64"
190-
echo " To test on this platform, connect a physical Android device"
191-
192174
- name: Run benchmark on device
193-
if: runner.os != 'Linux' || !contains('aarch64 arm64', runner.arch)
194175
run: |
195176
python -m ovmobilebench.cli run \
196-
-c experiments/android_example.yaml \
177+
-c experiments/android_x86_64_ci.yaml \
197178
--verbose
198179
199-
- name: Skip benchmark on Linux ARM64
200-
if: runner.os == 'Linux' && contains('aarch64 arm64', runner.arch)
201-
run: |
202-
echo "⚠️ Skipping benchmark - no emulator available on Linux ARM64"
203-
204180
- name: Generate benchmark report
205181
run: |
206182
python -m ovmobilebench.cli report \
207-
-c experiments/android_example.yaml \
183+
-c experiments/android_x86_64_ci.yaml \
208184
--verbose
209185
210186
# === ALTERNATIVE: Run all stages at once ===
211187
- name: Run complete pipeline (alternative)
212188
if: false # Set to true to use this instead of individual stages
213189
run: |
214190
python -m ovmobilebench.cli all \
215-
-c experiments/android_example.yaml \
191+
-c experiments/android_x86_64_ci.yaml \
216192
--verbose
217193
218194
# === VALIDATION ===
219195
- name: Validate results
220-
if: runner.os != 'Linux' || !contains('aarch64 arm64', runner.arch)
221196
run: python tests/e2e/test_validate_results.py
222197

223198
- name: Display benchmark results
224-
if: runner.os != 'Linux' || !contains('aarch64 arm64', runner.arch)
225199
run: python tests/e2e/test_display_results.py
226200

227201
# === CLEANUP ===
228202
- name: Stop emulator
229-
if: always() && (runner.os != 'Linux' || !contains('aarch64 arm64', runner.arch))
230-
run: python tests/e2e/test_emulator_helper.py -c experiments/android_example.yaml stop-emulator
203+
if: always()
204+
run: python tests/e2e/test_emulator_helper.py -c experiments/android_x86_64_ci.yaml stop-emulator
231205

232206
- name: Upload artifacts
233207
if: always()

experiments/android_x86_64_ci.yaml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Android x86_64 Benchmark Configuration for CI
2+
# This configuration is optimized for x86_64 Android emulators in CI environments
3+
# Uses x86_64 architecture for better emulator performance on standard CI runners
4+
5+
project:
6+
name: "android-x86-benchmark" # Project identifier for tracking
7+
run_id: "android_x86_001" # Unique identifier for this benchmark run
8+
description: "OpenVINO benchmark on Android x86_64 emulator for CI"
9+
cache_dir: "ovmb_cache" # Directory for all cached files (NDK, SDK, OpenVINO source, models)
10+
# Relative paths are resolved from the project root
11+
12+
environment:
13+
# Environment configuration for Java and Android SDK
14+
# These paths are auto-detected from environment variables if not specified
15+
# java_home: "/path/to/java" # Optional: Path to Java installation (auto-detected from JAVA_HOME)
16+
# sdk_root: "/path/to/android-sdk" # Optional: Android SDK root (defaults to cache_dir/android-sdk)
17+
18+
# OpenVINO distribution configuration
19+
# Supports three modes: build (from source), install (pre-built), or link (download archive)
20+
openvino:
21+
mode: "build" # Build OpenVINO from source for Android
22+
# source_dir: "/path/to/openvino" # Optional: Path to OpenVINO source (defaults to cache_dir/openvino_source)
23+
# If not exists, will prompt to clone from GitHub
24+
commit: "HEAD" # Git commit/tag to build (HEAD for latest)
25+
26+
# Android toolchain configuration for x86_64
27+
toolchain:
28+
# android_ndk: "/path/to/ndk" # Optional: Path to Android NDK (auto-detected from cache_dir/android-sdk/ndk)
29+
# If not found, will prompt to install using setup-android command
30+
abi: "x86_64" # Target Android ABI for x86_64 emulators
31+
api_level: 30 # Android API level (minimum 24 for OpenVINO)
32+
33+
# CMake build options - all CMake flags go here
34+
options:
35+
CMAKE_BUILD_TYPE: "Release" # Build type: Release, Debug, RelWithDebInfo
36+
CMAKE_GENERATOR: "Ninja" # Build system generator (Ninja recommended for speed)
37+
# CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER auto-detected if ccache is available
38+
# Android toolchain options (CMAKE_TOOLCHAIN_FILE, ANDROID_ABI, etc.) autoconfigured from toolchain settings
39+
40+
# OpenVINO component options
41+
ENABLE_INTEL_CPU: "ON" # Intel CPU plugin (required for CPU inference)
42+
ENABLE_INTEL_GPU: "OFF" # Intel GPU plugin (not needed for Android)
43+
ENABLE_ONEDNN_FOR_ARM: "OFF" # oneDNN optimizations for ARM (not needed for x86_64)
44+
ENABLE_PYTHON: "OFF" # Python bindings (not needed for mobile)
45+
BUILD_SHARED_LIBS: "ON" # Build as shared libraries (.so files)
46+
ENABLE_TESTS: "OFF" # Unit tests (not needed for benchmarking)
47+
ENABLE_FUNCTIONAL_TESTS: "OFF" # Functional tests (not needed for benchmarking)
48+
ENABLE_SAMPLES: "ON" # Build samples including benchmark_app
49+
ENABLE_OPENCV: "OFF" # OpenCV support (not needed for benchmark_app)
50+
51+
# Alternative mode 2: Use pre-built OpenVINO installation
52+
# mode: "install"
53+
# install_dir: "/path/to/openvino/install"
54+
55+
# Alternative mode 3: Download OpenVINO archive from URL
56+
# mode: "link"
57+
# archive_url: "https://storage.openvinotoolkit.org/repositories/openvino/packages/..."
58+
# archive_url: "latest" # Auto-detect the latest nightly build
59+
60+
# Package configuration - controls what gets deployed to a device
61+
package:
62+
include_symbols: false # Include debug symbols in the package (increases size)
63+
extra_files: [] # Additional files to include in the package
64+
65+
# Target device configuration
66+
device:
67+
kind: "android" # Device type (android or linux_ssh)
68+
serials: ["emulator-5554"] # Use emulator for CI testing
69+
# Empty list [] for auto-detect
70+
push_dir: "/data/local/tmp/ovmobilebench" # Directory on a device for benchmark files
71+
use_root: false # Whether to use root access (not required)
72+
73+
# Model configuration - scan directory for all models
74+
models:
75+
directories:
76+
- "ovmb_cache/models"
77+
extensions: [".xml"] # File extensions to look for
78+
79+
# Alternative: Specify models explicitly
80+
# models:
81+
# - name: "resnet-50" # Model identifier for reports
82+
# path: "ovmb_cache/models/resnet-50-pytorch.xml" # Path to model XML file
83+
# # precision: "FP16" # Optional: Model precision override
84+
# # tags: {} # Optional: Additional metadata tags
85+
86+
# Benchmark execution configuration
87+
run:
88+
repeats: 3 # Number of times to repeat each configuration
89+
warmup: true # Perform warmup run before measurements
90+
cooldown_sec: 2 # Seconds to wait between runs
91+
timeout_sec: 120 # Maximum seconds per benchmark run
92+
93+
# Matrix of parameters to test - creates all combinations
94+
matrix:
95+
niter: [100, 200] # Number of inference iterations
96+
hint: ["latency", "throughput"] # Performance hint (latency for responsiveness, throughput for maximum FPS)
97+
device: ["CPU"] # Target device (CPU only for x86_64 emulator)
98+
infer_precision: ["FP32"] # Use FP32 for x86_64 (FP16 is mainly for ARM)
99+
100+
# Report generation configuration
101+
report:
102+
sinks: # Output destinations for results
103+
- type: "json" # JSON format for programmatic processing
104+
path: "artifacts/reports/results.json"
105+
- type: "csv" # CSV format for spreadsheet analysis
106+
path: "artifacts/reports/results.csv"
107+
108+
tags: # Metadata tags for tracking
109+
experiment: "android_x86_benchmark"
110+
platform: "android_x86_64"
111+
ci: "true"
112+
version: "v1.0"
113+
114+
aggregate: true # Aggregate results across repeats
115+
include_raw: true # Include raw benchmark output in reports
116+
117+
# Usage for CI:
118+
# 1. Install dependencies:
119+
# pip install -e .
120+
#
121+
# 2. Setup Android SDK/NDK with x86_64 system image:
122+
# python -m ovmobilebench.cli setup-android --api 30 --arch x86_64 --create-avd
123+
#
124+
# 3. Clone OpenVINO (if source_dir doesn't exist):
125+
# git clone https://github.com/openvinotoolkit/openvino.git ovmb_cache/openvino_source
126+
#
127+
# 4. Download model (if not already present):
128+
# # Download from OpenVINO Model Zoo or convert from PyTorch/TensorFlow
129+
#
130+
# 5. Start emulator (x86_64 for better performance on CI):
131+
# # The emulator will be automatically started if using the setup-android command
132+
#
133+
# 6. Run complete pipeline:
134+
# python -m ovmobilebench.cli all -c experiments/android_x86_64_ci.yaml --verbose
135+
#
136+
# Or run individual stages:
137+
# python -m ovmobilebench.cli build -c experiments/android_x86_64_ci.yaml
138+
# python -m ovmobilebench.cli package -c experiments/android_x86_64_ci.yaml
139+
# python -m ovmobilebench.cli deploy -c experiments/android_x86_64_ci.yaml
140+
# python -m ovmobilebench.cli run -c experiments/android_x86_64_ci.yaml
141+
# python -m ovmobilebench.cli report -c experiments/android_x86_64_ci.yaml

0 commit comments

Comments
 (0)