SlideShare a Scribd company logo
Koan-Sin Tan,
freedom@computer.org
COSCUP, Aug 1st, 2020
Running TFLite on Your Mobile
Devices
• disclaimer: opinions are my own

• feel free to interrupt me if you have any questions during the presentation

• questions could be Taiwanese, English, or Mandarin
• Used open source before the term “open
source” is used
• A software guy, learned to use Unix and open
source software on VAX-11/780 running 4.3BSD
• Used to be a programming language junkie
• Worked on various system software, e.g., CPU
scheduling and power management of non-
CPU components
• Recently, on NN performance on edge devices
related stuff
• Contributed from time to time to TensorFlow Lite
• started a command line label_image for TFLite
who i am
https://gunkies.org/w/images/c/c1/DEC-VAX-11-780.jpg
VAX 11/780 CPU consists of TTL ICs
https://en.wikipedia.org/wiki/Transistor%E2%80%93transistor_logic https://en.wikipedia.org/wiki/7400-series_integrated_circuits
Why TFLite?
• TensorFlow Lite

• TensorFlow is one of the most popular machine learning frameworks

• TFLite: a lightweight runtime for edge devices

• originally mobile devices —> mobile and IoT/embedded devices

• could be accelerated by GPU, DSP, or ASIC accelerator

• How about PyTorch?

• yes, it is popular, but not on mobile devices yet

• Yes, there are other open source NN frameworks. No one is as comprehensive as TF Lite, as far as I can tell

• See my talk slide deck at COSCUP 2019 for more discussion, https://www.slideshare.net/kstan2/status-
quo-of-tensor-flow-lite-on-edge-devices-coscup-2019
Outline
• Overview of TFLite on Android and iOS devices,

• TFLite metadata and TFLite Android code generator,

• Some new features: CoreML delegate and XNNPACK delegate
What is TensorFlow Lite
• TensorFlow Lite is a cross-platform framework for deploying ML on mobile
devices and embedded systems

• Mobile devices -> mobile and IoT/embedded devices

• TFLite for Android and iOS

• TFLu: TFLite micro for micro-controllers
Why ML on Edge devices
• Low latency & close knit interactions

• “There is an old network saying: Bandwidth problems can be cured with money.
 Latency problems are harder because the speed of light is fixed — you can't bribe
God.” -- David D. Clark,

• network connectivity

• you probably heard “always-on” back from 3G days, you know that’s not true in
the 5G era

• privacy preserving

• sensors
from TF Dev Summit 2020, https://youtu.be/27Zx-4GOQA8
• We’ll talk about

• TFLite metadata and codegen which are in tflite support library

• two delegates which enable using hardware capabilities

• What others you may want to dig into

• quantization, fixed point, integer

• ARM dot product instruction, Apple A13 matrix operations in CPUs (yes, CPU)

• GPU delegate started quantized models couple month ago

• GPUs usually support fp16 first

• new MLIR-based runtimes, such as TFRT and IREE

• I’ll talk a little bit about TFRT tomorrow
So how to start using TFLite
• TFLite actually has two main parts

• interpreter: loads and runs a model on various hardware

• converter: converts TF models to a TFLite specific format to be used by the
interpreter

• see https://www.tensorflow.org/lite/guide for more introduction materials

• There is a good guide on how to load a model and do inference on devices
using TFLite interpreter, in Java, Swift, Objective-C, C++, and Python

• https://www.tensorflow.org/lite/guide/inference
load and run a model in C++
other APIs are wrappers around C++ code
https://www.tensorflow.org/lite/guide/inference
TFLite metadata and TFLite
Android code generator
TFLite Metadata
• before TFLite Metadata was introduced, when we load and run a model

• it’s user’s/developer’s responsibility to figure out what input tensors and output tensors are. E.g.,

• we know image a classifier usually expects preprocessed (resizing, cropping, padding, etc.) and normalized ([0,
1] or [-1, 1]) data

• label file is not included

• in TFLite metadata, there are three parts in the schema:

• Model information - Overall description of the model as well as items such as licence terms.
See ModelMetadata.
• Input information - Description of the inputs and pre-processing required such as normalization.
See SubGraphMetadata.input_tensor_metadata.

• Output information - Description of the output and post-processing required such as mapping to labels.
See SubGraphMetadata.output_tensor_metadata.
https://www.tensorflow.org/lite/convert/metadata
• Supported Input / Output types

• Feature - Numbers which are unsigned integers or float32.

• Image - Metadata currently supports RGB and greyscale images.

• Bounding box - Rectangular shape bounding boxes. The schema supports a
variety of numbering schemes.

• Pack the associated files, e.g.,

• label file(s)

• Normalization and quantization parameters
• With example at https://
www.tensorflow.org/lite/convert/
metadata, we can create a image
classifier with

• image input, and

• label output
https://www.tensorflow.org/lite/convert/metadata
• https://developer.android.com/
studio/preview/features#tensor-
flow-lite-models
CoreML Classifier model
and autogen headers for Objective-C
My exercise to use Android CameraX and TFLite codegen in Kotlin
• To test TFLite metadata and codegen, I need an Android app that can

• grab camera inputs and 

• convert them into Android Bitmap to feed into the generated model
wrapper. 

• Since I know nothing about Android Camera and Kotlin, I started this from the
CameraX tutorial. It seems quite easy.

• https://github.com/freedomtan/CameraxTFLite
https://github.com/freedomtan/CameraxTFLite/blob/master/my_classify_wrapper/myclassifiermodel.md
https://github.com/freedomtan/CameraxTFLite/blob/master/app/src/main/java/com/mediatek/cameraxtflite/MainActivity.kt#L182-L215
screenshot of the simple app
Other new things
What is a TFLite delegate?
• “A TensorFlow Lite delegate is a way to delegate part or all of graph execution to another executor.”

• Why delegates?

• running computation-intensive NN models on mobile devices is resource demanding for mobile CPUs,
processing power and energy consumption could be problems

• and matrix-multiplication which is there core of convolution and fully connected ops is highly parallel

• Thus, some devices have hardware accelerators, such as GPU or DSP, that provide better performance
and higher energy efficiency thru Android NNAPI

• To use NNAPI, TFLite has an NNAPI delegate from the very beginning. Then, there are GPU delegates
(GL ES, OpenCL, and Metal for now. Vulkan one is coming) and others.

• my COSCUP 2019 slide deck on how NNAPI and GPU delegates work , https://www.slideshare.net/
kstan2/tflite-nnapi-and-gpu-delegates
XNNPACK and CoreML Delegates
• “XNNPACK is a highly optimized library of floating-point neural network inference operators for ARM,
WebAssembly, and x86 platforms.” 

• “XNNPACK is not intended for direct use by deep learning practitioners and researchers; instead it
provides low-level performance primitives for accelerating high-level machine learning frameworks, such
as TensorFlow Lite, TensorFlow.js, PyTorch, and MediaPipe.", https://github.com/google/XNNPACK

• NNPACK —> QNNPACK —> XNNPACK

• In TFLite, there is a XNNPACK delegate

• CoreML is Apple’s machine learning framework

• the only formal way to use Neural Engine, Apple’s NN accelerator started from A11

• nope, CoreML cannot use A11 Neural Engine, https://www.slideshare.net/kstan2/why-you-cannot-
use-neural-engine-to-run-your-nn-models-on-a11-devices
• convolution is at the core of current
neural network models

• How convolution is implemented either
in SW or HW

• “direct convolution”: 6- or 7-layer
nested for loops,

• im2col, then GEMM,

• other transforms, e.g., Winograd

• XNNPACK found a way to efficiently
reuse GEMM
XNNPACK
https://arxiv.org/pdf/1907.02129.pdf
Using XNNPACK in label_image.cc
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/label_image/
label_image.cc#L109-L116
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/tools/evaluation/utils.h#L64-L88
Using CoreML delegate
https://github.com/freedomtan/glDelegateBenchmark/blob/master/glDelegateBenchmark/ViewController.mm#L61-L68
model name CPU 1 thread (ms) CPU 2 threads (ms) GPU (ms) CoreML Delegate (ms) [4]
Mobilenet V1 1.0 224 26.54 18.21 10.91 2.03
PoseNet 34.14 23.62 16.75 3.34
DeepLab V3 (257x257) 39.65 29.87 20.43 9.10
Mobilnet V2 SSD COCO 44.94 34.05 19.73 11.54
On iPhone 11 Pro, I got
Concluding remarks
• TFLite is getting more and more mature and comprehensive

• If you haven’t started using it, you may want to start with TFLite metadata and
Android code generators

• nope, there is no iOS code generator (yet)

• To speed up execution of NN models, use TFL delegates

• note that not all accelerators are created equal

• some are fp only; some are int/quant only
Fin
A13 AMX (Apple Matrix Extension?)
sgemm and dgemm in BLAS
• For (2048x4096) x (40x96x4096) matrix multiplication
• sgemm (32-bit floating point) speed: A13 > My MBP >> A12 > A11
• dgemm (64-bit floating point) speed: My MBP > A13 >> A12 > A11

More Related Content

What's hot

Introduction to Deep Learning (NVIDIA)
Introduction to Deep Learning (NVIDIA)Introduction to Deep Learning (NVIDIA)
Introduction to Deep Learning (NVIDIA)
Rakuten Group, Inc.
 
Fugaku, the Successes and the Lessons Learned
Fugaku, the Successes and the Lessons LearnedFugaku, the Successes and the Lessons Learned
Fugaku, the Successes and the Lessons Learned
RCCSRENKEI
 
Google edge tpu
Google edge tpuGoogle edge tpu
Google edge tpu
Rouyun Pan
 
Machine Intelligence at Google Scale: TensorFlow
Machine Intelligence at Google Scale: TensorFlowMachine Intelligence at Google Scale: TensorFlow
Machine Intelligence at Google Scale: TensorFlow
DataWorks Summit/Hadoop Summit
 
Facebook ML Infrastructure - 2018 slides
Facebook ML Infrastructure - 2018 slidesFacebook ML Infrastructure - 2018 slides
Facebook ML Infrastructure - 2018 slides
Karthik Murugesan
 
初心者がOpenIndianaで自宅サーバを作ったよって話
初心者がOpenIndianaで自宅サーバを作ったよって話初心者がOpenIndianaで自宅サーバを作ったよって話
初心者がOpenIndianaで自宅サーバを作ったよって話
Masataka Tsukamoto
 
CXL Fabric Management Standards
CXL Fabric Management StandardsCXL Fabric Management Standards
CXL Fabric Management Standards
Memory Fabric Forum
 
Profiling deep learning network using NVIDIA nsight systems
Profiling deep learning network using NVIDIA nsight systemsProfiling deep learning network using NVIDIA nsight systems
Profiling deep learning network using NVIDIA nsight systems
Jack (Jaegeun) Han
 
TensorRT survey
TensorRT surveyTensorRT survey
TensorRT survey
Yi-Hsiu Hsu
 
Flutter + tensor flow lite = awesome sauce
Flutter + tensor flow lite = awesome sauceFlutter + tensor flow lite = awesome sauce
Flutter + tensor flow lite = awesome sauce
Amit Sharma
 
GPU and Deep learning best practices
GPU and Deep learning best practicesGPU and Deep learning best practices
GPU and Deep learning best practices
Lior Sidi
 
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
중선 곽
 
Binarized CNN on FPGA
Binarized CNN on FPGABinarized CNN on FPGA
Binarized CNN on FPGA
홍배 김
 
ONF Transport API (TAPI) Project
ONF Transport API (TAPI) ProjectONF Transport API (TAPI) Project
ONF Transport API (TAPI) Project
Deborah Porchivina
 
Deep learning: Hardware Landscape
Deep learning: Hardware LandscapeDeep learning: Hardware Landscape
Deep learning: Hardware Landscape
Grigory Sapunov
 
ACRiウェビナー:小野様ご講演資料
ACRiウェビナー:小野様ご講演資料ACRiウェビナー:小野様ご講演資料
ACRiウェビナー:小野様ご講演資料
直久 住川
 
TPU paper slide
TPU paper slideTPU paper slide
TPU paper slide
Dong-Hyun Hwang
 
Edge Computing Architecture using GPUs and Kubernetes
Edge Computing Architecture using GPUs and KubernetesEdge Computing Architecture using GPUs and Kubernetes
Edge Computing Architecture using GPUs and Kubernetes
VirtualTech Japan Inc.
 
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging Docker for Hadoop build automation and Big Data stack provisioningLeveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
DataWorks Summit
 

What's hot (20)

Introduction to Deep Learning (NVIDIA)
Introduction to Deep Learning (NVIDIA)Introduction to Deep Learning (NVIDIA)
Introduction to Deep Learning (NVIDIA)
 
Fugaku, the Successes and the Lessons Learned
Fugaku, the Successes and the Lessons LearnedFugaku, the Successes and the Lessons Learned
Fugaku, the Successes and the Lessons Learned
 
Google edge tpu
Google edge tpuGoogle edge tpu
Google edge tpu
 
Machine Intelligence at Google Scale: TensorFlow
Machine Intelligence at Google Scale: TensorFlowMachine Intelligence at Google Scale: TensorFlow
Machine Intelligence at Google Scale: TensorFlow
 
Facebook ML Infrastructure - 2018 slides
Facebook ML Infrastructure - 2018 slidesFacebook ML Infrastructure - 2018 slides
Facebook ML Infrastructure - 2018 slides
 
初心者がOpenIndianaで自宅サーバを作ったよって話
初心者がOpenIndianaで自宅サーバを作ったよって話初心者がOpenIndianaで自宅サーバを作ったよって話
初心者がOpenIndianaで自宅サーバを作ったよって話
 
CXL Fabric Management Standards
CXL Fabric Management StandardsCXL Fabric Management Standards
CXL Fabric Management Standards
 
Profiling deep learning network using NVIDIA nsight systems
Profiling deep learning network using NVIDIA nsight systemsProfiling deep learning network using NVIDIA nsight systems
Profiling deep learning network using NVIDIA nsight systems
 
TensorRT survey
TensorRT surveyTensorRT survey
TensorRT survey
 
Flutter + tensor flow lite = awesome sauce
Flutter + tensor flow lite = awesome sauceFlutter + tensor flow lite = awesome sauce
Flutter + tensor flow lite = awesome sauce
 
GPU and Deep learning best practices
GPU and Deep learning best practicesGPU and Deep learning best practices
GPU and Deep learning best practices
 
Windows io manager
Windows io managerWindows io manager
Windows io manager
 
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
 
Binarized CNN on FPGA
Binarized CNN on FPGABinarized CNN on FPGA
Binarized CNN on FPGA
 
ONF Transport API (TAPI) Project
ONF Transport API (TAPI) ProjectONF Transport API (TAPI) Project
ONF Transport API (TAPI) Project
 
Deep learning: Hardware Landscape
Deep learning: Hardware LandscapeDeep learning: Hardware Landscape
Deep learning: Hardware Landscape
 
ACRiウェビナー:小野様ご講演資料
ACRiウェビナー:小野様ご講演資料ACRiウェビナー:小野様ご講演資料
ACRiウェビナー:小野様ご講演資料
 
TPU paper slide
TPU paper slideTPU paper slide
TPU paper slide
 
Edge Computing Architecture using GPUs and Kubernetes
Edge Computing Architecture using GPUs and KubernetesEdge Computing Architecture using GPUs and Kubernetes
Edge Computing Architecture using GPUs and Kubernetes
 
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging Docker for Hadoop build automation and Big Data stack provisioningLeveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
 

Similar to Running TFLite on Your Mobile Devices, 2020

Machine learning and Deep learning on edge devices using TensorFlow
Machine learning and Deep learning on edge devices using TensorFlowMachine learning and Deep learning on edge devices using TensorFlow
Machine learning and Deep learning on edge devices using TensorFlow
Aditya Bhattacharya
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
Alex Moskvin
 
Tensorflow on Android
Tensorflow on AndroidTensorflow on Android
Tensorflow on Android
Koan-Sin Tan
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
Jonas Brømsø
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?
GetInData
 
TEE - kernel support is now upstream. What this means for open source security
TEE - kernel support is now upstream. What this means for open source securityTEE - kernel support is now upstream. What this means for open source security
TEE - kernel support is now upstream. What this means for open source security
Linaro
 
Smart Object Architecture
Smart Object ArchitectureSmart Object Architecture
Smart Object Architecture
Hannes Tschofenig
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Adam Dunkels
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
Jonas Brømsø
 
The Flink - Apache Bigtop integration
The Flink - Apache Bigtop integrationThe Flink - Apache Bigtop integration
The Flink - Apache Bigtop integration
Márton Balassi
 
Near real-time anomaly detection at Lyft
Near real-time anomaly detection at LyftNear real-time anomaly detection at Lyft
Near real-time anomaly detection at Lyft
markgrover
 
Stackato
StackatoStackato
Stackato
Jonas Brømsø
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
Jonas Brømsø
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
Alpen-Adria-Universität
 
Scale machine learning deployment
Scale machine learning deploymentScale machine learning deployment
Scale machine learning deployment
Gang Tao
 
Bit_Bucket_x31_Final
Bit_Bucket_x31_FinalBit_Bucket_x31_Final
Bit_Bucket_x31_FinalSam Knutson
 
TLDK - FD.io Sept 2016
TLDK - FD.io Sept 2016 TLDK - FD.io Sept 2016
TLDK - FD.io Sept 2016
Benoit Hudzia
 
It's a Jungle Out There – IoT and MRuby
It's a Jungle Out There – IoT and MRubyIt's a Jungle Out There – IoT and MRuby
It's a Jungle Out There – IoT and MRuby
matustomlein
 

Similar to Running TFLite on Your Mobile Devices, 2020 (20)

Machine learning and Deep learning on edge devices using TensorFlow
Machine learning and Deep learning on edge devices using TensorFlowMachine learning and Deep learning on edge devices using TensorFlow
Machine learning and Deep learning on edge devices using TensorFlow
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
Tensorflow on Android
Tensorflow on AndroidTensorflow on Android
Tensorflow on Android
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?
 
TEE - kernel support is now upstream. What this means for open source security
TEE - kernel support is now upstream. What this means for open source securityTEE - kernel support is now upstream. What this means for open source security
TEE - kernel support is now upstream. What this means for open source security
 
Smart Object Architecture
Smart Object ArchitectureSmart Object Architecture
Smart Object Architecture
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
Opnet tutorial
Opnet tutorialOpnet tutorial
Opnet tutorial
 
The Flink - Apache Bigtop integration
The Flink - Apache Bigtop integrationThe Flink - Apache Bigtop integration
The Flink - Apache Bigtop integration
 
gcdtmp
gcdtmpgcdtmp
gcdtmp
 
Near real-time anomaly detection at Lyft
Near real-time anomaly detection at LyftNear real-time anomaly detection at Lyft
Near real-time anomaly detection at Lyft
 
Stackato
StackatoStackato
Stackato
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 
Scale machine learning deployment
Scale machine learning deploymentScale machine learning deployment
Scale machine learning deployment
 
Bit_Bucket_x31_Final
Bit_Bucket_x31_FinalBit_Bucket_x31_Final
Bit_Bucket_x31_Final
 
TLDK - FD.io Sept 2016
TLDK - FD.io Sept 2016 TLDK - FD.io Sept 2016
TLDK - FD.io Sept 2016
 
It's a Jungle Out There – IoT and MRuby
It's a Jungle Out There – IoT and MRubyIt's a Jungle Out There – IoT and MRuby
It's a Jungle Out There – IoT and MRuby
 

More from Koan-Sin Tan

running stable diffusion on android
running stable diffusion on androidrunning stable diffusion on android
running stable diffusion on android
Koan-Sin Tan
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source Tools
Koan-Sin Tan
 
A Peek into TFRT
A Peek into TFRTA Peek into TFRT
A Peek into TFRT
Koan-Sin Tan
 
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source ToolExploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
Koan-Sin Tan
 
A Sneak Peek of MLIR in TensorFlow
A Sneak Peek of MLIR in TensorFlowA Sneak Peek of MLIR in TensorFlow
A Sneak Peek of MLIR in TensorFlow
Koan-Sin Tan
 
A Peek into Google's Edge TPU
A Peek into Google's Edge TPUA Peek into Google's Edge TPU
A Peek into Google's Edge TPU
Koan-Sin Tan
 
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
Koan-Sin Tan
 
open source nn frameworks on cellphones
open source nn frameworks on cellphonesopen source nn frameworks on cellphones
open source nn frameworks on cellphones
Koan-Sin Tan
 
Caffe2 on Android
Caffe2 on AndroidCaffe2 on Android
Caffe2 on Android
Koan-Sin Tan
 
SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016
Koan-Sin Tan
 
A peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk UserA peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk User
Koan-Sin Tan
 
Android Wear and the Future of Smartwatch
Android Wear and the Future of SmartwatchAndroid Wear and the Future of Smartwatch
Android Wear and the Future of Smartwatch
Koan-Sin Tan
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android BenchmarksKoan-Sin Tan
 
Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source SolutionsDark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source SolutionsKoan-Sin Tan
 
Smalltalk and ruby - 2012-12-08
Smalltalk and ruby  - 2012-12-08Smalltalk and ruby  - 2012-12-08
Smalltalk and ruby - 2012-12-08
Koan-Sin Tan
 

More from Koan-Sin Tan (15)

running stable diffusion on android
running stable diffusion on androidrunning stable diffusion on android
running stable diffusion on android
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source Tools
 
A Peek into TFRT
A Peek into TFRTA Peek into TFRT
A Peek into TFRT
 
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source ToolExploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
 
A Sneak Peek of MLIR in TensorFlow
A Sneak Peek of MLIR in TensorFlowA Sneak Peek of MLIR in TensorFlow
A Sneak Peek of MLIR in TensorFlow
 
A Peek into Google's Edge TPU
A Peek into Google's Edge TPUA Peek into Google's Edge TPU
A Peek into Google's Edge TPU
 
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
 
open source nn frameworks on cellphones
open source nn frameworks on cellphonesopen source nn frameworks on cellphones
open source nn frameworks on cellphones
 
Caffe2 on Android
Caffe2 on AndroidCaffe2 on Android
Caffe2 on Android
 
SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016
 
A peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk UserA peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk User
 
Android Wear and the Future of Smartwatch
Android Wear and the Future of SmartwatchAndroid Wear and the Future of Smartwatch
Android Wear and the Future of Smartwatch
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android Benchmarks
 
Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source SolutionsDark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
 
Smalltalk and ruby - 2012-12-08
Smalltalk and ruby  - 2012-12-08Smalltalk and ruby  - 2012-12-08
Smalltalk and ruby - 2012-12-08
 

Recently uploaded

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

Running TFLite on Your Mobile Devices, 2020

  • 1. Koan-Sin Tan, freedom@computer.org COSCUP, Aug 1st, 2020 Running TFLite on Your Mobile Devices
  • 2. • disclaimer: opinions are my own • feel free to interrupt me if you have any questions during the presentation • questions could be Taiwanese, English, or Mandarin
  • 3. • Used open source before the term “open source” is used • A software guy, learned to use Unix and open source software on VAX-11/780 running 4.3BSD • Used to be a programming language junkie • Worked on various system software, e.g., CPU scheduling and power management of non- CPU components • Recently, on NN performance on edge devices related stuff • Contributed from time to time to TensorFlow Lite • started a command line label_image for TFLite who i am https://gunkies.org/w/images/c/c1/DEC-VAX-11-780.jpg
  • 4. VAX 11/780 CPU consists of TTL ICs https://en.wikipedia.org/wiki/Transistor%E2%80%93transistor_logic https://en.wikipedia.org/wiki/7400-series_integrated_circuits
  • 5. Why TFLite? • TensorFlow Lite • TensorFlow is one of the most popular machine learning frameworks • TFLite: a lightweight runtime for edge devices • originally mobile devices —> mobile and IoT/embedded devices • could be accelerated by GPU, DSP, or ASIC accelerator • How about PyTorch? • yes, it is popular, but not on mobile devices yet • Yes, there are other open source NN frameworks. No one is as comprehensive as TF Lite, as far as I can tell • See my talk slide deck at COSCUP 2019 for more discussion, https://www.slideshare.net/kstan2/status- quo-of-tensor-flow-lite-on-edge-devices-coscup-2019
  • 6. Outline • Overview of TFLite on Android and iOS devices, • TFLite metadata and TFLite Android code generator, • Some new features: CoreML delegate and XNNPACK delegate
  • 7. What is TensorFlow Lite • TensorFlow Lite is a cross-platform framework for deploying ML on mobile devices and embedded systems • Mobile devices -> mobile and IoT/embedded devices • TFLite for Android and iOS • TFLu: TFLite micro for micro-controllers
  • 8. Why ML on Edge devices • Low latency & close knit interactions • “There is an old network saying: Bandwidth problems can be cured with money.  Latency problems are harder because the speed of light is fixed — you can't bribe God.” -- David D. Clark, • network connectivity • you probably heard “always-on” back from 3G days, you know that’s not true in the 5G era • privacy preserving • sensors
  • 9. from TF Dev Summit 2020, https://youtu.be/27Zx-4GOQA8
  • 10. • We’ll talk about • TFLite metadata and codegen which are in tflite support library • two delegates which enable using hardware capabilities • What others you may want to dig into • quantization, fixed point, integer • ARM dot product instruction, Apple A13 matrix operations in CPUs (yes, CPU) • GPU delegate started quantized models couple month ago • GPUs usually support fp16 first • new MLIR-based runtimes, such as TFRT and IREE • I’ll talk a little bit about TFRT tomorrow
  • 11. So how to start using TFLite • TFLite actually has two main parts • interpreter: loads and runs a model on various hardware • converter: converts TF models to a TFLite specific format to be used by the interpreter • see https://www.tensorflow.org/lite/guide for more introduction materials • There is a good guide on how to load a model and do inference on devices using TFLite interpreter, in Java, Swift, Objective-C, C++, and Python • https://www.tensorflow.org/lite/guide/inference
  • 12. load and run a model in C++ other APIs are wrappers around C++ code https://www.tensorflow.org/lite/guide/inference
  • 13. TFLite metadata and TFLite Android code generator
  • 14. TFLite Metadata • before TFLite Metadata was introduced, when we load and run a model • it’s user’s/developer’s responsibility to figure out what input tensors and output tensors are. E.g., • we know image a classifier usually expects preprocessed (resizing, cropping, padding, etc.) and normalized ([0, 1] or [-1, 1]) data • label file is not included • in TFLite metadata, there are three parts in the schema: • Model information - Overall description of the model as well as items such as licence terms. See ModelMetadata. • Input information - Description of the inputs and pre-processing required such as normalization. See SubGraphMetadata.input_tensor_metadata. • Output information - Description of the output and post-processing required such as mapping to labels. See SubGraphMetadata.output_tensor_metadata. https://www.tensorflow.org/lite/convert/metadata
  • 15. • Supported Input / Output types • Feature - Numbers which are unsigned integers or float32. • Image - Metadata currently supports RGB and greyscale images. • Bounding box - Rectangular shape bounding boxes. The schema supports a variety of numbering schemes. • Pack the associated files, e.g., • label file(s) • Normalization and quantization parameters
  • 16. • With example at https:// www.tensorflow.org/lite/convert/ metadata, we can create a image classifier with • image input, and • label output https://www.tensorflow.org/lite/convert/metadata
  • 18. CoreML Classifier model and autogen headers for Objective-C
  • 19. My exercise to use Android CameraX and TFLite codegen in Kotlin • To test TFLite metadata and codegen, I need an Android app that can • grab camera inputs and • convert them into Android Bitmap to feed into the generated model wrapper. • Since I know nothing about Android Camera and Kotlin, I started this from the CameraX tutorial. It seems quite easy. • https://github.com/freedomtan/CameraxTFLite
  • 22. screenshot of the simple app
  • 24. What is a TFLite delegate? • “A TensorFlow Lite delegate is a way to delegate part or all of graph execution to another executor.” • Why delegates? • running computation-intensive NN models on mobile devices is resource demanding for mobile CPUs, processing power and energy consumption could be problems • and matrix-multiplication which is there core of convolution and fully connected ops is highly parallel • Thus, some devices have hardware accelerators, such as GPU or DSP, that provide better performance and higher energy efficiency thru Android NNAPI • To use NNAPI, TFLite has an NNAPI delegate from the very beginning. Then, there are GPU delegates (GL ES, OpenCL, and Metal for now. Vulkan one is coming) and others. • my COSCUP 2019 slide deck on how NNAPI and GPU delegates work , https://www.slideshare.net/ kstan2/tflite-nnapi-and-gpu-delegates
  • 25. XNNPACK and CoreML Delegates • “XNNPACK is a highly optimized library of floating-point neural network inference operators for ARM, WebAssembly, and x86 platforms.” • “XNNPACK is not intended for direct use by deep learning practitioners and researchers; instead it provides low-level performance primitives for accelerating high-level machine learning frameworks, such as TensorFlow Lite, TensorFlow.js, PyTorch, and MediaPipe.", https://github.com/google/XNNPACK • NNPACK —> QNNPACK —> XNNPACK • In TFLite, there is a XNNPACK delegate • CoreML is Apple’s machine learning framework • the only formal way to use Neural Engine, Apple’s NN accelerator started from A11 • nope, CoreML cannot use A11 Neural Engine, https://www.slideshare.net/kstan2/why-you-cannot- use-neural-engine-to-run-your-nn-models-on-a11-devices
  • 26. • convolution is at the core of current neural network models • How convolution is implemented either in SW or HW • “direct convolution”: 6- or 7-layer nested for loops, • im2col, then GEMM, • other transforms, e.g., Winograd • XNNPACK found a way to efficiently reuse GEMM XNNPACK https://arxiv.org/pdf/1907.02129.pdf
  • 27. Using XNNPACK in label_image.cc https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/label_image/ label_image.cc#L109-L116 https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/tools/evaluation/utils.h#L64-L88
  • 28. Using CoreML delegate https://github.com/freedomtan/glDelegateBenchmark/blob/master/glDelegateBenchmark/ViewController.mm#L61-L68 model name CPU 1 thread (ms) CPU 2 threads (ms) GPU (ms) CoreML Delegate (ms) [4] Mobilenet V1 1.0 224 26.54 18.21 10.91 2.03 PoseNet 34.14 23.62 16.75 3.34 DeepLab V3 (257x257) 39.65 29.87 20.43 9.10 Mobilnet V2 SSD COCO 44.94 34.05 19.73 11.54 On iPhone 11 Pro, I got
  • 29. Concluding remarks • TFLite is getting more and more mature and comprehensive • If you haven’t started using it, you may want to start with TFLite metadata and Android code generators • nope, there is no iOS code generator (yet) • To speed up execution of NN models, use TFL delegates • note that not all accelerators are created equal • some are fp only; some are int/quant only
  • 30. Fin
  • 31. A13 AMX (Apple Matrix Extension?)
  • 32. sgemm and dgemm in BLAS • For (2048x4096) x (40x96x4096) matrix multiplication • sgemm (32-bit floating point) speed: A13 > My MBP >> A12 > A11 • dgemm (64-bit floating point) speed: My MBP > A13 >> A12 > A11