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] Merge the pytorch-inference feature branch #73660

Merged
merged 22 commits into from
Jun 3, 2021

Conversation

davidkyle
Copy link
Member

@davidkyle davidkyle commented Jun 2, 2021

The feature branch contains changes to configure PyTorch models with a TrainedModelConfig and defines a format to store the binary models. The _start and _stop deployment actions control the model lifecycle and the model can be directly evaluated with the _infer endpoint. 2 Types of NLP tasks are supported: Named Entity Recognition and Fill Mask.

The feature branch consists of these PRs:

dimitris-athanasiou and others added 17 commits March 29, 2021 16:38
Initial start/stop trained model deployment actions.
Adds the model_type field to TrainedModelConfig for distinguishing between models
that can be loaded via the model loading service and those that require a native process.
This adds a temporary API for doing inference against
a trained model deployment.
Introduces code for re-assembling the individual chunks a model is stored in and 
streaming those chunks to the inference process. Re-uses the 
TrainedModelDefinitionDoc format already defined for boosted tree models
Binary data is stored in lucene base64 encoded, the same data stored in a 
Java string uses 2 bytes (UTF16) to represent each base64 character 
consuming twice the amount of memory required. The compressed
binary representation of the models can stored in ByteReferences
more efficiently. For BWC a new field mapping binary_definition 
is added .ml-inference-* and the index version incremented.
This adds a location field to TrainedModelConfig for large models that cannot be
PUT inline with the config. Large models are reassembled from their location.
Adds tokenisation for BERT models via the WordPiece algorithm using the
vocabulary that defined with the model and introduces the concept of NLP
tasks. Each task is configured with a BERT model supporting that task, 
pre-processing and post-processing is defined by the task. 

Named Entity Recognition and Fill Mask are the 2 task types supported by
this PR
@davidkyle davidkyle changed the title Feature/pytorch inference [ML] Merge the pytorch-inference feature branch Jun 2, 2021
@davidkyle davidkyle added :ml Machine learning v8.0.0 labels Jun 2, 2021
@elasticmachine elasticmachine added the Team:ML Meta label for the ML team label Jun 2, 2021
@elasticmachine
Copy link
Collaborator

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

@sethmlarson sethmlarson added the Team:Clients Meta label for clients team label Jun 2, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/clients-team (Team:Clients)

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Early review comments, very excited for this functionality.

@davidkyle
Copy link
Member Author

Thanks for jumping in with an early review @sethmlarson

use /_ml/trained_models/{model_id}/deployment/[_start|_stop]?

👍 This makes sense to me I'll raise it with the team

I've missed out the spec of the _infer endpoint which follows the same pattern as start & stop: /_ml/trained_models/deployment/{model_id}/_infer and will add that soon.

These APIs may be in flux for a short while as we work through all the use cases. Is that a problem for the clients team? Would you prefer us to tell you when we settled on something we like?

@sethmlarson
Copy link
Contributor

@davidkyle It's no problem for us that these APIs may change especially if they're experimental/on master branch, we'll regenerate from the specs each time :) We like being a part of the process even if it's just seeing changes happen.

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Looks good from an API spec perspective 🎉 One comment I was unsure about.

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :ml Machine learning Team:Clients Meta label for clients team Team:ML Meta label for the ML team v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants