Loading page

What ML Drift is

ML Drift is the Google open-source GPU compute engine for on-device AI and ML inference. It powers GPU acceleration in LiteRT and is available as a standalone library for custom graphics and inference runtimes. Its unified shaders separate computation from how data is stored and accessed through currently supported GPU APIs. Supported APIs include OpenCL, Metal, WebGPU, and OpenGL ES 3.1 or later.

ML Drift generates GPU-specific shader code at runtime, when preparing a workload for execution. This helps you share shader logic across supported platforms while retaining hardware-specific performance optimizations.

Application developers can use ML Drift through the LiteRT GPU accelerator without writing shaders. For custom graphics and inference runtimes, you can use ML Drift standalone C++ APIs to assemble and run GPU workloads. When you need custom computations, you can write portable shaders in the ML Drift Unified Compute Language (UCL).

What you’ll build for profiling on Arm

You’ll use the OpenCL backend to run an existing workload on an Android device with an Arm Mali GPU.

One example is the Mali-specific tuning within the ML Drift general convolution implementation . Convolution applies filters to input data, a common operation in image-processing models. ML Drift adjusts how this work is divided across the GPU according to the GPU generation and workload. When you use this built-in operation, ML Drift applies these settings internally. You don’t need to select them or write separate shaders for each GPU.

You’ll build a standalone Stable Diffusion command-line example and inspect one of its unified shaders. You’ll then profile execution on an Arm Mali GPU. You won’t need a LiteRT application or changes to the ML Drift source.

What you’ve learned and what’s next

You now know where standalone ML Drift fits in GPU compute.

Next, you’ll prepare your host tools and device connection.