-
Notifications
You must be signed in to change notification settings - Fork 138
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
[BUG] MLInferenceIngestProcessor has xContentRegistry as null #3276
Comments
After investigating, I realized that this requires a open-search core code change along with a minor Ml-Commons change. More specifically, it requires that the IngestService class change its constructor to have a content registry object as a new parameter. ml-commons/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java Line 1068 in 9a4166e
This is the most sensible solution as any new ingest processor can benefit from making objects using the xContentRegistry provided by the Node class. This also benefits the MlInferenceIngest processor to create custom ML Inputs based on any new model that comes up as shown by the Asymmetric Model Type . Are there any easier ways to solve this issue?Currently we can not circumvent this by using the createComponents method within MLPlugin ml-commons/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java Lines 458 to 470 in 9a4166e
as the creation of the ingestProcessor gets called before the createComponents method ml-commons/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java Line 1063 in 9a4166e
One way to easily remove the need for the code change is to change the order of creation with the node class. But this is a terrible idea as we will depend on the order of code (This is a huge headache for future contributors who decide to modify the relavent code discussed) to make sure everything is correct see below. This is the order the code executes which explains why the xContentRegistry is null when creating the ingest processor
|
I think you should start with a PR in core and get feedback. Just to be clear, you want to introduce a new |
Hey Austin! @austintlee, Yes thats part of it; this involves several code changes
new MLInferenceIngestProcessor.Factory(parameters.scriptService, parameters.client, paramters.xContentRegistry) |
Currently since the implementation of ingestProcessors have a null content registry we can force the xContentRegistry to have the registry as specified by the getNamedXContent() method ml-commons/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java Line 912 in 9a4166e
this is a temporary ML-Commons unblocker for using local models but I would need to have a OpenSearch core fix which would take awhile. Here is the plan of action to make this happen. Within the specified order.
|
What is the bug?
Commit that introduces local models to MLInferenceIngestProcessor
On creation of the Ingest processor the MLInferenceIngestProcessor has no valid xContentRegistry which is used to create valid MLInput objects used for model prediction
Contrast this with the MLInferenceSearchResponseProcessor That has a valid contentRegistry, this processor is able to correctly make objects and can produce valid model input.
If you want to test this locally I reccomend you follow the steps to create a local embedding
Then run the following
What is the expected behavior?
A proper embedding should appear as a result of the simulating the ingest pipeline.
What is your host/environment?
The text was updated successfully, but these errors were encountered: