E2Former-V2: On-the-Fly Equivariant Attention with Linear Activation Memory
Abstract
Lay Summary
Lay Summary Equivariant Graph Neural Networks (EGNNs) are powerful AI models for simulating molecules and materials, but existing methods are often computationally expensive because they build large geometric tensors for every atomic interaction. This limits their scalability on modern GPUs. We introduce E2Former-V2, a new equivariant transformer architecture that combines mathematical sparsity with hardware-aware GPU execution. Our method, called Equivariant Axis-Aligned Sparsification (EAAS), converts expensive geometric tensor operations into lightweight sparse indexing operations. We further design an On-the-Fly Equivariant Attention mechanism implemented with fused Triton GPU kernels, avoiding costly intermediate tensor materialization. Together, these optimizations achieve up to 20× higher effective TFLOPS than standard implementations while preserving predictive accuracy on the SPICE and OMol25 benchmarks. Our results show that large equivariant transformers can become significantly more practical and efficient on commodity GPUs. Our released code can be found at \url{https://github.com/IQuestLab/UBio-MolFM/tree/main}