Merged
Conversation
40cdb39 to
83f3d7a
Compare
slaren
reviewed
Jan 15, 2024
slaren
reviewed
Jan 15, 2024
slaren
reviewed
Jan 15, 2024
ggml-backend.c
Outdated
Comment on lines
+1356
to
+1359
| if (sched->callback_eval(t, true, sched->callback_eval_user_data) && // ask | ||
| !sched->callback_eval(t, false, sched->callback_eval_user_data)) { // eval | ||
| break; | ||
| } |
Member
There was a problem hiding this comment.
Is the ask callback really necessary here?
Member
Author
There was a problem hiding this comment.
I've changed the implementation to ask only once per node in a split
slaren
reviewed
Jan 15, 2024
slaren
reviewed
Jan 16, 2024
ggml-backend.c
Outdated
Comment on lines
+1387
to
+1390
| // TODO: should we clear the callbacks? | ||
| //sched->callback_eval = NULL; | ||
| //sched->callback_eval_user_data = NULL; | ||
|
|
Member
There was a problem hiding this comment.
I think this is fine, we don't need to clear the callbacks here, the reset function is meant to prepare the sched for the next graph evaluation, resetting the allocators and the backend assignments (similar to ggml_allocr_reset).
slaren
approved these changes
Jan 16, 2024
brittlewis12
added a commit
to brittlewis12/llama.cpp
that referenced
this pull request
Jan 18, 2024
Fixes ggml-org#5029 introduced in ggml-org#4935
jordankanter
pushed a commit
to jordankanter/llama.cpp
that referenced
this pull request
Feb 3, 2024
* backend : add eval callback ggml-ci * backend : group nodes in a single compute when user don't need them * backend : clean-up the implementation ggml-ci * simple : do not perform tensor data copy if not needed * simple : fix * simple : no need for ggml_is_contiguous + fix bool parse * llama : fix callback placement in llama_context_params * backend : avoid double-ask callback calls * simple : restore examples, imatrix will serve as a demo
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.
ref: #4931
The callback currently observes the softmax results in the attention, but can be customized in any way:
https://github.com/ggerganov/llama.cpp/blob/81d41628f90c4a2e68e6253f20cd3c46235f41a5/examples/simple/simple.cpp#L9-L34
Skip last CLI arg (or set to
0) to disable the callback