Performance benchmarks

This document lists TensorFlow Lite performance benchmarks when running well known models on some Android and iOS devices.

These performance benchmark numbers were generated with the Android TFLite benchmark binary and the iOS benchmark app.

Android performance benchmarks

For Android benchmarks, the CPU affinity is set to use big cores on the device to reduce variance (see details).

It assumes that models were download and unzipped to the /data/local/tmp/tflite_models directory. The benchmark binary is built using these instructions and assumed in the /data/local/tmp directory.

To run the benchmark:

adb shell taskset ${CPU_MASK} /data/local/tmp/benchmark_model \
  --num_threads=1 \
  --graph=/data/local/tmp/tflite_models/${GRAPH} \
  --warmup_runs=1 \
  --num_runs=50 \
  --use_nnapi=false

Here, ${GRAPH} is the name of model and ${CPU_MASK} is the CPU affinity chosen according to the following table:

DeviceCPU_MASK
Pixel 2f0
Pixel xl0c

iOS benchmarks

To run iOS benchmarks, the benchmark app was modified to include the appropriate model and benchmark_params.json was modified to set num_threads to 1.