xnn.gnn.fast.allegro_kernels#
Triton kernels and autograd function of the Allegro fast path (see xnn.gnn.fast.allegro).
Imported only when the fast path runs, so that triton is needed only there.
out[r, k] = sum_t c_t x[r, i_t] y[r, j_t] over the nonzero entries
t = (k_t, i_t, j_t) of a sparse coupling. One kernel per pattern and per
role of its three axes (output, first and second operand), generated from the
pattern: a program takes a block of rows, one row per thread, loads the
operand columns once and writes every output column from its unrolled sum.
The coefficients are a tensor argument, so the kernels run the model’s own
constants in either precision. The gradients of the contraction are the same
contraction with the roles of the axes exchanged.
Module Attributes
Rows per program (one per thread) and warps per program. |
|
The nonzero entries |
Functions
|
The sparse contraction of the Allegro tensor product (see |
Classes
|
|