Evaluating high-dimensional integrals via deep hierarchical recurrences is a dominant cost in quantum chemistry. While CPUs manage these efficiently, GPUs suffer a critical mismatch: limited per-thread memory is quickly overwhelmed by an explosion of simultaneously live intermediate variables. As recurrence scales, this forces massive data spilling to global memory, collapsing performance into a severe memory-bound regime. We present FusionRCG, a framework that jointly optimizes computation graph structure and GPU memory mapping. Exploiting the inherent topological flexibility of recurrence graphs, using electron repulsion integrals as an example, we contribute: (1) liveness-aware graph orchestration to minimize peak live intermediates; (2) algebraic dimensionality reduction via stepwise Cartesian-to-spherical fusion, shrinking intermediate footprints by up to $7.7\times$; and (3) an adaptive multi-tier kernel architecture routing graphs across the memory hierarchy. Evaluated on NVIDIA A100 GPUs, FusionRCG achieves up to $3.09\times$ end-to-end SCF speedup over GPU4PySCF and maintains $75\%$ parallel efficiency at 64~GPUs, successfully rescuing these workloads from memory-bound limits.
翻译:通过深度层级递归计算高维积分是量子化学中的主要计算开销。尽管CPU能高效处理此类计算,但GPU存在关键性不匹配:有限的每线程内存迅速被同时活跃的中间变量激增所淹没。随着递归规模扩大,这迫使大量数据溢出至全局内存,导致性能严重受限于内存带宽。我们提出FusionRCG框架,通过联合优化计算图结构与GPU内存映射来解决该问题。利用递归图固有的拓扑灵活性,以电子排斥积分为例,我们的贡献包括:(1) 面向活跃性感知的图编排策略,最小化峰值活跃中间变量;(2) 通过逐步笛卡尔-球谐融合实现代数降维,将中间变量足迹缩小至多$7.7\times$;(3) 自适应多级内核架构,将计算图路由至内存层级的不同层次。在NVIDIA A100 GPU上的评估表明,FusionRCG相比GPU4PySCF实现最高$3.09\times$的端到端自洽场加速,并在64个GPU上保持$75\%$并行效率,成功将此类工作负载从内存限制中解救出来。