MobileNetV2 deployment workflow
You will use the same initial workflow pattern as Module 1:
- Prepare the model, labels, image, and preprocessing settings.
- Export MobileNetV2 from PyTorch.
- Lower the FP32 model to ExecuTorch with XNNPACK.
- Inspect the delegation summary.
- Copy the artifacts to the Raspberry Pi.
- Benchmark PyTorch eager and FP32 ExecuTorch with XNNPACK.
You will then add quantization:
- Calibrate and quantize the exported model to INT8.
- Lower the quantized model and delegate to XNNPACK
- Benchmark INT8 ExecuTorch with XNNPACK.
- Compare artifact size, latency, delegation, and top-5 output.
- Run the image-classifier demo.
As you work, pay attention to the engineering trade-offs: latency, .pte artifact size, quantization accuracy shift, application behavior, and production validation still needed.
By the end of the workflow, you should have three benchmark results, two .pte artifact sizes, one delegation comparison, INT8 top-5 output, and at least one application-demo observation.
If you have not set up your development machine, follow the
Module 1 development machine setup
through creating and activating .cpu_aot_venv, then return here.
If you have not done so already, clone the repository and enter the directory:
git clone https://github.com/ArmDeveloperEcosystem/arm-courses-code-executorch.git ~/executorch_on_arm
cd ~/executorch_on_arm
Script layout
Module 2 follows the script workflow used in Module 1:
aot prepare/export/quantize/lower models on the development machine
pi/ compare PyTorch and ExecuTorch on the Raspberry Pi
pi/core load `.pte` artifacts and turn model outputs into app behavior
_support shared setup, plotting, result writing, and HTML rendering
You will prepare and lower the model on the development machine, copy the
deployable .pte files to the Raspberry Pi, and measure them on the target.
The model family changes from transformers to CNNs, and this module introduces the new quantization step, but the split between
ahead-of-time preparation and target-side execution remains the same.
Development and target environments
| Environment | Responsibility | Main outputs |
|---|---|---|
| Development machine | Prepare MobileNetV2, export, lower, calibrate, quantize | .pte artifacts, metadata, calibration images |
| Raspberry Pi | Benchmark PyTorch, FP32 XNNPACK, INT8 XNNPACK, run demo | JSON/CSV results, plots, top-5 output, app observations |
Course complete
Nice work
You completed Optimize and deploy AI inference with ExecuTorch on Arm.