用异步任务提升Python中高斯过程的训练与预测速度
GPRat: Gaussian Process Regression with Asynchronous Tasks
- 将异步运行时HPX的C++代码通过pybind11绑定到Python,实现高效并行
- 在64核上训练速度超越GPyTorch和GPflow,预测速度提升7.63至25.25倍
- 适合需要高性能高斯过程计算的科研与工业用户
Python是人工智能软件开发的通用语言,如PyTorch和TensorFlow等常用库依赖其底层BLAS后端的并行化以提升CPU性能。然而,仅在低层后端应用并行化可能导致性能与扩展性下降。本文提出一种新方法,利用pybind11将基于异步运行时模型HPX的任务式C++代码绑定至高层Python API,构建了并行高斯过程(GP)库GPRat。该库结合了常见GP库的易用性与异步运行系统的性能与可扩展性。我们在控制理论中的经典质量-弹簧-阻尼系统上评估了不同回归器(特征数)下的性能。结果表明,使用pybind11绑定异步HPX代码几乎无开销。相较于GPyTorch和GPflow,GPRat在AMD EPYC 7742 CPU上64核训练时表现更优。预测速度分别提升7.63倍与25.25倍;当特征数从8增至128时,速度提升达29.62倍与21.19倍。这些结果展示了在基于Python的AI应用中采用异步任务的巨大潜力。
原文摘要 · Abstract (English)
Python is the de-facto language for software development in artificial intelligence (AI). Commonly used libraries, such as PyTorch and TensorFlow, rely on parallelization built into their BLAS backends to achieve speedup on CPUs. However, only applying parallelization in a low-level backend can lead to performance and scaling degradation. In this work, we present a novel way of binding task-based C++ code built on the asynchronous runtime model HPX to a high-level Python API using pybind11. We develop a parallel Gaussian process (GP) li- brary as an application. The resulting Python library GPRat combines the ease of use of commonly available GP libraries with the performance and scalability of asynchronous runtime systems. We evaluate the per- formance on a mass-spring-damper system, a standard benchmark from control theory, for varying numbers of regressors (features). The results show almost no binding overhead when binding the asynchronous HPX code using pybind11. Compared to GPyTorch and GPflow, GPRat shows superior scaling on up to 64 cores on an AMD EPYC 7742 CPU for train- ing. Furthermore, our library achieves a prediction speedup of 7.63 over GPyTorch and 25.25 over GPflow. If we increase the number of features from eight to 128, we observe speedups of 29.62 and 21.19, respectively. These results showcase the potential of using asynchronous tasks within Python-based AI applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。