mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #611] [CLOSED] DeepSeek --parallel: the DSpark drafter in the steps of several requests #624
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#624
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/611
Author: @needmorevram
Created: 10/28/2026
Status: ❌ Closed
Base:
main← Head:ds4-parallel-dspark📝 Commits (3)
3c2e935DeepSeek --parallel: the DSpark drafter in the steps of several requestsc97b0c3DeepSeek --parallel: two or three requests' drafts in one drafter pass193b851docs: DeepSeek --parallel with the drafter on one RTX 3090 + two RTX 5060 Ti📊 Changes
4 files changed (+807 additions, -108 deletions)
View changed files
📝
docs/SETTINGS.md(+20 -5)📝
src/ds4/ds4_main.cpp(+290 -61)📝
src/ds4/ds4_model.cu(+480 -42)📝
src/ds4/ds4_model.hpp(+17 -0)📄 Description
What
With
--parallelabove 1, DeepSeek's batched steps carried no drafts: as soon as two requests ran at once, each decoded one plain token a step and ran slower than it did alone with the DSpark drafter. Now the requests' rounds go through the model together with their drafts:verify()'s rule (greedy, or the speculative-sampling rule with the drafts as points) and undoes only its own rejected rows.A round with no drafts (low confidence,
--dspark off) is stillstep_multi's token of each.Why
On a PC with most experts in RAM, the drafter is what makes one request fast, so two at once without it gave up most of what batching won. On one RTX 3090 + eight RTX 5060 Ti (
--tp 8, EXL3 3.5 bpw), two short prose answers at once ran at 32.1 + 34.7 tok/s each before, against 43.7 / 55.2 alone.How
src/ds4/ds4_model.cu:step_runs(Model::step_multi_spec):step_multiwith a run of rows per conversation.step_multiis now its runs of one, with the same rows, seeding and sampling.layer()callsattn_coreonce per run.r0);c_snapiso.seqssnapshots long; it was one).verify_multi:verify()'s verdict over the run's rows, with the penalties over its conversation's tokens.rollback_runrestores that conversation's rings and compressors (ring_restore_batch/comp_restore_batchwith its buffers), thenseed_drafterseeds it with the kept rows.draft_multi:draft_()'s steps for n conversations' blocks as rows, then each conversation's markov chain (also over a head group,mk_split) and confidences. It's used for 2–3 conversations whose blocks fit a window; otherwise each drafts withdraft().src/ds4/ds4_main.cpp:--multi-checkadds three greedy passes with the drafter: each alone (draft/verify), together with a drafter pass each, and together in one pass. Every draft is verified whatever its confidence, so rejected rows are undone in most rounds.One request is unchanged, with or without
--parallel:draft_(),verify(),rollback(),step()and the one-conversationservepath are not touched.attn_core's backup offsets are 0 for a single window.c_snapis the same size with one conversation.Tested
Greedy, EXL3 3.5 bpw,
--parallel 2,--dspark on.--multi-checkuses a 554-token prompt of code; the second conversation is the same prompt 5 tokens shorter.One RTX 3090 + eight RTX 5060 Ti,
--tp 8(two thirds of the experts in RAM), 2 × 200 tokens:Server, two requests at once (prose / code), per request:
One RTX 3090 + two RTX 5060 Ti,
--tp 2(207 GB of experts read in place from the model's files), 2 × 160 tokens:Server, two requests at once, per request (two runs):
Exactness: the first conversation's tokens match its plain decode alone in every pass on both setups, with 177–250 drafts rejected and undone per pass. The second conversation's prompt ends at a near tie and drifts from its plain decode alone also without drafts. On these PCs the CPU lane's rounding changes the logits' last bits between a window and a step: the together pass without drafts,
step_multias on main, matches 0 rows bit for bit.It builds with no new warnings.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.