Google 发布 LiteRT Tensor API,面向设备端 ML 模型构建与优化
原标题:Google Launches LiteRT Tensor API for Building, Customizing, and Optimizing ML Models for On-Device
AI 摘要
Google 推出 LiteRT Tensor API,这是一个轻量级 C++ API,让开发者能够直接在设备端构建、定制和优化机器学习模型,并支持同一计算图在 CPU、GPU、NPU 上跨平台运行而无需重写。该 API 支持直接从 Hugging Face .safetensors 等检查点加载权重、零拷贝缓冲区互操作,并兼容 AI 编码代理生成 C++ 代码来构建和优化模型图。Google 用编码代理构建了基于 SAM 2 的多目标分割与跟踪应用,在 MacBook Pro 上比 Apple MLX 快约 1.5 倍,Arm 的 Laurence Moroney 也强调了其在 WebGPU 上从不到 10 帧提升到 30 帧以上的优化效果。
正文节选
Google has introduced the LiteRT Tensor API, a lightweight C++ API that allows developers to build, customize, and optimize machine learning models directly for on-device execution. According to Google, it combines the flexibility of native model authoring with cross-platform portability. The traditional approach, Google says, is for developers to write computations manually in C++ for maximum control, which comes with a significant drawback: Implementations are tightly coupled to specific backe