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

[WIP] Integrating OpenVINO Runtime in Spark NLP #13947

Closed

Conversation

rajatkrishna
Copy link

@rajatkrishna rajatkrishna commented Aug 28, 2023

Reopened as #14200


This PR introduces OpenVINO Runtime support in Spark NLP

Description

This PR enables Spark NLP to leverage the OpenVINO Runtime API for Java to load and run models in various formats including ONNX, PaddlePaddle, Tensorflow, Tensorflow Lite and OpenVINO IR format. OpenVINO also enables performance improvements when running on supported intel hardware, with upto 40% improvement vs Tensorflow on benchmarks with no further tuning. You can also take advantage of the full optimization and quantization capabilities offered by the OpenVINO toolkit when exporting/converting the model to the OpenVINO format using the Model Conversion API.

The following annotators have been enabled to work with OpenVINO:

Note: To take advantage of this feature, see these instructions to build OpenVINO jar (Linux), and these to build Spark NLP. OpenVINO is cross-platform. Refer here for Windows build instructions, and here for other platforms.

Motivation and Context

  • Out-of-the-box optimizations and better performance on supported Intel hardware
  • Capable of reading ONNX, PaddlePaddle, TensorFlow and TensorFlow Lite formats directly
  • This work was completed as part of Google Summer of Code 2023

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Code improvements with no or little impact
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING page.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Add OpenVINO model engine wrapper

Add default buffer size for reading weights file

Read OpenVINO IR format models

Remove redundant classes and update comments
Resolve merge conflicts

Typo fix
* Add param to enable OpenVINO through Python API
* Formatting changes
* Enable OpenVINO backend for E5 Embeddings
* Update Python APIs
@rajatkrishna rajatkrishna deleted the feature/ov-integration branch March 9, 2024 04:04
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.

None yet

1 participant