用上下文老虎机和强化学习在线自动调优 BoomerAMG 求解参数
Online Autotuning of Algebraic Multigrid via Contextual Bandits and Reinforcement Learning
劳伦斯利弗莫尔背景的团队给 BoomerAMG 装上 LinUCB 和 LSTDQ 在线调参,扩散问题提速 40% 左右,不用离线预训练,做数值模拟的可以看看。
针对 hypre 的 BoomerAMG 求解大规模稀疏线性系统时参数依赖问题,研究者提出分阶段在线自动调优方法。方法用 LinUCB 上下文老虎机基于 PDE 描述符选择 AMG 层级构建参数,用递归 LSTDQ 控制器根据残差和计时观测在多重度循环间调整松弛权重。在 40³、60³、80³ 网格的 5000 个线性系统序列上,扩散问题总运行时间降低 36.1-43.3%,对流扩散问题降低 19.8-31.0%。在 30000 个系统的变流基准上,默认配置有 1677 个系统不收敛,自动调优后仅 2 个。
Online Autotuning of Algebraic Multigrid via Contextual Bandits and Reinforcement Learning
Algebraic multigrid (AMG) methods are widely used for solving large sparse linear systems, but their efficiency depends strongly on interacting setup and solve parameters. Effective parameter choices typically depend on the problem. We develop a phase-aware online autotuning method for hypre's BoomerAMG to reduce cumulative time-to-solution over sequences of related linear systems. A LinUCB-based contextual bandit selects mixed-type parameters for AMG hierarchy construction using a shared cost model over PDE descriptors and configuration encodings. A recursive LSTDQ controller uses residual and timing observations to estimate the AMG solve time within each attempt and adapt relaxation weights between multigrid cycles. Both learners update from ongoing solves without offline pretraining. Across grids of sizes $40^3$, $60^3$, and $80^3$, the joint autotuning method reduces total runtime, including recurring learner computation, by 36.1-43.3% for diffusion problems and 19.8-31.0% for diffusion-advection problems over sequences of 5000 linear systems, relative to the reference BoomerAMG default configuration. On a variable-flow diffusion-advection benchmark comprising 30,000 systems on a $60^3$ grid, 2 systems fail to converge with joint autotuning, compared with 1677 for the reference configuration, under their respective attempt budgets.