xnn.gnn.fast.schnet#

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

The reference block evaluates the filter-generating network, the envelope, the gather of the neighbor features, their product with the filters and the sum onto the centers as separate tensor operations, each writing an (E, F) tensor that autograd keeps for the backward pass. Here the filter network stays as it is (two dense layers and the shifted softplus between them), and one kernel applies the second layer’s shifted softplus (when the model has one) and the envelope, gathers h[src], multiplies and adds the products onto out[dst]: the filters and messages are never stored, only the second layer’s output is saved. The backward pass is one kernel for the feature gradient, the gradient of the second layer’s output and that of the envelope.

The gradient reaches the features, the filter network (its weights included) and the envelope, so forces, stress and the weight gradients of a force loss: the backward kernel is itself differentiable, through a kernel of the same form, so training takes the fused convolution as well.

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).

Functions

supported(device, dtype)

Triton kernels on a CUDA device in float32 or float64.