OVMobileBench is an end-to-end benchmarking pipeline for OpenVINO on mobile devices. It automates the complete workflow from building OpenVINO runtime, packaging models and libraries, deploying to devices, running benchmarks, and generating reports.
┌─────────────────────────────────────────────────────────┐
│ User Interface │
│ (CLI via Typer) │
└────────────────────┬────────────────────────────────────┘
│
┌────────────────────▼────────────────────────────────────┐
│ Pipeline │
│ (Orchestration Layer) │
└─────┬──────┬──────┬──────┬──────┬──────┬──────────────┘
│ │ │ │ │ │
┌─────▼──┐ ┌▼─────┐┌▼─────┐┌▼─────┐┌▼─────┐┌▼──────┐
│ Build │ │Pack ││Deploy││ Run ││Parse ││Report│
│ │ │ ││ ││ ││ ││ │
└────────┘ └──────┘└──────┘└──────┘└──────┘└──────┘
│ │ │ │ │ │
┌────▼─────────▼───────▼───────▼───────▼───────▼─────┐
│ Device Abstraction Layer │
│ (Android/ADB, Linux/SSH, iOS/stub) │
└─────────────────────────────────────────────────────┘
Purpose: Define and validate experiment configurations.
Key Classes:
Experiment: Top-level configuration containerBuildConfig: OpenVINO build settingsDeviceConfig: Target device specificationsRunConfig: Benchmark execution parametersReportConfig: Output format and sinks
Technology: Pydantic for schema validation and type safety.
Purpose: Command-line interface for user interaction.
Commands:
build: Build OpenVINO from sourcepackage: Create deployment bundledeploy: Push to device(s)run: Execute benchmarksreport: Generate reportsall: Complete pipeline execution
Technology: Typer for modern CLI with auto-completion.
Purpose: Coordinate execution of all pipeline stages.
Responsibilities:
- Stage dependency management
- Error handling and recovery
- Progress tracking
- Resource cleanup
Design Pattern: Chain of Responsibility with stage isolation.
Purpose: Uniform interface for different device types.
Implementations:
AndroidDevice: ADB-based Android device controlLinuxDevice: SSH-based Linux device control (planned)iOSDevice: iOS device control (stub)
Interface:
class Device(ABC):
def push(local, remote)
def pull(remote, local)
def shell(command)
def exists(path)
def mkdir(path)
def rm(path)
def info()Purpose: Build OpenVINO runtime for target platforms.
Features:
- CMake configuration generation
- Cross-compilation support (Android NDK)
- Build caching
- Artifact collection
Supported Platforms:
- Android (arm64-v8a)
- Linux ARM (aarch64)
Purpose: Bundle runtime, libraries, and models.
Bundle Structure:
ovbundle.tar.gz
├── bin/
│ └── benchmark_app
├── lib/
│ ├── libopenvino.so
│ └── ...
├── models/
│ ├── model.xml
│ └── model.bin
└── README.txt
Purpose: Execute benchmark_app with various configurations.
Features:
- Matrix expansion (device, threads, streams, precision)
- Timeout handling
- Cooldown between runs
- Warmup runs
- Progress tracking
Purpose: Extract metrics from benchmark_app output.
Metrics:
- Throughput (FPS)
- Latencies (avg, median, min, max)
- Device utilization
- Memory usage
Purpose: Generate structured reports from results.
Formats:
- JSON: Machine-readable format
- CSV: Spreadsheet-compatible
- SQLite: Database format (planned)
- HTML: Visual reports (planned)
Shared Components:
shell.py: Command execution with timeoutfs.py: File system operationsartifacts.py: Artifact managementlogging.py: Structured loggingerrors.py: Custom exceptions
YAML File → Pydantic Validation → Experiment Object
Git Checkout → CMake Configure → Ninja Build → Artifact Collection
Build Artifacts + Models → Tar Archive → Checksum Generation
Bundle → ADB/SSH Push → Remote Extraction → Permission Setup
Matrix Expansion → Device Preparation → Benchmark Execution → Output Collection
Raw Output → Parsing → Aggregation → Format Conversion → Sink Writing
project:
name: string
run_id: string
build:
openvino_repo: path
toolchain:
android_ndk: path
device:
kind: android|linux_ssh
serials: [string]
models:
- name: string
path: path
run:
matrix:
threads: [int]
nstreams: [string]
report:
sinks:
- type: json|csv
path: path- All user inputs validated via Pydantic
- Shell commands parameterized to prevent injection
- Path traversal prevention
- No hardcoded credentials
- Environment variables for sensitive data
- SSH key-based authentication
- ADB authorization required
- Limited command set execution
- Temporary file cleanup
- CMake build cache
- ccache integration (planned)
- Incremental builds
- Multiple device support
- Concurrent stage execution (where safe)
- Async I/O for file operations
- Automatic cleanup of temporary files
- Connection pooling for SSH
- Memory-mapped file I/O for large files
- Inherit from
Devicebase class - Implement required methods
- Register in
pipeline.py
- Inherit from
ReportSink - Implement
write()method - Register in configuration schema
- Create runner in
runners/ - Create parser in
parsers/ - Update configuration schema
- Configuration validation
- Parser accuracy
- Device command generation
- Pipeline stage transitions
- File operations
- Mock device operations
- End-to-end pipeline execution
- Real device testing (CI)
- Performance regression tests
- Lint (Black, Ruff)
- Type check (MyPy)
- Unit tests (pytest)
- Coverage report
- Build distribution
- Generate artifacts
- Integration tests
- Dry-run validation
- PyPI publishing
- Docker image creation
- Documentation update
- SQLite report sink
- Linux SSH device support
- HTML report generation
- Docker development environment
- Web UI dashboard
- Real-time monitoring
- Cloud device farm integration
- Model optimization recommendations
- Performance regression detection
- Distributed execution
- Python 3.11+
- typer: CLI framework
- pydantic: Data validation
- pyyaml: YAML parsing
- paramiko: SSH client
- pandas: Data manipulation
- rich: Terminal formatting
- Android NDK r26d+
- CMake 3.24+
- Ninja 1.11+
- pip: Dependency management
- pytest: Testing framework
- black: Code formatting
- ruff: Linting
- mypy: Type checking
Apache License 2.0