spec: keep DFlash vision positions contiguous - #4
Open
Sphinx-8 wants to merge 1 commit into
Open
Conversation
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.
Problem
DFlash2 uses a one-dimensional draft KV cache, while multimodal target batches can carry multi-dimensional M-RoPE positions with repeated or jumping values. Copying those positions into the draft batch makes the draft sequence non-consecutive and vision requests fail during llama_decode.
A second mismatch appears after multimodal prefill: dp.n_past is measured on the target sequence, but the text-only draft cache advances on its own position scale.
Change
This keeps target positions untouched. It is intentionally narrow and is offered for comparison with the zero-fill approach in #1. The initial dense-position direction was also discussed in ggml-org#27342.
Validation
Base: z-lab dflash2 at 1deefcc.
Hardware/runtime: DGX Spark GB10, CUDA; Qwen3.8 27B target BF16, DFlash2 draft BF16, F16 vision projector, speculative depth 4.
Measured vision requests, each cell after three warmups:
No request errors occurred across the 50 measured requests. A separate two-slot, 262144-context-per-slot smoke test passed 2/2 concurrent vision requests with active DFlash2.
The patched current branch also builds llama-server successfully on aarch64 with GCC 13.3.0. Patch SHA-256 from the validated deployment: ad8e244316fb51c088258d532f271c32e15289045605cd2c5eb093f13f8ef91f.
Disclosure
Implementation and PR text were prepared with OpenAI Codex under Sphinx-8 direction. All reported measurements came from actual runs on the stated hardware; no results are inferred.