﻿# NNAPI_FLAG_CPU_DISABLED does not remove every ONNX Runtime CPU path

The NNAPI option excludes NNAPI CPU devices, while ORT kernels may still execute work. Name the layer before interpreting a CPU-free mobile inference claim.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/edge-onnxruntime-nnapi-cpu-disabled-scope/
Language: en

## A disabled label hides a nested runtime

A mobile application sets NNAPI_FLAG_CPU_DISABLED and labels its model execution CPU free. Later profiling shows host activity, which is immediately diagnosed as the flag being ignored. That conclusion skips a runtime boundary. NNAPI has its own CPU-device path, while ONNX Runtime can execute kernels outside that provider. First determine which layer produced the observation. Host preprocessing is another possibility and should not be classified as neural graph placement from total CPU utilization alone.

## Read the exact option scope

The [NNAPI provider reference](https://onnxruntime.ai/docs/execution-providers/NNAPI-ExecutionProvider) defines the option as preventing NNAPI from using CPU devices. It explicitly says that some models can fall back to ORT kernels when NNAPI would otherwise execute an operation on CPU. The option applies from Android API level 29 and is ignored at API level 28 and below. Preserve the effective platform level and flags; copying the same configuration string across phones does not establish identical option behavior.

## Separate provider coverage from provider devices

The [execution-provider overview](https://onnxruntime.ai/docs/execution-providers/) explains capability-based assignment of nodes or subgraphs. An NNAPI provider does not necessarily own the complete graph. Within the work it receives, NNAPI device selection is another decision. These are separate placement layers. Retain evidence of assigned graph regions and the supported NNAPI device information instead of combining them into a single accelerator-present flag. A successful session construction is useful evidence, but it cannot identify every operation executed during a request.

## Use a placement question that the evidence can answer

A proposed comparison keeps the exported model, input and provider build fixed while changing the documented flag on a supported platform. Inspect execution assignment with the runtime tooling available in that build, and check model outputs independently. Acceptance explains whether observed work used NNAPI CPU devices, ORT kernels or unrelated application processing. It does not require every CPU sample to disappear. No phone model or profiling experiment was run here, so no placement or performance outcome is claimed.

## Keep the historical integration scope visible

The [Android NNAPI guide](https://developer.android.com/ndk/guides/neuralnetworks) now marks NNAPI deprecated and recommends alternatives for performance-critical workloads. This article interprets an existing integration; it does not recommend adopting a deprecated backend for a new application. Preserve the release and device context when comparing older results. Even a confirmed absence of the NNAPI reference CPU path would not prove use of a particular NPU, full graph acceleration, lower energy consumption or an acceptable numerical result.

## Report the exclusion instead of an absolute slogan

[Provider priority and graph partitioning](/journal/fg2-onnxruntime-provider-priority-subgraph-partition/) describe the outer assignment layer. [OpenVINO device attribution](/journal/openvino-auto-startup-helper-runtime-device-attribution/) illustrates another runtime with distinct placement policies. For this integration, report the NNAPI CPU-device exclusion, applicable platform level and actual remaining execution evidence. That wording remains useful even when CPU kernels are intentionally retained. It makes a flag audit actionable without turning a provider-local policy into an unsupported statement about the complete mobile request.
