Google AI Edge 团队很高兴宣布,在 Apache 2.0 许可证下开源发布 ML Drift。这是一款高性能、跨平台的设备端 GPU 计算引擎,专为设备端 AI/ML 推理而打造。通过抽象化 OpenGL ES、OpenCL、Metal 和 WebGPU 等设备端 GPU 的硬件和低级 API 复杂性,ML Drift 赋能开发者在多个平台上构建实时、交互式的 ML 体验,从高级视频效果到生成式 AI 皆可实现。作为 LiteRT 内部的核心 GPU 加速引擎,ML Drift 也作为独立库提供,用于自定义图形和推理运行时,提供一个统一的底层基础,以在所有地方实现峰值性能。
ML Drift 在各平台上的 GPU API 支持矩阵
我们为何构建 ML Drift
与数据中心推理不同,后者中的模型在同质化、可预测的加速器集群上运行,将 GPU 加速 AI 部署到边缘设备则受制于显著的硬件多样性。开发者面临着广泛的 GPU 架构、驱动程序版本和低级 API 的挑战,且无法预先知道应用程序将在哪种特定硬件上运行。
TensorFlow Lite GPU delegate 奠定了 GPU 加速的基础,但生态系统随后发生了演变:当前的设备端工作负载涵盖广泛范围,从实时计算机视觉、音频和深度处理模型到高参数量的生成式 AI。这些架构将消费级硅片推向极限,造成了计算和内存瓶颈,而传统的运行时并非为此设计。
这种转变需要一个通用的工程基础,以确保经典模型和下一代模型的便携性与性能。借鉴“Speed is all you need”一文中讨论的优化原则,我们构建了一个单一、统一的框架,既为传统 ML 提供稳定性,又为最先进的生成式 AI 提供峰值性能,确保您的模型在我们的最高效、面向未来的 GPU 计算引擎上运行。
针对峰值性能和覆盖率的架构现代化
为了在经典和生成式架构中实现峰值性能和扩展的模型覆盖率,ML Drift 引入了核心架构变更和对传统 TFLite GPU delegate 的结构升级。
通过张量虚拟化统一着色器:历史上,为 TFLite GPU delegate 维护优化的着色器需要在 OpenGL、OpenCL 和 Metal 后端分别硬编码逻辑张量映射到物理 GPU 对象(如纹理和缓冲区)。ML Drift 引入了张量虚拟化这一核心架构范式,将张量的逻辑表示与其在 GPU 上的物理分配解耦。通过让动态着色器模板在编译器的初始化阶段解析并转换坐标,这种统一的着色器模型消除了维护不同后端特定着色器代码库的需求,同时增加了极少的运行时开销,并保留了跨平台模型的便携性。
可扩展的自定义算子框架:ML Drift 采用了现代化的自定义算子框架,提供直接注册 API 和低级着色语言访问权限。为了加速这一过程,ML Drift 包含了一个智能 SKILL.md 指南,使编码代理能够在几分钟内编写、注册和验证高性能的自定义着色器。这为开发者提供了细粒度的控制能力,可以直接将专用模型模块集成到执行图中,极大地降低了部署专有架构的门槛。
5D张量支持:TFLite GPU委托在结构上被硬编码为4D张量,迫使开发者使用布局技巧来处理需要5D张量的复杂模型。ML Drift将这一迟来的功能反映在新的LiteRT ML Drift GPU加速器中,以开箱即用地启用5D张量支持。借此,LiteRT能够在边缘GPU上直接执行复杂的工作负载,如用于体积/空间AI的3D卷积网络及时空模型(例如YOLO 11n、MobileViT v2和Swin Transformer v2)。
经典模型的性能升级:作为我们传统GPU后端的直接继任者,ML Drift为现有的经典工作负载提供了严格性能提升。通过使运行时与硬件特定的约束解耦,并提高内核执行效率,已经在TFLite GPU上运行的模型能够立即获得性能改进。迁移设计得简单直接,传统工作负载保持或超越之前的基准测试表现。
面向边缘LLM的阶段感知优化:自回归大语言模型在推理过程中有两种不同的计算工作负载:计算绑定的KV缓存预填充阶段和内存带宽绑定的解码阶段,后者逐个生成令牌。ML Drift根据当前执行阶段动态切换内核和布局配置。在解码阶段,它利用自定义的、与卷积对齐的KV缓存布局,并应用激进的内核激活量化,以绕过冗余的内存往返操作。
预填充512,解码128,上下文长度640,4位权重(块大小32),fp16 KV缓存,argmax采样,每个令牌同步。
展示了预填充(实心条;左侧纵坐标)和解码(空心条;右侧纵坐标)的吞吐量。
Gemma4 EB在支持跨KV共享的框架上表现更佳。
跨平台扩展(桌面预览):在当今新兴的智能体编码时代,高度响应的桌面推理对于驱动本地编码代理和工作站工作流变得至关重要。虽然我们最初为浏览器内加速设计了ML Drift的WebGPU后端,但Dawn(Chromium的WebGPU实现)使我们能够在浏览器外部原生编译完全相同的代码库。这种统一的API模型使ML Drift能够在Windows和Linux上运行,利用WebGPU现代化的原生硬件抽象来绕过DirectX和Vulkan的碎片化问题,同时补充我们在macOS上现有的高性能原生Metal后端。
我们的主要焦点仍然是提供轻量级、生产级的推理服务,特别是在资源限制最严格的移动和边缘设备上。然而,本地开发需要在开发者机器之间保持灵活性。以下是ML Drift在工作站硬件上运行Gemma模型的早期快照,展示了我们的统一运行时如何跨环境扩展。
桌面LLM性能。预填充8192,解码1024,上下文长度9216,
4位权重(块大小32),fp16 KV缓存,argmax采样,每个令牌同步。
在边缘和工作站环境中,峰值吞吐量只揭示了故事的一半:内存占用决定了哪些工作负载实际上可以并发运行。在我们的Gemma基准测试中,ML Drift比其他框架实现了高达12%的更低内存开销,从而为其他本地任务释放了内存。
大规模实战检验:从Google旗舰产品到行业领导者
ML Drift已在每天数百万台设备上投入生产运行,驱动Google生态系统中的关键功能,包括Chrome、YouTube Shorts、Photos和Meet。在最前沿,它作为开创性设备端功能的运行时,驱动着Google AI Edge应用如Gallery、Foresight和Eloquent。
YouTube Shorts将其基于分割的效果迁移至使用ML Drift。这使得Android和iOS上的平均帧延迟降低了多达40%,使创作者能够实时应用高保真视觉效果,而不会丢失相机帧。
抱歉,您的浏览器不支持此视频的回放。
为了实现快速、无缝的本地照片编辑,Google Photos 团队将其计算摄影和分割管线中集成了 ML Drift。与传统的 GPU 代理相比,这使得处理速度最高提升了 2 秒,让高级照片增强功能感觉如同即时完成。
抱歉,您的浏览器不支持此视频的回放。
Google Photos Unblur 通过 ML Drift 实现加速
Google Chrome 将 ML Drift 集成到其 AI 运行时基础设施中,以支持内置 AI API(包括 Prompt、Summarize 和 Writer API)的原生硬件加速 Gemini Nano 模型。在桌面平台上,ML Drift 使得从电商评论摘要到企业客户工作流的广泛网络应用生态系统能够实现高效的本地 AI:
抱歉,您的浏览器不支持此视频的回放。
Cafe24 使用通过 ML Drift 加速的 Prompt API 进行标签生成。
除了 Google 的产品之外,领先的开发者合作伙伴也采用了 ML Drift,将桌面级的能力带给移动用户:
Adobe Lightroom 和 Adobe Photoshop 利用 ML Drift 升级了关键 AI 功能,包括“选择主体”、“选择天空”和“自适应人像”,在移动端实现了高达 30% 的本地性能提升,从而实现专业级照片编辑。
抱歉,您的浏览器不支持此视频的回放。
通过移动 LiteRT ML Drift GPU 加速器在本地运行的 Adobe Lightroom
Snap 集成了 LiteRT,以在 Android 设备上利用 GPU 实现本地推理。ML Drift GPU 加速器使 Snapchat 镜头中基于 ML 的面部和风格生成效果模型延迟降低了 30%。ML Drift 不仅改善了基于现有模型的用户体验,还扩展了运行更大扩散模型的能力。
抱歉,您的浏览器不支持此视频的回放。
与主要硬件合作伙伴优化
最大化边缘 AI 效率需要软件架构与物理硅片之间的深度协同。在 ML Drift 的开发过程中,Google 与硅片和 IP 合作伙伴紧密合作,实现了针对现代 GPU 最大化硬件利用率的优化:
Arm:为 Mali 和 Immortalis GPU 共同优化了计算内核和纹理缓存局部性,确保移动设备上的高吞吐量、低功耗推理。
Intel:ML Drift 利用了原生 WebGPU 计算和 Xe 矩阵扩展(XMX),以加速搭载 Xe3 图形的 Intel® Core™ Ultra 处理器上的客户端大语言模型和视觉工作负载。
Qualcomm Technologies, Inc.:ML Drift 优化了 OpenCL 内核,以实现峰值 ALU 和内存带宽利用率,从而在 Qualcomm® Adreno™ GPU 上实现高效的边缘 AI 加速。
通过与硅片领域的领导者携手合作,ML Drift 确保最先进的模型优化转化为用户设备上电池友好、高帧率的性能表现。
下一步:弃用与迁移
随着 ML Drift 的发布,传统的 TFLite GPU 代理将不再接收新功能更新。我们鼓励所有开发者转向 LiteRT ML Drift GPU 加速器,该加速器为您的现有模型提供完全向后兼容,同时立即解锁 Android、iOS、Web 和桌面端的现代性能提升。对于使用解耦运行时以最小化应用二进制大小的 Android 开发者,ML Drift 加速功能现已在独立的 LiteRT 包中提供,并即将登陆 Google Play Services 中的 LiteRT。
入门指南
无论您是将本地模型集成到应用中,还是编写自定义 GPU 着色器,ML Drift 都提供了两条简单路径:
社区反馈与贡献
ML Drift 完全遵循 Apache 2.0 许可证开源。我们欢迎贡献、RFC(征求意见稿)以及社区反馈:
致谢:
安德烈·库利克、安基特·戈亚尔、鲍勃·刘、边澈尔·金、陈普·叶恩、常明·孙、克里斯·麦克莱纳汉、克拉克·杜瓦尔、科马克·布里克、丹尼尔·霍、戴维·内托、叶卡捷琳娜·伊格纳舍娃、冯武·姚、弗兰克·班、杰拉尔多·卡兰萨、格兰特·詹森、雅各布·多默斯、贾格迪什·帕卡拉沃、詹姆斯·普赖斯、杰里米·肯普、景江·李、九强·唐、凯尔文·马、肯·罗素、健二·巴侯克斯、林晨、洛科·孔、陆王、玛丽萨·伊科诺米迪斯、马特·克莱勒德、马蒂亚斯·格鲁恩曼、马蒂亚斯·西蒙松、帕维尔·安德鲁什凯维奇、拉曼·萨罗金、罗马里克·若丁、萨钦·科特瓦尼、索姆达塔·班纳吉、苏莱曼·沙希德、苏里尔·沙赫、特里·何、泰勒·穆伦、瓦伊巴夫·贾因、魏仪·王、于辉·陈
向合作伙伴致以一般性感谢:阿尔宾·伯恩哈德松、阿列克谢·列别杰夫、阿努拉达·奥博伊、阿塞尔兰·阿尔维、巴拉·加图、恩辛·熊、艾琳·迪莱瓦、汉娜·斯塔宾加斯、建辉·戴、家伟·邵、杰·陈、约瑟夫·施赫、科马尔·德赛、M·N·苏哈斯、马兹汗·加比多拉、明林·范、宁欣·胡、帕德马斯里·钱德拉谢卡尔、荣·王、瓦伦·查里、维克多·周、兆良·马
The Google AI Edge Team is excited to announce the open-source release of ML Drift , our high-performance, cross-platform, on-device GPU compute engine specifically built for on-device AI/ML inference, under the Apache 2.0 license. By abstracting hardware and low-level API complexities of on-device GPUs across OpenGL ES, OpenCL, Metal, and WebGPU, ML Drift empowers developers to build real-time, interactive ML experiences from advanced video effects to generative AI across multiple platforms. Serving as the core GPU acceleration engine within LiteRT , ML Drift is also available as a standalone library for custom graphics and inference runtimes providing a unified foundation to deliver peak performance everywhere.
ML Drift's GPU API support matrix across platforms
Why We Built ML Drift
Unlike datacenter inference, where models run on homogeneous, predictable accelerator clusters, deploying GPU-accelerated AI to edge devices is defined by significant hardware diversity. Developers are faced with a wide range of GPU architectures, driver versions, and low-level APIs, not knowing a priori on which specific hardware the application will run on.
The TensorFlow Lite GPU delegate established foundational GPU acceleration, but the ecosystem has since evolved: current on-device workloads now encompass a broad spectrum, ranging from real-time computer vision, audio, and depth processing models to high-parameter generative AI. These architectures push consumer silicon to its limits, creating compute and memory bottlenecks that legacy runtimes weren't designed to solve.
This shift necessitates a universal engineering foundation of ensuring portability and performance across both classical and next-generation models. Drawing on optimization principles discussed in "Speed is all you need" , we've built a single, unified framework that delivers stability for traditional ML and peak performance for the most advanced generative AI, ensuring that your models are running on our most efficient, forward-looking GPU compute engine.
Structural Modernization for Peak Performance & Coverage
To achieve both peak performance and expanded model coverage across classical and generative architectures, ML Drift introduces core architectural changes and structural upgrades over the legacy TFLite GPU delegate.
Unified Shaders via Tensor Virtualization: Historically, maintaining optimized shaders for the TFLite GPU delegate required hardcoding logical tensor mappings directly to physical GPU objects (such as textures and buffers) separately across OpenGL, OpenCL, and Metal backends. ML Drift introduces tensor virtualization, a core architectural paradigm that decouples a tensor's logical representation from its physical allocation on the GPU. By having dynamic shader templates resolve and translate coordinates during the compiler’s initialization phase, this unified shader model eliminates the need to maintain disparate, backend-specific shader codebases, adding minimal runtime overhead while preserving cross-platform model portability.
Extensible Custom Op Framework: ML Drift adopts a modernized custom op framework that provides direct registration APIs with low-level shading language access. To accelerate this, ML Drift includes an agentic SKILL.md guide, enabling coding agents to author, register, and verify performant custom shaders in minutes. This provides developers with granular control to integrate specialized model blocks directly into the execution graph, drastically reducing the barrier to deploying proprietary architectures.
5D Tensor Support: The TFLite GPU delegate is structurally hardcoded to 4D tensors, forcing developers to use layout hacks for complex models requiring 5D tensors. ML Drift reflected this long overdue functionality in the new LiteRT ML Drift GPU accelerator to enable 5D tensor support out-of-the-box. With this, LiteRT executes complex workloads like 3D convolutional networks for volumetric/spatial AI and spatiotemporal models (e.g., YOLO 11n, MobileViT v2, and Swin Transformer v2) directly on edge GPUs.
Performance Upgrades for Classical Models: As the direct successor to our legacy GPU backend, ML Drift provides a strict performance upgrade for existing classical workloads. By decoupling the runtime from hardware-specific constraints and improving kernel execution efficiency, models that were already running on TFLite GPU gain immediate performance improvements. Migration is designed to be straightforward, with legacy workloads maintaining or exceeding previous benchmarks.
Stage-aware Optimizations for Edge LLMs: Autoregressive LLMs have two different computational workloads during inference: the compute-bound KV cache prefill stage and the memory-bandwidth-bound decode stage, generating tokens one by one. ML Drift dynamically switches kernels and layout configurations depending on the active execution phase. During the decoding stage, it utilizes a custom, convolution-aligned KV cache layout and applies aggressive in-kernel activation quantization to bypass redundant memory roundtrips.
Prefill 512, decode 128, context length 640, 4-bit weights (block size 32), fp16 KV cache, argmax sampling, sync every token.
Prefill (solid bars; left ord.) and decode (hollow bars; right ord.) throughputs are presented.
Gemma4 E2B performs better on frameworks supporting cross KV sharing.
Broadening across Platforms (Desktop Previews): In today’s emerging agentic coding era, highly responsive desktop inference is becoming vital for powering local coding agents and workstation workflows. While we originally engineered ML Drift’s WebGPU backend for in-browser acceleration, Dawn (Chromium's WebGPU implementation) allowed us to compile that exact same codebase natively outside the browser. This unified API model enables ML Drift to run on Windows and Linux, leveraging WebGPU's modern, native hardware abstraction to bypass DirectX and Vulkan fragmentation, while complementing our existing high-performance native Metal backend on macOS.
Our primary focus remains delivering lightweight, production-grade inference where resource constraints are tightest: mobile and edge devices. However, local development requires flexibility across developer machines. Below is an early snapshot of ML Drift running Gemma models on workstation hardware, illustrating how our unified runtime scales across environments.
Desktop LLM performance. Prefill 8192, decode 1024, context length 9216,
4-bit weights (block size 32), fp16 KV cache, argmax sampling, sync every token.
Across edge and workstation environments alike, peak throughput only tells half the story: Memory footprint dictates what workloads can actually run concurrently. In our Gemma benchmarks, ML Drift achieves up to 12% lower memory overhead than other frameworks, freeing up memory for other local tasks.
Battle-Tested at Scale: From Google’s Flagship to Industry Leaders
ML Drift is already running in production across millions of devices daily, powering key features across Google's ecosystem, including Chrome , YouTube Shorts, Photos , and Meet . At the frontier, it acts as the runtime for pioneering on-device capabilities, powering Google AI Edge apps like Gallery , Foresight , and Eloquent .
YouTube Shorts migrated its segmentation-based effects to use ML Drift. This delivered up to a 40% reduction in average frame latency across both Android and iOS, enabling creators to apply high-fidelity visual effects in real time without dropping camera frames.
Sorry, your browser doesn't support playback for this video
To deliver fast, seamless on-device photo editing, the Google Photos team integrated ML Drift across its computational photography and segmentation pipelines. This delivered up to 2 sec speedup compared to the legacy GPU delegate, making advanced photo enhancements feel instantaneous.
Sorry, your browser doesn't support playback for this video
Google Photos Unblur accelerated via ML Drift
Google Chrome integrated ML Drift into its AI runtime infrastructure to power native hardware-accelerated Gemini Nano models for Built-In AI APIs (including the Prompt, Summarize, and Writer APIs). Across desktop platforms, ML Drift enables high-efficiency on-device AI across a growing ecosystem of web applications from e-commerce review summarization to enterprise customer workflows:
Sorry, your browser doesn't support playback for this video
Cafe24 using Prompt API for tag generation accelerated via ML Drift.
Beyond Google products, leading developer partners have adopted ML Drift to bring desktop grade capabilities to mobile users:
Adobe Lightroom and Adobe Photoshop upgraded key AI features, including Select Subject, Select Sky, and Adaptive Portrait, with ML Drift, achieving up to 30% faster on-device performance for pro-quality photo editing on mobile.
Sorry, your browser doesn't support playback for this video
Adobe Lightroom running on-device via mobile LiteRT ML Drift GPU accelerator
Snap integrated LiteRT to power on-device inference on GPU across Android devices. ML Drift GPU accelerator brought 30% model latency improvements for ML-powered face and style generator effects in Snapchat lenses. ML Drift not only improves user experiences based on existing models, but also expands capabilities to run even large diffusion models.
Sorry, your browser doesn't support playback for this video
Optimized with Leading Hardware Partners
Maximizing edge AI efficiency requires deep alignment between software architectures and physical silicon. Throughout ML Drift's development, Google worked closely with silicon and IP partners to enable optimizations that maximize hardware utilization across modern GPUs:
Arm: Co-optimized compute kernels and texture cache locality for Mali and Immortalis GPUs, ensuring high-throughput, power-efficient inference across mobile devices.
Intel: ML Drift harnessed native WebGPU compute and Xe Matrix Extensions (XMX) to accelerate client LLM and vision workloads on Intel® Core™ Ultra processors with Xe3 graphics.
Qualcomm Technologies, Inc. : ML Drift optimized OpenCL kernels for peak ALU and memory bandwidth utilization, enabling efficient edge AI acceleration on Qualcomm® Adreno™ GPUs.
By working hand-in-hand with silicon leaders, ML Drift ensures that state-of-the-art model optimizations translate into battery-conscious, high-frame rate performance on user devices.
What's Next: Deprecation & Migration
With the launch of ML Drift, the legacy TFLite GPU delegate will no longer receive new feature updates. We encourage all developers to transition to the LiteRT ML Drift GPU accelerator which offers full backwards compatibility for your existing models while immediately unlocking modern performance gains across Android, iOS, Web, and desktop. For Android developers using unbundled runtimes to minimize app binary size, ML Drift acceleration is available today in standalone LiteRT packages and is coming soon to LiteRT in Google Play Services .
Getting Started
Whether you are integrating on-device models into an app or authoring custom GPU shaders, ML Drift provides two straightforward paths:
Community feedback and Contributions
ML Drift is fully open source under the Apache 2.0 license. We welcome contributions, RFCs, and community feedback:
Acknowledgments:
Andrei Kulik, Ankit Goyal, Bob Liu, Byungchul Kim, Champ Yen, Changming Sun, Chris McClanahan, Clark Duvall, Cormac Brick, Daniel Ho, David Neto, Ekaterina Ignasheva, Fengwu Yao, Frank Ban, Gerardo Carranza, Grant Jensen, Jacob Dormuth, Jagadeesh Pakaravoor, James Price, Jeremy Kemp, Jingjiang Li, Jiuqiang Tang, Kelvin Ma, Ken Russell, Kenji Baheux, Lin Chen, Loko Kung, Lu Wang, Marissa Ikonomidis, Matt Kreileder, Matthias Grundmann, Mattias Simonsson, Paweł Andruszkiewicz, Raman Sarokin, Romaric Jodin, Sachin Kotwani, Somdatta Banerjee, Suleman Shahid, Suril Shah, Terry Heo, Tyler Mullen, Vaibhav Jain, Weiyi Wang, Yu-Hui Chen
General acknowledgement to partners, Albin Bernhardsson, Aleksei Lebedev, Anuradha Oberoi, Arselan Alvi, Bala Gattu, Enxing Xiong, Erin Di Leva, Hannah Stabingas, Jianhui Dai, Jiawei Shao, Jie Chen, Joseph Hsieh, Komal Desai, M N Suhas, Magzhan Gabidolla, My Linh Van, Ningxin Hu, Padmassri Chandrashekar, Rong Wang, Varun Chari, Viktor Zhou, Zhaoliang Ma
| 刊期 | 得分 | 排名 | 结果 |
|---|---|---|---|
| 2026-10-12 | 8.4 | 21 | 入选 |
| 2026-10-11 | 8.4 | 29 | 未入选 |
| 2026-10-10 | 8.4 | 39 | 未入选 |
| 2026-10-09 | 8.4 | 42 | 未入选 |