Skip to content

Fix padded batch items lengthening generation time - #419

Merged
jonatanklosko merged 1 commit into
mainfrom
jk-padded-generation
Jun 17, 2025
Merged

Fix padded batch items lengthening generation time#419
jonatanklosko merged 1 commit into
mainfrom
jk-padded-generation

Conversation

@jonatanklosko

Copy link
Copy Markdown
Member

When generating text with batch_size > 1, if there are padded batch items, the model gets zeroed input and may output arbitrary tokens. For some models that could be EOS and it would make no difference, but others could keep outputting a random token until the max length is reached (making the generation longer unnecessarily).

@jonatanklosko
jonatanklosko merged commit 7617ff5 into main Jun 17, 2025
@jonatanklosko
jonatanklosko deleted the jk-padded-generation branch June 17, 2025 18:27
@jonatanklosko jonatanklosko mentioned this pull request Jun 17, 2025
bartekupartek pushed a commit to bartekupartek/bumblebee that referenced this pull request Sep 24, 2025
bartekupartek pushed a commit to bartekupartek/bumblebee that referenced this pull request Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant