AI Edge Torch Generative API for Custom LLMs on Device- Google Developers Blog

Introduces the AI Edge Torch Generative API, enabling developers to author high-performance LLMs in PyTorch for deployment using the TensorFlow Lite (TFLite) runtime. This API offers custom transformer support, optimized CPU performance (with GPU/NPU support coming), compatibility with TFLite deployment flows (quantization, runtime), and support for models like TinyLlama, Phi-2, and Gemma 2B. It provides an easy authoring experience with core building blocks, weight re-mapping, intuitive quantization APIs, and multi-signature export for disaggregated prefill/decode functions. Performance optimizations include high-performant SDPA and KVCache, leveraging TFLite's XNNPack delegate, avoiding wasteful computations, and reducing runtime memory consumption. The post details the conversion and quantization process to TFLite, including export to StableHLO and further compiler passes.
More from the Coral Edge AI Platform trail
- ML Drift: Next-Gen GPU AI/ML Inference at the Edge- Google Developers Blog
- Bring multimodal semantic search to the edge with EmbeddingGemma 2- Google Developers Blog
- EmbeddingGemma 2: The Developer Guide- Google Developers Blog
- Mastering Edge AI on Raspberry Pi with LiteRT and Gemma- Google Developers Blog
- LiteRT.js, Google's high performance Web AI Inference- Google Developers Blog