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] ML Model Inference Ingest Processor #49052

Merged
merged 32 commits into from
Nov 18, 2019
Merged

Conversation

benwtrent
Copy link
Member

This contains the groundwork for allowing machine model inference in an ingest processor.

The new ingest processor is called inference:

  • field_mappings: The mapping of ingest doc field names to the fields expected by the model
  • model_id: The model with which to infer
  • inference_config: The type of inference (regression or classification) and their related options
  • target_field: The field name to put the results of the inference

The steps for building a model and then utilizing it for inference are as follows:

  • Build a machine learning data frame analytics job for regression or classification
  • Once the job has completed, it will automatically store the trained model.
  • The model can be retrieved via _ml/inference API
  • Create/Update a pipeline to use an inference processor that refers to the created model_id

The machine learning data frame analytics jobs automatically store models for inference when it completes a classification or regression analysis.

Additionally, some basic management APIs and quality of life features are included.

benwtrent and others added 26 commits October 9, 2019 11:27
This adds a couple of things:

- A model loader service that is accessible via transport calls. This service will load in models and cache them. They will stay loaded until a processor no longer references them
- A Model class and its first sub-class LocalModel. Used to cache model information and run inference.
- Transport action and handler for requests to infer against a local model
* [ML][Inference] Adjust inference configuration option API

* fixing method reference

* fixing tests
* [ML][Inference] adds logistic_regression output aggregator

* Addressing PR comments
* [ML][Inference] Adding read/del trained models

* addressing PR comments and fixing tests

* adding error tests to ml_security blacklist

* fixing tests
* [ML][Inference] Adding ingest processor

* optionally including tag in model metadata injection in processor

* fixing test

* addressing PR comments

* adding comment
* [ML][Inference] Adding model memory estimations

* addressing PR comments
* [ML][Inference] adding more options to inference processor, fixing minor bug

* addressing PR comments
…8584)

* [ML][Inference] handle string values better in feature extraction

* adding tests for InferenceHelpers
[ML][Inference] Adding _stats endpoint for inference. Initially only contains ingest stats and pipeline counts.
…47869)

* [ML][Inference] add inference processors and trained models to usage

* renaming usage fields
#48718)

* [ML][Inference] add new flag for optionally including model definition

* adjusting after definition and config split

* revert unnecessary changes to AbstractTransportGetResourcesAction

* fixing TrainedModelDefinitionTests

* fixing yaml tests from previous code changes

* fixing integration test

* making tests an assertBusy for verification
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

@benwtrent benwtrent changed the title [ML] Model Inference Processor [ML] ML Model Inference Ingest Processor Nov 13, 2019
benwtrent and others added 5 commits November 14, 2019 09:13
* [ML][Inference] adding license checks

* Apply suggestions from code review

Co-Authored-By: Przemysław Witek <przemyslaw.witek@elastic.co>
)

* [ML][Inference] Adding memory and compute estimates to inference

* Make nodes non-empty

* fixing tests
@benwtrent
Copy link
Member Author

@elasticmachine retest this please

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@benwtrent benwtrent merged commit 6806081 into master Nov 18, 2019
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Nov 18, 2019
* [ML][Inference] adds lazy model loader and inference (elastic#47410)

This adds a couple of things:

- A model loader service that is accessible via transport calls. This service will load in models and cache them. They will stay loaded until a processor no longer references them
- A Model class and its first sub-class LocalModel. Used to cache model information and run inference.
- Transport action and handler for requests to infer against a local model
Related Feature PRs:
* [ML][Inference] Adjust inference configuration option API (elastic#47812)

* [ML][Inference] adds logistic_regression output aggregator (elastic#48075)

* [ML][Inference] Adding read/del trained models (elastic#47882)

* [ML][Inference] Adding inference ingest processor (elastic#47859)

* [ML][Inference] fixing classification inference for ensemble (elastic#48463)

* [ML][Inference] Adding model memory estimations (elastic#48323)

* [ML][Inference] adding more options to inference processor (elastic#48545)

* [ML][Inference] handle string values better in feature extraction (elastic#48584)

* [ML][Inference] Adding _stats endpoint for inference (elastic#48492)

* [ML][Inference] add inference processors and trained models to usage (elastic#47869)

* [ML][Inference] add new flag for optionally including model definition (elastic#48718)

* [ML][Inference] adding license checks (elastic#49056)

* [ML][Inference] Adding memory and compute estimates to inference (elastic#48955)
benwtrent added a commit that referenced this pull request Nov 18, 2019
* [ML] ML Model Inference Ingest Processor (#49052)

* [ML][Inference] adds lazy model loader and inference (#47410)

This adds a couple of things:

- A model loader service that is accessible via transport calls. This service will load in models and cache them. They will stay loaded until a processor no longer references them
- A Model class and its first sub-class LocalModel. Used to cache model information and run inference.
- Transport action and handler for requests to infer against a local model
Related Feature PRs:

* [ML][Inference] Adjust inference configuration option API (#47812)

* [ML][Inference] adds logistic_regression output aggregator (#48075)

* [ML][Inference] Adding read/del trained models (#47882)

* [ML][Inference] Adding inference ingest processor (#47859)

* [ML][Inference] fixing classification inference for ensemble (#48463)

* [ML][Inference] Adding model memory estimations (#48323)

* [ML][Inference] adding more options to inference processor (#48545)

* [ML][Inference] handle string values better in feature extraction (#48584)

* [ML][Inference] Adding _stats endpoint for inference (#48492)

* [ML][Inference] add inference processors and trained models to usage (#47869)

* [ML][Inference] add new flag for optionally including model definition (#48718)

* [ML][Inference] adding license checks (#49056)

* [ML][Inference] Adding memory and compute estimates to inference (#48955)

* fixing version of indexed docs for model inference
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Feb 21, 2020
Relates: #4341, elastic/elasticsearch#49052

This commit adds the ingest inference processor.
@colings86 colings86 deleted the feature/ml-inference branch May 27, 2020 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants