Fix DeepSeek V4/0731 target-path correctness and fail closed on unsupported state - #10
Conversation
|
Current review handoff for frozen head The PR is now ready for review and the deliberately narrow contract is unchanged: one stream, initial prefill, then single-token cached decode. Generic fresh-cache/continuous multi-stream insertion, prompt-cache serialization, KV-cache quantization, chunked-prefill continuation after compressor initialization, external speculation, DSpark, real-checkpoint qualification, long-context quality, and performance remain unsupported or unqualified. The fail-closed batching guard remains non-mutating: capability is checked before a second stream is admitted or an active stream advances. Exact-head evidence remains attached:
@Thump604 — a formal review request has now been submitted. Your prior COMMENTED review said you would be comfortable approving this exact frozen diff once the PR was ready and the evidence was attached; both conditions are now satisfied. |
Thump604
left a comment
There was a problem hiding this comment.
Independent external review only: I am not a maintainer or collaborator on machiabeli/mlx-lm-1 or ml-explore/mlx-lm, so this should not be read as project approval or merge authority.
I reviewed frozen head b759c7f against base 63a2662. The revised scope now matches the implementation: singleton initial prefill plus single-token cached decode, with unsupported overlapping insertion, cache extension, serialization, quantization, chunked continuation, and speculative rollback failing closed. I specifically checked that the second-stream batching preflight occurs before scheduler queues or active prompt/generation caches are mutated, and that sequential reuse remains possible after the singleton completes.
Local independent verification on this head:
- all 18 newly added focused regressions passed, including 3 subtests
- prompt-cache suite: 22 passed
- git diff --check: clean
I found no blocking defect within that deliberately narrow contract. The broader DeepSeek V4 feature claims in upstream ml-explore#1189 remain unqualified and should not inherit this result. Because this PR is still a draft and has no reported GitHub checks, I am submitting a formal COMMENTED review rather than bypassing the draft gate with APPROVE. Once it is marked ready and its checks/evidence are attached, I would be comfortable approving this exact frozen diff.
Exact-head verification receipt - 2026-08-09Frozen candidate:
Focused DeepSeek V4 and batching boundary suite: Prompt-cache regression suite: Static verification: No GitHub Actions jobs can run in this fork: both jobs in Independent review:
The branch remains frozen. Any code commit or material base movement invalidates this receipt and requires rerunning the gate. |
|
Ready for review at frozen head @Thump604, the exact-head verification receipt is attached above and the branch remains unchanged. When convenient, please submit the formal @machiabeli, GitHub reports the PR cleanly mergeable into |
Summary
This is a focused correctness and safety patch on top of
feat/deepseek-v4. It does not claim that ml-explore#1189's advertised DeepSeek-V4 feature set is complete.Supported contract
The supported target path is deliberately narrow: one stream, initial prefill, then single-token cached decode.
Any.mtp.*weights with a warning instead of instantiating conventional MTP.Explicit fail-closed boundaries
Verification
On the final frozen diff:
[0, 128, 4, 0], and all-uncompressed[0, 0, 0, 0]topologies: serial andBatchGeneratortokens, logprobs, cache types, and cache state match.None,[], and[None]cache arguments, callable/nested cache capabilities, and ordinary batchable models have regression coverage.compileallandgit diff --checkpass.The untouched
mixed_quant_predicate_builderpath parser still fails atmlx_lm/convert.py:57; it was reproduced as a pre-existing base defect and is not presented as passing evidence here.No real-checkpoint generation, long-context quality, or performance claim is made by this PR.
Known limitations
Prior work and credit
This patch consolidates and extends findings already reported on ml-explore#1189:
The additional work here covers official compressor rolling-state parity, vector cache offsets, serial-exact singleton lifecycle behavior across mixed cache topologies, generic non-mutating batching capability preflight, DSpark target-only detection, lazy opt-in behavior, and fail-closed speculative rollback.