xnn.gnn.fast.gemnet_kernels#
Triton kernels and autograd functions of the GemNet fast path (see xnn.gnn.fast.gemnet).
Imported only when the fast path runs, so that triton is needed only there.
The neighbor sums of the efficient bilinear layer,
S[e, a, f] = sum_{t: out_t = e} s[t, a] x[in_t, f], split the items of every
output edge (triplets or quadruplets, in output order) into chunks of at most
CHUNK: one program per chunk forms the chunk’s product s^T x (a
matrix-unit tile in IEEE float32, multiply-adds in float64) and one program per output adds
its chunks’ partial sums in order, so long rows (quadruplets) occupy the whole
GPU. The gradients take one program per chunk as well (the output’s gradient
row read once): per item gs[t, a] = sum_f w[out_t, a, f] x[in_t, f] and the
share u[t, f] = sum_a w[out_t, a, f] s[t, a], then one program per input
row sums the shares of its items, gx[r] = sum_{t: in_t = r} u[t]
(compressed rows, xnn.common.models.csr). No atomic adds: the sums come
out the same in every run.
Module Attributes
one program each, the partial sums of an output's chunks added in order. |
|
Triton has no float64 tile product (it rejects the operands), so float64 accumulates by multiply-adds. |
Functions
|
The items by output and by input and the output chunks: |
|
The neighbor sums of the efficient bilinear layer (see |
Classes
|
|
|
|