ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

概念

SageMaker hosting: model, endpoint config, endpoint

Three objects host a model: the model, the endpoint configuration and the endpoint.

本课尚未翻译,暂以英文显示。

Image and artifacts
Model
Endpoint config
Endpoint
Application
  1. 1create_model names the container image, the artifacts in S3 and the execution role.
  2. 2create_endpoint_config lists the variants: model, instance type, count and weight.
  3. 3create_endpoint reads the config and starts the instances.
  4. 4The application calls the endpoint through the SageMaker Runtime.
Each object points to the one before it.

分步说明

  1. 1create_model names the container image, the artifacts in S3 and the execution role.
  2. 2create_endpoint_config lists the variants: model, instance type, count and weight.
  3. 3create_endpoint reads the config and starts the instances.
  4. 4The application calls the endpoint through the SageMaker Runtime.

Each object points to the one before it.

  • Boto3

    Create
    create_model, create_endpoint_config, create_endpoint
    Invoke
    sagemaker-runtime invoke_endpoint
  • SageMaker Python SDK

    Create
    One deploy call makes all three
    Invoke
    Call the endpoint object
  • AWS CLI

    Create
    aws sagemaker create-model and the two next calls
    Invoke
    aws sagemaker-runtime invoke-endpoint
Three ways to call the same three steps.

是什么

Hosting a model on Amazon SageMaker AI takes three objects. The model names the container image, the model artifacts in Amazon S3 and the execution role. The endpoint configuration lists one or more production variants: a model, an instance type, an instance count and a traffic weight. The endpoint is the running service built from that configuration.

是什么

You create them in order with create_model, create_endpoint_config and create_endpoint. The SageMaker Python SDK wraps all three in one deploy call. Boto3 and the AWS CLI expose each call. Clients do not get predictions from the SageMaker API. They use the SageMaker Runtime, a separate client: invoke_endpoint in Boto3, or aws sagemaker-runtime invoke-endpoint in the CLI.

是什么

To change a live endpoint, create a new endpoint configuration and call update_endpoint. SageMaker AI starts the new instances, shifts traffic, then removes the old ones, so the endpoint stays in service. Use update_endpoint_weights_and_capacities to change only weights or instance counts. An endpoint configuration cannot be edited after you create it.

要记住

  • Model: image, artifacts in S3, execution role. Endpoint config: variants. Endpoint: the running service.
  • Order: create_model, create_endpoint_config, create_endpoint.
  • Predictions go through SageMaker Runtime invoke_endpoint, not the SageMaker API.
  • A production variant has a model, an instance type, an instance count and a weight.

要记住

  • To update with no downtime, make a new endpoint config and call update_endpoint.
  • Delete the endpoint to stop paying. Its instances bill while it exists.

考试中

  • “Change the instance type of a live endpoint without downtime” points to a new endpoint configuration and update_endpoint.
  • “Send a prediction request from an application” points to the SageMaker Runtime invoke_endpoint call.
  • “Split traffic between two model versions” points to two production variants with weights.