Skip to content

OSS Android Benchmarking: minibench and microbench #8402

@kirklandsign

Description

@kirklandsign

🚀 The feature, motivation and pitch

We have an open source Android benchmarking app (minibench) which creates Activities for benchmarking ET runtime/model in a real app setup.

It does well in simulating a real app user use case, because all apps need to be wrapped in an APK, not a shell binary, so it has the same permission and OOM priority as the user app. However, it doesn’t do well in generating profiling reports and flame graphs with simpleperf/perfetto, without Android Studio. We need a separate binary program, microbench.

Meanwhile, the new microbench can be used to benchmark and profile single operators, useful for fine granite tuning.

Minibench (existing)

  • The first step to get the overall idea of how a model runs on a platform.
  • Simulates real user workflow.
  • Can't generate profiling reports on servers.
  • Needs adb shell am to start, and hard to debug when there is an error.

Microbench (new)

  • Get detailed profiling data.
  • Native binary, similar to running a program in linux.
  • simpleperf/perfetto can generate profiling reports.
  • If a model runs on microbench, it may not necessarily run on minibench, or real user app, because binary may have higher OOM priority (even than System UI!).

Tasks

  • Build the new microbench app (binary) for OSS.
  • Obtain the simpleperf/perfetto profiling data, and write a script for it.
  • Set up workflow to trigger the run.

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @guangy10 @huydhn @shoumikhin

Metadata

Metadata

Assignees

Labels

module: androidIssues related to Android code, build, and executionmodule: benchmarkIssues related to the benchmark infrastructuretriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

Status

No status

Status

Backlog/Lowpri

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions