Skip to content

Speed up SMILES Transformer model inference#17

Open
kmaziarz wants to merge 8 commits into
mainfrom
kmaziarz/speed-up-transformer-model
Open

Speed up SMILES Transformer model inference#17
kmaziarz wants to merge 8 commits into
mainfrom
kmaziarz/speed-up-transformer-model

Conversation

@kmaziarz

@kmaziarz kmaziarz commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Our SMILES Transformer model is based on forked and modified code from opennmt. This PR bundles together several tweaks to that code which don't change model output but significantly speed up inference time. Majority of the changes are related to being more careful about GPU-CPU sync points and avoiding recomputing things unnecessarily. Inference time reduction varies from 25% for a batch size of 1 to nearly 50% for larger batch sizes.

Setting Before (ms/mol) After (ms/mol) Speedup
batch_size=1 2588.214 1945.268 1.33x
batch_size=16 919.146 464.255 1.98x

@mrwnmsr

mrwnmsr commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

decent speedup indeed!

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.

2 participants