Repository navigation
🔄 Auto-Sync: ml-explore/mlx-swift main (35c10b4, 3 commit(s)) - #25
Closed
github-actions[bot] wants to merge 4 commits into
Closed
github-actions[bot] wants to merge 4 commits into
github-actions[bot] wants to merge 4 commits into
Conversation
…lore#501) Fix leak when `_updateInternal` replaces an array with siblings `_updateInternal` assigned the new array with `mlx_array_set`, a C++ copy assignment that skips `array::~array()`. That destructor breaks the cycle between sibling outputs of a multi-output primitive. As a result, `Module.update(parameters:)` orphaned the init graph on every model load. This happened, for example, with a freshly built `QuantizedLinear` whose unevaluated random init weight is an output of `Quantize`. Now the code copies into a new handle and then frees the old one, so the destructor runs. Copying before freeing also keeps the contents intact when an array is passed to itself (`a._updateInternal(a)`), which the sharding path reaches. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Fix asArray crash on zero-size arrays An array with a logical size of 0 (e.g. an empty slice like a[128...] on a shorter axis) has no backing data pointer, so asArray() crashed by dereferencing nil. physicalSize now returns 0 for empty arrays, so asArray, asData and asDataCopy all return empty results from one place. The strided copy and the two no-copy asData paths also skip the nil pointer, which a transposed empty array or noCopy access would otherwise unwrap. This matches Python's tolist() behaviour. Adds tests for the empty-slice, empty-constructed, and scalar cases. Fixes ml-explore#480 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Automated merge by the upstream-sync workflow. 3 upstream commit(s). Merge with a merge commit, not squash/rebase.
Member
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.
Automated real merge of
ml-explore/mlx-swiftmain (35c10b4, 3 commit(s) not yet in this fork) intomain. Upstream changes: ml-explore/mlx-swift@2f96983...35c10b4Merge this PR with a merge commit ("Create a merge commit"), not squash or rebase. Squashing orphans the upstream commits and the fork commits that downstream repos pin (submodule SHAs).
Upstream commits
35c10b4Fix asArray crash on zero-size arrays (#486)(Ahmed Hassan)31c03d9Enable JACCL (#502)(Ronald Mannak)f93decfFix leak when _updateInternal replaces an array with siblings (#501)(ShankyShako)Needs a human look
Package.swiftSource/Cmlx/mlx-conditional/jaccl_conditional.cppWhat was checked
-X ours/theirs); the fork's workflows were restored unchanged.Bot disclosure
Prepared by the
upstream-syncGitHub Actions workflow. The workflow never approves, reviews or merges; no human has reviewed this merge yet.