[SPARKNLP-1037] Adding addFile changes to to replace broadcast in all ONNX based annotators #14236
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.
Description
This PR introduces enhancements to the Spark NLP library, focusing on the efficient distribution of ONNX model files across Spark executors. Leveraging Spark's built-in file distribution capabilities, this update aims to optimize the performance and scalability of LLMs within distributed cloud environments.
Motivation and Context
The primary motivation behind this update is to address the challenges associated with deploying and scaling LLMs in cloud-based Spark environments. By utilizing Spark's native support for distributing files across executors, we can significantly enhance the scalability and efficiency of LLM annotators. This is particularly crucial for models like Llama-2 and M2M100, which require access to large ONNX files to function correctly.
This improvement ensures that ONNX models are effectively shared across all nodes in a Spark cluster, reducing the overhead associated with model loading and facilitating faster, more scalable annotations. As a result, users can expect improved performance and a smoother experience when processing large datasets or working in resource-intensive cloud environments.
The integration of these changes represents a significant step forward in our ongoing efforts to optimize Spark NLP for LLM processing, reinforcing our commitment to providing robust, scalable NLP solutions for the cloud.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: