ai-edge-torch  by google-ai-edge

Python library for converting PyTorch models to TFLite format

Created 1 year ago
785 stars

Top 44.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

AI Edge Torch is a Python library designed to convert PyTorch models into the TFLite format, enabling on-device execution for Android, iOS, and IoT applications. It targets developers building mobile and edge AI solutions, offering broad CPU support with initial GPU and NPU capabilities, and a specialized Generative API for LLMs.

How It Works

The library leverages torch.export() to convert PyTorch models, aiming for broad coverage of Core ATen operators. This approach integrates closely with the PyTorch ecosystem. For LLMs, the Generative API facilitates model authoring and quantization for optimized on-device performance, with conversion to TFLite for execution via the TensorFlow Lite runtime or direct integration with the MediaPipe LLM Inference API.

Quick Start & Requirements

Highlighted Details

  • Supports conversion of PyTorch models to TFLite format for on-device inference.
  • Generative API specifically targets LLMs and transformer models for mobile deployment.
  • Offers broad CPU coverage with planned GPU and NPU support.
  • Integrates with MediaPipe LLM Inference API for mobile application development.

Maintenance & Community

  • Users can seek help by creating a GitHub issue.
  • Contribution documentation is available.

Licensing & Compatibility

  • License details are not explicitly stated in the README.

Limitations & Caveats

The PyTorch converter is in Beta, and the Generative API is in Alpha. The Generative API is currently CPU-only, with GPU and NPU support planned.

Health Check
Last Commit

17 hours ago

Responsiveness

1 day

Pull Requests (30d)
18
Issues (30d)
7
Star History
43 stars in the last 30 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Gabriel Almeida Gabriel Almeida(Cofounder of Langflow), and
2 more.

torchchat by pytorch

0.1%
4k
PyTorch-native SDK for local LLM inference across diverse platforms
Created 1 year ago
Updated 1 week ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
4 more.

gemma_pytorch by google

0.2%
6k
PyTorch implementation for Google's Gemma models
Created 1 year ago
Updated 3 months ago
Starred by Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), Lewis Tunstall Lewis Tunstall(Research Engineer at Hugging Face), and
15 more.

torchtune by pytorch

0.2%
5k
PyTorch library for LLM post-training and experimentation
Created 1 year ago
Updated 1 day ago
Starred by Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), and
20 more.

TensorRT-LLM by NVIDIA

0.5%
12k
LLM inference optimization SDK for NVIDIA GPUs
Created 2 years ago
Updated 12 hours ago
Feedback? Help us improve.