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

Update documentation for automatic remote model deployment #6748

Merged
merged 5 commits into from
Mar 25, 2024

Conversation

Zhangxunmt
Copy link
Contributor

@Zhangxunmt Zhangxunmt commented Mar 20, 2024

Description

Update the Model Deploy API to include the automatic deploy feature for remote models in ML-Commons.

Issues Resolved

Closes #6734

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@hdhalter hdhalter added 4 - Doc review PR: Doc review in progress release-notes PR: Include this PR in the automated release notes v2.13.0 labels Mar 20, 2024
@ylwu-amzn
Copy link
Contributor

ylwu-amzn commented Mar 20, 2024

Add auto deployment to this file https://github.com/opensearch-project/documentation-website/blob/main/_ml-commons-plugin/remote-models/index.md#step-4-deploy-the-model

Step 4: Deploy the model

From 2.13, we support automatically deploy remote model by default. You can disable it by setting plugins.ml_commons.model_auto_deploy.enable as false

PUT /_cluster/settings
{
    "persistent" : {
        "plugins.ml_commons.model_auto_deploy.enable" : false 
  }
}

To deploy the registered model manually, provide its model ID from step 3 in the following request:

@ylwu-amzn
Copy link
Contributor

@Zhangxunmt add new enable auto deploy settings to this this doc https://github.com/opensearch-project/documentation-website/blob/main/_ml-commons-plugin/cluster-settings.md

Please also check if any other setting missed

@Zhangxunmt
Copy link
Contributor Author

Zhangxunmt commented Mar 21, 2024

Updated accordingly. @ylwu-amzn

@@ -8,7 +8,17 @@ nav_order: 20

# Deploy 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`.
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`. For remote models, by default the model is deployed automatically when it's predicted the first time through the Predict API. You can disable the remote model auto deployment by setting plugins.ml_commons.model_auto_deploy.enable to false. To learn more about remote models, see [Connecting to externally hosted models]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/index).
Copy link
Contributor

Choose a reason for hiding this comment

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

For remote models, by default the model is deployed automatically when it's predicted the first time through the Predict API.

Suggest add version information, we only support this from 2.13

@ylwu-amzn
Copy link
Contributor

ylwu-amzn commented Mar 21, 2024

Updated accordingly. @ylwu-amzn

Have you addressed this comment #6748 (comment)

@hdhalter hdhalter changed the title update documentation for automatic remote model deployment Update documentation for automatic remote model deployment Mar 21, 2024
@kolchfa-aws kolchfa-aws self-assigned this Mar 21, 2024
}
```
{% include copy-curl.html %}

Copy link
Contributor

@ylwu-amzn ylwu-amzn Mar 21, 2024

Choose a reason for hiding this comment

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

Add note that user need to manually undeploy model if they don't need this model

@@ -8,7 +8,17 @@ nav_order: 20

# Deploy 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`.
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`. For remote models, from 2.13 the model is deployed automatically by default when it's predicted the first time through the Predict API. You can disable the remote model auto deployment by setting plugins.ml_commons.model_auto_deploy.enable to false. To learn more about remote models, see [Connecting to externally hosted models]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/index).
Copy link
Collaborator

@kolchfa-aws kolchfa-aws Mar 22, 2024

Choose a reason for hiding this comment

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

Suggested change
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`. For remote models, from 2.13 the model is deployed automatically by default when it's predicted the first time through the Predict API. You can disable the remote model auto deployment by setting plugins.ml_commons.model_auto_deploy.enable to false. To learn more about remote models, see [Connecting to externally hosted models]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/index).
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`.
Starting with OpenSearch version 2.13, [externally hosted models]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/index) are deployed automatically by default when you send a Predict API request for the first time. You can disable the remote model auto deployment by setting `plugins.ml_commons.model_auto_deploy.enable` to `false`:

Copy link
Collaborator

@kolchfa-aws kolchfa-aws left a comment

Choose a reason for hiding this comment

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

Thanks, @Zhangxunmt! A couple of suggestions.

@@ -205,7 +205,18 @@ Take note of the returned `model_id` because you’ll need it to deploy the mode

## Step 4: Deploy the model

To deploy the registered model, provide its model ID from step 3 in the following request:
From 2.13, we support automatically deploy remote model by default so this step can be skipped. You can disable it by setting plugins.ml_commons.model_auto_deploy.enable as false. To undeploy the model, please use the undeploy API to undeploy it.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we remove this step altogether and just add a sentence to the previous step: Starting with OpenSearch version 2.13, externally hosted models are deployed automatically by default when you send a Predict API request for the first time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's keep this step because we still support manual deploy for the sake of BWC.

@Zhangxunmt
Copy link
Contributor Author

@kolchfa-aws updated based on your suggestion. Can you help approve and merge this PR?

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`.
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`.

Starting with OpenSearch version 2.13, [externally hosted models]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/index) are deployed automatically by default when you send a Predict API request for the first time. You can disable the remote model auto deployment by setting `plugins.ml_commons.model_auto_deploy.enable` to `false`:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Starting with OpenSearch version 2.13, [externally hosted models]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/index) are deployed automatically by default when you send a Predict API request for the first time. You can disable the remote model auto deployment by setting `plugins.ml_commons.model_auto_deploy.enable` to `false`:
Starting with OpenSearch version 2.13, [externally hosted models]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/index) are deployed automatically by default when you send a Predict API request for the first time. To disable automatic deployment for an externally hosted model, set `plugins.ml_commons.model_auto_deploy.enable` to `false`:

@@ -205,7 +205,18 @@ Take note of the returned `model_id` because you’ll need it to deploy the mode

## Step 4: Deploy the model

To deploy the registered model, provide its model ID from step 3 in the following request:
Starting with OpenSearch version 2.13, externally hosted models are deployed automatically by default when you send a Predict API request for the first time. You can disable it by setting plugins.ml_commons.model_auto_deploy.enable as false. To undeploy the model, please use the undeploy API to undeploy it.
Copy link
Collaborator

@kolchfa-aws kolchfa-aws Mar 22, 2024

Choose a reason for hiding this comment

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

Suggested change
Starting with OpenSearch version 2.13, externally hosted models are deployed automatically by default when you send a Predict API request for the first time. You can disable it by setting plugins.ml_commons.model_auto_deploy.enable as false. To undeploy the model, please use the undeploy API to undeploy it.
Starting with OpenSearch version 2.13, externally hosted models are deployed automatically by default when you send a Predict API request for the first time. To disable automatic deployment for an externally hosted model, set `plugins.ml_commons.model_auto_deploy.enable` to `false`:

}
```
{% include copy-curl.html %}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
To undeploy the model, use the [Undeploy API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/model-apis/undeploy-model/).

@kolchfa-aws
Copy link
Collaborator

@Zhangxunmt A couple of more suggestions, and I will move the PR to editorial review. After the editorial comments are addressed, we can merge the PR. Thanks!

Signed-off-by: Xun Zhang <[email protected]>
@Zhangxunmt
Copy link
Contributor Author

@Zhangxunmt A couple of more suggestions, and I will move the PR to editorial review. After the editorial comments are addressed, we can merge the PR. Thanks!

Updated accordingly. Please go ahead with the editorial review. @kolchfa-aws

Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

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

@Zhangxunmt @kolchfa-aws Just one minor comment. Thanks!

@@ -8,7 +8,19 @@ nav_order: 20

# Deploy 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`.
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`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"in" instead of "into"?

@kolchfa-aws kolchfa-aws merged commit 88242fa into opensearch-project:main Mar 25, 2024
3 checks passed
@hdhalter hdhalter added 3 - Done Issue is done/complete and removed 4 - Doc review PR: Doc review in progress labels Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Done Issue is done/complete release-notes PR: Include this PR in the automated release notes v2.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] Auto deploy model when predict request comes
5 participants