Skip to content

Fix shardInPlace wrong integer split positions on quantized layers - #503

Merged
davidkoski merged 1 commit into
ml-explore:mainfrom
ronaldmannak:shard-quantized-layers
Oct 19, 2026
Merged

davidkoski merged 1 commit into
ml-explore:mainfrom
ronaldmannak:shard-quantized-layers

Conversation

@ronaldmannak

@ronaldmannak ronaldmannak commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Proposed changes

This PR brings one fix from ml-explore/mlx#4715 to MLX-Swift (the two other fixes in 4715 were already in MLX-Swift). It fixes integer split positions in shardInPlace that could split in the wrong places for quantized layers. The issue is fixed by using the existing quantizedShardedToAllPredicate that shardLinear already used. Misaligned positions now throw instead of silently failing and returning wrong tensors.
Tests added to DistributedNNTests and DistributedNNRingTests

Checklist

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@ronaldmannak ronaldmannak changed the title Add shardedToAllPredicate Fix shardInPlace wrong integer split positions on quantized layers Oct 17, 2026

@davidkoski davidkoski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good, thank you!

@davidkoski
davidkoski merged commit 12a704a into ml-explore:main Oct 19, 2026
7 checks passed
tsnAnh pushed a commit to TitoniumLab/mlx-swift that referenced this pull request Nov 7, 2026
Brings in the seven upstream commits after 35c10b4: ml-explore#481 (Sendable closures and
3-parameter VJP for MLXCustomFunction), ml-explore#503 (shardedToAllPredicate), ml-explore#494 (iOS
26.2 launch crash from Logger.isEnabled), ml-explore#498 (GPU.deviceInfo device selection),
ml-explore#418 (MaterializedArray is Sendable), ml-explore#505 (tripletLoss fix). The cLogSupport
removal in release.yml comes in with the merge; no fork-side edit was needed.
No conflicts.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants