Elastic Algorithm Service (EAS) of Machine Learning Platform for AI allows you to deploy trained models as RESTful APIs regardless of the training method. In the Machine Learning Platform for AI console, you can upload and deploy models on the Elastic Algorithm Service page, and deploy models in Machine Learning Studio, in Data Science Workshop (DSW), and on on-premises clients. This topic describes these deployment methods.

Prerequisites

A trained model is obtained.

Background information

EAS allows you to use the following methods to deploy models regardless of the training method:
  • Upload and deploy models in the console

    To deploy a trained model that is stored on the premises, in Object Storage Service (OSS), or on the Internet, you can upload and deploy the model as an online model service on the Elastic Algorithm Service page.

  • Use Machine Learning Studio to deploy models

    To deploy a model that is trained in Machine Learning Studio, you can deploy the model as an online model service by choosing Deploy > Online Model Service on the top of the canvas of the model.

  • Use the EASCMD client to deploy models

    You can use the EASCMD client to create, view, modify, and delete online model services on your server.

  • Use DSW to deploy models

    DSW has the built-in EASCMD client, which allows you to directly deploy trained models as online model services.

Upload and deploy models in the console

On the Elastic Algorithm Service page, you can upload trained models and deploy them as online model services.

  1. Go to the Elastic Algorithm Service page.
    1. Log on to the Machine Learning Platform for AI console.
    2. In the left-side navigation pane, choose Model Deployment > EAS-Model Serving.
  2. On the Elastic Algorithm Service page, click Model Deploy.
  3. In the Model Configuration step of the panel that appears, set the parameters.
    Section Parameter Description
    Resource Group Resource Group Type You can deploy models by using shared resource groups or the dedicated resource groups that you have purchased.
    Model Processor Type

    If you select Public Resource Group for the Resource Group Type parameter, you can set the Processor Type parameter to a built-in processor except for Blade. For more information, see Built-in processors. Custom processors are not supported.

    If you select a dedicated resource group for the Resource Group Type parameter, all built-in processors and custom processors are supported. For more information about built-in processors, see Built-in processors.

    Resources Type This parameter takes effect only when the Resource Group Type parameter is set to Public Resource Group.
    Processor Language This parameter takes effect only when the Processor Type parameter is set to Self-definition processor. Valid values: Cpp, Java, and python.
    Processor package This parameter takes effect only when the Processor Type parameter is set to Self-definition processor. You can set this parameter in one of the following ways:
    • In the Processor package field, enter a public URL.
    • Click Upload Local Files below the Processor package field and upload a downloaded processor package as prompted.

      The package is uploaded to the OSS path in the current region and the Processor package parameter is automatically set.

      Note If you upload an on-premises processor package, the loading speed of the processor can be improved during model deployment.
    Processor Master File This parameter takes effect only when the Processor Type parameter is set to Self-definition processor. The main file of the custom processor package.
    Model Files You can set this parameter in one of the following ways:
    • Upload Local File
      1. Select Upload Local File.
      2. Click Upload Local Files. Then, upload an on-premises model file as prompted.
    • Import OSS File

      Select Import OSS File. Then, select the OSS path where the model file resides.

    • Download from Internet

      Select Download from Internet. Then, enter a public URL.

  4. Click Next.
  5. In the Deployment details and confirmation step, set the parameters.
    1. Select New Service.
      EAS supports the following deployment modes:
      • New Service: Deploy a new service. In this example, this deployment mode is used.
      • Increase version: Add a new version to an existing model service. The version number of the existing model service increases by one. For more information, see Add a version to an existing service.
      • New blue-green deployment: Deploy an associated service for an existing service. You can configure the traffic allocation between the two services. For more information, see Create a blue-green deployment.
    2. Set the Custom Model Name parameter and other parameters.
      Parameter Description
      Model Deployment take up resources Number Of Instances We recommend that you configure multiple service instances to avoid the risks that are caused by single points of failure.
      Quota This parameter takes effect only when the Resource Group Type parameter is set to Public Resource Group. One quota contains 1 core and 4 GB of memory. Valid values: 1 to 100.
      Cores This parameter takes effect only when the Resource Group Type parameter is set to a dedicated resource group.
      Memory (M) This parameter takes effect only when the Resource Group Type parameter is set to a dedicated resource group.
      Note
      • The CPU, graphics processing units (GPU), and memory resources that you configure for a service instance must belong to the same machine. If the resources are insufficient, the deployment may fail.
      • For formal services that require high stability, we recommend that you use a resource group that contains multiple machines and deploy multiple service instances.
    3. Click Deploy.

Use Machine Learning Studio to deploy models

Machine Learning Studio is a typical visual modeling platform of Machine Learning Platform for AI. You can choose Deploy > Online Model Service on the top of the canvas to deploy the trained models to EAS. For more information, see Create experiments based on templates.

The algorithms that can be deployed to EAS by using Machine Learning Studio include Gradient Boosting Decision Tree (GBDT) for binary classification, Support Vector Machine (SVM), binary classification with logistic regression, multiclass classification with logistic regression, random forest, k-means, linear regression, GBDT regression, and TensorFlow. The GBDT regression algorithm does not support input data of the INT type. Therefore, make sure that the input of the GBDT algorithm is of the DOUBLE type before deployment.

Use the EASCMD client to deploy models

You can use the EASCMD client to create, view, modify, and delete online model services on your server. For more information about how to download the EASCMD client and complete identity authentication, see Download the EASCMD client and complete user authentication. For more information about how to run commands to use the EASCMD client, see Run commands to use the EASCMD client.
Note When you deploy a model, you must use the AccessKey pair for identity authentication. You can log on to the User Management console to view the AccessKey pair.

Use DSW to deploy models

DSW is an interactive cloud development environment for deep learning. It provides high-performance GPUs and an open interactive programming environment. DSW has the built-in EASCMD client, which allows you to directly deploy trained models to EAS. For more information, see Run commands to use the EASCMD client.
Note When you deploy a model, you must use the AccessKey pair for identity authentication. You can log on to the User Management console to view the AccessKey pair.