Compute transition scores on CPU#1087
Draft
benjaminking wants to merge 1 commit into
Draft
Conversation
benjaminking
commented
Jun 2, 2026
benjaminking
left a comment
Collaborator
Author
There was a problem hiding this comment.
One upside to the performance hit that I just realized: the EITL team has already been running inference with a batch size of 8 instead of 16, so computing transition scores on the CPU with a batch size of 16 will have comparable performance to computing transition scores on the GPU with a batch size of 8. So, this fix is at least no slower than the status quo.
Also, it looks like we compute transition scores whether or not we're calculating confidence. We may want to change that so to avoid an unnecessary performance hit calculating something that we're just throwing away.
@benjaminking made 1 comment.
Reviewable status: 0 of 1 files reviewed, all discussions resolved.
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 moves the computation of transition scores in
SilTranslationPipelineto the CPU. The scores form a large tuple whose size isnum_generated_tokens × batch_size × num_beams × vocab_sizethat can occupy a lot of the GPU's RAM. The tradeoff is that inference now takes 1.5-2x longer, since we're using the CPU.We should discuss further whether this is a good tradeoff to make.
This change is