Integrate DeepSeek V4 Flash 0731 into MTPLX - #251
Open
davidtai wants to merge 24 commits into
Open
Conversation
added 11 commits
August 12, 2026 19:02
added 11 commits
August 12, 2026 23:47
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
Adds native DeepSeek-V4-Flash-0731 support to MTPLX: model loading, DSpark proposal execution, construction-bound K1-K3 routing, physical-M3 verification, benchmark coverage, and model-specific tests.
The optimized lane is installed only after its artifact and topology invariants pass. Once installed, it executes directly—there is no silent fallback to stock generation.
Model artifact
mlx-community/DeepSeek-V4-Flash-0731-2.4bit-mixed10001e0065f8394e03e968e652cbbe7cd2ca122c44735712733fcf8f299bdf1faa1d87fac88f1917efe1d3876d6d4c582f79a68ff1332b2b209769c2db335954c2651652a8048e7d7dbf60296c2f2c0198715861Every performance, memory, and correctness result in this PR is scoped to this exact artifact and revision.
What this adds
Performance
Apple M5 Max, 128 GB, MLX 0.32.0, greedy sampling (
temperature=0,top_p=1,top_k=0), 14-token prompt, 128 generated tokens, one model load. These are the warmed rows only; the one-time K0 compile row is intentionally excluded from the comparison.K2 accepted 68 of 119 drafted tokens: 68.3% at draft position 1 and 45.8% at position 2.
K2 and K3 both use one block target verification call per full cycle and both currently require greedy sampling. They do not use the same target kernel route: K2 has the receipt-backed compiled physical-M3 target stack, while K3 uses the native M4 target shape. Only K0 and K2 are a matched performance comparison; K1 and K3 are historical filler included to show the complete depth picture until the MLX 0.32.0 rerun is available.
Memory
The table below comes from the short 14-prompt-token / 128-output-token bracket; it is not a 64K or 128K context measurement. It reports post-load active memory and growth from the same 86.4561 GiB baseline. The listed MLX peak counter includes model loading and is therefore not a valid request peak. A post-load-reset 128K context rerun is pending and will replace this table.
Historical K-depth sweep
The earlier MLX 0.31.2 sweep used a 9-token prompt and 64 generated tokens. It did not record prefill throughput or post-load growth, so neither is fabricated here. Peak delta is calculated against K0 within the same model load.
This historical sweep is diagnostic, not the promotion result. The current physical-M3 K2 lane is faster than warmed K0 but diverges from K0 at generated-token index 44, so it is exposed as an explicit throughput-over-exactness route.
Evaluation status
No HumanEval, HumanEval+, MBPP, or MBPP+ receipt exists for the 0731 artifact yet. The older DeepSeek-V4 EvalPlus run used
DeepSeek-V4-Flash-2bit-DQ-mtp; those scores are deliberately excluded because they do not validate these weights or this K1-K3 implementation.Correctness contract
Verification
Tracked performance details and raw-artifact hashes are in
docs/perf/receipts/deepseek-v4-0731-dspark.md.