xnn.gnn.fast.aimnet2#

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

The reference gathers the convolved per-atom quantity onto every edge, forms its products with the radial basis and with the radial basis times each Cartesian component of the unit bond vector, and sums each product onto the centers: per pass a (E, C, S) gather and four products of that size, all kept by autograd. Here one kernel walks the edges of every center and accumulates the four shell sums sum_j a_jcs g_ijsk directly from the per-atom quantity, so nothing edge-sized beyond the basis is formed or saved. The sums are bilinear in the quantity and the basis: their gradients are one kernel over the edges of every center and a row pass over the edges of every neighbor, and the derivatives of those are the same kernels again, so forces, stress and the weight gradients of a force loss take the fused path at any derivative order.

Module Attributes

AUTO_POLICY

Edge counts above which use_fast="auto" takes the kernels in evaluation mode (energy and forces).

AUTO_POLICY_TRAINING

The same for training mode (a step with a force loss, second derivatives included): on an A30 the kernels were faster from about 5k edges on, on an L40S from about 30k (a few percent slower on smaller graphs).

Functions

supported(device, dtype)

Triton kernels on a CUDA device in float32 or float64.