From a3be34b1c80416dd384157fdb0307e6abda6af81 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Tue, 18 Apr 2023 09:28:20 -0500 Subject: [PATCH 01/16] Add ML fault tolerance Signed-off-by: Naarcha-AWS --- _ml-commons-plugin/api.md | 37 ++++++++++++++++++++++++++ _ml-commons-plugin/cluster-settings.md | 32 ++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 0b11a63fbe..4b8799a004 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -494,6 +494,43 @@ GET /_plugins/_ml/profile } ``` +### Example: Return auto deploy and node information + +The profile API returns additional information when the [auto redeploy]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#enable-auto-redeploy) cluster setting is set to `true`. + +```json +{ + "name": "all-mpnet-base-v2", + "algorithm": "TEXT_EMBEDDING", + "model_version": "1", + "model_format": "TORCH_SCRIPT", + "model_state": "DEPLOYED", + "model_content_size_in_bytes": 404999545, + "model_content_hash_value": "fe72818b76a91e154776e4737b1fb0db255c091e8123117ad8758d9f7be6e594", + "model_config": { + "model_type": "bert", + "embedding_dimension": 768, + "framework_type": "SENTENCE_TRANSFORMERS" + }, + "created_time": 1681642820665, + "last_updated_time": 1681646576370, + "last_registered_time": 1681642837416, + "last_deployed_time": 1681646576370, + "auto_redeploy_retry_times": 0, + "total_chunks": 41, + "planning_worker_node_count": 6, + "current_worker_node_count": 6, + "planning_worker_nodes": [ + "Liz28BgFTo--u0ZXVtmOaQ", + "jPPe_s9vQq-cKgZrn6hN-w", + "gN8IFfxdT4mnPdc6WW9ung", + "lCUgCEiASWKfRNTYoKo9Ng", + "ZCBneXv6SG2VdHQvLAnEUg", + "F483VPEbQlaQoEW_F2H-gQ" + ] +} +``` + ## Predict diff --git a/_ml-commons-plugin/cluster-settings.md b/_ml-commons-plugin/cluster-settings.md index 660c9e5c18..edde914145 100644 --- a/_ml-commons-plugin/cluster-settings.md +++ b/_ml-commons-plugin/cluster-settings.md @@ -186,3 +186,35 @@ plugins.ml_commons.native_memory_threshold: 90 - Default value: 90 - Value range: [0, 100] + +## Enable auto redeploy + +Automatically redeploys previously deployed models upon cluster failure. + +### Setting + +``` +plugins.ml_commons.model_auto_redeploy.enable: false +``` + +### Values + +- Default value: false +- Value range: [false, true] + +## Set retires for auto redeploy + +Sets the limit for the number of times a previously deployed model will try and redeploy upon cluster failure. + +### Setting + +``` +plugins.ml_commons.model_auto_redeploy.lifetime_retry_times: 3 +``` + +### Values + +- Default value: 3 +- Value range: [0, 100] + + From 73e41e360fb44e970a4c99cc3ed5d732789987f1 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Tue, 18 Apr 2023 09:45:37 -0500 Subject: [PATCH 02/16] Rework Profile API sentence Signed-off-by: Naarcha-AWS --- _ml-commons-plugin/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 4b8799a004..96daebe8f5 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -496,7 +496,7 @@ GET /_plugins/_ml/profile ### Example: Return auto deploy and node information -The profile API returns additional information when the [auto redeploy]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#enable-auto-redeploy) cluster setting is set to `true`. +When the [auto redeploy]({{site.url}}{{site.baseurl}}/ml-commons-plugin/cluster-setting#enable-auto-redeploy) cluster setting is set to `true`, the profile API returns additional deployment information, including deployment time, retry count, and worker node IDs where the model is deployed. ```json { From c09c4a68fea131d8dd23e7285abf90ad5857ccf0 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Tue, 18 Apr 2023 10:03:09 -0500 Subject: [PATCH 03/16] Fix link Signed-off-by: Naarcha-AWS --- _ml-commons-plugin/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 96daebe8f5..6d16d808cf 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -496,7 +496,7 @@ GET /_plugins/_ml/profile ### Example: Return auto deploy and node information -When the [auto redeploy]({{site.url}}{{site.baseurl}}/ml-commons-plugin/cluster-setting#enable-auto-redeploy) cluster setting is set to `true`, the profile API returns additional deployment information, including deployment time, retry count, and worker node IDs where the model is deployed. +When the [auto redeploy]({{site.url}}{{site.baseurl}}/ml-commons-plugin/cluster-settings#enable-auto-redeploy) cluster setting is set to `true`, the profile API returns additional deployment information, including deployment time, retry count, and worker node IDs where the model is deployed. ```json { From 82ac08edbb15f1b5343f0cdd32ee8deb71f07c78 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Tue, 18 Apr 2023 11:59:18 -0500 Subject: [PATCH 04/16] Add review feedback Signed-off-by: Naarcha-AWS --- _ml-commons-plugin/cluster-settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/cluster-settings.md b/_ml-commons-plugin/cluster-settings.md index edde914145..e4ea19d0ba 100644 --- a/_ml-commons-plugin/cluster-settings.md +++ b/_ml-commons-plugin/cluster-settings.md @@ -189,7 +189,7 @@ plugins.ml_commons.native_memory_threshold: 90 ## Enable auto redeploy -Automatically redeploys previously deployed models upon cluster failure. +Automatically redeploys deployed or partially deployed models upon cluster failure. If all ML nodes inside inside a cluster crash, auto model redeployment fails, and the model must be deployed manually. ### Setting From f254342f6caadb0e4c5590bc0106b8aa90c1574c Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Tue, 25 Apr 2023 11:09:14 -0500 Subject: [PATCH 05/16] Add technical feedback for ML. Change API names Signed-off-by: Naarcha-AWS --- _ml-commons-plugin/api.md | 70 +++++++++++++------------- _ml-commons-plugin/cluster-settings.md | 20 ++++++-- 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 6d16d808cf..bef374e680 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -115,12 +115,12 @@ The API returns information on the model, the algorithm used, and the content fo } ``` -## Upload a model +## Register a model -Use the upload operation to upload a custom model to a model index. ML Commons splits the model into smaller chunks and saves those chunks in the model's index. +Use the Register operation to register a custom model to a model index. ML Commons splits the model into smaller chunks and saves those chunks in the model's index. ```json -POST /_plugins/_ml/models/_upload +POST /_plugins/_ml/models/_register ``` ### Request fields @@ -137,10 +137,10 @@ Field | Data type | Description ### Example -The following example request uploads version `1.0.0` of an NLP sentence transformation model named `all-MiniLM-L6-v2`. +The following example request registers a version `1.0.0` of an NLP sentence transformation model named `all-MiniLM-L6-v2`. ```json -POST /_plugins/_ml/models/_upload +POST /_plugins/_ml/models/_register { "name": "all-MiniLM-L6-v2", "version": "1.0.0", @@ -166,14 +166,14 @@ OpenSearch responds with the `task_id` and task `status`. } ``` -To see the status of your model upload, enter the `task_id` into the [task API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#get-task-information). Use the `model_id` from the task response once the upload is complete. For example: +To see the status of your model registation, enter the `task_id` into the [task API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#get-task-information). Use the `model_id` from the task response once the registration is complete. For example: ```json { "model_id" : "WWQI44MBbzI2oUKAvNUt", "task_type" : "UPLOAD_MODEL", "function_name" : "TEXT_EMBEDDING", - "state" : "COMPLETED", + "state" : "REGISTERED", "worker_node" : "KzONM8c8T4Od-NoUANQNGg", "create_time" : 1665961344003, "last_update_time" : 1665961373047, @@ -181,28 +181,28 @@ To see the status of your model upload, enter the `task_id` into the [task API]( } ``` -## Load model +## Deploy model -The load model operation reads the model's chunks from the model index, then creates an instance of the model to cache into memory. This operation requires the `model_id`. +The deploy model operation reads the model's chunks from the model index, then creates an instance of the model to cache into memory. This operation requires the `model_id`. ```json -POST /_plugins/_ml/models//_load +POST /_plugins/_ml/models//_deploy ``` -### Example: Load into all available ML nodes +### Example: Deploy into all available ML nodes -In this example request, OpenSearch loads the model into any available OpenSearch ML node: +In this example request, OpenSearch deploys the model into any available OpenSearch ML node: ```json -POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_load +POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_deploy ``` -### Example: Load into a specific node +### Example: Deploy into a specific node -If you want to reserve the memory of other ML nodes within your cluster, you can load your model into a specific node(s) by specifying the `node_ids` in the request body: +If you want to reserve the memory of other ML nodes within your cluster, you can deploy your model into a specific node(s) by specifying the `node_ids` in the request body: ```json -POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_load +POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_deploy { "node_ids": ["4PLK7KJWReyX0oWKnBA8nA"] } @@ -213,40 +213,40 @@ POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_load ```json { "task_id" : "hA8P44MBhyWuIwnfvTKP", - "status" : "CREATED" + "status" : "DEPLOYING" } ``` -## Unload a model +## Undeploy a model -To unload a model from memory, use the unload operation. +To undeploy a model from memory, use the undeploy operation. ```json -POST /_plugins/_ml/models//_unload +POST /_plugins/_ml/models//_undeploy ``` -### Example: Unload model from all ML nodes +### Example: Undeploy model from all ML nodes ```json -POST /_plugins/_ml/models/MGqJhYMBbbh0ushjm8p_/_unload +POST /_plugins/_ml/models/MGqJhYMBbbh0ushjm8p_/_undeploy ``` -### Response: Unload model from all ML nodes +### Response: Undeploy model from all ML nodes ```json { "s5JwjZRqTY6nOT0EvFwVdA": { "stats": { - "MGqJhYMBbbh0ushjm8p_": "unloaded" + "MGqJhYMBbbh0ushjm8p_": "UNDEPLOYED" } } } ``` -### Example: Unload specific models from specific nodes +### Example: Undeploy specific models from specific nodes ```json -POST /_plugins/_ml/models/_unload +POST /_plugins/_ml/models/_undeploy { "node_ids": ["sv7-3CbwQW-4PiIsDOfLxQ"], "model_ids": ["KDo2ZYQB-v9VEDwdjkZ4"] @@ -254,32 +254,32 @@ POST /_plugins/_ml/models/_unload ``` -### Response: Unload specific models from specific nodes +### Response: Undeploy specific models from specific nodes ```json { "sv7-3CbwQW-4PiIsDOfLxQ" : { "stats" : { - "KDo2ZYQB-v9VEDwdjkZ4" : "unloaded" + "KDo2ZYQB-v9VEDwdjkZ4" : "UNDEPLOYED" } } } ``` -### Response: Unload all models from specific nodes +### Response: undeploy all models from specific nodes ```json { "sv7-3CbwQW-4PiIsDOfLxQ" : { "stats" : { - "KDo2ZYQB-v9VEDwdjkZ4" : "unloaded", - "-8o8ZYQBvrLMaN0vtwzN" : "unloaded" + "KDo2ZYQB-v9VEDwdjkZ4" : "UNDEPLOYED", + "-8o8ZYQBvrLMaN0vtwzN" : "UNDEPLOYED" } } } ``` -### Example: Unload specific models from all nodes +### Example: undeploy specific models from all nodes ```json { @@ -287,13 +287,13 @@ POST /_plugins/_ml/models/_unload } ``` -### Response: Unload specific models from all nodes +### Response: undeploy specific models from all nodes ```json { "sv7-3CbwQW-4PiIsDOfLxQ" : { "stats" : { - "KDo2ZYQB-v9VEDwdjkZ4" : "unloaded" + "KDo2ZYQB-v9VEDwdjkZ4" : "UNDEPLOYED" } } } @@ -473,7 +473,7 @@ GET /_plugins/_ml/profile "KzONM8c8T4Od-NoUANQNGg" : { # node id "models" : { "WWQI44MBbzI2oUKAvNUt" : { # model id - "model_state" : "LOADED", # model status + "model_state" : "DEPLOYED", # model status "predictor" : "org.opensearch.ml.engine.algorithms.text_embedding.TextEmbeddingModel@592814c9", "worker_nodes" : [ # routing table "KzONM8c8T4Od-NoUANQNGg" diff --git a/_ml-commons-plugin/cluster-settings.md b/_ml-commons-plugin/cluster-settings.md index e4ea19d0ba..209adbdccc 100644 --- a/_ml-commons-plugin/cluster-settings.md +++ b/_ml-commons-plugin/cluster-settings.md @@ -187,9 +187,24 @@ plugins.ml_commons.native_memory_threshold: 90 - Default value: 90 - Value range: [0, 100] +## Allow custom deployment plans + +When enabled, grants users the ability to deploy models to specific ML nodes according to that user's permissions. + +### Setting + +``` +plugins.ml_commons.allow_custom_deployment_plan: false +``` + +### Values + +- Default value: false +- Value range: [false, true] + ## Enable auto redeploy -Automatically redeploys deployed or partially deployed models upon cluster failure. If all ML nodes inside inside a cluster crash, auto model redeployment fails, and the model must be deployed manually. +Automatically redeploys deployed or partially deployed models upon cluster failure. If all ML nodes inside a cluster crash, the model switches to the `DEPLOYED_FAILED` state, and the model must be deployed manually. ### Setting @@ -204,7 +219,7 @@ plugins.ml_commons.model_auto_redeploy.enable: false ## Set retires for auto redeploy -Sets the limit for the number of times a previously deployed model will try and redeploy upon cluster failure. +Sets the limit for the number of times a deployed or partially deployed model will try and redeploy upon cluster failure. ### Setting @@ -217,4 +232,3 @@ plugins.ml_commons.model_auto_redeploy.lifetime_retry_times: 3 - Default value: 3 - Value range: [0, 100] - From c51962d73683a87d94c12278a4a65f2c4892a978 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Tue, 25 Apr 2023 12:11:44 -0500 Subject: [PATCH 06/16] Add final ML node setting Signed-off-by: Naarcha-AWS --- _ml-commons-plugin/cluster-settings.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/_ml-commons-plugin/cluster-settings.md b/_ml-commons-plugin/cluster-settings.md index 209adbdccc..4c9aa10217 100644 --- a/_ml-commons-plugin/cluster-settings.md +++ b/_ml-commons-plugin/cluster-settings.md @@ -59,7 +59,7 @@ plugins.ml_commons.max_ml_task_per_node: 10 ## Set number of ML models per node -Sets the number of ML models that can be loaded on to each ML node. When set to `0`, no ML models can load on any node. +Sets the number of ML models that can be deployed on to each ML node. When set to `0`, no ML models can deploy on any node. ### Setting @@ -74,7 +74,7 @@ plugins.ml_commons.max_model_on_node: 10 ## Set sync job intervals -When returning runtime information with the [profile API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#profile), ML Commons will run a regular job to sync newly loaded or unloaded models on each node. When set to `0`, ML Commons immediately stops sync up jobs. +When returning runtime information with the [profile API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#profile), ML Commons will run a regular job to sync newly deployed or undeployed models on each node. When set to `0`, ML Commons immediately stops sync up jobs. ### Setting @@ -232,3 +232,17 @@ plugins.ml_commons.model_auto_redeploy.lifetime_retry_times: 3 - Default value: 3 - Value range: [0, 100] +## Set auto redeploy success ratio + +Sets the ratio of success for the auto redeployment of a model based on the available ML nodes in the cluster. For example, if ML nodes crash inside a cluster, the auto redeploy protocol adds another node or retires a crashed node. If our ratio is `0.7` and 70% of all ML nodes successfully redeploy the model on auto redeploy activation, the redeployment is a success. If the model redeploys on less the 70% of available ML nodes, the auto redeploy retries until the redeployment succeeds or OpenSearch reaches [the maximum number of retries](#set-retires-for-auto-redeploy). + +### Setting + +``` +plugins.ml_commons.model_auto_redeploy_success_ratio: 0.8 +``` + +### Values + +- Default value: 0.8 +- Value range: [0, 1] \ No newline at end of file From 7f58d1e306702fb91ed59da5c4b263a8c98a8e03 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Tue, 25 Apr 2023 12:43:35 -0500 Subject: [PATCH 07/16] Add more technical feedback Signed-off-by: Naarcha-AWS --- _ml-commons-plugin/api.md | 45 ++++----------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index bef374e680..85468e7714 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -266,7 +266,7 @@ POST /_plugins/_ml/models/_undeploy } ``` -### Response: undeploy all models from specific nodes +### Response: Undeploy all models from specific nodes ```json { @@ -279,7 +279,7 @@ POST /_plugins/_ml/models/_undeploy } ``` -### Example: undeploy specific models from all nodes +### Example: Undeploy specific models from all nodes ```json { @@ -287,7 +287,7 @@ POST /_plugins/_ml/models/_undeploy } ``` -### Response: undeploy specific models from all nodes +### Response: Undeploy specific models from all nodes ```json { @@ -390,7 +390,7 @@ POST /_plugins/_ml/models/_search ## Delete model -Deletes a model based on the model_id +Deletes a model based on the `model_id`. ```json DELETE /_plugins/_ml/models/ @@ -494,43 +494,6 @@ GET /_plugins/_ml/profile } ``` -### Example: Return auto deploy and node information - -When the [auto redeploy]({{site.url}}{{site.baseurl}}/ml-commons-plugin/cluster-settings#enable-auto-redeploy) cluster setting is set to `true`, the profile API returns additional deployment information, including deployment time, retry count, and worker node IDs where the model is deployed. - -```json -{ - "name": "all-mpnet-base-v2", - "algorithm": "TEXT_EMBEDDING", - "model_version": "1", - "model_format": "TORCH_SCRIPT", - "model_state": "DEPLOYED", - "model_content_size_in_bytes": 404999545, - "model_content_hash_value": "fe72818b76a91e154776e4737b1fb0db255c091e8123117ad8758d9f7be6e594", - "model_config": { - "model_type": "bert", - "embedding_dimension": 768, - "framework_type": "SENTENCE_TRANSFORMERS" - }, - "created_time": 1681642820665, - "last_updated_time": 1681646576370, - "last_registered_time": 1681642837416, - "last_deployed_time": 1681646576370, - "auto_redeploy_retry_times": 0, - "total_chunks": 41, - "planning_worker_node_count": 6, - "current_worker_node_count": 6, - "planning_worker_nodes": [ - "Liz28BgFTo--u0ZXVtmOaQ", - "jPPe_s9vQq-cKgZrn6hN-w", - "gN8IFfxdT4mnPdc6WW9ung", - "lCUgCEiASWKfRNTYoKo9Ng", - "ZCBneXv6SG2VdHQvLAnEUg", - "F483VPEbQlaQoEW_F2H-gQ" - ] -} -``` - ## Predict From d40ad63b74e0914b7395ffab2ffe7a65359b7281 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Wed, 26 Apr 2023 09:26:53 -0500 Subject: [PATCH 08/16] Apply suggestions from code review Co-authored-by: Chris Moore <107723039+cwillum@users.noreply.github.com> Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 85468e7714..3936f3cc82 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -166,7 +166,7 @@ OpenSearch responds with the `task_id` and task `status`. } ``` -To see the status of your model registation, enter the `task_id` into the [task API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#get-task-information). Use the `model_id` from the task response once the registration is complete. For example: +To see the status of your model registation, enter the `task_id` in the [task API] ... ```json { From 90e8bb5bf5637f4d0f09d088d2d354364fcfafa4 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Wed, 26 Apr 2023 09:28:17 -0500 Subject: [PATCH 09/16] Update cluster-settings.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/cluster-settings.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_ml-commons-plugin/cluster-settings.md b/_ml-commons-plugin/cluster-settings.md index 4c9aa10217..d2431607f6 100644 --- a/_ml-commons-plugin/cluster-settings.md +++ b/_ml-commons-plugin/cluster-settings.md @@ -219,7 +219,7 @@ plugins.ml_commons.model_auto_redeploy.enable: false ## Set retires for auto redeploy -Sets the limit for the number of times a deployed or partially deployed model will try and redeploy upon cluster failure. +Sets the limit for the number of times a deployed or partially deployed model will try and redeploy when ML nodes in a cluster fail or new ML nodes join the cluster. ### Setting @@ -245,4 +245,4 @@ plugins.ml_commons.model_auto_redeploy_success_ratio: 0.8 ### Values - Default value: 0.8 -- Value range: [0, 1] \ No newline at end of file +- Value range: [0, 1] From ced1a8e399abc9d88eee7300a9946ca9fbf05d83 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Wed, 26 Apr 2023 11:38:10 -0500 Subject: [PATCH 10/16] Update _ml-commons-plugin/api.md Co-authored-by: Nathan Bower Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 3936f3cc82..855888ec0e 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -166,7 +166,7 @@ OpenSearch responds with the `task_id` and task `status`. } ``` -To see the status of your model registation, enter the `task_id` in the [task API] ... +To see the status of your model registration, enter the `task_id` in the [task API] ... ```json { From 75136073913c3e7e10ab018da74e1020d1f7b171 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Wed, 26 Apr 2023 11:40:07 -0500 Subject: [PATCH 11/16] Update _ml-commons-plugin/api.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 855888ec0e..6a320f295d 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -217,7 +217,7 @@ POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_deploy } ``` -## Undeploy a model +## Undeploying a model To undeploy a model from memory, use the undeploy operation. From ed8e832a9be309af718bb3513c8c21cfd892aa40 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Wed, 26 Apr 2023 11:44:19 -0500 Subject: [PATCH 12/16] Apply suggestions from code review Co-authored-by: Nathan Bower Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/api.md | 16 ++++++++-------- _ml-commons-plugin/cluster-settings.md | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 6a320f295d..c0a8a16c57 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -183,23 +183,23 @@ To see the status of your model registration, enter the `task_id` in the [task A ## Deploy model -The deploy model operation reads the model's chunks from the model index, then creates an instance of the model to cache into memory. This operation requires the `model_id`. +The deploy model operation reads the model's chunks from the model index and then creates an instance of the model to cache into memory. This operation requires the `model_id`. ```json POST /_plugins/_ml/models//_deploy ``` -### Example: Deploy into all available ML nodes +### Example: Deploy to all available ML nodes -In this example request, OpenSearch deploys the model into any available OpenSearch ML node: +In this example request, OpenSearch deploys the model to any available OpenSearch ML node: ```json POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_deploy ``` -### Example: Deploy into a specific node +### Example: Deploy to a specific node -If you want to reserve the memory of other ML nodes within your cluster, you can deploy your model into a specific node(s) by specifying the `node_ids` in the request body: +If you want to reserve the memory of other ML nodes within your cluster, you can deploy your model to a specific node(s) by specifying the `node_ids` in the request body: ```json POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_deploy @@ -219,13 +219,13 @@ POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_deploy ## Undeploying a model -To undeploy a model from memory, use the undeploy operation. +To undeploy a model from memory, use the undeploy operation: ```json POST /_plugins/_ml/models//_undeploy ``` -### Example: Undeploy model from all ML nodes +### Example: Undeploying model from all ML nodes ```json POST /_plugins/_ml/models/MGqJhYMBbbh0ushjm8p_/_undeploy @@ -254,7 +254,7 @@ POST /_plugins/_ml/models/_undeploy ``` -### Response: Undeploy specific models from specific nodes +### Response: Undeploying specific models from specific nodes ```json { diff --git a/_ml-commons-plugin/cluster-settings.md b/_ml-commons-plugin/cluster-settings.md index d2431607f6..31f0abc559 100644 --- a/_ml-commons-plugin/cluster-settings.md +++ b/_ml-commons-plugin/cluster-settings.md @@ -59,7 +59,7 @@ plugins.ml_commons.max_ml_task_per_node: 10 ## Set number of ML models per node -Sets the number of ML models that can be deployed on to each ML node. When set to `0`, no ML models can deploy on any node. +Sets the number of ML models that can be deployed to each ML node. When set to `0`, no ML models can deploy on any node. ### Setting @@ -74,7 +74,7 @@ plugins.ml_commons.max_model_on_node: 10 ## Set sync job intervals -When returning runtime information with the [profile API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#profile), ML Commons will run a regular job to sync newly deployed or undeployed models on each node. When set to `0`, ML Commons immediately stops sync up jobs. +When returning runtime information with the [Profile API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#profile), ML Commons will run a regular job to sync newly deployed or undeployed models on each node. When set to `0`, ML Commons immediately stops sync-up jobs. ### Setting @@ -189,7 +189,7 @@ plugins.ml_commons.native_memory_threshold: 90 ## Allow custom deployment plans -When enabled, grants users the ability to deploy models to specific ML nodes according to that user's permissions. +When enabled, this setting grants users the ability to deploy models to specific ML nodes according to that user's permissions. ### Setting @@ -204,7 +204,7 @@ plugins.ml_commons.allow_custom_deployment_plan: false ## Enable auto redeploy -Automatically redeploys deployed or partially deployed models upon cluster failure. If all ML nodes inside a cluster crash, the model switches to the `DEPLOYED_FAILED` state, and the model must be deployed manually. +This setting automatically redeploys deployed or partially deployed models upon cluster failure. If all ML nodes inside a cluster crash, the model switches to the `DEPLOYED_FAILED` state, and the model must be deployed manually. ### Setting @@ -219,7 +219,7 @@ plugins.ml_commons.model_auto_redeploy.enable: false ## Set retires for auto redeploy -Sets the limit for the number of times a deployed or partially deployed model will try and redeploy when ML nodes in a cluster fail or new ML nodes join the cluster. +This setting sets the limit for the number of times a deployed or partially deployed model will try and redeploy when ML nodes in a cluster fail or new ML nodes join the cluster. ### Setting @@ -234,7 +234,7 @@ plugins.ml_commons.model_auto_redeploy.lifetime_retry_times: 3 ## Set auto redeploy success ratio -Sets the ratio of success for the auto redeployment of a model based on the available ML nodes in the cluster. For example, if ML nodes crash inside a cluster, the auto redeploy protocol adds another node or retires a crashed node. If our ratio is `0.7` and 70% of all ML nodes successfully redeploy the model on auto redeploy activation, the redeployment is a success. If the model redeploys on less the 70% of available ML nodes, the auto redeploy retries until the redeployment succeeds or OpenSearch reaches [the maximum number of retries](#set-retires-for-auto-redeploy). +This setting sets the ratio of success for the auto-redeployment of a model based on the available ML nodes in a cluster. For example, if ML nodes crash inside a cluster, the auto redeploy protocol adds another node or retires a crashed node. If the ratio is `0.7` and 70% of all ML nodes successfully redeploy the model on auto-redeploy activation, the redeployment is a success. If the model redeploys on fewer than 70% of available ML nodes, the auto-redeploy retries until the redeployment succeeds or OpenSearch reaches [the maximum number of retries](#set-retires-for-auto-redeploy). ### Setting From bfa20f7ca0eb756c2dffd2bd215d9c1673b74224 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Wed, 26 Apr 2023 11:47:39 -0500 Subject: [PATCH 13/16] Update _ml-commons-plugin/api.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index c0a8a16c57..ccb1ac4369 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -243,7 +243,7 @@ POST /_plugins/_ml/models/MGqJhYMBbbh0ushjm8p_/_undeploy } ``` -### Example: Undeploy specific models from specific nodes +### Example: Undeploying specific models from specific nodes ```json POST /_plugins/_ml/models/_undeploy From 26b2efce86a0b85a3afecf7cfb4f71922e99a241 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Wed, 26 Apr 2023 11:48:39 -0500 Subject: [PATCH 14/16] Update _ml-commons-plugin/api.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index ccb1ac4369..9dd00a6e71 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -231,7 +231,7 @@ POST /_plugins/_ml/models//_undeploy POST /_plugins/_ml/models/MGqJhYMBbbh0ushjm8p_/_undeploy ``` -### Response: Undeploy model from all ML nodes +### Response: Undeploying a model from all ML nodes ```json { From bc7cf6deda51afb1493ff1b36283b35925c24769 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Wed, 26 Apr 2023 11:48:59 -0500 Subject: [PATCH 15/16] Update _ml-commons-plugin/api.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index 9dd00a6e71..f211a76c50 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -279,7 +279,7 @@ POST /_plugins/_ml/models/_undeploy } ``` -### Example: Undeploy specific models from all nodes +### Example: Undeploying specific models from all nodes ```json { From 8fec9e03407800a51fa696eea2e90499dc581f6e Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Mon, 1 May 2023 08:15:10 -0500 Subject: [PATCH 16/16] Update api.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- _ml-commons-plugin/api.md | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/_ml-commons-plugin/api.md b/_ml-commons-plugin/api.md index f211a76c50..163c726f36 100644 --- a/_ml-commons-plugin/api.md +++ b/_ml-commons-plugin/api.md @@ -24,7 +24,7 @@ In order to train tasks through the API, three inputs are required. - Model hyper parameters: Adjust these parameters to make the model train better. - Input data: The data input that trains the ML model, or applies the ML models to predictions. You can input data in two ways, query against your index or use data frame. -## Train model +## Training a model Training can occur both synchronously and asynchronously. @@ -96,7 +96,7 @@ For asynchronous responses, the API returns the task_id, which can be used to ge } ``` -## Get model information +## Getting model information You can retrieve information on your model using the model_id. @@ -115,9 +115,9 @@ The API returns information on the model, the algorithm used, and the content fo } ``` -## Register a model +## Registering a model -Use the Register operation to register a custom model to a model index. ML Commons splits the model into smaller chunks and saves those chunks in the model's index. +Use the register operation to register a custom model to a model index. ML Commons splits the model into smaller chunks and saves those chunks in the model's index. ```json POST /_plugins/_ml/models/_register @@ -181,7 +181,7 @@ To see the status of your model registration, enter the `task_id` in the [task A } ``` -## Deploy model +## Deploying a model The deploy model operation reads the model's chunks from the model index and then creates an instance of the model to cache into memory. This operation requires the `model_id`. @@ -189,7 +189,7 @@ The deploy model operation reads the model's chunks from the model index and the POST /_plugins/_ml/models//_deploy ``` -### Example: Deploy to all available ML nodes +### Example: Deploying to all available ML nodes In this example request, OpenSearch deploys the model to any available OpenSearch ML node: @@ -197,7 +197,7 @@ In this example request, OpenSearch deploys the model to any available OpenSearc POST /_plugins/_ml/models/WWQI44MBbzI2oUKAvNUt/_deploy ``` -### Example: Deploy to a specific node +### Example: Deploying to a specific node If you want to reserve the memory of other ML nodes within your cluster, you can deploy your model to a specific node(s) by specifying the `node_ids` in the request body: @@ -266,7 +266,7 @@ POST /_plugins/_ml/models/_undeploy } ``` -### Response: Undeploy all models from specific nodes +### Response: Undeploying all models from specific nodes ```json { @@ -287,7 +287,7 @@ POST /_plugins/_ml/models/_undeploy } ``` -### Response: Undeploy specific models from all nodes +### Response: Undeploying specific models from all nodes ```json { @@ -299,7 +299,7 @@ POST /_plugins/_ml/models/_undeploy } ``` -## Search model +## Searching for a model Use this command to search models you've already created. @@ -309,7 +309,7 @@ POST /_plugins/_ml/models/_search {query} ``` -### Example: Query all models +### Example: Querying all models ```json POST /_plugins/_ml/models/_search @@ -321,7 +321,7 @@ POST /_plugins/_ml/models/_search } ``` -### Example: Query models with algorithm "FIT_RCF" +### Example: Querying models with algorithm "FIT_RCF" ```json POST /_plugins/_ml/models/_search @@ -388,7 +388,7 @@ POST /_plugins/_ml/models/_search } ``` -## Delete model +## Deleting a model Deletes a model based on the `model_id`. @@ -414,9 +414,9 @@ The API returns the following: } ``` -## Profile +## Returning model profile information -Returns runtime information on ML tasks and models. This operation can help debug issues with models at runtime. +The profile operation returns runtime information on ML tasks and models. The profile operation can help debug issues with models at runtime. ```json @@ -444,7 +444,7 @@ task_ids | string | Returns runtime data for a specific task. You can string tog return_all_tasks | boolean | Determines whether or not a request returns all tasks. When set to `false` task profiles are left out of the response. return_all_models | boolean | Determines whether or not a profile request returns all models. When set to `false` model profiles are left out of the response. -### Example: Return all tasks and models on a specific node +### Example: Returning all tasks and models on a specific node ```json GET /_plugins/_ml/profile @@ -455,7 +455,7 @@ GET /_plugins/_ml/profile } ``` -### Response: Return all tasks and models on a specific node +### Response: Returning all tasks and models on a specific node ```json { @@ -790,7 +790,7 @@ POST /_plugins/_ml/_train_predict/kmeans } ``` -## Get task information +## Getting task information You can retrieve information about a task using the task_id. @@ -814,7 +814,7 @@ The response includes information about the task. } ``` -## Search task +## Searching for a task Search tasks based on parameters indicated in the request body. @@ -905,7 +905,7 @@ GET /_plugins/_ml/tasks/_search } ``` -## Delete task +## Deleting a task Delete a task based on the task_id.