Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-1089: Optimize FlairEmbeddings depending on storage mode #1095

Merged
merged 4 commits into from
Sep 13, 2019

Conversation

alanakbik
Copy link
Collaborator

As discussed in #1089, the clone() operation in FlairEmbeddings is expensive and only required if the embedding_storage_mode is 'gpu'. However, information of which storage mode is selected is not visible in FlairEmbeddings. To address this, this PR adds a new global variable embedding_storage_mode that is set in the store_embeddings() method and checked in FlairEmbeddings. This gives us a roughly 10% improvement in inference speed.

The PR also renames the embeddings_storage_mode parameter of the evaluate() functions to embedding_storage_mode to make it consistent.

@MichaelHintz
Copy link

👍

1 similar comment
@adizdari
Copy link

👍

@alanakbik alanakbik merged commit b9c0e44 into master Sep 13, 2019
@alanakbik alanakbik deleted the clone-optimization branch September 18, 2019 12:30
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.

3 participants