mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #318] [MERGED] DeepSeek long prompts skip layers 20-39 where the answer does not need them, exact #463
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#463
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/318
Author: @mw00
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @mw00
Base:
main← Head:rel-1119📝 Commits (1)
208f77eDeepSeek long prompts skip layers 20-39 where the answer does not need them, exact📊 Changes
2 files changed (+161 additions, -38 deletions)
View changed files
📝
docs/SETTINGS.md(+14 -0)📝
src/ds4/ds4_model.cu(+147 -38)📄 Description
DeepSeek-V4.1-Flash's layers 20-39 see a prompt's earlier tokens only through layer 20's compressed KV and index keys,
and each looks back one 128-token window more than the layer before - so they need their own work only on the last
(40 - 20) x 127 + 128 = 2,668 tokens of a prompt for its last rows and the decode's rings to be what the full work gives
(DeepSeek's own deployment notes: rebuilding them exactly "would require running the last 2,560 tokens through 20
decoder layers"; their serving replays 128). A long prompt (3,692+ new tokens) now skips the rest:
hyper-connection pre-norm, the compressor latent, the index keys, the compressed KV - nothing of its attention or
experts); the cut's chunk through layers 20-39 from the cut on only (a view of its buffers from that row,
run_layer); the chunks after it through every layer. The flow plans no experts for the skipped (chunk, layer)s and
sizes its early reads by the rows a layer runs on, so each layer's experts are read as without the skip.
against the full work: KL 1.5e-4, the same greedy tokens); DeepSeek's 128-row replay as an option shifts them more.
off. Several GPUs read prompts as before. docs/SETTINGS.md: "DeepSeek: long prompts read without the second half's
work".
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.