common : add env to override n_rs_seq - #26499
Draft
Green-Sky wants to merge 1 commit into
Draft
Conversation
This allows us to manually specify how many recurrent state rollback states we use for speculation. Currently it is set to 0 for all non-draft-model speculators, which can hurt performance a lot. But on the other side you have to be carefull to be conservative with the rollback states, as they baloon quick as they are unquantized f32.
Open
Collaborator
Author
|
ngram speculation is currently hard to benchmark. I ran the speed bench, but that rarely triggers ngram spec. In practice, agents with edit toolcalls make use of ngram spec a lot. Like a hole bunch. speed bench with the example settings from above: Comparison: baseline=speed_bench_ornith_35b_coding_baseline.json speculative=speed_bench_ornith_35b_coding_ngram-mod-7-7-24.json
^the ~400MiB extra memory are mostly at fault fault here I think. Also no tool calls. |
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
This allows us to manually specify how many recurrent state rollback states we use for speculation. Currently it is set to 0 for all non-draft-model speculators, which can hurt performance a lot. But on the other side you have to be careful to be conservative with the rollback states, as they balloon quick as they are unquantized f32.
Additional information
Without rollback, partial accepted sequences need to perform a full checkpoint rollback, and on my setup that is prohibitively expensive.
Exampel I use:
which for qwen_3_5_moe with 168192ctx gives:
which is 500MiB of recurrent memory, which is a lot on a 8gig card.
Requirements