Repository navigation
Conversation
…h SWA Fixes ggml-org#32339. For recurrent and hybrid models, llama_memory_seq_pos_min() returns pos_max (the position of the recurrent state) rather than pos_max - n_swa + 1. Passing n_swa to server_prompt::get_reuse() caused it to subtract the SWA slack from pos_eval, rejecting valid checkpoints within n_swa tokens of the prompt end and falling back to an older checkpoint. Pass 0 for n_swa when calling get_reuse() on recurrent or hybrid models, and add unit tests for server_prompt::get_reuse() in test-server-component.
|
Hi @SMC17, 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. |
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.
Fixes #32339.
Summary
llama_memory_seq_pos_min()returnspos_max(the exact position of the recurrent state) rather thanpos_max - n_swa + 1.n_swatoserver_prompt::get_reuse()causedpos_min_tholdto subtractn_swa - 2, rejecting valid checkpoints withinn_swatokens ofpos_evaland falling back to an older checkpoint.0forn_swawhen callingget_reuse()on recurrent or hybrid models (llama_model_is_recurrent(model_tgt) || llama_model_is_hybrid(model_tgt)), since the recurrent state is only valid at its exact position.server_prompt::get_reuse()intests/test-server-component.cpp.Testing
ctest --test-dir build -R test-server-component --output-on-failure: 100% tests passed (1/1).