context : round n_tokens to next multiple of n_seqs when reserving #14140
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.
This fixes RWKV inference which otherwise fails when
ubatch.n_seq_tokens
is 0.I noticed this when trying to run the command from #13834 (comment), but with RWKV instead of Mamba.
For example, with https://huggingface.co/latestissue/rwkv-6-finch-1b6-gguf/blob/main/rwkv-6-finch-1b6-Q4_0.gguf
Before:
After:
This has been broken since #13746 because it made the worst case
graph_reserve
usen_seqs = cparams.n_seq_max
instead ofn_seqs = 1
.ubatch.n_seq_tokens
must not be 0 for RWKV, because in some views it usesubatch.n_seq_tokens - 1
for one of the dimensions:llama.cpp/src/llama-model.cpp
Line 11858 in 2e89f76
There will hopefully eventually be automated tests which will help detect this kind of problem, see #14139 (still in the early stages, though).
Make sure to read the contributing guidelines before submitting a PR