mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3882] [Engine] Port the DFlash2 drafter onto the serve solo stream #4817
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4817
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/Niko1221/Strata/pull/3882
Author: @Faks
Created: 10/23/2026
Status: 🔄 Open
Base:
main← Head:feat/dflash2-serve📝 Commits (1)
41f6b79feat(hip): port the DFlash2 drafter onto the serve solo stream (one card, single stream; batch slots keep the MTP)📊 Changes
4 files changed (+83 additions, -26 deletions)
View changed files
📝
src/core/verify.cpp(+2 -1)📝
src/program/generate.cpp(+55 -6)📝
strata_control/drafting.py(+6 -6)📝
tests/terminal/test_drafting.py(+20 -13)📄 Description
Problem and result
--draft dflash2is accepted on the CLI run but the served engine refuses it: the guard inmain()names--serveas a reason to fall back to the MTP. On the card this fork runs, that guard is the only thing blocking the drafter in serve mode — the drafter itself, its taps and its graphs already work there.After the change, the served solo stream drafts with DFlash2. Batch slots keep the MTP. Behaviour on the CLI path is unchanged, and the change is opt-in: it only takes effect when
--draft dflash2is passed.Related discussion
None — no issue was opened and no maintainer agreement on scope was sought before writing this. CONTRIBUTING asks for scope agreement on features; this is one, so a maintainer may reasonably return it to draft or ask for an issue first.
Approach
whyguard dropso.serve: the block it sits in is already the serve path, soo.servethere was self-refusing.multi_gpu(layer split) stays refused.init(), so the window graphs bake the tap copy in; binding or preparing the drafter falls back to the MTP with a plain line rather than failing the start.df2_reqis true only for the solo stream when the prompt read reaches the drafter's 2048-row ring. A prompt read through the batched/lent path has no taps, so that request keeps the MTP. This keeps the batch slots on the code path that already works.Validation
Passed:
python3 -m pytest tests/terminal/test_drafting.py -q→40 passedon the submitted revision (41f6b794), Linux, Python 3.13. These are the mock/unit tests; they do not execute a GPU.gfx1201(build-hip/strata) compiled and the served engine ran with--draft dflash2: the start line reports the drafter on, and the engine served a real request with DFlash2 drafts —drafts accepted 177 of 291on a 48445-token prompt, 256 tokens generated in 2824 ms. Run on the AMD RX 9700, single card.Failed:
killhit thesetsid nohupwrapper, not the child), so it still held the port and served the second request — at 58.9 tok/s on the same server, not on an MTP one. The83.2 tok/sfigure that appears in the original PR body came from a different run at a different machine load, so it is not comparable to90.6 tok/s.Not run:
Limits
set_commit_async(!multi_gpu)is active, andcommit()does not synchronize the verify stream when the next stage is absent; the tap copy is queued on the verify stream and the drafter runs on its own. The drafter can therefore readtap_dev_before the window graph has written it. Output correctness is not at risk — every draft is verified against the model, and a stale draft is rejected, not emitted — but the acceptance rate is not guaranteed, and a stream event or an explicit sync beforedf2.context()would be the fix.Disclosure
Prepared by Gnarl, the Operator's agent, at his instruction, on this account. AI-assisted work; every changed line here is understood and is his own reading of the diff, and the numbers above are measured, not estimated. The one number that was not measured as claimed (the MTP comparison) is withdrawn above rather than left standing.
The commit is authored and committed under this account rather than the agent's own address, because attribution resolves the commit author email to a GitHub account and the agent's address is not linked to one. The agent's internal address and its infrastructure hosts are kept out of this body.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.