You are most likely seeing small abs. errors due to the limited floating point precision and can’t expect to see bitwise equal values if the order of operations is not fixed (or if determinism is set otherwise).
You could see the same limitation by comparing the results of:
x = torch.randn(100, 100, 100)
s1 = x.sum()
s2 = x.sum(0).sum(0).sum()
print((s1 - s2).abs().max())
> tensor(0.0002)