This directory contains examples for some AI models.
Please check helper of each examples for detailed arguments.
Here are some general information and limitations.
Please finish tutorial Setting up executorch.
Please finish setup QNN backend.
Please set up QNN_SDK_ROOT
environment variable.
Note that this version should be exactly same as building QNN backend.
Please check setup.
Please set up LD_LIBRARY_PATH
to $QNN_SDK_ROOT/lib/x86_64-linux-clang
.
Or, you could put QNN libraries to default search path of the dynamic linker.
Please connect an Android phone to the workstation. We use adb
to communicate with the device.
If the device is in a remote host, you might want to add -H
to the adb
commands in the SimpleADB
class inside utils.py.
Some CLI examples here. Please adjust according to your environment:
cd $EXECUTORCH_ROOT/examples/qualcomm/scripts
python mobilenet_v2.py -s <device_serial> -m "SM8550" -b path/to/build_android/ -d /path/to/imagenet-mini/val
python deeplab_v3.py -s <device_serial> -m "SM8550" -b path/to/build_android/ --download
The mobilebert multi-class text classification example requires pandas
and sklearn
.
Please install them by something like
pip install scikit-learn pandas
-
QNN 2.13 is used for all examples. Newer or older QNN might work, but the performance and accuracy number can differ.
-
The mobilebert example is on QNN HTP fp16, which is only supported by a limited set of SoCs. Please check QNN documents for details.
-
The mobilebert example needs to train the last classifier layer a bit, so it takes time to run.
-
[Important] Due to the numerical limits of FP16, other use cases leveraging mobileBert wouldn't guarantee to work.