Research notebook

Why parallel sums disagree: tracing FP32 reduction order notebook

Edit a Python cell and run it here. Your code runs in this browser tab; the notebook runtime and packages are served by this site.

Python starts when you choose Run.

Why parallel sums disagree: tracing FP32 reduction order

Two correct addition orders return zero and one for inputs whose exact sum is two. Enumerating every input order reveals the numerical contract.

CPU FP32 rounding illustration with exact chosen inputs; not a device race test or GPU benchmark.

Python · cell 1
serial=1.0 tree=0.0 reference=2.0
serial=2.0 tree=2.0 reference=2.0
Rounding-order demonstration, not a GPU reduction benchmark.
Distinct input permutations: 12
Serial outcomes: [0.0, 1.0, 2.0] pairwise outcomes: [0.0, 2.0]
Python · cell 2

Python runs locally in this page. Saved results and figures are visible before execution.

Download full experiment notebook