

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# SageMaker API を使用してトレーニングプランで SageMaker HyperPod クラスターを作成する、または AWS CLI
<a name="use-training-plan-for-hyperpod-creation-using-api-cli-sdk"></a>

Amazon SageMaker HyperPod クラスターで SageMaker トレーニングプランを使用するには、[https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateCluster.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateCluster.html) オペレーションを呼び出す際に、[https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ClusterInstanceGroupSpecification.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ClusterInstanceGroupSpecification.html) の [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ClusterInstanceGroupSpecification.html#sagemaker-Type-ClusterInstanceGroupSpecification-TrainingPlanArn](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ClusterInstanceGroupSpecification.html#sagemaker-Type-ClusterInstanceGroupSpecification-TrainingPlanArn) パラメータで使用するトレーニングプランの ARN を指定します。

プランの指定された AZ に関連付けられたサブネットが、クラスターの設定の `VPCConfig` に含まれていることを確認します。[``DescribeTrainingPlan](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeTrainingPlan.html) API コールのレスポンスでトレーニングプランの `AvailabilityZone` を取得できます。

次のサンプルは、新しい SageMaker HyperPod クラスターを作成し、 `create-cluster` AWS CLI コマンドの `--instance-groups` 属性でインスタンスグループにトレーニングプランを提供する方法を示しています。

```
# Create a cluster         
aws sagemaker create-cluster \
  --cluster-name cluster-name \
  --instance-groups '[ \
        { \
            "InstanceCount": 1,\
            "InstanceGroupName": "controller-nodes",\
            "InstanceType": "ml.t3.xlarge",\
            "LifeCycleConfig": {"SourceS3Uri": source_s3_uri, "OnCreate": "on_create.sh"},\
            "ExecutionRole": "arn:aws:iam::customer_account_id:role/execution_role",\
            "ThreadsPerCore": 1,\
        },\
        { \
            "InstanceCount": 2, \
            "InstanceGroupName": "worker-nodes",\
            "InstanceType": "p4d.24xlarge",\
            "LifeCycleConfig": {"SourceS3Uri": source_s3_uri, "OnCreate": "on_create.sh"},\
            "ExecutionRole": "arn:aws:iam::customer_account_id}:role/execution_role}",\
            "ThreadsPerCore": 1,\
            "TrainingPlanArn": training_plan_arn,\
        }]'
```

を使用して HyperPod クラスターを作成する方法については AWS CLI、「」を参照してください[https://docs.aws.amazon.com/cli/latest/reference/sagemaker/create-cluster.html](https://docs.aws.amazon.com/cli/latest/reference/sagemaker/create-cluster.html)。

クラスターを作成したら、`DescribeCluster` API を呼び出して、インスタンスグループにトレーニングプランから適切にキャパシティが割り当てられたことを喧噪できます。

```
aws sagemaker describe-cluster --cluster-name cluster-name
```