Repository navigation
chore: bump mlx-swift-lm to 4e6e521 and mlx-swift to 34bc52f (UserInput API) - #211
Merged
Merged
Conversation
…in tests
Upstream ml-explore/mlx-swift-lm (merged into SharpAI/mlx-swift-lm in
5152526, upstream 5e46681) turned UserInput.Image / Audio / Video from
enums into structs that wrap a `Source` enum, and replaced the enum
cases with static factory functions (`.ciImage(_:)`, `.url(_:)`, ...).
A static func cannot be used as a pattern, so
if case let .ciImage(image) = images.first
no longer compiles ("pattern variable binding cannot appear in an
expression") and the whole SwiftBuddyTests target fails to build, which
takes `swift build --build-tests` (and the mlx-swift-lm "Test with
SwiftLM (Umbrella Repo)" check) down with it.
Match on `images.first?.source` instead. The assertions are unchanged.
Production code needs no change: `return .ciImage(x)` / `.url(x)` /
`.data(_, format:)` in OpenAIPayloads.swift, Server.swift and
SwiftLMTestSTFT/main.swift resolve to the new static factories.
Also bump the submodules the fix depends on (against the old pinned lm
8055044 the `.source` member does not exist, so they must land together):
- mlx-swift-lm 8055044 -> 4e6e521 (SharpAI/mlx-swift-lm#74: real merge of
upstream 5e46681 plus a KVarN decode-smoke warm-up and the umbrella
workflow ref fix)
- mlx-swift 1a2b3af -> 34bc52f (SharpAI/mlx-swift#20: mlx v0.32.2 / mlx-c
ebc88f1 sync)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Summary
Bump the
mlx-swift-lmsubmodule from8055044to4e6e521(SharpAI/mlx-swift-lm#74) andmlx-swiftfrom1a2b3afto34bc52f(SharpAI/mlx-swift#20), and adapt one test file to the newUserInputAPI.Pulled in by this bump:
ml-explore/mlx-swift-lm(5e46681):UserInput.Image/Audio/Videobecome structs with aSourceenum,MatmulPrecision.splitTolerance, WHT barrier fix, fused GDN projection compile state, reranker changes, and more (see the lm PR description).ebc88f1sync in mlx-swift (Sync upstream ml-explore/mlx-swift (mlx v0.32.2, mlx-c ebc88f1) via real merge mlx-swift#20).reffix (lm-side only).SwiftLM change:
tests/SwiftBuddyTests/VLMExtractionTests.swiftmatched.ciImage(...)/.url(...)withif case let. Those are now static factory functions, which cannot be patterns (pattern variable binding cannot appear in an expression), so the wholeSwiftBuddyTeststarget stopped compiling. The two lines now match onimages.first?.source; the assertions are unchanged. Production code needs no change (return .ciImage(x),.url(x)and.data(_, format:)resolve to the new factories). The test change needs the new lm (UserInput.Image.source), so it has to land together with the bump.Test plan
Local (M5), against lm
4e6e521+ mlx-swift34bc52f:swift build --build-tests: clean (the only 2 errors before the change were the 2 lines above);swift build -c release: OKSwiftLMTests: 226 tests, 0 failuresSwiftBuddyTests: 124 tests, 9 skipped (environment-gated), 0 failures (VLMExtractionTests: 5/5)tests/test-vision.shcase 1 (Qwen2-VL-2B,--vision): pass through the release binarytests/test-vision.shcase 2 (LFM2.5-VL, local HF cache issue),xcodebuild -scheme SwiftBuddyCI:
build_and_unit_testspeculative-decoding,dflash-speculative-decoding,speculative-decoding-evalintegration_matrixjobs (these also exercise the bumped mlx-swift metallib build)After this merges, re-run
Test with SwiftLM (Umbrella Repo)on SharpAI/mlx-swift-lm#74; it checks out SwiftLMmainand was red only because of the two lines above.AI disclosure
This PR was prepared with AI assistance (Claude Code: diagnosis, the test change, build/test runs and this description). It still needs human review before merging.
🤖 Generated with Claude Code