xnn.gnn.fast.tensornet_kernels#

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

Imported only when the fast path runs, so that triton is needed only there.

Per atom the kernels read and write ten F-wide rows: the scalar, the three components of the vector (the axial vector of the skew part) and the six distinct entries xx, xy, xz, yy, yz, zz of a symmetric part. One program handles one atom and walks its pairs in a sorted order (compressed rows: by center for the sums onto centers, by neighbor for the gradients onto neighbors), accumulating in registers, so the sums need no atomic adds (one remains, for the neighbor term of the pair embedding) and are the same in every run.

Module Attributes

ROWS

scalar, vector (3), symmetric (6)

Functions

embedding(left, right, cut, d1, d2, d3, u, ...)

The fused pair sums of the tensor embedding.

messages(x, a, cut, src, dst)

The fused interaction messages.

Classes

EmbeddingFunction(*args, **kwargs)

The pair sums of the embedding on the ten rows.

EmbeddingGradFunction(*args, **kwargs)

The backward of EmbeddingFunction up to the per-pair sums dots, differentiable once more.

MessageFunction(*args, **kwargs)

The interaction messages on the ten rows x with filters cut * a.

MessageGradFunction(*args, **kwargs)

The backward of MessageFunction (the gradients of x, a and the cutoff for the incoming gradient g), differentiable once more.