arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.00728cs.LGcs.NAmath.NA
收藏

通过基于上下文老虎机的强化学习实现线性求解器的精度自调优

Precision autotuning for linear solvers via contextual bandit-based RL

Charles University(查理大学);Sorbonne Université, CNRS, LIP6(索邦大学,法国国家科学研究中心,计算机科学实验室LIP6)

Erin Carson, Xinye Chen

AI总结:

本文提出基于上下文老虎机的强化学习框架,用于自适应调整线性求解器的精度,通过离散化状态空间选择最优精度配置,平衡精度与计算效率,并在未见过的数据集上验证有效性。

摘要:

我们提出了一种强化学习(RL)框架,用于自适应调整线性求解器的精度,该框架可扩展至通用算法。该框架被建模为一个上下文老虎机问题,并通过增量动作值估计法解决,利用离散化状态空间选择计算步骤的最优精度配置,平衡精度和计算效率。为了验证其有效性,我们将该框架应用于迭代细化求解线性系统Ax=b。在此应用中,我们的方法根据系统计算出的特征动态选择精度,同时保持可接受的精度和收敛性。具体而言,一个动作值估计器以离散化特征(例如近似条件数和矩阵范数)作为输入,并输出估计的动作值,从其中策略选择动作(特定步骤的精度配置),通过ε-贪心策略优化以最大化多目标奖励,以平衡精度和计算成本。实证结果表明,该方法在减少计算成本的同时,保持了与双精度基线相当的精度。该框架可推广至多样化的外推数据,并为将RL精度选择应用于其他数值算法提供了见解,推动了科学计算中的混合精度数值方法。据我们所知,这是首次利用强化学习进行精度自调优的工作,并在未见过的数据集上进行了验证。

英文摘要:

We propose a reinforcement learning (RL) framework for \xy{responsive} precision tuning for linear solvers, which can be extended to general algorithms. The framework is formulated as a contextual bandit problem and solved using incremental action-value estimation with a discretized state space to select optimal precision configurations for computational steps, \xy{retaining} precision and computational efficiency. To verify its effectiveness, we apply the framework to iterative refinement for solving linear systems $Ax = b$. In this application, our approach dynamically chooses precisions based on calculated features from the system while maintaining acceptable accuracy and convergence. In detail, an action-value estimator takes discretized features (e.g., approximate condition number and matrix norm) as input and outputs estimated action values, from which a policy selects the actions (chosen precision configurations for specific steps), optimized via an $ε$-greedy strategy to maximize a multi-objective reward to balance accuracy and computational cost. Empirical results demonstrate effective precision selection, \xy{increasing the use of lower-precision arithmetic} while maintaining accuracy comparable to double-precision baselines. \xy{We further evaluate the learned policies in a compiled CPU GMRES-IR implementation using FP16, FP32, and FP64 arithmetic for solver-level native validation.} The framework generalizes to diverse out-of-sample data and provides insights into applying RL precision selection to other numerical algorithms, advancing mixed-precision numerical methods in scientific computing. To the best of our knowledge, this is the first work on precision autotuning with RL with verification on unseen datasets.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑