tensorflow/lite/tools/delegates/README.md
A TFLite delegate registrar is provided here. The registrar keeps a list of TFLite delegate providers, each of which defines a list parameters that could be initialized from commandline arguments and provides a TFLite delegate instance creation based on those parameters. This delegate registrar has been used in TFLite evaluation tools and the benchmark model tool.
A particular TFLite delegate provider can be used by linking the corresponding
library, e.g. adding it to the deps of a BUILD rule. Note that each delegate
provider library has been configured with alwayslink=1 in the BUILD rule so
that it will be linked to any binary that directly or indirectly depends on it.
The following lists all implemented TFLite delegate providers and their corresponding list of parameters that each supports to create a particular TFLite delegate.
num_threads: int (default=-1) max_delegated_partitions: int (default=0, i.e. no limit) min_nodes_per_partition: int (default=delegate's own choice) delegate_serialize_dir: string (default="") delegate_serialize_token: string (default="") first_delegate_node_index: int (default=0) last_delegate_node_index: int (default=INT_MAX) The GPU delegate is supported on Android and iOS devices, or platforms where the delegate library is built with "-DCL_DELEGATE_NO_GL" macro.
use_gpu: bool (default=false) gpu_precision_loss_allowed: bool (default=true) gpu_experimental_enable_quant: bool (default=true) gpu_inference_for_sustained_speed: bool (default=false) gpu_backend: string (default="") gpu_wait_type: string (default="") use_nnapi: bool (default=false) nnapi_accelerator_name flag.nnapi_accelerator_name: string (default="") nnapi_execution_preference: string (default="") nnapi_execution_priority: string (default="") disable_nnapi_cpu: bool (default=true) nnapi_accelerator_name is specified.nnapi_allow_fp16: bool (default=false) nnapi_allow_dynamic_dimensions: bool (default=false) nnapi_use_burst_mode: bool (default=false) nnapi_support_library_path: string (default=""), Path from which NNAPI
support library will be loaded to construct the delegate. In order to use
NNAPI delegate with support library, --nnapi_accelerator_name must be
specified and must be equal to one of the devices provided by the support
library.use_hexagon: bool (default=false) hexagon_profiling: bool (default=false) use_xnnpack: bool (default=false)
Whether to explicitly apply the XNNPACK delegate. Note the XNNPACK delegate
could be implicitly applied by the TF Lite runtime regardless the value of
this parameter. To disable this implicit application, set the value to
false explicitly.
xnnpack_force_fp16: bool (default=false)
Enforce float16 inference. Internaly, set flag
TFLITE_XNNPACK_DELEGATE_FLAG_FORCE_FP16 on XNNPackDelegateOptions.
use_coreml: bool (default=false) coreml_version: int (default=0) external_delegate_path: string (default="") external_delegate_options: string (default="") option1:value1;option2:value2;optionN:valueNThe stable delegate provider provides a TfLiteOpaqueDelegate object pointer
and its corresponding deleter by loading a dynamic library that encapsulates the
actual TFLite delegate implementation in a
TfLiteStableDelegate
struct instance.
While the structure of the stable delegate provider is similar to the external delegate provider, which provides the external delegates, the design objectives of the stable delegates and the external delegates are different.
The stable delegates and the external delegates use different APIs for diagnosing errors, creating and destroying the delegates. For more details of the concrete API differences, please check stable_delegate.h and external_delegate.h.
The stable delegate provider is not supported on Windows platform.
stable_abi_delegate_settings_file: string (default="")