arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.23621cs.LGcs.AI
收藏

加速MACE:等变力场的低精度优化技巧

Speeding Up MACE: Low-Precision Tricks for Equivarient Force Fields

University of Cambridge(剑桥大学);Clare College(克莱尔学院)

Alexandre Benoit

AI总结:

本研究针对MACE等SO(3)等变力场计算成本高的问题,通过剖析计算瓶颈、对比不同后端与精度策略,提出混合精度推理方案,可在保证物理保真度的前提下大幅加速分子动力学模拟。

摘要:

机器学习力场能够以较高的计算成本实现精准的分子动力学(MD)模拟。对于MACE这类SO(3)等变模型,目前尚无系统性证据表明降低精度的算术运算与GPU优化内核能否在不损失物理保真度的前提下削减这一成本。本论文旨在通过定位计算瓶颈、评估低精度执行策略,在保持精度的同时让MACE更廉价、更快速。我们对MACE进行了端到端及分模块的性能剖析,对比了e3nn与NVIDIA cuEquivariance两种后端,在可复现的稳态计时条件下,评估了FP64/FP32/BF16/FP16(搭配FP32累加)设置在推理、短时长NVT系综与长时长NPT系综水模拟,以及小型训练任务中的表现。cuEquivariance可将推理延迟降低约3倍。在FP32模型中仅将线性层转换为BF16/FP16精度,可额外带来约4倍的速度提升,同时NVT/NPT分子动力学中的能量与热力学可观测量仍处于运行间波动范围内。训练时使用半精度权重会导致力的均方根误差(RMSE)下降。无显式适配器的情况下混合e3nn与cuEq模块会引发表示不匹配问题。融合等变内核与混合精度推理可大幅加速当前最先进的力场,且对下游分子动力学的影响可忽略不计。实用策略为默认使用搭配FP32的cuEquivariance,为最大化吞吐量可启用线性层的BF16/FP16精度(保持FP32累加),而训练仍采用FP32精度。在Ampere/Hopper架构GPU(支持TF32/BF16)上,以及通过内核级FP16/BF16路径与流水线融合,有望获得进一步性能提升。

英文摘要:

Machine-learning force fields can deliver accurate molecular dynamics (MD) at high computational cost. For SO(3)-equivariant models such as MACE, there is little systematic evidence on whether reduced-precision arithmetic and GPU-optimized kernels can cut this cost without harming physical fidelity. This thesis aims to make MACE cheaper and faster while preserving accuracy by identifying computational bottlenecks and evaluating low-precision execution policies. We profile MACE end-to-end and per block, compare the e3nn and NVIDIA cuEquivariance backends, and assess FP64/FP32/BF16/FP16 settings (with FP32 accumulation) for inference, short NVT and long NPT water simulations, and toy training runs under reproducible, steady-state timing. cuEquivariance reduces inference latency by about $3\times$. Casting only linear layers to BF16/FP16 within an FP32 model yields roughly 4x additional speedups, while energies and thermodynamic observables in NVT/NPT MD remain within run-to-run variability. Half-precision weights during training degrade force RMSE. Mixing e3nn and cuEq modules without explicit adapters causes representation mismatches. Fused equivariant kernels and mixed-precision inference can substantially accelerate state-of-the-art force fields with negligible impact on downstream MD. A practical policy is to use cuEquivariance with FP32 by default and enable BF16/FP16 for linear layers (keeping FP32 accumulations) for maximum throughput, while training remains in FP32. Further gains are expected on Ampere/Hopper GPUs (TF32/BF16) and from kernel-level FP16/BF16 paths and pipeline fusion.

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

↑