xnn.trfnn.fast.et_kernels#
Triton kernels and multilinear blocks of the ET fast path (see xnn.trfnn.fast.et).
Imported only when the fast path runs, so that triton is needed only there.
Features are F = H D wide (H heads of D); a kernel holds them as an
(H, D) tile, padded to powers of two. 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 and are the same in every run.
Two blocks, each linear in every operand:
the logits
l[e, h] = sum_(f in h) q[i, f] k[j, f] dk[e, f]of every paire(centeri, neighborj);the messages,
dx[i] = sum_e a[e, h] s3[e]anddv[i, c] = sum_e v[j, c] s1[e] + s2[e] u[e, c], with the valuess_k[e] = w_k[j] dw_k[e] cw[e](wthe value projections,dwthe value filters,cwthe cutoff of the values,uthe pair directions), returned as four rows per atom:dxand the three ofdv.
Their adjoints are kernels of the same form, and the derivatives of the
adjoints are values and adjoints with one operand replaced by its cotangent
(xnn.common.models.multilinear), so the fused layers train with a force
loss.
Functions
|
The fused logits |
|
The fused messages of every center: |