Run ExecuTorch Llama 3.2 1B Instruct on an Android phone with Vulkan
Introduction
Prepare a Linux host and Android device for ExecuTorch Vulkan
Install ExecuTorch and download the model on the Linux host
Export the Vulkan PTE
Build the Android Vulkan runtime
Deploy and measure Llama 3.2 with ExecuTorch Vulkan on Android
Next Steps
Run ExecuTorch Llama 3.2 1B Instruct on an Android phone with Vulkan
Who is this for?
This Learning Path is for developers who want to export a Llama 3.2 model with ExecuTorch and run it on an Android phone through the Vulkan backend.
What will you learn?
Upon completion of this Learning Path, you will be able to:
- Set up a Linux host for Android cross-compilation, ADB deployment, and Vulkan-backed ExecuTorch builds.
- Export Meta Llama 3.2 1B Instruct to a Vulkan-enabled `.pte` with the exact quantization settings used in the guide.
- Build, deploy, measure, and validate the Android `llama_main` runner on a Vivo X300 Pro or similar Android phone.
Prerequisites
Before starting, you will need the following:
- A Linux host with enough disk space for the ExecuTorch source tree, Android SDK and NDK, Vulkan SDK, and the Llama checkpoint
- A Vivo X300 Pro or a similar Android phone with USB debugging enabled
- A Hugging Face account
- Working familiarity with the shell, Python virtual environments, and Android
adbworkflows
Summary
This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
.pte with the specified quantization, KV-cache, context, and metadata settings. After exporting, you’ll install glslc, cross-compile the runtime and llama_main, deploy the artifacts with adb, and verify Vulkan libraries during inference.Frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
git clone --branch release/1.4 --recursive https://github.com/pytorch/executorch.git and git submodule update --init --recursive. Create the environment with python3.12 -m venv .venv, activate it with source .venv/bin/activate, then install the pinned PyTorch version 2.13.0+cpu before continuing..pte file is about 1.8 GB.setup-env.sh script. Run which glslc and glslc --version to confirm that the compiler is available to the build.PyTorchObserver summary also reports prefill_token_per_sec and decode_token_per_sec.