Skip to content

Android inference runs on CPU: no NNAPI or GPU execution provider is selected #228

Description

@kacperpaczos

android/app/build.gradle.kts sets abiFilters for arm64-v8a, armeabi-v7a and x86_64, ships sherpa-onnx as a prebuilt JNI library in the full flavour, and builds whisper.cpp from the pinned source. Nothing in the build selects an ONNX Runtime execution provider, so inference lands on the CPU.

Most recent Android phones have an NPU reachable through NNAPI, or through the vendor provider on Qualcomm parts. On a phone the argument is battery and thermals more than raw throughput, which is the same argument that makes the ANE worth using on Apple hardware — something the sibling clients on macOS already do.

Caveats:

  • the prebuilt JNI library may not have been built with a provider compiled in, in which case this is a build-flavour question rather than a runtime one
  • delegate coverage for transducer models is uneven, so this needs measuring rather than assuming
  • I found no dictation app in this category doing it, so there is no reference implementation to copy

Part of a comparison I made of what each Voca client takes from its platform.

Related on the other platforms: VocaHQ/vocawin#39 (NPU on Windows) and #227 (ANE on iOS).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions