Repository navigation
Conversation
The new --parallel N keeps each reply KV and recurrent state parked in host memory and lets the sequences take turns, PAR_QUANTUM tokens each. On a 2060 with four sequences, quantum 1 loses half the aggregate throughput to the state copies and quantum 8 stays within a few percent of generating one reply at a time, so each stream runs at about 1/4 speed instead of 1/8. Prefill happens when the request arrives, before the reply is parked. The system-prompt stash is dropped in this mode (its KV rows belong to whichever sequence ran last). MTP is off, because a parked state does not carry the draft head, and a split model falls back to one reply at a time. The default stays serial. Four streaming requests of 48 tokens took 4.7-7.3 s each with 1-3.8 s to the first byte. Four 64-token replies one at a time take 9.2 s for the same work, with the last client waiting 8.7 s; with four in parallel they finish together in about 9.8 s. tests/concurrency.rs interleaves four sequences and checks their tokens against generating them one at a time (q = 1, 4 and 8).
Vasyl-Trefilov
pushed a commit
that referenced
this pull request
Nov 8, 2026
* docs(parity): record V100 Vulkan parity baseline (M0-T7) 20 prompts x 32 greedy tokens against llama-server 0.9.0-dev build 12110 (cd959bae9) on the V100, parity mode with --fixed-experts. strict 625/640 = 97.66%, either llama.cpp mode 629/640 = 98.28%, llama.cpp self-agreement 630/640 = 98.44%: below the 634/640 either-mode bar, recorded as a documented deviation with a second parity-mode repeat (identical) and the default path (626/630). No new Xid. Artifact in docs/parity/vk-sm70.json. * docs: fix the 3060 comparison in the M0-T7 deviation note
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.
The server runs one request at a time (
handledecodes until the reply is done), so four clients means four people waiting for their turn. This lets up to--parallel Nreplies make progress at once on one GPU.The model already parked a conversation's state in host memory when another history replaced it, so I reused that: a reply prefills and parks its state when it arrives, then each turn of the scheduler adopts the state, generates
PAR_QUANTUMtokens and parks it again. The tokens are unchanged; the only thing that moves is the state.I picked the quantum by measuring. With four sequences, one token a turn loses about half the aggregate throughput to the state copies (23 vs 39 tok/s), four tokens gets most of it back (35), and eight is within noise of one at a time (39). So the default is 8.
Numbers on a 2060 6 GB:
Limitations, all deliberate for a first cut:
--paralleldefaults to 1, so nothing changes unless asked.tests/concurrency.rsruns four sequences interleaved at q = 1, 4 and 8 and checks the tokens match generating them one at a time, so the state round-trip is covered.