You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Trn2: eager torch.cat(dim=1) producing a ~9.4e9-byte fp32 output silently returns wrong data (63% of elements); exact at ≤8.7e9 bytes #1502
Summary: on Trn2, eager torch.cat(chunks, dim=1) on neuron tensors returns a silently wrong result when the output is about 9.4e9 bytes. 63% of the elements differ from the host result and no error is raised. The same call is bitwise exact at 4.7e9, 8.19e9 and 8.70e9 bytes. Every input chunk is under 2³¹ bytes.
Environment: trn2.3xlarge, Deep Learning AMI Neuron torch-neuronx 2.14.0 (Ubuntu 24.04) SDK 2.33.1, torch-neuronx 2.14.3, neuronx-cc 2.28.7631, runtime 2.35.33, LNC=2, one logical core (NEURON_RT_VISIBLE_CORES=3).
1,486,199,911 of 2,348,810,240 (rows 0…458751, 404,202 rows affected)
The failing case puts about 18.8 GB (inputs plus output) on one logical core, which may be relevant (cf. #1447). It was found while assembling feature-axis chunks of a graph-network message tensor (MACE-style, 8000 atoms). We now avoid the pattern; a single NKI launch over the full tensor is exact.
Asks:
fix or detect the condition;
at minimum, raise an error instead of returning wrong data.
The original report (LNC=2) failed at about 9.4e9 output bytes and was exact up to 8.7e9. At LNC=1 the same pattern fails at 4.7e9 and is exact at 2.0e9.
The threshold roughly doubles from LNC=1 to LNC=2. That suggests an addressing limit of about 2^32 bytes per physical core in the cat lowering; the exact LNC=2 boundary (between 8.7e9 and 9.4e9) is not pinned down:
it breaks past 2^32 bytes at LNC=1;
it breaks somewhere past about 2^33 at LNC=2, where the logical core spans two physical cores.
The writes also land in the memory of the cat's own inputs: inputs 1 and 2 are corrupted afterwards. So any later use of those tensors is wrong too, still with no error raised.
Activity
github-actions commentedon Nov 25, 2026
Hi @scttfrdmn, Thank you for filing the issue! We will take a look and get back to you.
ahoffman-aws commentedon Nov 25, 2026
The team reproduced the issue related to memory spans of 4 GB or more on SDK 2.33.1 and are planning to fix in a future release
scttfrdmn commentedon Nov 28, 2026
Additional data: the same failure at LNC=1, at half the size, and it also corrupts the inputs.
Toolchain: Trn2 trn2.3xlarge, DLAMI SDK 2.33.1, torch-neuronx 2.14.3, neuronx-cc 2.28.7631, runtime 2.35.33. Eager mode, fp32.
Repro (aten only):
NEURON_LOGICAL_NC_CONFIG=1,NEURON_RT_VISIBLE_CORES=6(one physical core);torch.cat([a, b, c], dim=1)of host-generated device tensors of shapes (E, 2048), (E, 2048) and (E, 1024);The original report (LNC=2) failed at about 9.4e9 output bytes and was exact up to 8.7e9. At LNC=1 the same pattern fails at 4.7e9 and is exact at 2.0e9.
The threshold roughly doubles from LNC=1 to LNC=2. That suggests an addressing limit of about 2^32 bytes per physical core in the cat lowering; the exact LNC=2 boundary (between 8.7e9 and 9.4e9) is not pinned down:
The writes also land in the memory of the cat's own inputs: inputs 1 and 2 are corrupted afterwards. So any later use of those tensors is wrong too, still with no error raised.
Downstream tracking: trnsci/trnsparse#150.