AI
Google Open-Sources ML Drift, a GPU Engine for Edge AI Inference Across Devices
Google's new ML Drift framework brings high-performance GPU acceleration to on-device AI, spanning mobile, web, and desktop with unified shader technology and support for modern generative models.
Google Developers Blog (AI)
Google's AI Edge Team has released ML Drift under the Apache 2.0 license, an open-source GPU compute engine designed to accelerate machine learning inference directly on consumer devices. The framework abstracts the complexity of diverse hardware and APIs—including OpenGL ES, OpenCL, Metal, and WebGPU—enabling developers to deploy real-time AI experiences from video effects to large language models across platforms without rewriting code for each GPU architecture.
Why Edge GPU Acceleration Needs a New Approach#
On-device AI deployment faces challenges that datacenter inference does not. While cloud systems run models on uniform, predictable clusters of accelerators, edge devices present a fragmented landscape: countless GPU architectures, driver versions, and low-level APIs that developers cannot predict in advance. The aging TensorFlow Lite GPU delegate, which established the foundation for on-device GPU work, was not built for today's workloads—which now span real-time computer vision, audio processing, and parameter-heavy generative AI that stress consumer silicon to its limits.
ML Drift addresses this by introducing a unified engineering foundation that maintains both backward compatibility with classical models and peak performance for cutting-edge architectures.
Key Technical Innovations#
Tensor Virtualization: Rather than hardcoding tensor mappings to physical GPU objects separately for each backend, ML Drift decouples logical tensor representation from physical GPU allocation. Dynamic shader templates resolve and translate coordinates at compile time, eliminating the need for multiple backend-specific shader codebases while maintaining cross-platform portability with minimal runtime overhead.
Custom Op Framework: A modernized API allows direct registration of custom operators with low-level shader language access. ML Drift includes an agentic SKILL.md guide that helps developers write, register, and verify performant custom shaders in minutes—shrinking the effort to deploy proprietary model architectures.
5D Tensor Support: The legacy TFLite delegate was hardcoded for 4D tensors, forcing workarounds for models requiring 5D tensors. ML Drift natively supports 5D tensors, enabling complex workloads like 3D convolutional networks for volumetric AI and spatiotemporal models (e.g., YOLO 11n, Swin Transformer v2) to run directly on edge GPUs.
LLM-Specific Optimizations: Autoregressive language models shift between two distinct computational phases during inference: a compute-bound prefill stage and a memory-bandwidth-bound decode stage. ML Drift dynamically switches kernels and memory layouts based on the active phase, using custom KV cache configurations and aggressive in-kernel quantization during decoding to reduce redundant memory transfers.

