

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

# 在 HyperPod 上建立 Slurm 叢集之前驗證 JSON 組態檔案
<a name="sagemaker-hyperpod-lifecycle-best-practices-slurm-slurm-validate-json-files"></a>

若要在提交叢集建立請求之前驗證 JSON 組態檔案，請使用組態驗證指令碼 [https://github.com/aws-samples/awsome-distributed-training/blob/main/1.architectures/5.sagemaker-hyperpod/validate-config.py](https://github.com/aws-samples/awsome-distributed-training/blob/main/1.architectures/5.sagemaker-hyperpod/validate-config.py)。此指令碼會剖析並比較您的 HyperPod 叢集組態 JSON 檔案和 Slurm 組態 JSON 檔案，並識別這兩個檔案之間以及 Amazon EC2、Amazon VPC 和 Amazon FSx 資源之間是否有任何資源組態錯誤。例如，若要從 [HyperPod 提供的基本生命週期指令碼](sagemaker-hyperpod-lifecycle-best-practices-slurm-slurm-base-config.md)一節中驗證 `create_cluster.json` 和 `provisioning_parameters.json` 檔案，請執行驗證指令碼，如下所示。

```
python3 validate-config.py --cluster-config create_cluster.json --provisioning-parameters provisioning_parameters.json
```

以下是成功驗證的範例輸出。

```
✔️  Validated instance group name worker-group-1 is correct ...

✔️  Validated subnet subnet-012345abcdef67890 ...
✔️  Validated security group sg-012345abcdef67890 ingress rules ...
✔️  Validated security group sg-012345abcdef67890 egress rules ...
✔️  Validated FSx Lustre DNS name fs-012345abcdef67890.fsx.us-east-1.amazonaws.com
✔️  Validated FSx Lustre mount name abcdefgh
✅ Cluster Validation succeeded
```