Repository navigation
Fix sharded-to-all bias and integer split positions on quantized layers - #4715
Conversation
zcbenz
left a comment
There was a problem hiding this comment.
Sorry for the late response, can you take a look at the failed cpu tests?
And btw way please consider creating PRs from personal accounts, we are unable to rebase this branch when it is in org account even when you enabled it on GitHub.
|
@zcbenz It only fails on Linux CPU. Linux doesn't use MacOS' Accelerate SIMD kernel and a rounding error seems to push one output just over the tolerance. The sharding itself is exact (checked in float64). I can change the two new checks to use exactly representable values and compare with array_equal, so they don’t depend on summation order. Or would you rather I just loosen the tolerance for these checks? Re: personal account, Ronan mentioned that as well yesterday. I can reopen the PR from my personal fork. |
|
Thanks for looking into it, either fix sounds good to me. We can just use this PR, please do a rebase though. |
2b8c7ca to
cdda3e1
Compare
|
@zcbenz done. Verified on macOS but not on Linux. |
|
Can you rebase the PR for CI changes? |
Power-of-two scales, offsets in eighths and integer inputs keep every sum exact, so the sharded layers must match bit for bit regardless of summation order. The tolerance-based checks failed on Linux CPU, where the scalar quantized matmul kernel accumulates in a different order than the sharded sum. Co-Authored-By: Claude Opus 5.5 <[email protected]>
cdda3e1 to
5dc07e6
Compare
|
@zcbenz done |
…rs (ml-explore#4715) (cherry picked from commit 3392795)
This PR has three fixes:
The first two fixes are already fixed in MLX-Swift. I'll open a separate PR for the third issue on MLX-Swift.