llama: refactor llama_decode_impl#11381
Merged
JohannesGaessler merged 1 commit intoggml-org:masterfrom Jan 27, 2025
Merged
Conversation
21 tasks
ggerganov
approved these changes
Jan 27, 2025
Member
ggerganov
left a comment
There was a problem hiding this comment.
In the #11213 refactoring, the llama_prepare_sbatch and llama_prepare_ubatch will be replaced with something like:
// internal llama_context logic will be implemented
// for example, the llama_prepare_sbatch logic will go here
llama_batch_manager_i bm = lctx.prepare_batch(batch, logits_all);
while (!bm->done()) {
// the llama_prepare_ubatch() will be implemented here
llama_ubatch ubatch = bm->next();
...
}Feel free to merge. After merging, I will rebase the #11213 PR to illustrate this.
arthw
pushed a commit
to arthw/llama.cpp
that referenced
this pull request
Feb 26, 2025
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.
This PR refactors
llama_decode_implby moving some of the code to functionsllama_prepare_sbatchandllama_prepare_ubatch. There should be no change to functionality. The motivation for the change is that this enables re-using the code for training in #10544 .