TL;DR
TrimSO(2) is a new algorithm and implementation that significantly accelerates the training of equivariant interatomic potentials by eliminating the need to store massive intermediate tensors in GPU memory. By integrating geometric transformations directly into the model's dataflow, it achieves up to 2.94× faster training and reduces peak memory usage by up to 3.16× on modern A100 and H100 GPUs.
What Problem Does This Paper Address?
Simulating the behavior of molecules and materials requires "interatomic potentials"—models that predict the energy and forces within a system of atoms. To be accurate, these models must be equivariant, meaning they respect the rotational symmetry of physical space.
Recent state-of-the-art models have shifted from expensive SO(3) convolutions to more efficient SO(2) convolutions in local "edge frames." While this reduces algorithmic complexity from $O(L^6)$ to $O(L^3)$, the actual training remains a bottleneck. Current implementations are "memory-intensive" because they constantly write and read large temporary tensors (representing rotated and recombined features) to and from the GPU's High-Bandwidth Memory (HBM). This "materialization" of intermediate data leads to massive data movement overhead and limits the size of systems that can be simulated.
Methods
The authors introduce TrimSO(2), which "trims" away these intermediate HBM accesses by fusing representation transformations into existing operations. Instead of treating rotation, activation, and aggregation as separate steps, TrimSO(2) performs them "on-the-fly" while data is still in the GPU's fast on-chip registers.
The core strategy involves three main optimizations, illustrated in the comparison between standard materialization and the TrimSO(2) approach:
- Rotation on Gather: When gathering node features to create edge messages, the algorithm rotates them into the local edge frame immediately, avoiding a separate "gathered features" tensor.
- Recombination with Activation: The additions and subtractions required by the SO(2) formulation are performed alongside the activation function in a single step.
- Inverse Rotation on Reduction: As edge messages are summed back into nodes, they are rotated back to the global frame on-chip, eliminating the need for a global-frame edge message array.
Crucially, the authors implemented these kernels using Triton and provided full support for double-backward differentiation, which is essential for training models on force labels (since forces are themselves gradients of energy).
Datasets
The researchers evaluated TrimSO(2) using the OMat24 (Open Materials 2024) dataset, a large-scale benchmark for inorganic materials. They tested the algorithm across three prominent equivariant architectures:
- eSEN
- UMA
- EquiformerV3
Key Insights and Ideas
- Geometric Transformations as "Free" Overheads: The authors realized that the computational cost of rotating a vector is small compared to the cost of moving that vector to and from HBM. By "absorbing" rotations into gather/scatter operations, they effectively make the geometric overhead disappear.
- Cumulative Benefits: The optimizations are not just additive; they compound. As shown in the ablation study, each stage of the dataflow integration provides a significant jump in both speed and memory efficiency.
- Preserving Mathematical Integrity: Unlike some optimizations that trade accuracy for speed (like quantization), TrimSO(2) preserves the exact mathematical operations of the original models, ensuring that numerical accuracy remains within $10^{-7}$ of standard PyTorch implementations.
Key Results
TrimSO(2) demonstrates impressive performance gains across the board on A100 and H100 GPUs:
- Training Speedup: Achieved 2.07–2.94× end-to-end speedups compared to official PyTorch implementations.
- Memory Reduction: Reduced peak training memory by 1.53–3.16×, allowing for larger batch sizes or higher-degree representations.
- Data Movement: Reduced model-level HBM traffic by 3.81–9.88×.
- Operator Performance: Individual operators saw speedups as high as 16.73× for forward passes and 9.38× for backward passes.
Limitations and Future Work
- Baseline Comparisons: The authors note that their baseline was the official PyTorch implementation. They did not compare against a baseline using
torch.compilewith NequIP-style tracing, as PyTorch's AOTAutograd currently struggles with the double-backward requirements of these models. - Hardware Specificity: While Triton makes the kernels somewhat portable, the current implementation is highly optimized for NVIDIA A100 and H100 architectures.
- Future Directions: The authors suggest that the "trimming" principle could be extended to other types of equivariant layers beyond SO(2) convolutions, potentially benefiting a wider array of geometric deep learning models.
Summary updated