Skip to content

suite

trnsci: the PSUM bug that never showed

Five trnsci libraries opened their matmul accumulation groups in a way the NKI documentation calls undefined behaviour on NeuronCore-v3, the core in Trn2. Device conformance in Trn2 windows 3 to 7 had passed with it. The fix, validated in Trn2 window 8, changed no output bit the suite measured and no timing beyond run-to-run noise. This post explains why that was still worth a suite-wide fix, what PSUM's accumulation groups are, and why the NKI simulator in CI never warned. It is for NKI kernel authors and for anyone who relies on the suite's bitwise-reproducibility promise.

trnsci: what Trainium's arithmetic actually does

The suite's next precision step, fp64-class sums and dot products on the device, depends on how each NeuronCore engine rounds, and the Neuron documentation doesn't say. So one Trn2 window measured it: VectorE and GpSimd are textbook IEEE fp32, ScalarE has a fused multiply-add the docs don't mention, the fp32 TensorE path isn't correctly rounded, and stochastic rounding is deterministic per process. The same window also produced an accuracy table that mistook the worst corner of a range for the whole range, filed it upstream, and corrected it in public that night. This post is for anyone writing NKI kernels that need more than ML accuracy, and for anyone porting double-word or compensated algorithms to Trainium.

trnsci: rows of 32 MiB, partitions 64–127, and the 4 GiB point that was right by luck

On Trn2, a device matmul or copy whose operand has rows of 32 MiB or more can return wrong numbers with no error, and trnblas 0.12.1 and trntensor 0.25.1 now block every such product into pieces the hardware gets right. Getting there meant retracting a data point the suite had published: "a right operand of exactly 2³² bytes is correct" was true only because the wrong addresses happened to hold an identical copy of the right data. AWS maintainers traced the fault to how a DMA spreads rows over the 128 SBUF partitions, and that model, not the suite's first guess, is what the guards now encode. This post continues the suite's silent wrong answers, and it is for anyone moving tensors of more than 4 GiB through a NeuronCore.

trnsci: compile on a CPU host, run on Trainium. Neuron compile caches carry over

A feasibility test in trnsci#118 found that NEFFs compiled on a machine with no Neuron device are reused by a Trn2 box's persistent compile cache, with no neuronx-cc run, a fast first call and the same results. That works because the cache key is a pure function of the program and the compiler configuration, so compiling can move to cheaper CPUs ahead of a hardware window. The window that proved it also failed to keep most of its own cache, which is the practical half of this post. It is for anyone who pays for Trainium time and watches the first call compile.

trnsci: the suite's silent wrong answers, and the float64 rule that came out of them

Across three Trn2 hardware windows, correctness audits found about 60 silent wrong-result bugs in released versions of all six trnsci libraries. Most were wrong on every backend, so the suite's own pytorch-vs-NKI tests had passed them for months. The fixes taught the suite two things about Trainium: what float64 actually means on a device whose arithmetic is fp32, and that a test is only as independent as its reference. This post is for anyone who has shipped numerical code on Trainium, and for anyone deciding whether to trust ours.