Skip to content

completion : simplify batch (embd) processing#19286

Merged
danbev merged 2 commits intoggml-org:masterfrom
danbev:completion-embd-processing-simplification
Feb 4, 2026
Merged

completion : simplify batch (embd) processing#19286
danbev merged 2 commits intoggml-org:masterfrom
danbev:completion-embd-processing-simplification

Conversation

@danbev
Copy link
Member

@danbev danbev commented Feb 3, 2026

This commit simplifies the processing of embd by removing the for loop that currently exists which uses params.n_batch as its increment. This commit also removes the clamping of n_eval as the size of embd is always at most the size of params.n_batch.

The motivation is to clarify the code as it is currently a little confusing when looking at this for loop in isolation and thinking that it can process multiple batches.

This commit simplifies the processing of embd by removing the for loop
that currently exists which uses params.n_batch as its increment. This
commit also removes the clamping of n_eval as the size of embd is always
at most the size of params.n_batch.

The motivation is to clarify the code as it is currently a little
confusing when looking at this for loop in isolation and thinking that
it can process multiple batches.
@danbev danbev merged commit 25f40ca into ggml-org:master Feb 4, 2026
77 of 78 checks passed
@danbev danbev deleted the completion-embd-processing-simplification branch February 4, 2026 04:43
agent-enemy-2 pushed a commit to agent-enemy-2/llama.cpp that referenced this pull request Feb 4, 2026
* completion : simplify batch (embd) processing

This commit simplifies the processing of embd by removing the for loop
that currently exists which uses params.n_batch as its increment. This
commit also removes the clamping of n_eval as the size of embd is always
at most the size of params.n_batch.

The motivation is to clarify the code as it is currently a little
confusing when looking at this for loop in isolation and thinking that
it can process multiple batches.

* add an assert to verify n_eval is not greater than n_batch
liparetejas pushed a commit to liparetejas/llama.cpp that referenced this pull request Feb 23, 2026
* completion : simplify batch (embd) processing

This commit simplifies the processing of embd by removing the for loop
that currently exists which uses params.n_batch as its increment. This
commit also removes the clamping of n_eval as the size of embd is always
at most the size of params.n_batch.

The motivation is to clarify the code as it is currently a little
confusing when looking at this for loop in isolation and thinking that
it can process multiple batches.

* add an assert to verify n_eval is not greater than n_batch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants