trntensor: a batched MACE step on Trn2, and the hand kernels the compiler made redundant
Batched eight structures at a time, the MACE-MP-0b2 energy-plus-forces step takes 21.05 ms per 216-atom structure on one Trn2 logical core, 31× unmodified MACE on all 12 of the same box's host CPUs, with forces within 1.21e-5 of CPU MACE up to 1728 atoms. For the rest of the step, trntensor 0.27.0 shipped two hand-written NKI kernels and a way to run the same PyTorch bodies as compiled graphs, and the compiled graphs won: as fast as the kernels (39.8 against 41.9 ms per step), with a backward 4.6× closer to fp64. So "auto" leaves the kernels off. This post is for anyone deciding where hand-written kernels pay on Trainium. The answer here was the equivariant and graph blocks, and not the elementwise chains between them.