xnn.trfnn.fast.et#

Fast path of the ET update layers (Triton kernels).

The reference layer gathers queries, keys, values and vector features onto the pairs and multiplies them with the distance filters as separate tensor operations, each writing a (P, F) or (P, 3, F) tensor that autograd keeps for the backward pass (P pairs, the self pairs included). Here the atom-wise projections and the filter networks stay as they are, and two kernels per layer do the pair work: one forms the logits of every pair and head (a (P, H) tensor), the other gathers, weighs and adds the messages onto the centers, writing no pair-sized tensor. The attention nonlinearity runs between them on the (P, H) logits, so all its derivatives are the reference’s.

Both kernels are linear in each input, so their backward kernels are of the same form and differentiable once more (xnn.common.models.multilinear): a force loss trains through the fused layers. Third derivatives are not supported.

Module Attributes

AUTO_POLICY

Edge counts above which use_fast="auto" takes the kernels in evaluation mode (energy and forces): every size, since the fused layers were faster than the reference from a single small molecule on, in both precisions, and use about a third of its memory.

AUTO_POLICY_TRAINING

from about ten thousand edges on (A100).

Functions

supported(device, dtype)

Triton kernels on a CUDA device in float32 or float64.