Repository navigation
Reuse Gemma4 softcap fusion for text inference - #675
Merged
davidkoski merged 1 commit intoOct 9, 2026
Merged
Conversation
davidkoski
approved these changes
Oct 9, 2026
davidkoski
left a comment
Member
There was a problem hiding this comment.
Change looks good, thank you!
slamfinger
pushed a commit
to slamfinger/mlx-swift-lm
that referenced
this pull request
Oct 14, 2026
davidtai
added a commit
to Layr-Labs/mlx-swift-lm
that referenced
this pull request
Oct 23, 2026
…ogits David's rulings, 2026-10-23. Tool calls: - `ToolCallPolicy.returnsFailedCallsAsText` defaults to true. The fork's frame state machine returns a failed, incomplete or undeclared frame as visible text, as on fork main before the merge. This restores the fork behavior of the generate path, ChatSession and the server container engine. - Upstream's recovery state machine needs an explicit false. The separate `ToolCallProcessor` init parameter is removed, so the policy is the one switch. The FoundationModels router passes false (its rejection events come only from the recovery machine). - Upstream tool tests that test the recovery machine pass false explicitly. Fork tests use the default and are unchanged in substance. - QwenXMLPayloadScanner finds tag ends by Unicode scalar, so a value that starts with a combining mark no longer hides the `>` (the fork parser did this before the merge; Qwen35OpaqueFramingTests). Gemma4Text keeps float32 softcap logits over upstream 34a3fd2 (ml-explore#675): the sampler receives full-precision logits (fork 8a212b4, vMLX decode port). Gemma4TextTests expects the float32 result; its structure is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 5 tasks
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.
Proposed changes
Reuse the existing Gemma4 softcap fusion in
Gemma4TextModel, including thegemma4_unifiedtext wrapper.Performance
Isolated softcap measurements on Apple M2, Release build, BF16 logits and a 262,144-token vocabulary:
Medians from 10 alternating baseline/fused rounds after warmup, with evaluation barriers. Outputs matched bit-for-bit.
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changesAI usage
accurately describes the code changes.