Skip to content

Size five float32 test comparisons for TF32 matmuls - #802

Merged
davidkoski merged 1 commit into
ml-explore:mainfrom
Augustas11:tests-exact-matmul-precision
Nov 17, 2026
Merged

davidkoski merged 1 commit into
ml-explore:mainfrom
Augustas11:tests-exact-matmul-precision

Conversation

@Augustas11

Copy link
Copy Markdown
Contributor

Proposed changes

On an Apple M5 (TF32 matmuls by default), five tests fail on main (bf5a5d4). They pass with MLX_ENABLE_TF32=0 and on an M3. Following #649 and #721:

  • Two HadamardQuantizedTests, EmbeddingGemma G7 and LFM2DSparkMetalTests.rotatingHybridCacheMatchesGreedyAcrossWindow use MatmulPrecision.tolerance. The float32 bounds are unchanged. The TF32 bounds are 1e-4→2e-3, 1e-3→5e-3, 1e-5→5e-3 and 1e-4→1e-3, against values needed on the M5 of 5.7e-4, 1.4e-3, 1.1e-3 and 1.9e-4 (smallest 1-2-5 step at least 3x; for the two Hadamard tests the needed value is the atol after their rtol of 1e-4 and 1e-3, with max errors 7.2e-4 and 2.7e-3). G5 and G6 keep 1e-5.
  • The EvalTests speculative log-probability test runs on the CPU with unchanged assertions. It compares top-k order exactly; tokens 97 and 48 are 4.7e-4 apart, and TF32 shifts log probabilities by up to 3e-3.

Deliberate bugs against the TF32 bounds: a dropped Hadamard sign fails by 0.47 and 1.48; marking one pad as real in the G7 left-padded mask fails with relNorm 0.75, 150x the bound; a one-position RoPE offset in LFM2 fails one of ten cases by 3.5e-2 with identical tokens. Three other deliberate cache bugs in LFM2 were not detected by this test at either bound.

Verified on an Apple M5 (32 GB, macOS 27.0.1, MLX_ENABLE_TF32 unset):

  • swift test --filter 'HadamardQuantizedTests|EmbeddingGemmaMaskTests|LFM2DSpark|EvalTests': main has 175 XCTest failures and 4 issues; this branch has 0 failures (30 XCTest, 22 Swift Testing).
  • xcodebuild test restricted to those four classes: TEST SUCCEEDED.

Not checked: this branch on an M3 (main passes there; macOS differs between the machines, 26.7.3 vs 27.0.1), a second M5, and GPU log-probability equality for the speculative iterator, which this change no longer asserts.

Checklist

Put an x in the boxes that apply.

  • 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)

AI usage

  • I have read this PR description in full and approve it as my own, and it
    accurately describes the code changes.
  • AI usage disclosure: the change and this description were drafted with an AI coding assistant; I reviewed them and ran the tests on my own machines.

Augustas from Malibu

On Apple silicon with neural accelerators (M5 and later) MLX runs float32
matmuls as TF32 unless MLX_ENABLE_TF32=0, and five tests fail there with
default settings.

- HadamardQuantizedTests (2 tests), EmbeddingGemmaMaskTests G7 and
  LFM2DSparkMetalTests.rotatingHybridCacheMatchesGreedyAcrossWindow use
  MatmulPrecision.tolerance: the float32 bound is unchanged, the reduced
  bound applies only where the probe measures TF32.
- EvalTests speculative log-probability test runs on the CPU, which pins
  IEEE float32: it compares top-k order exactly, and TF32 reorders
  near-ties.

@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.

Thanks for dealing with these!

@davidkoski
davidkoski merged commit ca661dc into ml-explore:main Nov 17, 2026
5 of 6 checks passed
aleroot added a commit to aleroot/mlx-swift-lm that referenced this pull request Nov 18, 2026
testRestoredMellumAndRecurrentQwenMatchFreshPrefill compares a restored
checkpoint with a cold prefill whose chunk boundaries differ, at 1e-4
relative. On Apple silicon with neural accelerators (M5 and later) MLX runs
float32 matmuls as TF32, and the float32 cases reach 1.2e-4 (Mellum) and
2.9e-4 (Qwen 3.5). With MLX_ENABLE_TF32=0 they measure 3e-7, and the test
passes unchanged.

The float32 bound now comes from MatmulPrecision.tolerance (ml-explore#802): 1e-4
where float32 is IEEE, 1e-3 where the probe measures TF32. The exact
restore-against-replay checks (atol 0) and the bfloat16 bound are unchanged;
both pass under TF32.
jyauxi added a commit to jyauxi/mlx-swift-lm that referenced this pull request Nov 18, 2026
The port is now checked against mlx-vlm 0.8.0, which fixed the DeepSeek-OCR
vision tower in October (76700c8). Each fix below has a test that fails on
the old code.

Parity with mlx-vlm:
- Vision: the CLIP MLP uses quick_gelu, x * sigmoid(1.702 * x). The CLIP
  and SAM position embeddings are resized with antialiased bicubic. The
  weights are the ones EmbeddingGemma2 already built, moved to
  MediaProcessing.antialiasedBicubicWeights. The SAM relative positions are
  resized half-pixel linear and keep the weights' dtype.
- The image placeholder per pack: `<image>\n` per image for DeepSeek-OCR,
  one bare `<image>` for Unlimited-OCR, as mlx-vlm keys it on model_type.
- Both packs end the prompt at its text. The template's trailing separator
  is dropped only when it decodes to whitespace.
- Each pack sets its gundam tile cap: 9 for DeepSeek-OCR, 32 for
  Unlimited-OCR. One maxNumTiles(from:default:) reads a caller's override.
- Gundam tiles are cropped top to bottom, as PIL does.

Review fixes:
- DeepseekOCRProcessor.unlimited(_:tokenizer:) replaces the
  UnlimitedOCRProcessor typealias and the rules in the registry closure.
  unlimitedContext is removed.
- parseDetections reads Unlimited-OCR's layout spans
  (`<|det|>label [x1, y1, x2, y2]`) and every box in a multi-box span. An
  unclosed span ends at its boxes.
- RingSlidingKVCache saves and restores through KVCacheTypeRegistry.
- Comments are cut to one or two lines, and the README states each pack's
  rules.

Loading:
- VLMRegistry.unlimitedOCR6bit is mlx-community/Unlimited-OCR-6bit. It
  ships model_type unlimited-ocr and a weight index that matches its files.
  The majentik pack gives the same output and still loads.
- An Unlimited-OCR-2 config (use_sparse_attention or
  sparse_attention_config) is refused at load instead of running as v1. A
  null config section is not taken for one.

Tests:
- The end-to-end DeepSeek-OCR test is back in IntegrationTesting. It runs
  gundam tiles and prefers a cached pack.
- Golden values computed through float32 matmuls run on the CPU, so TF32
  hardware cannot fail them (as ml-explore#802 does).
- The stub tokenizers see whitespace, and the prompt-recording stub takes
  a lock.

Prefill stays a single forward. A chunked version changed long fused
output, and the reason is stated where prefill runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidkoski pushed a commit that referenced this pull request Nov 20, 2026
…rim back) (#716)

* Restore a prompt checkpoint when a cache cannot trim back

Reasoning templates such as Mellum 2.1 and Qwen3 drop the reasoning of
past replies when they render the next prompt. The new prompt then
diverges right after the previous prompt's assistant header, or earlier
when that prompt ended with a prefilled reasoning block (thinking off).
Reusing the cache means rewinding the whole previous reply. A sliding
window that has wrapped, or recurrent state, cannot trim that far, so
ChatSession rebuilt the cache and every follow-up reported 0 cached
prompt tokens.

Approach

mlx-lm reuses an untrimmable cache only through an exact-prefix
snapshot, taken at segment boundaries such as the start of the
assistant tail. vLLM lets each cache type answer which prefix it can
restore, and splits prefill at those boundaries so the state exists
there. This change follows the same idea: keep one checkpoint of the
cache at the end of the prompt a later render keeps, and prefer, in
order, a trim that reaches the common prefix, a restore of that
checkpoint, then a rebuild.

Design

- KVCacheStorage.Checkpoint is a value. checkpoint() copies only the
  entries a trim may not return (!isTrimmable(after: .max): wrapping
  windows, recurrent state). restore(_:) trims the other entries and
  puts back copies of the copies, so it can be restored again. It
  changes nothing and returns false when it cannot restore. The storage
  keeps no checkpoint state of its own.
- TokenIterator(checkpointAt:) pauses prefill at a position, records
  prefillCheckpoint (cache checkpoint plus carried model state), then
  prefills the rest. The head goes through a new prefill-only
  LanguageModel.prefill(_:into:state:parameters:).
  PrefillParameters.pass(after:of:) keeps progress and prefix reports
  as one prefill. The iterator still owns the whole input, so timing,
  prompt counts and logit processors see the full prompt.
- PromptCacheReuseDecision gains .restoreCheckpoint(prefixLength:),
  decided by a new RestoreCheckpointRule.
  RewindToCommonPrefixRule now declines instead of returning .rebuild,
  and the policy's fallback still rebuilds. A restore also returns the
  carried model state, which a trim cannot. Like a trim, a refused
  restore is downgraded to .rebuild before prefilling.
- ChatSession checkpoints only turns that answer a user message, since
  templates drop reasoning from every reply after it. The checkpoint
  sits before any prefilled reasoning block and before the token the
  iterator samples from. ReasoningConfig.prefilledBlock finds the block
  and replaces the old prefilledReasoningStartDelimiter scan. The
  checkpoint is used only while the token ledger still starts with its
  tokens and the storage can restore it.

Costs and limits

Memory is one copy of each window or recurrent entry per session,
bounded by window and state size. Models whose caches all trim take
no checkpoint and run no extra forward. Sessions with a draft cache,
and inputs with media or an attention mask, take no checkpoint and keep
the previous behavior.

* Bound prompt checkpoints to the state a trim cannot restore

The first version copied whole top-level entries and probed
isTrimmable(after: .max). A variance-normalized tail overflowed on that
probe, and a CacheList kept its global attention history next to the
recurrent state. Automatic splitting also overrode an explicit unchunked
prefill.

Copy leaves instead. Rotating and recurrent state is snapshotted, global
attention is trimmed in place, and a variance-normalized cache keeps only
its raw tile after that compression has run. One asyncEval materializes
the copies so an oversized prefill buffer is not pinned. Explicit
unchunked and remainder schedules stay one forward.

Restore still requires an exact token prefix. The checkpoint reproduces
that prefix; it does not change the model's answers.

* Report prompt checkpoint memory in cache status

* Keep checkpoints across append-only turns and count batch metadata

* Size the checkpoint numerics test for TF32 matmuls

testRestoredMellumAndRecurrentQwenMatchFreshPrefill compares a restored
checkpoint with a cold prefill whose chunk boundaries differ, at 1e-4
relative. On Apple silicon with neural accelerators (M5 and later) MLX runs
float32 matmuls as TF32, and the float32 cases reach 1.2e-4 (Mellum) and
2.9e-4 (Qwen 3.5). With MLX_ENABLE_TF32=0 they measure 3e-7, and the test
passes unchanged.

The float32 bound now comes from MatmulPrecision.tolerance (#802): 1e-4
where float32 is IEEE, 1e-3 where the probe measures TF32. The exact
restore-against-replay checks (atol 0) and the bfloat16 bound are unchanged;
both pass under TF32.

* Compare the EXIF orientation test's renders within a tolerance

imagesTurnUprightByTheirExifOrientationOnce renders one JPEG through two
paths, orienting it either in EmbeddingGemma2ImageProcessor.prepared or in
the decoder, and required the two pixel arrays to be exactly equal. The
paths decode and resample at different stages, so a different GPU or
decoder can round them apart: the CI runner failed orientation 4 while it
passes locally and on main.

Compare the maximum difference against 0.05 instead. Pixels are in 0...1,
and a wrong orientation moves the blue square over red, a difference near
1: forcing the mirrored orientation in prepared fails all seven non-upright
cases at this bound.

* Keep a checkpoint before the latest reply to tool results

A checkpoint was taken only for a turn that answers a user message, so a
tool loop kept the one before its first reply. A Qwen template renders
the call in a reply differently from how the model wrote it, with its
arguments sorted by name and its whitespace canonical. Each tool step
after a call that did not render back exactly therefore restored that
first checkpoint and prefilled every tool result since. vLLM, SGLang
and llama.cpp save recurrent state along the prompt and resume from the
last state saved before the mismatch.

Keep two checkpoints:

- `turn`, before the reply to the last user message, as before. A user
  turn keeps it until a prompt rewrites the turn.
- `step`, before the latest reply to tool results. Every tool step moves
  it, because the next step rewrites the call this one makes. A new user
  turn checkpoint drops it.

A turn restores the longest checkpoint the new prompt starts with, and
a checkpoint the new token ledger no longer starts with is dropped. A
user turn after a tool loop still resumes before its first reply, since
the template drops the reasoning of every reply after the last user
message. `KVCacheStatus.checkpoint` reports the longest prefix and the
memory of both. The cost is a second copy of the window and recurrent
state for a session in a tool loop.

`QwenReasoningTemplateTests` still expected a mismatching Qwen 3.8
continuation to rebuild, and one prepare per turn, which a checkpoint
splits. Its scripted model now ends a pass at end-of-sequence, and the
mismatching variants check that the session prefills only the tokens
after the last match: the first step from before the first reply, the
next from before the latest one. Without the step checkpoint that check
fails for reordered arguments, non-canonical whitespace and an implicit
reasoning end.
djandrewgibbons pushed a commit to djandrewgibbons/mlx-swift-lm that referenced this pull request Nov 20, 2026
…rim back) (ml-explore#716)

* Restore a prompt checkpoint when a cache cannot trim back

Reasoning templates such as Mellum 2.1 and Qwen3 drop the reasoning of
past replies when they render the next prompt. The new prompt then
diverges right after the previous prompt's assistant header, or earlier
when that prompt ended with a prefilled reasoning block (thinking off).
Reusing the cache means rewinding the whole previous reply. A sliding
window that has wrapped, or recurrent state, cannot trim that far, so
ChatSession rebuilt the cache and every follow-up reported 0 cached
prompt tokens.

Approach

mlx-lm reuses an untrimmable cache only through an exact-prefix
snapshot, taken at segment boundaries such as the start of the
assistant tail. vLLM lets each cache type answer which prefix it can
restore, and splits prefill at those boundaries so the state exists
there. This change follows the same idea: keep one checkpoint of the
cache at the end of the prompt a later render keeps, and prefer, in
order, a trim that reaches the common prefix, a restore of that
checkpoint, then a rebuild.

Design

- KVCacheStorage.Checkpoint is a value. checkpoint() copies only the
  entries a trim may not return (!isTrimmable(after: .max): wrapping
  windows, recurrent state). restore(_:) trims the other entries and
  puts back copies of the copies, so it can be restored again. It
  changes nothing and returns false when it cannot restore. The storage
  keeps no checkpoint state of its own.
- TokenIterator(checkpointAt:) pauses prefill at a position, records
  prefillCheckpoint (cache checkpoint plus carried model state), then
  prefills the rest. The head goes through a new prefill-only
  LanguageModel.prefill(_:into:state:parameters:).
  PrefillParameters.pass(after:of:) keeps progress and prefix reports
  as one prefill. The iterator still owns the whole input, so timing,
  prompt counts and logit processors see the full prompt.
- PromptCacheReuseDecision gains .restoreCheckpoint(prefixLength:),
  decided by a new RestoreCheckpointRule.
  RewindToCommonPrefixRule now declines instead of returning .rebuild,
  and the policy's fallback still rebuilds. A restore also returns the
  carried model state, which a trim cannot. Like a trim, a refused
  restore is downgraded to .rebuild before prefilling.
- ChatSession checkpoints only turns that answer a user message, since
  templates drop reasoning from every reply after it. The checkpoint
  sits before any prefilled reasoning block and before the token the
  iterator samples from. ReasoningConfig.prefilledBlock finds the block
  and replaces the old prefilledReasoningStartDelimiter scan. The
  checkpoint is used only while the token ledger still starts with its
  tokens and the storage can restore it.

Costs and limits

Memory is one copy of each window or recurrent entry per session,
bounded by window and state size. Models whose caches all trim take
no checkpoint and run no extra forward. Sessions with a draft cache,
and inputs with media or an attention mask, take no checkpoint and keep
the previous behavior.

* Bound prompt checkpoints to the state a trim cannot restore

The first version copied whole top-level entries and probed
isTrimmable(after: .max). A variance-normalized tail overflowed on that
probe, and a CacheList kept its global attention history next to the
recurrent state. Automatic splitting also overrode an explicit unchunked
prefill.

Copy leaves instead. Rotating and recurrent state is snapshotted, global
attention is trimmed in place, and a variance-normalized cache keeps only
its raw tile after that compression has run. One asyncEval materializes
the copies so an oversized prefill buffer is not pinned. Explicit
unchunked and remainder schedules stay one forward.

Restore still requires an exact token prefix. The checkpoint reproduces
that prefix; it does not change the model's answers.

* Report prompt checkpoint memory in cache status

* Keep checkpoints across append-only turns and count batch metadata

* Size the checkpoint numerics test for TF32 matmuls

testRestoredMellumAndRecurrentQwenMatchFreshPrefill compares a restored
checkpoint with a cold prefill whose chunk boundaries differ, at 1e-4
relative. On Apple silicon with neural accelerators (M5 and later) MLX runs
float32 matmuls as TF32, and the float32 cases reach 1.2e-4 (Mellum) and
2.9e-4 (Qwen 3.5). With MLX_ENABLE_TF32=0 they measure 3e-7, and the test
passes unchanged.

The float32 bound now comes from MatmulPrecision.tolerance (ml-explore#802): 1e-4
where float32 is IEEE, 1e-3 where the probe measures TF32. The exact
restore-against-replay checks (atol 0) and the bfloat16 bound are unchanged;
both pass under TF32.

* Compare the EXIF orientation test's renders within a tolerance

imagesTurnUprightByTheirExifOrientationOnce renders one JPEG through two
paths, orienting it either in EmbeddingGemma2ImageProcessor.prepared or in
the decoder, and required the two pixel arrays to be exactly equal. The
paths decode and resample at different stages, so a different GPU or
decoder can round them apart: the CI runner failed orientation 4 while it
passes locally and on main.

Compare the maximum difference against 0.05 instead. Pixels are in 0...1,
and a wrong orientation moves the blue square over red, a difference near
1: forcing the mirrored orientation in prepared fails all seven non-upright
cases at this bound.

* Keep a checkpoint before the latest reply to tool results

A checkpoint was taken only for a turn that answers a user message, so a
tool loop kept the one before its first reply. A Qwen template renders
the call in a reply differently from how the model wrote it, with its
arguments sorted by name and its whitespace canonical. Each tool step
after a call that did not render back exactly therefore restored that
first checkpoint and prefilled every tool result since. vLLM, SGLang
and llama.cpp save recurrent state along the prompt and resume from the
last state saved before the mismatch.

Keep two checkpoints:

- `turn`, before the reply to the last user message, as before. A user
  turn keeps it until a prompt rewrites the turn.
- `step`, before the latest reply to tool results. Every tool step moves
  it, because the next step rewrites the call this one makes. A new user
  turn checkpoint drops it.

A turn restores the longest checkpoint the new prompt starts with, and
a checkpoint the new token ledger no longer starts with is dropped. A
user turn after a tool loop still resumes before its first reply, since
the template drops the reasoning of every reply after the last user
message. `KVCacheStatus.checkpoint` reports the longest prefix and the
memory of both. The cost is a second copy of the window and recurrent
state for a session in a tool loop.

`QwenReasoningTemplateTests` still expected a mismatching Qwen 3.8
continuation to rebuild, and one prepare per turn, which a checkpoint
splits. Its scripted model now ends a pass at end-of-sequence, and the
mismatching variants check that the session prefills only the tokens
after the last match: the first step from before the first reply, the
next from before the latest one. Without the step checkpoint that check
fails for reordered arguments, non-canonical whitespace and an implicit
reasoning end.
wballard added a commit to swissarmyhammer/mlx-swift-lm-old that referenced this pull request Nov 21, 2026
Apply the upstream commits dbee7be..cb59e9a (the 18 after 6352907) as
cherry-picks. CLAUDE.md is untouched. Where a conflict was only a fork
refactor, upstream's code is taken; the fork's MTP speed and prompt-cache
behavior is kept.

- dbee7be Serialize integration tests and their model loading. (ml-explore#760)
- 7dde329 GLM-OCR: count the temporal patch in the pixel budget (ml-explore#783)
- f0d6150 fix: render null tool-call arguments in chat history (ml-explore#780)
- c6c6556 Base Gemma diffusion implementation (ml-explore#352)
- 5ecb13b Add LiquidAI LFM3 text support with extended validation and regression tests (ml-explore#756)
- 7e2c90f Match the DeepSeek-V3 MoE gate to mlx-lm (ml-explore#795)
- 700d8e2 Read r/u prefixes and adjacent string literals in PythonLiteralParser (ml-explore#799)
- c75b537 Keep the DeepSeek-V3 MoE output in the activation dtype (ml-explore#793)
- bc4746e Fix GLM-OCR small images; match smart_resize rounding in QwenVL.targetSize (ml-explore#764)
- b55217c Keep Qwen2-VL vision attention inside each image (ml-explore#755)
- dcfcf79 steering follow up and chat interrupt API (ml-explore#798)
- e589f33 Load Hadamard-rotated ternary checkpoints (prism_hadamard_qwen35) (ml-explore#630)
- cb2bd77 GPT-OSS: clip the SwiGLU with plain Float bounds (ml-explore#792)
- bf5a5d4 Declare measured budget transitions for Muse Glimmer and Qwen3.5 (ml-explore#734)
- 7517abc Let guided generation use the caller's sampler and logit processor (ml-explore#733)
- 5a14024 Refuse LoRA/DoRA on layers the adapters cannot reproduce (ml-explore#800) (ml-explore#803)
- ca661dc Size five float32 test comparisons for TF32 matmuls (ml-explore#802)
- cb59e9a Batching: Apply a per-row mask to each row of Gemma 2's grouped-query scores (ml-explore#772)

Conflict resolutions:
- ml-explore#760: the fork's MTPGreedyVerificationIntegrationTests keeps its fixture
  and moves under ModelLoadingSuite; the fixture loads the target and the
  drafter as one TestModelManager entry. The fork-only MiniMax M3 suites
  drop their private `models` for the shared one. .gitignore keeps both.
- ml-explore#352 diffusion: the edits to the monolithic Evaluate.swift and KVCache.swift
  go into the fork's split files (GenerateParameters, TokenIterators,
  GenerateTokens, GenerationLoop; KVCacheSimple/Chunked, RotatingKVCache,
  QuantizedKVCache). MTPSpeculation.makeTokenIterator builds the
  BlockDiffusionTokenIterator for a diffusion model, and throws
  unsupportedSpeculativeDecoding when a speculation is asked for, so every
  package path (FM executor, recording generate) takes it. ChatSession takes
  the diffusion branch before the fork's MTP eligibility check, with the
  pass's prompt token count; it takes no prompt-end checkpoint. The
  blockDiffusion guard is in the fork's shared private MTP init.
  TurboQuantKVCache saves the head width as a sixth meta-state value; the
  fork's strict prompt-cache validation accepts 5 (old files) or 6 values.
  The upstream KVCacheTests additions go into KVCacheTests and
  KVCacheQuantizationTests; MockMainModel (MLXLMTestSupport) gets
  `capabilities:`. New tests await the fork's async loadWeights.
- ml-explore#756 LFM3: model.validate(tokenizer:) runs before the fork's closed-
  reasoning end guard. The upstream LFM3CheckpointTests await loadWeights.
- ml-explore#755: the doc edit goes into the fork's PromptCacheFile.swift.
- ml-explore#798 interrupt: `.interrupted` and the steering boundary go into the fork's
  GenerationLoop and GenerationResults; TokenLoopHandler keeps
  emitOrCancel with `hasOutput`. Both reasoning-history tests are kept.
- ml-explore#734: the fork's QwenReasoningProtocol.qwen35 (history replay, closed
  thinking-off block) also declares the `.immediate` budget transition;
  upstream's second `qwen35` is folded into it. The family-delta test
  resets the fork's replay and prompt-strategy fields too.
- ml-explore#733: ported into the fork's GuidedDecoder/GuidedGenerationLoop split. A
  caller processor or sampler decodes plainly: guided MTP speculation stays
  greedy-only, so its output stays that of plain greedy decoding.
- ml-explore#802: the speculative log-probability test stays out (ml-explore#774 was dropped).

After the merge (CLAUDE.md):
- No manual `offset +=` after `advance(` in the merged models.
- HybridRecurrentCacheOffsetTests adds prism_hadamard_qwen35 (LLM and VLM
  classes), whose Qwen 3.5 caches include MambaCache.
- LFM3ReferenceTests.testLongContextChunking (gated by
  MLX_LFM3_LONG_CONTEXT) moves ungated to IntegrationTesting as
  LFM3LongContextProfileTests. The env-gated upstream IntegrationTesting
  suites LFM3CheckpointTests and LFM3TokenizerIntegrationTests stay gated.

Tests: MLXLMTests 1227 XCTest and 2459 Swift Testing (3 known issues),
MLXGuidedGenerationTests 85, MLXFoundationModelsTests 537, CXGrammarTests 7,
MLXHuggingFaceMacrosTests 11 pass. Release, IntegrationTesting:
Qwen35SessionPromptCacheTests, Qwen35AgenticPromptCacheAssessmentTests,
PromptCacheSpoolCostAssessmentTests and LFM3LongContextProfileTests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants