xnn.gnn.fast.cace#

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

The reference forms the edge basis chi_e = R(r_e) (x) L(u_e) (x) T_e, one (n_rbf, L, C) tensor per edge (C the products of the sender and receiver element embeddings), and sums it onto the centers for the atom-centred basis A and, weighted by the sender’s H(B), for the Bchi messages; autograd keeps the edge-sized tensors. The receiver’s embedding is constant over the edges of a center, so the sums are theta_i (x) sum_{e -> i} p_e (x) x_e with p_e = R(r_e) (x) L(u_e) and x_e the sender’s (weighted) embedding: the neighbor sums of xnn.gnn.fast.gemnet, the same kernels, differentiable at any order. chi is never formed. The Ar messages, the senders’ A features times a decay per angular order, radial and edge channel, are summed onto the receivers by kernels of their own (xnn.gnn.fast.cace_kernels): the gathered features of every edge are never formed either.

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): faster from about 12k edges in float32 and 5k in float64.

Functions

supported(device, dtype)

Triton kernels on a CUDA device in float32 or float64.