Repository navigation
Conversation
|
Hi @Chazyl, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
Follow-up to ggml-org#28587. That PR skips M-RoPE-pinned mtmd embedding batches in the DFlash process() ("the draft can jump over the gap"), but the gap it leaves in the draft KV cache is not harmless: the next token batch fails the KV cache's consecutive-position check and llama-server returns HTTP 500 for any request whose prompt contains an image (issue ggml-org#27408). The same hole appears when the target reuses a cached prompt prefix the draft cache never saw. Detect the per-sequence gap at the top of the DFlash process() and seed it with zero-feature injections. Drafted tokens are still verified by the target, so this only degrades draft acceptance right after an image -- output stays distribution-exact. Tested on 2x RTX 5060 Ti (CUDA, b11434): Qwen3.6-35B-A3B Q4_K_M + mmproj Q8_0 + DFlash sidecar. Image requests go from HTTP 500 to 200 with no speculative-batch errors; text-only n=6 quality is unchanged (paired P=0.505) and speed is within noise. The approach is due to @dagnarf (z-lab#1); this is the minimal port to upstream. Signed-off-by: Chazyl ARFI <arfi.chazyl@gmail.com>
Chazyl
force-pushed
the
dflash-mtmd-zero-fill
branch
from
October 9, 2026 10:12
e173f7c to
73647e8
Compare
This branch has not been deployed
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.
Overview
Fixes #27408. Follow-up to #28587.
With
--spec-type draft-dflashand an mmproj model, every image request returns HTTP 500(
failed to process speculative batch). #28587 skips M-RoPE-pinned mtmd embedding batches inthe DFlash
process()and assumes "the draft can jump over the gap" -- but that gap is notharmless: the next token batch fails the draft KV cache's consecutive-position check. This
patch detects the per-sequence gap at the top of
process()and seeds it with zero-featureinjections. Drafted tokens are still verified by the target, so output stays distribution-exact;
only draft acceptance immediately after an image is degraded.
Additional information
pos_pinnedskip; this is the missing half that fills the resulting hole.positions spanning slots/requests) are not covered by this patch.
DFlash sidecar: image requests go from HTTP 500 to HTTP 200 with no
failed to process speculative batchin the log; text-only n=6 quality is unchanged (paired bootstrap P = 0.505)and speed is within noise.
Requirements