Get desktop application:
View/edit binary Protocol Buffers messages
Used in:
One possible acceleration configuration.
Which preference to use this accelerator for.
How to configure TFLite
Identifiers to use for instrumentation and telemetry.
TFLite delegate to use.
Used in:
EdgeTPU Delegate settings
Used in:
Generic definitions of EdgeTPU power states.
Used in:
Undefined power state.
TPU core is off but control cluster is on.
A non-active low-power state that has much smaller transition time to active compared to off.
Device is inactive but ready and all previous data is retained (e.g. cached parameters).
Minimum power active state.
Low performance, low power.
The normal performance and power. This setting usually provides the optimal perf/power trade-off for the average use-case.
Maximum performance level. Potentially higher power and thermal. This setting may not be allowed in production depending on the system.
ExecutionPreference is used to match accelerators against the preferences of the current application or usecase. Some of the values here can appear both in the compatibility list and as input, some only as input. These are separate from NNAPIExecutionPreference - the compatibility list design doesn't assume a one-to-one mapping between which usecases compatibility list entries have been developed for and what settings are used for NNAPI.
Used in:
Match any selected preference. Allowlist (semantically - value is same as on input).
Match low latency preference. Both compatibility list and input.
Math low power preference. Both compatibility list and input.
Never accelerate. Can be used for input to compatibility list or for standalone Acceleration configuration.
Whether to automatically fallback to TFLite CPU path on delegation errors. Typically fallback is enabled in production use but disabled in tests and benchmarks to ensure they test the intended path.
Used in:
Whether to allow automatically falling back to TfLite CPU path on compilation failure. Default is not allowing automatic fallback. This is useful in naive production usecases where the caller would prefer for the model to run even if it's not accelerated. More advanced users will implement fallback themselves; e.g., by using a different model on CPU. Note that compilation errors may occur either at initial ModifyGraphWithDelegate() time, or when calling AllocateTensors() after resizing.
Whether to allow automatically falling back to TfLite CPU path on execution error. Default is not allowing automatic fallback. Experimental, use with care (only when you have complete control over the client code). The caveat above for compilation error holds. Additionally, execution-time errors are harder to handle automatically as they require invalidating the TfLite interpreter which most client code has not been designed to deal with.
Which GPU backend to select. Default behaviour on Android is to try OpenCL and if it's not available fall back to OpenGL.
Used in:
Not yet supported. VULKAN = 3; METAL = 4;
GPU Delegate settings. See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/delegates/gpu/delegate.h
Used in:
TODO(b/152019007): add remaining options.
Hexagon Delegate settings. See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/delegates/hexagon/hexagon_delegate.h
Used in:
Used in:
Undefined.
Prefer executing in a way that minimizes battery drain.
Prefer returning a single answer as fast as possible, even if this causes more power consumption.
Prefer maximizing the throughput of successive frames, for example when processing successive frames coming from the camera.
Used in:
NNAPI delegate settings.
Used in:
Which instance (NNAPI accelerator) to use. One driver may provide several accelerators (though a driver may also hide several back-ends behind one name, at the choice of the driver vendor). Note that driver introspection is only available in Android Q and later.
NNAPI model compilation caching settings to be passed to tflite::StatefulNnApiDelegate
NNAPI execution preference to pass. See https://developer.android.com/ndk/reference/group/neural-networks.html
Number of instances to cache for the same model (for input size changes). This is mandatory for getting reasonable performance in that case.
Whether to automatically fall back to TFLite CPU path.
Whether to allow use of NNAPI CPU (nnapi-reference accelerator) on Android 10+ when an accelerator name is not specified. The NNAPI CPU typically performs less well than the TfLite built-in kernels; but allowing allows a model to be partially accelerated which may be a win.
Whether to allow dynamic dimension sizes without re-compilation. A tensor of with dynamic dimension must have a valid dims_signature defined. Only supported in NNAPI 1.1 and newer versions. WARNING: Setting this flag to true may result in model being rejected by accelerator. This should only be enabled if the target device supports dynamic dimensions of the model. By default this is set to false.
Whether to allow the NNAPI accelerator to optionally use lower-precision float16 (16-bit floating point) arithmetic when doing calculations on float32 (32-bit floating point).
How to configure TFLite.
Used in:
Which delegate to use.
How to configure the chosen delegate. (In principle we would like to use 'oneof', but flatc turns that into an nested anonymous table rather than a union. See https://github.com/google/flatbuffers/issues/4628).
How to configure CPU execution.
Shared delegation settings.
For configuring the EdgeTpuDelegate.
XNNPack Delegate settings. See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h
Used in: