Adaptive Inference Batching using Policy Gradients
作者: Ruslan Sharifullin
分类: cs.LG, cs.AI, cs.DC, cs.PF
发布日期: 2026-07-06
备注: 5 pages, 5 figures, 1 table
💡 一句话要点
利用强化学习实现自适应推理批处理以优化系统性能
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 推理服务 强化学习 自适应批处理 多GPU路由 性能优化 排队理论 动态调度
📋 核心要点
- 现有的静态批处理策略无法适应动态流量,导致推理服务系统在吞吐量和延迟之间难以平衡。
- 本文提出利用强化学习来学习自适应的批处理和路由策略,能够根据实时流量变化进行调整。
- 实验结果表明,在多GPU异构路由中,所提策略相比于传统方法提升了348%的性能,并且在吞吐量和延迟上均有显著改善。
📝 摘要(中文)
推理服务系统必须在突发和异构工作负载下平衡吞吐量和延迟,但行业标准仍然是需要手动调优的静态批处理策略,无法适应变化的流量。本文探讨了强化学习(RL)是否能够学习自适应的批处理和路由策略,以超越这些启发式方法。通过在一个经过排队理论和生产轨迹(如Azure Functions和BurstGPT)验证的离散事件模拟器上训练REINFORCE和PPO代理,我们将问题形式化为一个关于队列状态、请求类型和GPU可用性的马尔可夫决策过程(MDP)。研究发现,在单GPU设置下,经过良好调优的静态批处理策略在类似泊松的到达情况下已经接近最优,而在多GPU异构路由中,代理发现了一种工作负载分隔策略,消除了排队阻塞,显著提高了性能。
🔬 方法详解
问题定义:本文解决的是推理服务系统在面对突发和异构工作负载时,如何有效地进行批处理和路由的问题。现有的静态批处理策略需要手动调优,无法适应流量的变化,导致性能不佳。
核心思路:论文的核心思路是利用强化学习(RL)来自动学习自适应的批处理和路由策略。通过将问题建模为马尔可夫决策过程(MDP),RL代理能够根据队列状态、请求类型和GPU可用性动态调整策略。
技术框架:整体架构包括一个离散事件模拟器,RL代理在此环境中进行训练。模拟器经过排队理论和实际生产数据验证,确保训练的有效性。主要模块包括状态表示、动作选择和策略更新。
关键创新:最重要的技术创新点在于提出了一种工作负载分隔策略,能够有效消除排队中的头部阻塞现象。这一策略在多GPU环境中表现出色,显著超越了传统的轮询和最短队列策略。
关键设计:在训练过程中,采用了REINFORCE和PPO算法,设计了适应性强的损失函数和策略网络。注意力增强的策略网络比传统的多层感知器(MLP)收敛速度快约20%。
🖼️ 关键图片
📊 实验亮点
实验结果显示,在多GPU异构路由中,所提自适应策略相比于传统的轮询方法提升了348%的性能,吞吐量提高了60%,延迟降低了25%。此外,该策略在未见的突发流量和真实世界流量中也表现出良好的泛化能力。
🎯 应用场景
该研究的潜在应用领域包括云计算服务、边缘计算和大规模推理系统等。通过实现自适应批处理和路由策略,可以显著提高系统的资源利用率和响应速度,降低延迟,满足更高的服务水平协议(SLA)要求,具有重要的实际价值和未来影响。
📄 摘要(原文)
Inference serving systems must balance throughput and latency under bursty, heterogeneous workloads, yet the industry standard remains static batching policies that require manual tuning and cannot adapt to shifting traffic. We investigate whether reinforcement learning (RL) can learn adaptive batching and routing policies that outperform these heuristics, training REINFORCE and PPO agents on a discrete-event simulator validated against queuing theory and production traces (Azure Functions, BurstGPT). We formulate the problem as an MDP over queue state, request type and GPU availability, evaluating across standard Poisson traffic, extreme bursts, real-world traces and heterogeneous multi-GPU routing. Our central finding is a clear boundary condition for RL's value in systems problems. In single-GPU settings, a well-tuned static batching policy is already near-optimal under Poisson-like arrivals and RL offers only marginal gains (+0.1% to +1.0%). In multi-GPU heterogeneous routing, however, where fast and slow requests compete for shared resources, the agent discovers a workload-segregation policy that eliminates Head-of-Line blocking, yielding a 3.5x (348%) improvement over Round-Robin and a 48% improvement over the strongest heuristic baseline (Shortest-Queue), with 60% higher throughput and 25% lower latency while respecting SLA constraints. The policy generalizes to unseen bursty and real-world traffic despite training only on synthetic Poisson arrivals and an attention-augmented policy network converges roughly 20% faster than an MLP baseline. These results suggest RL's advantage over engineered heuristics concentrates in combinatorial, multi-resource decisions rather than single-resource temporal scheduling, a practical distinction for deciding where learned policies justify their engineering cost in production inference infrastructure.