diff --git a/docs/LicenseInfo.md b/docs/LicenseInfo.md index 6db23dcaf1c..7d35321a627 100644 --- a/docs/LicenseInfo.md +++ b/docs/LicenseInfo.md @@ -7,7 +7,7 @@ All the **Nussknacker** code available on [GitHub](https://github.com/TouK/nussk ### Enterprise edition -The [Nussknacker Enterprise](about/NussknackerEnterprise.md) version is subject to different license terms. Contact info@nussknacker.io for more information. +The [Nussknacker Enterprise](about/NussknackerEnterprise.md) version is subject to different license terms. Contact for more information. Additionally, the ML Enricher enterprise component uses [JPMML-Evaluator](https://github.com/jpmml/jpmml-evaluator) library licensed under the BSD 3-Clause License reproduced below: diff --git a/docs/about/NussknackerEnterprise.md b/docs/about/NussknackerEnterprise.md index 1c603a885fe..afb7445b54a 100644 --- a/docs/about/NussknackerEnterprise.md +++ b/docs/about/NussknackerEnterprise.md @@ -18,5 +18,5 @@ Future plans: - Automatic input / output logging from enrichers - Redis integration component -For license and support terms contact info@nussknacker.io. +For license and support terms contact . diff --git a/docs/integration/MachineLearning.md b/docs/integration/MachineLearning.md index bd65e0125a6..069c222fc72 100644 --- a/docs/integration/MachineLearning.md +++ b/docs/integration/MachineLearning.md @@ -4,9 +4,46 @@ sidebar_position: 5 # Machine Learning (Enterprise only) -Nussknacker can infer ML models using the Machine Learning enrichers. The ML enrichers are Enterprise components of Nussknacker and require a separate license. Please contact for license terms and more details. +Nussknacker can infer ML models using the Machine Learning enrichers. We support both in-process inference and inference +using a dedicated ML runtime. -We support the inference of the following ML technologies: -- native Python models discovered using the [MLflow](https://mlflow.org/) model registry and executed with our ML runtime -- models exported in the [PMML](https://en.wikipedia.org/wiki/Predictive_Model_Markup_Language) format -- models exported in the [H2O](https://h2o.ai/) format +Nussknacker ML enrichers can infer **in-process** models exported in the following formats: +- [ONNX](https://onnx.ai/) +- [PMML](https://en.wikipedia.org/wiki/Predictive_Model_Markup_Language) +- [H2O](https://h2o.ai/) + +Executing ML models in the same process as the Nussknacker scenario is a matter of configuring an ML enricher. No +additional components are required to infer models. Also, invoking exported models using their native runtimes +should result in both minimal latency and low resource requirements. However, this approach has some limitations. +Namely, not all models and not all popular ML libraries are covered by these formats. The export process itself +can feel cumbersome. + +Nussknacker can discover exported models from file (e.g. local directory, NFS) or HTTP based registries. +We also plan to support MLflow as a registry for exported models in these formats. + +The diagram below shows the interactions for ML enricher inferring an exported model: + +![alt_text](img/mlExportedModels.png "Inferring ML exported models") + +Because of some restrictions with exporting models, we also support inference of **any Python ML model** using our +*Nussknacker ML runtime* component. ML models are discovered and fetched from the [MLflow](https://mlflow.org/) +model registry which also serves as an experiment tracking tool for data scientists. This way, data scientists do not +have to worry about exporting trained models to other formats, they just log the models in the MLflow model registry. +They also have the flexibility to use various Python ML libraries. + +Nussknacker ML runtime offers higher throughput at the cost of higher inference latency. Since the ML runtime +is a separate component of Nussknacker installation, a GPU can be also harnessed to infer ML models. + +The diagram below shows the interactions for MLflow enricher and ML runtime: + +![alt_text](img/mlMlflowAndNussknackerMlRuntime.png "Inferring MLflow models with Nussknacker ML runtime") + +A Kubernetes cluster is recommended for installing the Nussknacker ML runtime. However, the ML runtime can also be +installed as a standalone application. + +You can read more about this approach in our [blog post](https://nussknacker.io/blog/ml-models-inference-in-fraud-detection/) +where we present a complete path from analysing a dataset to training a model and finally inferring the model +in a Nussknacker scenario. + +The ML enrichers are Enterprise components of Nussknacker and require a separate license. Please contact + for license terms and more details. diff --git a/docs/integration/img/mlExportedModels.png b/docs/integration/img/mlExportedModels.png new file mode 100644 index 00000000000..5355a054c19 Binary files /dev/null and b/docs/integration/img/mlExportedModels.png differ diff --git a/docs/integration/img/mlMlflowAndNussknackerMlRuntime.png b/docs/integration/img/mlMlflowAndNussknackerMlRuntime.png new file mode 100644 index 00000000000..54000e17c85 Binary files /dev/null and b/docs/integration/img/mlMlflowAndNussknackerMlRuntime.png differ diff --git a/docs/scenarios_authoring/Enrichers.md b/docs/scenarios_authoring/Enrichers.md index 20461a58afa..c8dc864d81d 100644 --- a/docs/scenarios_authoring/Enrichers.md +++ b/docs/scenarios_authoring/Enrichers.md @@ -152,15 +152,19 @@ Similarly, information about field names and types returned by the OpenAPI servi ## ML enricher **(Enterprise only)** -Nussknacker can infer ML models using the Machine Learning enrichers. The ML enrichers are Enterprise components of Nussknacker and require a separate license. Please contact for license terms and more details. +Similarly to SQL and OpenAPI enrichers, as ML model input and output vectors are known to Designer, when you double-click +the ML Enricher node in the scenario you will see entry fields required by the selected model and version; +data type hints and syntax error checking functionality will be active. -We support the inference of the following ML technologies: -- native Python models discovered using the [MLflow](https://mlflow.org/) model registry and executed with our ML runtime -- models exported in the [PMML](https://en.wikipedia.org/wiki/Predictive_Model_Markup_Language) format -- models exported in the [H2O](https://h2o.ai/) format +From the scenario author perspective, the ML Enricher is indistinguishable from OpenAPI enricher - it just takes +some input parameters and returns a value, e.g. a risk. -Similarly to SQL and OpenAPI enrichers, as ML model input and output are known to Designer, when you double-click the ML Enricher node in the scenario you will see entry fields required by the model; data type hints and syntax error checking functionality will be active. +![alt_text](img/mlEnricherForm.png "ML Enricher") -From the scenario author perspective, the ML Enricher is indistinguishable from OpenAPI enricher - it just takes some input parameters and returns a value. +The following ML models are supported: +- [ONNX](https://onnx.ai/) +- [PMML](https://en.wikipedia.org/wiki/Predictive_Model_Markup_Language) +- [H2O](https://h2o.ai/) +- models fetched from [MLflow](https://mlflow.org/) models registry -![alt_text](img/mlEnricherForm.png "ML Enricher") +Please check [ML integration](../integration/MachineLearning.md) page for more details on how models are inferred by Nussknacker. diff --git a/docs/scenarios_authoring/img/mlEnricherForm.png b/docs/scenarios_authoring/img/mlEnricherForm.png index 89542f4ca3c..8b9cb6f111e 100644 Binary files a/docs/scenarios_authoring/img/mlEnricherForm.png and b/docs/scenarios_authoring/img/mlEnricherForm.png differ