選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

大型模型推論的 SageMaker AI 端點參數

焦點模式
大型模型推論的 SageMaker AI 端點參數 - Amazon SageMaker AI

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

您可以自訂下列參數,以使用 SageMaker AI 促進低延遲大型模型推論 (LMI):

  • 執行個體 (VolumeSizeInGB) 上的 Amazon EBS 磁碟區大小上限 — 如果模型的大小大於 30 GB,而且您使用的執行個體沒有本機磁碟,則應將此參數增加至稍微大於模型的大小。

  • 運作狀態檢查逾時配額 (ContainerStartupHealthCheckTimeoutInSeconds) — 如果您的容器已正確設定,且 CloudWatch 日誌指出運作狀態檢查逾時,您應該增加該配額,讓容器有足夠的時間回應運作狀態檢查。

  • 模型下載逾時配額 (ModelDataDownloadTimeoutInSeconds) — 如果模型的大小大於 40 GB,則應增加該配額,提供足夠的時間將模型從 Amazon S3 下載到執行個體。

以下程式碼片段示範如何以程式化的方式設定上述參數。將範例中的斜體預留位置文字取代為您自己的資訊。

import boto3 aws_region = "aws-region" sagemaker_client = boto3.client('sagemaker', region_name=aws_region) # The name of the endpoint. The name must be unique within an AWS Region in your AWS account. endpoint_name = "endpoint-name" # Create an endpoint config name. endpoint_config_name = "endpoint-config-name" # The name of the model that you want to host. model_name = "the-name-of-your-model" instance_type = "instance-type" sagemaker_client.create_endpoint_config( EndpointConfigName = endpoint_config_name ProductionVariants=[ { "VariantName": "variant1", # The name of the production variant. "ModelName": model_name, "InstanceType": instance_type, # Specify the compute instance type. "InitialInstanceCount": 1, # Number of instances to launch initially. "VolumeSizeInGB": 256, # Specify the size of the Amazon EBS volume. "ModelDataDownloadTimeoutInSeconds": 1800, # Specify the model download timeout in seconds. "ContainerStartupHealthCheckTimeoutInSeconds": 1800, # Specify the health checkup timeout in seconds }, ], ) sagemaker_client.create_endpoint(EndpointName=endpoint_name, EndpointConfigName=endpoint_config_name)

如需 金鑰的詳細資訊ProductionVariants,請參閱 ProductionVariant

如需示範如何使用大型模型實現低延遲推論的範例,請參閱 aws-samples GitHub 儲存庫中 Amazon SageMaker AI 上的生成性 AI 推論範例

隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。