

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 连接到 HyperPod 集群并向集群提交任务
<a name="sagemaker-hyperpod-studio-open"></a>

您可以在 Amazon SageMaker Studio IDE 中的 HyperPod 集群上启动机器学习工作负载。当你在 HyperPod 集群上启动 Studio IDE 时，有一组命令可以帮助你入门。您可以在 Studio IDE 中处理训练脚本、将 Docker 容器用于训练脚本以及向集群提交作业。以下部分介绍如何将集群连接到 Studio IDE。

在 Amazon SageMaker Studio 中，您可以导航到集群中的一个**HyperPod集群**（在 “**计算**” 下），并查看您的集群列表。您可以将集群连接到**操作**下列出的 IDE。

您也可以从选项列表中选择自定义文件系统。有关如何进行此项设置的信息，请参阅[在 Studio HyperPod 中设置](sagemaker-hyperpod-studio-setup.md)。

或者，您也可以使用 AWS CLI创建空间并启动 IDE。为此，请使用以下命令。以下示例为 `{{user-profile-name}}` 创建一个 `Private` `JupyterLab` 空间，并附加 `{{fs-id}}` 适用于 Lustre 的 FSx 文件系统。

1. 使用创建空间[https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/create-space.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/create-space.html) AWS CLI。

   ```
   aws sagemaker create-space \
   --region {{your-region}} \
   --ownership-settings "OwnerUserProfileName={{user-profile-name}}" \
   --space-sharing-settings "SharingType=Private" \
   --space-settings "AppType=JupyterLab,CustomFileSystems=[{FSxLustreFileSystem={FileSystemId={{fs-id}}}}]"
   ```

1. 使用创建应用程序[https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/create-app.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/create-app.html) AWS CLI。

   ```
   aws sagemaker create-app \
   --region {{your-region}} \
   --space-name {{space-name}} \
   --resource-spec '{"ec2InstanceType":"'"{{instance-type}}"'","appEnvironmentArn":"'"{{image-arn}}"'"}'
   ```

打开您的应用程序后，可以直接向连接到的集群提交任务。