加速Python风格的耦合簇实现:CPU与GPU的比较
Accelerating Pythonic coupled cluster implementations: a comparison between CPUs and GPUs
AI总结:
本研究针对Python风格耦合簇计算的瓶颈,基于PyBEST软件通过CuPy调用CUDA实现GPU加速,采用分批计算应对显存限制,测试显示大张量缩并较36核CPU快10倍,瓶颈运算最高加速16倍,并确定了最优张量缩并方案。
摘要:
我们详细研究了如何在NVIDIA Tesla V100S PCIe 32GB(rev 1a)图形处理单元(GPU)上加速Python风格耦合簇实现的瓶颈运算。我们通过CuPy——一个为Python设计的、可作为NumPy在GPU上的直接替代方案的开源库——与NVIDIA计算统一设备架构(CUDA)API进行交互。该实现采用Cholesky线性代数域,在PyBEST(Pythonic Black-box Electronic Structure Tool,Python风格黑箱电子结构工具)这一功能完备的现代电子结构软件包中完成。由于显存(VRAM)的限制,GPU计算必须分批进行。我们给出了部分包含大张量的缩并运算的计时结果:与36核CPU上的计算相比,CuPy实现可实现10倍的加速。此外,我们对多种Python例程的时间和内存需求进行了基准测试,以确定可用张量缩并运算的最优选择。最后,我们将纯CPU上的CCSD和pCCD-LCCSD计算示例与其CPU-GPU混合实现进行了对比。结果表明,使用CuPy将特定缩并运算卸载到GPU时,可实现显著加速(瓶颈运算最高可达16倍)。
英文摘要:
We scrutinize how to accelerate the bottleneck operations of Pythonic coupled cluster implementations performed on a \texttt{NVIDIA} Tesla V100S PCIe 32GB (rev 1a) Graphics Processing Unit (GPU). The \texttt{NVIDIA} Compute Unified Device Architecture (CUDA) API is interacted with via \texttt{CuPy}, an open-source library for Python, designed as a \texttt{NumPy} drop-in replacement for GPUs. The implementation uses the Cholesky linear algebra domain and is done in {PyBEST}, the Pythonic Black-box Electronic Structure Tool -- a fully-fledged modern electronic structure software package. Due to the limitations of Video Memory (VRAM), the GPU calculations must be performed batch-wise. Timing results of some contractions containing large tensors are presented. The \texttt{CuPy} implementation leads to factor 10 speed-up compared to calculations on 36 CPUs. Furthermore, we benchmark several Pythonic routines for time and memory requirements to identify the optimal choice of the tensor contraction operations available. Finally, we compare an example CCSD and pCCD-LCCSD calculation performed solely on CPUs to their CPU--GPU hybrid implementation. Our results indicate a significant speed-up (up to a factor of 16 regarding the bottleneck operations) when offloading specific contractions to the GPU using \texttt{CuPy}.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。