-
Notifications
You must be signed in to change notification settings - Fork 717
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
Integrating ONNX runtime (ORT) in Spark NLP 5.0.0 🎉 #13857
Merged
maziyarpanahi
merged 33 commits into
release/500-release-candidate
from
feature/onnx-runtime
Jul 1, 2023
Merged
Integrating ONNX runtime (ORT) in Spark NLP 5.0.0 🎉 #13857
maziyarpanahi
merged 33 commits into
release/500-release-candidate
from
feature/onnx-runtime
Jul 1, 2023
Conversation
This file contains 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
maziyarpanahi
added
documentation
new-feature
Introducing a new feature
new model
DON'T MERGE
Do not merge this PR
labels
Jun 15, 2023
maziyarpanahi
changed the base branch from
master
to
release/500-release-candidate
June 19, 2023 06:51
Pull Request Test Coverage Report for Build 5388321371
💛 - Coveralls |
danilojsl
requested changes
Jun 19, 2023
src/main/scala/com/johnsnowlabs/nlp/embeddings/BertSentenceEmbeddings.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/johnsnowlabs/nlp/embeddings/BertSentenceEmbeddings.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/johnsnowlabs/nlp/embeddings/DeBertaEmbeddings.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: Stefano Lori <s.lori@izicap.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Overview
This pull request (PR) aims to enhance the capabilities of Spark NLP by introducing the integration of the ONNX runtime
ORT
for Java. This integration will enable the users to import Transformers and LLM (Language Model) models in ONNX format into Spark NLP. 🎉In the upcoming release of Spark NLP 5.0.0, users can work with models in both TensorFlow and ONNX formats. However, our team's default provision of pretrained models will be in ONNX format. This choice is driven by the fact that the ONNX models yield significantly better inference results, ranging from 3x to 5x, even without any optimization or quantization techniques on CPUs.
The integration of ORT in Spark NLP empowers users to further enhance the performance of their models. When exporting models to ONNX, users can leverage built-in features provided by libraries such as
onnx-runtime
,transformers
,optimum
, andpytorch
. These features include optimization and quantization capabilities, which come ready to use out of the box.Initial Annotators/Features to support ONNX Runtime
In the realm of Vector Databases, the quest for faster and more efficient Embeddings models has become an imperative pursuit. Models like BERT, DistilBERT, and DeBERTa have revolutionized natural language processing tasks by capturing intricate semantic relationships between words. However, their computational demands and slow inference times pose significant challenges in the game of Vector Databases.
In Vector Databases, the speed at which queries are processed and embeddings are retrieved directly impacts the overall performance and responsiveness of the system. As these databases store vast amounts of vectorized data, such as documents, sentences, or entities, swiftly retrieving relevant embeddings becomes paramount. It enables real-time applications like search engines, recommendation systems, sentiment analysis, and chat/instruct-like products similar to ChatGPT to deliver timely and accurate results, ensuring a seamless user experience.
With that in mind, we have started with the following annotators:
BertEmbeddings
,DistilBertEmebeddings
, andDeBertaEmbeddings
. We will identify all the existing models for these annotators on our Models Hub, re-exporting them in ONNX format, and re-uploading them with the same name to have a seamless transition for our community starting Spark NLP 5.0.0. (stuff will just get faster with each release starting Spark NLP 5.0.0 🚀)Models converted to ONNX
Tested platforms