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

Integrating OpenVINO Runtime in Spark NLP #14200

Conversation

rajatkrishna
Copy link

@rajatkrishna rajatkrishna commented Mar 9, 2024

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.

@maziyarpanahi maziyarpanahi self-requested a review March 10, 2024 12:20
@maziyarpanahi maziyarpanahi self-assigned this Mar 10, 2024
@maziyarpanahi maziyarpanahi added on-hold cannot be merged right away new-feature Introducing a new feature DON'T MERGE Do not merge this PR labels Mar 10, 2024
* Use CPU by default for OpenVINO inference due to error loading device config in cluster envs
@DevinTDHa DevinTDHa mentioned this pull request May 20, 2024
4 tasks
@maziyarpanahi maziyarpanahi changed the base branch from master to release/540-release-candidate May 21, 2024 12:34
@maziyarpanahi maziyarpanahi merged commit fabc4ab into JohnSnowLabs:release/540-release-candidate May 21, 2024
1 of 4 checks passed
@rajatkrishna rajatkrishna deleted the openvino-integration branch May 31, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DON'T MERGE Do not merge this PR new-feature Introducing a new feature on-hold cannot be merged right away
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants