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
mps: amax drops NaN and answers -FLT_MAX for all -inf; randn fails at an F64 -> F32 cast #49
Found by #29's design round (measured on the current build, this Mac):
aten.amax.default on mps returns -FLT_MAX (f16: -65504, bf16: -3.39e38) for an all--inf input, and drops NaN: amax([nan, 1]) is 1.0. Cause: candle's Metal reduce fold starts from the finite lowest value, not -inf, and skips NaN. The same helper feeds softmax's row max.
torch.randn(..., device='mps') fails with aten.normal_: Metal contiguous to_dtype F64 F32. eq and to(bool) on an empty mps tensor take an F32 -> F64 path.
min([0., -0., 0., -0.]) on cpu returns 0.0 where upstream returns -0.0. The golden comparator cannot see the sign of zero.
randn/normal_ on mps compute on the device and agree with upstream's distribution checks (or draws, if the stream can match). Otherwise they refuse by name.
The golden comparator distinguishes ±0.0, and the min case is fixed.
Activity
b-re-w commentedon Oct 5, 2026
Paused before starting (user's instruction). Next in the correctness queue after #33.
test_signedzero: pin the x86_64 upstream zero sign as a known diverge…
golden self-test: judge a fault mode only on a case that passes clean (…
golden: pin the 16 x86_64 whole-tensor min/max signed-zero cases (#49, …
Merge pull request #83 from thisisthepy/feat/mps-extrema
b-re-w commentedon Oct 16, 2026
Landed in develop via #83