Skip to content

fix: calibrate DeepSeek V4.1 text generation - #3780

Merged
inureyes merged 3 commits into
mainfrom
fix/deepseek-v41-text-generation
Dec 4, 2026
Merged

inureyes merged 3 commits into
mainfrom
fix/deepseek-v41-text-generation

Conversation

@inureyes

@inureyes inureyes commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #3686. DeepSeek V4.1 conversions that omit the chat template now use the official turn format in CLI and API requests. The fallback defaults to direct answers and supports explicit reasoning requests.

Match FP8 activation rounding, expert weighting, attention sinks, compressed attention and residual accumulation to the training-time numerical conventions. Bound sliding-window prefill while retaining the preceding keys at chunk boundaries.

On the real 2-bit checkpoint, ordinary and DSpark CLI decoding produced identical token IDs on a 128-token greedy probe, and the chat API returned identical bytes. Repeating the probe after integrating the latest main produced 621 matching bytes across all three paths. A Korean request for the capital of France returned 파리 and stopped. Long greedy explanations still repeated in both mlxcel and mlx-vlm, with different continuations.

Local validation passed 103 V4.1 tests, formatting and Clippy. The full workspace run passed 18,844 tests with one Laya parity failure. The pre-change binary reproduced the same discrepancy on the same local checkpoint (1.1712 versus 1.1694).

The WebUI and OpenXLA CUDA builds reused an obsolete fp_qmv.cu from a previous overlay. Extend the existing configure-time restoration to tracked CUDA backend paths absent from the current overlay set so cached builds compile the pinned source.

Use the trained chat format when a conversion omits its template. Match activation rounding, expert weighting and local and compressed attention to the reference inference path. Verify ordinary and speculative decoding against the same 2-bit checkpoint.
@inureyes inureyes added status:done Completed type:bug Bug fixes, error corrections, or issue resolutions labels Dec 4, 2026
A cached fp_qmv.cu from another build instantiated an unsupported CUTLASS tile in the WebUI and OpenXLA CI jobs. Restore tracked CUDA backend files absent from the active overlay set from the pinned checkout during configure.
@inureyes
inureyes merged commit 58b545e into main Dec 4, 2026
36 checks passed
@inureyes
inureyes deleted the fix/deepseek-v41-text-generation branch December 4, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:done Completed type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant