xnn.gnn.fast.aimnet2_kernels#

Triton kernels and autograd functions of the AIMNet2 fast path (see xnn.gnn.fast.aimnet2).

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

The shell sums z[i, c, s, k] = sum_{e: dst_e = i} a[src_e, c, s] g[e, s, k] take one program per center over its edges in center order; their gradients gg[e, s, k] = sum_c w[dst_e, c, s, k] a[src_e, c, s] and the edge’s share u[e, c, s] = sum_k w[dst_e, c, s, k] g[e, s, k] one program per center (its gradient row read once), and ga[j] = sum_{e: src_e = j} u[e] one program per neighbor over its edges in neighbor order (compressed rows, xnn.common.models.csr). The sums run in registers, without atomic adds, and come out the same in every run.

Module Attributes

WARPS

Warps per program of the sums, the gradients and the row pass of the gradients.

WARPS_BY_GPU

Per GPU (a substring of the device name), the counts that differ from WARPS: on a T4 two warps for the sums were faster.

SPLIT_CHANNELS

Whether channels just above a power of two run in two passes (see _split_channels()).

Functions

shell_sums(a, g, edge_index)

The four shell sums of the AIMNet2 convolution (see xnn.gnn.fast.aimnet2).

Classes

ShellGradsFunction(*args, **kwargs)

(sum_k w[dst] g, sum_c w[dst] a) onto the neighbors and edges: the gradients of ShellSumsFunction for the incoming w.

ShellSumsFunction(*args, **kwargs)

z[i] = sum_{e: dst_e = i} a[src_e] (x) g_e, differentiable at any order.