Repository navigation
mps CB walls: strided writes, cumsum, bool copy on Metal; named refusals (#32, stacked on #83) - #84
Merged
Merged
Conversation
…l; cpu min/max signed zero (#49) - amax on Metal: max_keepdim, then the first index equal to it (or the first NaN) and a gather, so all -inf rows answer -inf and NaN propagates. - compare ops off the cpu keep their common dtype instead of widening to f64 (candle has no Metal F32->F64 cast); scalars narrow to the operand's dtype as upstream does. to(bool) on mps uses ne(0) in its own dtype. - cpu min()/max() return upstream's zero sign (-0 for min, +0 for max when present); min.dim/max.dim keep the first equal element. - golden: opt-in signed_zero cases and a zero-sign fault mode. - randn/normal_ on mps already compute on the device; a test pins it. Red before: amax all -inf gave -FLT_MAX; eq.Tensor raised Metal to_dtype F32 F64; min([0,-0,0,-0]) gave 0.0. Nullified: each of the three fixes removed turns its test red.
…ses by name (#32) - write_on_device splits a non-contiguous receiver into contiguous runs and slice_sets each on the device; past 65536 runs it refuses by name. - fill_.Tensor accepts a 0-dim cpu value beside an mps receiver (x[..., :k] = 0). - cumsum, any and copy_ into bool stay in their own/opmath dtype off the cpu instead of widening to f64 (candle has no Metal F32->F64 cast). - pow.Tensor_Scalar with an exponent other than 2 on Metal refuses by name: candle fast-math Metal powf gives 3.0 ** 3 = 26.99999237. - int32 compute and index/gather/scatter/sort/multinomial/view.dtype stay refused by name (no int32 Metal kernels; Metal gather/scatter unchecked). Red before: cumsum f32 raised Metal to_dtype F32 F64; zero_ on [:, 0:2] refused. Nullified: dropping the run split, or the pow refusal, turns the suites red.
Contributor
Gate on CI (issue #24)Full gate: 127 suites = 119 run on at least one CI runner + 8 local-only. The local gate (
Local-only: verified by no CI runner (8)
Suites that verified nothing, or failed, on a runner
Every suite, every runner
A SKIP is unverified on that runner, never passed. UNVERIFIED means the suite ran and every one of its tests skipped by name. |
…#49) PR #83's x86_64 CI: upstream's max() zero sign differs from the shim's there, so the signed-zero case fails clean and flipping the shim's zero lands on upstream's answer, read as a MISS of zero-sign. A corruption of a case that already fails says nothing about the comparator; the golden run reports the failing case itself. Here (arm64) zero-sign is still CAUGHT and the self-test PASSes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #32 (partial: the end-to-end CB greedy criterion is not met). Stacked on #83 (#49); merge #83 first.
Defect fixed
zero_/fill_/copy_/add_into views,x[..., :k] = 0): computed on Metal one contiguous run perslice_set, no host download; layouts needing more than 65536 runs refuse by name.cumsum,any,copy_into bool on mps: no longer raw candleto_dtype F32 F64/U8 F64errors; computed on device.pow.Tensor_Scalarwith exponent other than 2 on mps: named refusal (candle's fast-math Metalpowfgives3.0 ** 3 = 26.99999237, so computing in f32 would be wrong). A sweep of every implemented op outside the readback gate found no other raw candle Metal error.Still refused by name: int32 compute on mps (no int32 Metal kernels in candle-metal-kernels);
index.Tensor,gather,scatter.src,sort,multinomial,view.dtype(Metal gather/scatter do not bounds-check).Test added:
tests/devices/mps/test_mpscb.py(5);test_mpsinplace.pyrefusal test replaced by two (runs written on device; too-many-runs refusal);test_shim.py/test_mpsfwd.pyupdated from the candle error to the named refusal and cumsum computing.Evidence (local, this Mac, worktree)
cumsum ... candle: Metal contiguous to_dtype F32 F64;zero_ on [:, 0:2] ... non-contiguous view is implemented for the CPU backend only.split = 0turns 4 tests red; removing the pow refusal turns 2 red.suites=125/125 ok=2021 FAIL=3; after the run, the mpsfwd FAIL was fixed (suite re-run green). The other two are worktree environment (test_toolguard_wheel_staging,test_wheelmatrix, no.caches/target-python, AGENTS.md §13.2).Not done: device
index.Tensor(every forward hits it), so CB greedy on mps does not complete; sin/cos accuracy point; cumsum on mps accumulates in f32 where upstream cpu uses f64.