Repository navigation
Align Falcon H1 with upstream MLX inference - #331
Merged
Merged
Conversation
davidkoski
reviewed
Jun 11, 2026
davidkoski
reviewed
Jun 11, 2026
Update Falcon H1/H1R inference behavior to match current mlx-lm more closely. This fixes tied embedding output projection and scaling, routes attention through the common cache-aware causal path, advances Mamba cache metadata during generation, reports per-layer KV head counts correctly, and chunks SSM prefill to reduce long-prompt memory and latency. Also mirror upstream ArraysCache length handling for hybrid and batched paths: preserve left padding and lengths through filter, extend, copy, and serialization; forward length preparation through CacheList; and use per-row lengths in Falcon H1 convolution plus chunked SSM state updates. Add regression coverage for the shared causal attention mask path, SSM mask metadata, nested hybrid cache length propagation, and Mamba metadata copy behavior.
aleroot
force-pushed
the
falconh1-improvments
branch
from
June 11, 2026 01:25
e09123a to
95dbbf5
Compare
mdstaff
added a commit
to mdstaff/mlx-swift-lm
that referenced
this pull request
Jun 12, 2026
…emma-4-12b-local-validation Brings in ml-explore#308 (Gemma 4 MTP speculative decoding, e145aca), ml-explore#333 (cross- layer KV sharing in no-cache forward), ml-explore#337 (prepare() windowSize), ml-explore#331, ml-explore#332. Conflict resolutions: - LMInput.ProcessedAudio: keep features/mask shape (consumed by Gemma4Unified); main's samples variant had no constructors. - Gemma4TextBackbone/Gemma4TextLanguageModel: union of ml-explore#327's tokenTypeIds and ml-explore#308's emitDrafterState threading; tuple return from ml-explore#308. - Gemma4.prepare image path: keep single full-sequence forward with tokenTypeIds (bidirectional vision overlay can't span chunk boundaries); main's chunked text-only prefill retained. - Dropped hasExplicitCache gating orphaned by ml-explore#333. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dkgv
pushed a commit
to dkgv/mlx-swift-lm
that referenced
this pull request
Jul 30, 2026
Update Falcon H1/H1R inference behavior to match current mlx-lm more closely. This fixes tied embedding output projection and scaling, routes attention through the common cache-aware causal path, advances Mamba cache metadata during generation, reports per-layer KV head counts correctly, and chunks SSM prefill to reduce long-prompt memory and latency. Also mirror upstream ArraysCache length handling for hybrid and batched paths: preserve left padding and lengths through filter, extend, copy, and serialization; forward length preparation through CacheList; and use per-row lengths in Falcon H1 convolution plus chunked SSM state updates. Add regression coverage for the shared causal attention mask path, SSM mask metadata, nested hybrid cache length propagation, and Mamba metadata copy behavior.
This was referenced Sep 30, 2026
div0-space
pushed a commit
to LibraxisAI/mlx-swift-lm
that referenced
this pull request
Nov 29, 2026
…l-explore#331) * Add an opt-in plain-chunk ceiling for bidirectional media requests `CBv2SchedulerConfig.bidirectionalMediaPrefillChunkCeiling` (nil by default) caps the plain prefill chunk of a request whose multimodal input carries bidirectional blocks. A paged span-bearing chunk attends in one unblocked call, so its score tensor grows with the chunk length times the history; the ceiling lets a host widen text chunks without widening that tensor. Both chunk-cap sites in SchedulerV2 (the ordinary plan and the deferred block-row admission) read `plainPrefillChunkSize(hasBidirectionalBlocks:)`. A chunk that begins at a block still extends over the whole block, the solo stripe still never arms for these requests, and causal media keeps `prefillChunkSize`. First-token projection already refuses to price block-bearing rows (`multimodalWork`), so it needs no mirror. Unit tests cover the ceiling beside a wide text chunk, block snap-over, unset and non-binding values, causal media, deferred admission and serialized prefill beside decode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Move the media chunk ceiling tests into the Scheduling unit folder SDK main keeps scheduler unit tests in Tests/MLXLMTests/Unit/Scheduling (CBv2PrefillInterleaveTests). Use the same folder so the merge does not leave a parallel Unit/Scheduler directory. No test or code change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
div0-space
pushed a commit
to LibraxisAI/mlx-swift-lm
that referenced
this pull request
Nov 29, 2026
Brings ml-explore#322 (Flint), ml-explore#324, ml-explore#326-ml-explore#330 (CBv2 paged/MTP/SDPA, GPT-OSS), ml-explore#325 and the Nemotron Super fused MTP verify window: SDK main up to the commit d-inference master pins (889fe3c). Main's later ml-explore#331/ml-explore#332 are left out until the provider adopts ml-explore#332's streamed tool-call type. Package.swift pins the cluster mlx-swift 9fe34405 instead of main's 67dc7528; that was the only conflict. Co-Authored-By: Claude Opus 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.
Proposed changes
Update Falcon H1/H1R inference behavior to match current mlx-lm more closely.
This fixes tied embedding output projection and scaling, routes attention through the common cache-aware causal path, advances Mamba cache metadata during generation, reports per-layer KV head counts correctly, and chunks SSM prefill to reduce long-prompt memory and latency.
Also mirror upstream ArraysCache length handling for hybrid and batched paths: preserve left padding and lengths through filter, extend, copy, and serialization; forward length preparation through CacheList; and use per-row lengths in Falcon H1 convolution plus chunked SSM state updates.
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes