xnn.gnn.fast#

Fast paths of the equivariant GNN blocks (fused cuEquivariance kernels).

ConvTensorProduct (the message step of MACE and NequIP) and the symmetric contraction of MACE have a fused GPU implementation next to their reference one; FastPathModule explains the contract and use_fast the choice. AUTO_POLICY holds the measured size above which use_fast="auto" takes the kernels. The fused continuous-filter convolution of SchNet and the fused message block of PaiNN (Triton kernels) live in xnn.gnn.fast.schnet and xnn.gnn.fast.painn. The equivariant linear maps and the element self-connection of MACE have plain-PyTorch fast paths in xnn.gnn.fast.linear.

Module Attributes

AUTO_POLICY

Edge counts above which use_fast="auto" uses the kernels.

AUTO_POLICY_TRAINING

the kernels pay off earlier than in evaluation, as the backward of a training step repeats the work the fixed cost is spread over.

NEQUIP_AUTO_POLICY

on an A100, A30, V100 and T4 the kernels were faster than the reference from a single small molecule on, in both precisions and both modes.

Modules

aimnet2

Fast path of the AIMNet2 shell convolution (Triton kernels).

aimnet2_kernels

Triton kernels and autograd functions of the AIMNet2 fast path (see xnn.gnn.fast.aimnet2).

allegro

Fast path of the Allegro tensor product (Triton kernels).

allegro_kernels

Triton kernels and autograd function of the Allegro fast path (see xnn.gnn.fast.allegro).

cace

Fast path of the CACE edge-basis sums (Triton kernels).

cace_kernels

Triton kernels and autograd functions of the CACE fast path (see xnn.gnn.fast.cace).

cgcnn

Fast path of CGCNN: the network from the positions to the pooled atom features as one compiled stage.

conv

The message step of an equivariant convolution, with a fused fast path.

dimenet

Fast path of the DimeNet and DimeNet++ triplet interactions (Triton kernels).

gemnet

Fast path of the GemNet efficient bilinear layer (Triton kernels).

gemnet_kernels

Triton kernels and autograd functions of the GemNet fast path (see xnn.gnn.fast.gemnet).

linear

Equivariant linear maps of the MACE blocks, with a fast path in plain PyTorch.

megnet

Fast path of MEGNet: the encoders, the blocks and the Set2Set readouts as compiled stages.

painn

Fast path of the PaiNN message block (Triton kernels).

painn_kernels

Triton kernels and autograd function of the PaiNN fast path (see xnn.gnn.fast.painn).

radial_kernels

Triton kernels of the fused hidden layers of a radial network (see RadialNet).

schnet

Fast path of the SchNet continuous-filter convolution (Triton kernels).

schnet_kernels

Triton kernels and autograd functions of the SchNet fast path (see xnn.gnn.fast.schnet).

symmetric_contraction

The fast path of the MACE symmetric contraction (the product basis).

tensornet

Fast path of the TensorNet embedding and interaction layers (Triton kernels).

tensornet_kernels

Triton kernels and autograd functions of the TensorNet fast path (see xnn.gnn.fast.tensornet).