Repository navigation
Releases
LiteRT Quantizer 0.12.0
LiteRT Quantizer Release Notes: Version 0.12.0
- Old Revision:
v0.10.0ofai-edge-quantizer(Commit 7e6af26) - New Revision:
v0.12.0oflitert-quantizer(Commit affc364 on release/2.4.0) - Repository: google-ai-edge/LiteRT, folder
litert_quantizer/
AI Edge Quantizer is now LiteRT Quantizer
- New name, package and repository. The quantizer moved to the LiteRT repository under
litert_quantizer/. Installlitert-quantizer(nightly:litert-quantizer-nightly), importlitert_quantizerinstead ofai_edge_quantizer, and runlitert-quantizerinstead ofaeq. Apart from the names, the API is unchanged (see the migration guide). ai-edge-quantizeris deprecated. Its final release, 0.10.1, warns on import, and the google-ai-edge/ai-edge-quantizer repository is archived.litert-quantizer0.11.0 only renamed 0.10.0, so the changes below are new in 0.12.0.
Quantization Algorithms & Recipes
- Mixture-of-Experts (MoE) quantization. The LiteRT MoE custom op (
moe) can now be quantized with int8 or int4 dynamic-range weights, either per expert and channel (newquantized_dimensionsfield inTensorQuantizationConfig) or in int4 blocks of 32.DEQUANTIZED_WEIGHT_RECOVERYhandles MoE weights too. - Kronecker Hadamard rotations.
DECOMPOSED_HADAMARD_ROTATIONhas newalgorithm_params: q_init_mode="auto"(two-stage Kronecker rotation),sizing_mode, randomize(deterministic ±1 sign flips) andscale_refinement="mse_grid"(refines OCTAV scales to minimize MSE). The defaults keep the previous behavior.get_hadamard_block_sizeandmake_cross_block_matrixare now public, so external rotation-aware calibration can build the same rotations. See the Hadamard rotation guide. - 2-bit weights on INT4 kernels (
int2_in_int4). Newalgorithm_paramsoption for symmetric 4-bitOCTAVand the Hadamard algorithms that use it. It stores weights as the 4-level codes{-3, -1, 1, 3} * scalein INT4, so you can evaluate 2-bit weights on existing INT4 kernels; the model is not smaller than INT4. On Gemma 4 E4B, 2-bit weight RMSE is ~30% lower than with symmetric INT2.
Performance & Usability
- Lower memory use in validation. When the float model or a previously quantized model is given as a file path,
validate()lets TFLite memory-map it instead of copying it into memory, which matters for multi-GB models. - Progress bar for model serialization. Writing the quantized model now reports progress.
Packaging & Dependencies
- Python 3.10 is deprecated. Importing
litert_quantizeron Python 3.10 emits aFutureWarning. The next release will require Python 3.11 or later.
Bug Fixes
- Calibration with generator datasets. Counting samples for the progress bar used up generator datasets before calibration started, so no samples were calibrated.
- Large tensors with more than 2 dimensions. Quantizing such tensors over 32 MiB no longer fails when broadcasting scales.
- Symmetric
OCTAVstep size. OCTAV now weighs quantization noise with the correct symmetric step, which tightens 4-bit scales by ~3% and lowers weight error. - Dequantized weight recovery. Fixed oversized scales for small blocks that only hold sparse multiples of the quantization step, which made lossless validation fail.
- Hadamard rotation of model outputs.
DECOMPOSED_HADAMARD_ROTATIONnow updates the signature when it rotates a subgraph output, e.g. in a standaloneEMBEDDING_LOOKUPmodel.
v2.4.1
LiteRT Release Notes: Version 2.4.1
LiteRT Runtime
Bug Fixes
-
Fixed
NaNoutput corruption in ML Drift'sodml.fused_sdpa_cache_updateby zeroing out the past-attention term when the KV cache is empty on the first prefill chunk -
Prevented Adreno 8xx OpenCL GPU watchdog timeouts on compute-heavy subgraphs by partitioning kernel dispatches into FLOPs-bounded batches
v2.4.0
LiteRT Release Notes: Version 2.4.0
LiteRT Runtime
Performance and Memory
- Mixture of Experts (MoE) on GPU and CPU: LiteRT now runs MoE models like Gemma 4 26B-A4B by executing only the active experts for each token. Sharing weights between prefill and decode and caching them on disk cuts repeat startup time from ~30–45s down to ~2s and saves over 11 GB of setup memory (and ~2.75 GB of RAM on CPU).
- Faster hybrid LLMs: Added fused GPU kernels across Metal, WebGPU, and OpenCL for hybrid models like Qwen3.5 and LFM2.5. Combining ~20 small operations per layer into a single pass cuts GPU launches per token by 58% and speeds up generation by up to 35% on Metal, 23% on WebGPU, and 18% on Android.
- Longer contexts with FlashAttention: Extended FlashAttention to WebGPU and Android OpenCL, allowing 32K-token prompts to run on mobile GPUs without running out of memory and saving up to 2.1 GB of RAM. Also improved Metal Flash-Decode for wider attention heads and large caches, speeding up Gemma 4 26B-A4B generation by ~15% at 32K and ~31% at 64K context.
- Lower GPU memory usage: Removed unnecessary offset buffers for 4-bit weights, cutting peak memory by 15–17% and speeding up generation by ~5%. Also added zero-copy weight loading on Apple WebGPU and Android OpenCL, plus native 4-bit GPU tensor buffers.
Hardware Acceleration
- Compile-Time Input Shape Refinement: Users can now override dynamic input shapes during AOT (apply_plugin_main) and on-device JIT (CompiledModel) compilation via new C, C++, and Kotlin/Java CompilerOptions APIs.
- Externalized Weight Support in Compiler Plugins: Added support for externalized weight models across LoadModelFromFile, IsConstant, and LiteRtCompiledModelT::ApplyPluginsWithCaching (across file paths, WeightLoader, ScopedWeightSource, and weight_in_memory_map), freeing NPU-consumed external buffers after compilation.
- Expected Dispatch Functions Hint: CompiledModel now passes expected dispatch function names from selected signatures through DispatchDelegate to LiteRtDispatchDeviceContextSetExpectedFunctions(), allowing backends to defer loading unselected subgraphs and weights.
- Vendor NPU Backends & SDKs
- Arm
* Introduced a new GPU backend based on the Arm Vulkan ML API, offering experimental support for the Arm Mali G2-Ultra NX. Under the hood, the GPU driver(provided by ARM) can offload select graph nodes to an integer-based Neural Engine within the GPU. - Qualcomm
* Added HTP init acceleration, load-time perf voting, and memory-budget controls.
* Added channel-tile tuning to reduce weight-sharing performance regressions.
* Added HTP DLBC activation and weight-compression controls.
* Added op-name formatting control for QNN context binary size.
* Added GQA transformations for both prefill and decode graphs.
* Expanded QNN coverage for Vision, detection, Conv3D, and Bool8 models.
* Expose JIT option and Graph priority options via Kotlin interface.
* QAIRT SDK Upgrade: Upgraded the QAIRT SDK dependency to 2.51.1.261002.
- Arm
- ML Drift GPU delegate: Now leaves an EMBEDDING_LOOKUP with a non-constant float32 table on the CPU instead of crashing.
APIs & Platform support
- Swift Package: Launched https://github.com/google-ai-edge/LiteRT-Swift, a lightweight repository for adding the LiteRT Swift package to iOS and macOS apps with Swift Package Manager.
- C++ SDK & Unified Prebuilts (litert_prebuilts.zip): Bundled litert_cc_sdk/ directly inside the unified prebuilt archive at https://storage.googleapis.com/litert/binaries/latest/litert_prebuilts.zip (with nightly builds also retaining a 60-day rolling archive history on GCS), alongside prebuilt runtime libraries (libLiteRt.*), GPU accelerators (libLiteRtClGlAccelerator.so, libLiteRtWebGpuAccelerator.{so,dll}, libLiteRtMetalAccelerator.dylib), vendor NPU compiler/dispatch plugins, and CLI tools (apply_plugin_main, analyze_model_main, benchmark_model, run_model, gpu_numerics_check, npu_numerics_check, culprit_finder_main) across Android (arm64, arm32, x86_64), Linux (x86_64, arm64, aarch64-oe-linux-gcc11.2), Windows (x86_64, arm64), macOS (arm64), and iOS (arm64, sim_arm64). The included litert_cc_sdk/ provides LiteRT C/C++ headers, wrapper sources, CMake presets (including new windows-arm64 and windows-x64 presets for MSVC and clang-cl with automatic .lib import-library generation), sample apps (run_model_simple, dump_model_simple), and a bundled litert-cc-sdk-prebuilt-onboarding skill (documented in litert_cc_sdk/README.md) to guide coding agents through CMake integration and GPU/NPU deployment.
- Windows ARM64 Wheels, Prebuilts & Qualcomm NPU Support: Cross-compiled ai-edge-litert wheels (Python 3.11–3.14) and litert_prebuilts_windows_arm64.zip are now built with Bazel and MSVC, packaging libLiteRt.dll, libLiteRtWebGpuAccelerator.dll, LiteRtCompilerPlugin_Qualcomm.dll, LiteRtDispatch_Qualcomm.dll, and CLI tools (apply_plugin_main, benchmark_model, run_model, analyze_model_main, gpu_numerics_check, npu_numerics_check), alongside Windows ARM64 support in ai-edge-litert-sdk-qualcomm (>= 2.4.0).
- Linux aarch64 On-Device Qualcomm NPU Support: The linux_aarch64 ai-edge-litert wheel now ships the Qualcomm compiler plugin, dispatch library, and apply_plugin_main, and ai-edge-litert-sdk-qualcomm automatically discovers glibc-matched QNN host libraries and Hexagon skel directories on Qualcomm Linux aarch64 devices.
- Versioned Vendor C ABIs (Breaking for Out-of-Tree Backends): Migrated both the LiteRT Dispatch C ABI and Compiler Plugin C ABI to versioned interface tables (LiteRtDispatchQueryInterface, LiteRtCompilerPluginQueryInterface, LiteRtAbiHeader), narrowed shared library exports, and published an out-of-tree backend guide (BUILD_YOUR_OWN_BACKEND.md).
- Last Inference Duration API (C, C++, Kotlin/Java): Restored TFLite's Interpreter.getLastNativeInferenceDurationNanoseconds() parity via LiteRtGetCompiledModelLastInferenceDuration (C), CompiledModel::LastInferenceDurationNanoseconds() (C++), and CompiledModel.lastNativeInferenceDurationNanoseconds / getLastNativeInferenceDurationNanoseconds() (Kotlin/Java).
- Python 3.10 support is deprecated. Python 3.10 reached upstream end-of-life on 2026-10-01 (PEP 619). Importing ai_edge_litert on Python 3.10 now emits a FutureWarning. 2.4.0 is the last release that supports Python 3.10. The next release (2.5.0) will require Python ≥ 3.11 and will no longer publish cp310 wheels. If you are on Python 3.10, upgrade to 3.11 or newer, or pin ai-edge-litert==2.4.*.
- TensorFlow-Free Builds (Bazel & CMake): The default LiteRT OSS Bazel build no longer fetches the TensorFlow repository and uses lightweight shim repositories instead. Building with real TensorFlow (needed for the converter and a few tests) is still available via --config=with_tensorflow (LITERT_WITH_TENSORFLOW=1). The CMake build no longer clones TensorFlow at configure time; it downloads only the few header-only files the runtime needs and fetches TensorFlow only for benchmark_model and kernel tests. Breaking: the use_local_tf bazelrc config and the USE_LOCAL_TF / TF_LOCAL_SOURCE_PATH variables were removed.
- Minimal CPU Runtime Builds & Selective Op Registration: Added the --//litert/build_common:cpu_backend={xnnpack,builtin,selective} build flag, replacing the TFLite-specific --define=tflite_with_xnnpack=false (still accepted). cpu_backend=selective drops XNNPACK and all unused built-in kernels, linking only the ops your model uses. Passing models = ["my_model.tflite"] to litert_cc_binary, litert_cc_test, or litert_cc_library extracts and registers the required ops automatically at build time; litert::tflite_support::SetOpResolver remains available for explicit control. On Linux ARM32, a minimal CompiledModel binary shrinks from 5.45 MB (default) to 2.18 MB (cpu_only + selective). See the new MINIMAL_BUILD.md guide for all options and measured sizes.
v2.3.2
v2.3.0
LiteRT Release Notes: Version 2.3.0
Summary
The LiteRT 2.3.0 release represents a leap in on-device AI efficiency, particularly for Large Language Models (LLMs) and cross-platform GPU/NPU utilization.
API and Platform updates
- Swift Package for iOS & macOS - New type-safe Swift APIs to run LiteRT models with hardware acceleration (developer guide).
- Support Library - Migrated from TensorFlow Lite Support to LiteRT Support (migration guide).
- Android - minSdk raised to 24; GPU (litert-gpu) and vendor-specific NPU libraries now ship as separate Maven packages (NPU sample).
Hardware acceleration
- Standalone Open Source LiteRT ML Drift GPU accelerator
- NPU Scaling - Samsung NPU (Exynos AI LiteCore) with LiteRT.
- Intel NPU/GPU - Weight sharing roughly halves AOT-compiled LLM size.
- MediaTek NPU - Support expanded to all Android S+ versions.
Performance and Memory optimizations
- FlashAttention on Metal - Up to 38% faster decode, up to 2.98x faster prefill, and >4 GB less peak RAM at 32K context.
- Fused LLM kernels - New QKV-RMSNorm-RoPE and SwiGLU GPU kernels for ~12% faster decode.
- GPU memory - Metal memory residency on iOS/macOS avoids swap paging; zero-copy mmap for the program cache lowers peak RAM.
Validation / Testing Infrastructure
- ATS - Coverage expanded to all core single ops and to macOS (Metal and WebGPU).
v2.2.0
LiteRT Release Notes: Version 2.2.0
Executive Summary & Scope
API and Platform updates:
- Rust Integration - Published google-ai-edge-litert crate on crates.io enabling C++ SDK capabilities in Rust
- ABI Compatibility - Added ABI version tracking to key modules (libLiteRT.so, GPU accelerator, Dispatch, Compiler) facilitating smoother upgrades across 2.2.x binary versions.
API Updates:- LiteRT.js - LiteRT Tensor API support and features for recurrent KV cache swapping; and JIT/tracing support for custom tensor graphs.
- (check: do we call out SetSelectedSignatures?)
- New Data Type - Added native support for for F8E4M3FN and F8E5M2 tensor elements
New HW support - Intel NPU - Added full JIT/AOT support for LunarLake and Panther Lake
- Qualcomm - QAIRT : Improved SoC coverage with SDK 2.47
- MediaTek - Improvements to channelwise quantization support
- CPU (Experimental) : New YNNPack accelerator
Performance and Model optimizations - LLM throughput improvements - added ROPE composite Ops for GPU, resulting in ~5% faster decode performance
- Multiple optimizations for memory efficiency and GPU execution
Validation / Testing Infrastructure - Faster test registration
- New multi-criteria validation framework (ConformanceSpec) for mixed-precision verification.
🌟 Release 2.2.0 Summary
1. LiteRT Runtime
Overview: Core C/C++ inference engine, delegate interfaces, platform APIs (Swift, Python, C), memory management, and hardware acceleration plugins.
- Old Revision: v2.1.6
- New Revision: v2.2.0
- Repository: google-ai-edge/LiteRT
🤖 Model/ Operator Coverage
XNNPACK supports for fp16 DEPTHWISE_CONV_2D, CONV_2D, FULLY_CONNECTED, and BATCH_MATMUL
⚡ Performance and Memory
- Added a new precision mode, kLiteRtDelegatePrecisionFp16WithFp32Accum.Currently it is GPU only. When enabled the GPU backend will use FP16 storage and arithmetic with FP32 accumulation for CONV_2D, DEPTHWISE_CONV_2D, FULLY_CONNECTED, TRANSPOSE_CONV and BATCH_MAT_MUL operators , which can provide a midground between pure 32-bit and pure 16-bit computation.
- Prepares input on GPU for the models which don’t run embedding lookup on CPU, including Gemma3 or before, and Open weight models like Qwen3
- Added ROPE composite op for GPU to improve the performance for LLMs.
The decode performance increased ~5% - For best GPU performance, weights are re-arranged in batches on the GPU to be the optimal format for execution. In this release, the batch size was changed to scale with the total size of the model to reduce memory usage and improve initialization time. The impact will vary depending on model and device type but Gemma 4 E2B on a Linux NVIDIA machine saved ~200MB.
🛠️ Hardware Acceleration
- [Experimental] New CPU accelerator YNNPACK can be enabled through the compilation flag:
--define litert_enable_ynnpack=trueand runtime flag:--enable_ynnpack=true. - Improved MTK NPU backend's channelwise quantization support for classical vision models, such as resnet18 and mobilenet.
- Added support for Intel NPU (LunarLake and PantherLake), enabling both JIT and AOT compilation. Verified on a variety of classic and selected GenAI models (Gemma4 2B instructions) on Windows and Linux.
- LiteRT QAIRT accelerator
- Major Features and Improvements
- Supported specifying the Qualcomm SoC using either the SoC name or numeric SoC model.
- Aligned SoC coverage with QAIRT SDK 2.47.
- Refined OP validation and debugging logs.
- Added documentation for QNN Native Path, QC options, and CMake toolchain builds.
- Improved compiler plugin to avoid redundant QNN library reloads.
- Enhanced OP coverage: A8W2 Fully Connected, BatchToSpaceNd, and SpaceToBatchNd.
- Bug Fixes and Other Changes
- Skipped custom op delegates when the custom op package is not registered.
- Major Features and Improvements
🔌 APIs & Platform support
- ABI version information has been added to data structures to enhance backward compatibility for data types used in interfaces between key LiteRT modules (libLiteRt.so, GPU Accelerators, Dispatch, Compiler). Once this compatibility feature is complete, the system will operate without issues even when using different 2.2.x version binaries together.
- The new LiteRT Rust binding has been open-sourced. The google-ai-edge-litert crate was published on crates.io and can be used with the standard Rust Cargo build manager. The binding is built on top of the LiteRT C++ Binary SDK.
- Introduced new
SetSelectedSignaturesAPI - Added two new tensor element data type: F8E4M3FN and F8E5M2.
- LiteRt.js API added support for streamed weight loading Dynamic Range Quantized models to WebGPU.
- Tensor API:
- Added RegisterCustomOpParser and MixinRegistrar to map custom flatbuffer operators (CUSTOM, STABLEHLO_COMPOSITE) to typed LiteRT operations and dynamically bind backend execution logic.
- Added FeedbackLoopConfig to automate recurrent KV cache swapping and zero-copy buffer bindings between execution steps without requiring manual per-iteration re-binding.
- Added Tensor API python support, extended with transformer operation surfaces, explicit Q/DQ export, quantized TFLite lowering, and Safetensors loading with compressed weight ingestion (qb4w).
- Added JIT compilation and tracing support (compile() / WrittenModel) for authoring and executing custom tensor graphs directly in LiteRT JS.
🐛 Security, Vulnerability and Stability
- Added integer overflow checks to convolution, reshape and pad-like CPU kernels,
- Stricter input shape restriction in Conv3DTranspose: older versions of LiteRT also allowed this op’s number of output channels to be a multiple of the number of filter channels, but that this case was never implemented correctly and is no longer permitted.
- Fixed a transitivity violation in TopK comparator when NaN is present. NaNs are now treated as smaller than every non-NaN value, For example, for input [1, 2, 3, NaN] with k=3, the output should be [1,2,3].
- Enforced that the 1D size operand (operand 1) for ResizeBilinear and ResizeNearestNeighbor TFLite ops is dynamic or has dimension length 2
- Added initial fuzzing test based on https://github.com/google/fuzztest
- Accelerator Test Suite (ATS) improvements over all accelerator backends:
- Expanded Operator & Subgraph coverage: Added test graph generators for Pad, Concatenation, Softmax, Transpose, BatchMatmul, FullyConnected, Reshape, Reduction, BinaryBroadcast, and OneHot, alongside a compound TransformerLayer generator built with the litert::tensor C++ API.
- Advanced Conformance and Precision Verification: Introduced the ConformanceSpec multi-criteria validation framework (MSE, exact match, quantized buckets, accumulation tolerance), expanded FullyConnected quantization with dynamic/shuffled weights, and enabled FP16 and mixed-precision delegate testing.
- Harness Performance and Infrastructure: Optimized test registration to be ~30x faster (reducing filter setup time from ~170s to ~6s), added full delegation hints for GPU/CPU to prevent premature validation errors, and lazily initialized test buffers to significantly reduce log noise during test execution.
- A fix was submitted that was preventing the GPU weight cache from being utilized.
v2.1.6
Release 2.1.6
Major Features and Improvements
- CC APIs now can be used without linking Abseil
- Released ARMv7 prebuilts
- Expanded Accelerator Test Suite (ATS) single op coverage to 43 ops across f16 and f32 data types.
Bug Fixes and Other Changes
- Improved built-in kernels to support high dimensional tensors, and fixed GPU kernel issues (like broadcast)
v2.1.5
Release 2.1.5
Major Features and Improvements
- Python 3.14 Support: Added PyPI wheels for Python 3.14
- Make LiteRT C++ APIs header only
- Support LiteRT environment and option APIs directly from Python
- Removed libLiteRt.so dependency from GPU Accelerator and Dispatch API shared libraries. They no longer require libLiteRt.so to use.
- Made LiteRT Options class as pure data only object. It doesn’t require a LiteRT C API call to create & update the object.
- Added Raspberry Pi 5 GPU acceleration support
Bug Fixes and Other Changes
v2.1.4
v2.1.3
Release 2.1.3
Major Features and Improvements
-
Updated CMake build rules to support both CompiledModel and Interpreter APIs.
cmake_example/CMakeLists.txt shows how you can use both libraries. -
Expanded MediaTek NPU support to all applicable Android versions
(only Android 15 previously) by supporting bundling MediaTek libraries in
application binary. -
Added experimental support for multi-threaded CompiledModel creation
-
Fixed GPU support for Python on Windows
-
Individual Options APIs (litert/cc/options) no longer use LiteRT C APIs (LiteRtXXX). They’re updated to use string based serialization and use LrtXXX() functions which can be linked individually.
-
Added basic support for Broadcom VideoCore GPUs.
Bug Fixes and Other Changes
-
Move the experimental API
GetProfiler()out oflitert::CompiledModel. -
Fixed a bug that given CPU Buffers are not always synced with GPU Accelerator
from the second inference. -
Removed methods from
litert::Eventwhich uses C typeLiteRtEnvironment.
All C++ API should uses C++litert::Environmentinstead.
Also removed methodCreateFromSyncFenceFd()that doesn't accept
litert::Environment. -
Updated
litert::Event::Type()to return C++ types instead of C types. -
The LiteRT headers no longer define the following OpenCL type names in the
global namespace when OpenCL is not supported:cl_mem,cl_event.
These have been replaced with the type aliasesLiteRtClMemand
LiteRtClEvent, defined in a new headerlitert/c/litert_opencl_types.h.
All of these symbols that didn't include theLiteRtprefix in their name
were never intended to be part of the LiteRT API, and their presence
in the global namespace risked conflicts with header files from other
packages. -
Likewise, and for the same reason, the LiteRT headers no longer define the
following WebGPU type names in the global namespace when WebGPU is
supported:struct WGPUBufferImpl,WGPUBuffer. These have been
replaced with the type aliasLiteRtWGPUBufferwhich is defined in a
new header filelitert/c/litert_webgpu_types.h. Alternatively, apps
using these symbols can get them from WebGPU'swebgpu.hheader file. -
Added experimental support for multi-threaded CompiledModel creation