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

[ML] make inference model definitions writeable #96804

Conversation

benwtrent
Copy link
Member

Model inference definitions are currently not serializable between nodes.

However, it is required for future LTR work that inference optimized models be serializable from the coordinator -> data nodes.

This adds wire serialization code for our ensemble and tree inference models. From a user perspective, this change does nothing.

@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Jun 13, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@benwtrent
Copy link
Member Author

Pinging @elastic/es-search (Team:Search)

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

There's nothing wrong with this change in itself. However, I think there could be complications with running boosted tree models extensively during searches to support LTR. Autoscaling doesn't take into account the memory required for inference models inside the JVM. Currently it's possible to work around this by disabling autoscaling and selecting bigger nodes manually. In serverless that won't be possible. This isn't a new problem, but introducing LTR could change it from an obscure edge case that hardly affects anyone into a major problem.

@benwtrent
Copy link
Member Author

Autoscaling doesn't take into account the memory required for inference models inside the JVM. Currently it's possible to work around this by disabling autoscaling and selecting bigger nodes manually. In serverless that won't be possible.

Good point. I will think a bit more about how we expose this. It would be bad for 1000s of search requests to all instantiate the same model needlessly.

@benwtrent
Copy link
Member Author

I am going to close this for now and think a bit more.

Regardless of the autoscaling issue, I am not sure we want to serialize models for the sake of inferencing at all without caching them in their location (like the ModelLoader).

@benwtrent benwtrent closed this Jun 13, 2023
@benwtrent benwtrent deleted the feature/ml-make-inference-models-serializable branch August 29, 2023 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml Machine learning >non-issue Team:ML Meta label for the ML team v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants