xnn.krnn.fast.sgdml#

Fast path of the GDML / sGDML kernel expansion (Triton kernels).

The reference forms, chunk by chunk, the differences between the descriptors of the batch and every permuted training descriptor, and makes several passes over them. The fast path reads each training term once per tile of structures: one kernel forms the kernel factors of every pair of a structure and a training term (and the energies), a second contracts them with the training terms into the gradient. A third pass of the same two kernels gives Hessian-vector products, so forces stay differentiable (Hessians) as in the reference. The arithmetic is float64, as in the reference, whatever the model’s dtype.

Module Attributes

AUTO_POLICY

Sizes (structures times training terms, B M Q) above which use_fast="auto" takes the kernels in evaluation mode (energy and forces).

AUTO_POLICY_TRAINING

0.7 of the reference's time for one structure, 0.1 for a thousand; a T4 from 6k.

Functions

supported(device, dtype)

Triton kernels on a CUDA device (the expansion is evaluated in float64).