embedding: adjust n_ubatch value, print error on insufficient n_batch value#6296
Merged
ggerganov merged 5 commits intoggml-org:masterfrom Mar 26, 2024
Conversation
ngxson
requested changes
Mar 25, 2024
| if (inp.size() > n_batch) { | ||
| inp.resize(n_batch); | ||
| fprintf(stderr, "%s: error: number of tokens in input line (%lld) exceeds batch size (%lld), increase batch size and re-run\n", | ||
| __func__, (long long int) inp.size(), (long long int) n_batch); |
Contributor
There was a problem hiding this comment.
Here you can use %ld instead of %lld, no need to cast the type then
Suggested change
| __func__, (long long int) inp.size(), (long long int) n_batch); | |
| __func__, inp.size(), n_batch); |
Collaborator
Author
There was a problem hiding this comment.
applied & rolled back due to build failure.
IIRC, this is why I used %lld with casting in #6193. Although I tried your suggestion just in case 😉.
Member
There was a problem hiding this comment.
We normally use PRIu64 / PRId64 to print 64-bit integers. Alternatively, in this case just %d and cast to (int) is fine
Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
…tch`-overflow' of github.com:mscheong01/llama.cpp into embedding-assign-`n_ubatch`-value,-print-error-on-`n_batch`-overflow
This reverts commit ea753ed.
ggerganov
approved these changes
Mar 26, 2024
hodlen
pushed a commit
to hodlen/llama.cpp
that referenced
this pull request
Apr 3, 2024
* embedding: assign `n_ubatch` value, print error on `n_batch` overflow * Update examples/embedding/embedding.cpp Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com> * use %ld instead of %lld * Revert "use %ld instead of %lld" This reverts commit ea753ed. --------- Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
4 tasks
Seunghhon
pushed a commit
to Seunghhon/llama.cpp
that referenced
this pull request
Apr 26, 2026
* embedding: assign `n_ubatch` value, print error on `n_batch` overflow * Update examples/embedding/embedding.cpp Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com> * use %ld instead of %lld * Revert "use %ld instead of %lld" This reverts commit ea753ed. --------- Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
phuongncn
pushed a commit
to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4
that referenced
this pull request
Apr 28, 2026
* embedding: assign `n_ubatch` value, print error on `n_batch` overflow * Update examples/embedding/embedding.cpp Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com> * use %ld instead of %lld * Revert "use %ld instead of %lld" This reverts commit ea753ed. --------- Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
ljubomirj
pushed a commit
to ljubomirj/llama.cpp
that referenced
this pull request
May 6, 2026
* embedding: assign `n_ubatch` value, print error on `n_batch` overflow * Update examples/embedding/embedding.cpp Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com> * use %ld instead of %lld * Revert "use %ld instead of %lld" This reverts commit ea753ed. --------- Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
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.
updates to the
embeddingexample based on discussion from #6193n_batchvalue tou_batch