xnn.dnn.fast.acsf#
Fast path of the atom-centered symmetry functions (HDNNP).
RuNNer evaluates the symmetry functions in fused Fortran loops; the reference
(AtomCenteredSymmetryFunctions) evaluates the
radial functions of every edge and the angular functions of every triplet as a
sequence of tensor operations over (edges, functions) and (triplets,
functions) blocks, each read and written in full.
On a GPU, the Triton kernels of xnn.dnn.fast.acsf_kernels evaluate the
functions and sum them onto the centers in registers, for the function types 1,
2, 3 and 9 with at most two cosine or tanh cutoffs. Their gradient is
differentiable once, so they serve evaluation and training. On a CPU, and for
other function sets, the reference’s two blocks run compiled by torch.compile with dynamic sizes
(C++ / OpenMP loops on a CPU, Triton kernels on a GPU); those are differentiable
once only, so they serve evaluation and a training step keeps the reference.
With the optional C++ kernels turned on (xnn.common.models.cpu_extension),
xnn.dnn.fast.acsf_cpu evaluates the kernels’ function sets on a CPU in loops
over the atoms, as RuNNer does (evaluation).
Module Attributes
the reference. |
|
on a GPU the kernels and compiled blocks are faster than the reference at every size measured (A100, A30, T4, V100, L40S in float32); float64 on an L40S or a T4 (little float64 throughput, 1.1-1.5 of the reference from 192 atoms on an L40S, 1.1-1.3 at every size on a T4), an unmeasured GPU and a CPU keep the reference. |
|
on a CPU every size takes them (0.43-0.57 of RuNNer's time on one and eight threads, 81 to 375 atoms). |
|
the Triton kernels (differentiable twice) on the GPUs measured (0.60-0.78 of the reference's time on an A100, 0.55-0.84 on an A30, 0.55-0.73 on a V100, at every size; on an L40S 0.43-0.73 in float32, 1.3-1.8 in float64; on a T4 0.49-0.73 in float32, 1.3-1.8 in float64); elsewhere the reference (the compiled blocks are differentiable once). |