我有一个实时 AWS Sagemaker 端点,我们已启用自动缩放功能。 现在我想将其从“ml.t2.xlarge”更新为“ml.t2.2xlarge”,但它显示此错误
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the
UpdateEndpoint operation: The variant(s) "[config1]" must be deregistered as scalable targets with
Application Auto Scaling before they can be removed or have their instance type updated.
我相信我们需要首先使用此链接取消注册自动缩放 https://docs.aws.amazon.com/sagemaker/latest/dg/endpoint-auto-scaling-delete.html
但我怀疑是否会取消我们的应用程序,并且新模型的训练将需要多个小时。我们负担不起,所以请告诉我是否有更好的方法。
最佳答案
您应该可以毫无问题地更新 Endpoint 实例类型,而不会受到可用性影响。当您有有效的自动缩放策略时,基本方法如下所示:
- 创建一个使用新实例类型
ml.t2.2xlarge
的新 EndpointConfig- 请调用
CreateEndpointConfig
执行此操作. - 传入与之前的端点配置相同的值。您也可以指向您所做的相同的
ModelName
。通过重复使用相同的模型,您无需重新训练它或进行任何操作
- 请调用
- Delete the existing autoscaling policy
- 根据您的自动扩缩,您可能需要增加所需的端点数量,以防在执行此操作时需要扩缩。
- 如果您在进行这些 API 调用时遇到流量高峰,并且模型跟不上流量,您的模型可能会面临中断的风险。请记住这一点,并可能提前扩展这种可能性。
- 像之前一样调用
UpdateEndpoint
并指定这个新的EndpointConfigName
- 等待您的端点状态变为
InService
。这应该需要 10-20 分钟。 - Create a new autoscaling policy对于这个新的端点和生产变体
您应该可以在不牺牲可用性的情况下开始使用。
关于amazon-web-services - 更新实时 AWS Sagemaker 自动缩放终端节点实例类型,无需放下它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60429339/