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] Update trained model inference endpoint #556

Merged
merged 4 commits into from
Jul 11, 2023

Conversation

valeriy42
Copy link
Contributor

@valeriy42 valeriy42 commented Jul 7, 2023

Infer trained model deployment API has been deprecated, so I changed the code to use the new one.

@valeriy42 valeriy42 requested a review from davidkyle July 7, 2023 11:25
@valeriy42 valeriy42 added bug Something isn't working topic:NLP Issue or PR about NLP model support and eland_import_hub_model refactor A refactoring task labels Jul 7, 2023
README.md Outdated
Comment on lines 247 to 248
[API](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-trained-model-deployment.html)
you will be able to set the threading options to make best use of your
[API](https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-trained-model.html)
you will be able to set the threading options to make the best use of your
Copy link
Contributor

Choose a reason for hiding this comment

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

This change isn't necessary. The start trained model deployment API still exists, and is the one where threading options are set.


self.quantize = (
True
if not (platform.system() == "Darwin" and platform.machine() == "arm64")
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes in this file should go in a separate PR. It will be hard to search for them in the future if they're in a PR that's about updating the model inference endpoint.

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the test

README.md Outdated
@@ -244,8 +244,8 @@ command line and instead start the model using the ML UI in Kibana.
The `--start` argument will deploy the model with one allocation and one
thread per allocation, which will not offer good performance. When starting
the model deployment using the ML UI in Kibana or the Elasticsearch
[API](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-trained-model-deployment.html)
you will be able to set the threading options to make best use of your
[API](https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-trained-model.html)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
[API](https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-trained-model.html)
[API](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-trained-model-deployment.html)

This is referring to the start API

("n_node_samples", "<i8"),
("weighted_n_node_samples", "<f8"),
],
dtype={
Copy link
Member

Choose a reason for hiding this comment

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

We should update the scikit learn version in requirements-dev.txt and setup.py otherwise these tests will fail for anyone on an older version

Currently it is:

scikit-learn>=0.22.1,<2

Suggest:

scikit-learn>=1.3,<2

@valeriy42
Copy link
Contributor Author

Thank you for your comments. I moved the fix of unit tests into #558. Once merged, the changes here should be related to the deprecated API only.

@valeriy42 valeriy42 removed bug Something isn't working refactor A refactoring task labels Jul 10, 2023
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

@valeriy42 valeriy42 merged commit 77781b9 into elastic:main Jul 11, 2023
2 checks passed
@valeriy42 valeriy42 deleted the inference-endpoint-update branch July 11, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:NLP Issue or PR about NLP model support and eland_import_hub_model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants