Productively Deploying Emerging Models on Emerging Platforms: A Top-Down Approach for Testing and Debugging

📄 arXiv: 2404.09151v3 📥 PDF

作者: Siyuan Feng, Jiawei Liu, Ruihang Lai, Charlie F. Ruan, Yong Yu, Lingming Zhang, Tianqi Chen

分类: cs.SE, cs.LG

发布日期: 2024-04-14 (更新: 2025-04-03)


💡 一句话要点

提出TapML以解决新兴平台上模型部署的挑战

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 模型部署 新兴平台 自动化测试 迁移策略 机器学习框架 开发效率 长语言模型 软件工程挑战

📋 核心要点

  1. 现有机器学习模型部署方法多集中于成熟平台,无法满足新兴应用的需求,测试和调试效率低下。
  2. 本文提出TapML,通过自动生成测试数据和迁移策略,优化新兴模型在新平台上的部署过程。
  3. TapML在两年内加速了105个新兴模型的部署,显著提升了开发者的生产力和模型质量。

📝 摘要(中文)

现有的机器学习框架主要集中在成熟平台上,如在服务器级GPU上运行CUDA。然而,随着对在浏览器和移动设备上运行大型语言模型(LLMs)的需求增加,如何在新兴平台(如Metal和WebGPU)上部署新兴模型面临显著的软件工程挑战。传统的自下而上的开发方法无法满足新兴机器学习应用的生产力需求,测试和调试成为瓶颈。为此,本文提出了TapML,一种自上而下的方法,旨在简化多平台上的模型部署。TapML通过操作符测试切割自动生成高质量的测试数据,并采用基于迁移的策略逐步将模型实现从成熟源平台转移到目标平台,从而最小化复合错误的调试范围。TapML已在MLC-LLM项目中作为默认开发方法,成功加速了105个新兴模型的部署。

🔬 方法详解

问题定义:论文要解决的问题是如何在新兴平台上高效部署新兴机器学习模型。现有的自下而上的方法导致测试和调试效率低下,无法满足快速发展的需求。

核心思路:TapML采用自上而下的方法,通过自动生成高质量的测试数据和逐步迁移模型实现,来简化部署过程。这种设计旨在减少手动测试的需求,提高生产力。

技术框架:TapML的整体架构包括两个主要模块:操作符测试切割模块和迁移策略模块。前者负责生成测试数据,后者则负责将模型从源平台迁移到目标平台。

关键创新:TapML的关键创新在于其自动化测试数据生成和迁移策略,这与传统的手动测试和自下而上的开发方法形成鲜明对比,显著提高了效率。

关键设计:在TapML中,操作符测试切割模块通过分析模型的操作符来生成高质量的测试数据,而迁移策略模块则通过逐步转移实现来降低调试复杂性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

TapML在过去两年内成功加速了105个新兴模型的部署,涵盖27种模型架构和5个新兴平台,显著提升了开发者的生产力。与传统方法相比,TapML在测试和调试效率上表现出明显的优势,确保了部署模型的质量。

🎯 应用场景

TapML的研究成果具有广泛的应用潜力,尤其是在需要快速部署新兴机器学习模型的场景中,如移动设备和浏览器中的AI应用。其方法可以帮助开发者更高效地适应快速变化的技术环境,推动新兴AI应用的普及和发展。

📄 摘要(原文)

While existing machine learning (ML) frameworks focus on established platforms, like running CUDA on server-grade GPUs, there have been growing demands to enable emerging AI applications in a broader set of scenarios, such as running Large Language Models (LLMs) within browsers and mobile phones. However, deploying emerging models on new platforms (such as Metal and WebGPU) presents significant software engineering challenges due to rapid model evolution and limited tooling and practices for these platforms. Previous practice for ML model deployment often follows a bottom-up fashion, where engineers first implement individual required operators and then put them together. However, this traditional development approach fails to meet the productivity requirements when deploying emerging ML applications, with the testing and debugging part as a bottleneck. To this end, we introduce \textsc{TapML}, a top-down approach designed to streamline model deployment on diverse platforms. While the traditional bottom-up approach requires crafting manual tests, \textsc{TapML} automatically creates high-quality, realistic test data through operator-wise test carving. Furthermore, \textsc{TapML} uses a migration-based strategy to gradually offload model implementation from the mature source platform to the target platform, minimizing the debugging scope of compound errors. \textsc{TapML} has been used as the default development method in the MLC-LLM project to deploy emerging ML models. Within 2 years, \textsc{TapML} has accelerated the deployment of 105 emerging models in 27 model architectures across 5 emerging platforms. We show that \textsc{TapML} effectively boosts developer productivity while ensuring the quality of deployed models. Furthermore, we summarize comprehensive case studies from our real-world development, offering best practices for developing emerging ML systems.