本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
配置数据输入通道以使用适用于 Lustre 的 Amazon FSx
了解如何使用适用于 Lustre 的 Amazon FSx 作为数据来源,通过缩短数据加载时间来提高吞吐量和训练速度。
注意
使用诸如 p4d 和 p3dn 之类的 EFA-enabled 实例时,请确保在安全组中设置适当的入站和输出规则。特别是,要让 SageMaker AI 在训练作业中访问 Amazon FSx 文件系统,就必须打开这些端口。要了解更多信息,请参阅使用 Amazon VPC 进行文件系统访问控制。
将 Amazon S3 与适用于 Lustre 的 Amazon FSx 同步
要将您的 Amazon S3 与适用于 Lustre 的 Amazon FSx 关联并上传您的训练数据集,请执行以下操作。
-
准备好您的数据集并上传到 Amazon S3 存储桶。例如,假设训练数据集和测试数据集的 Amazon S3 路径采用以下格式。
s3://amzn-s3-demo-bucket/data/train s3://amzn-s3-demo-bucket/data/test -
要创建与包含训练数据的 Amazon S3 存储桶关联的、适用于 Lustre 的 FSx 文件系统,请完成《适用于 Lustre 的 Amazon FSx 用户指南》中将您的文件系统与 Amazon S3 存储桶关联中的步骤。请务必在您的 VPC 中添加一个允许访问 Amazon S3 的端点。有关更多信息,请参阅 创建 Amazon S3 VPC 端点。指定数据存储库路径时,请提供包含您的数据集的文件夹的 Amazon S3 存储桶 URI。例如,根据步骤 1 中的 S3 路径示例,数据存储库路径应如下所示。
s3://amzn-s3-demo-bucket/data -
创建适用于 Lustre 的 FSx 文件系统后,通过运行以下命令检查配置信息。
aws fsx describe-file-systems && \ aws fsx describe-data-repository-association这些命令返回
FileSystemId、MountName、FileSystemPath和DataRepositoryPath。输出应该类似以下示例。# Output of aws fsx describe-file-systems "FileSystemId": "fs-0123456789abcdef0" "MountName": "1234abcd" # Output of aws fsx describe-data-repository-association "FileSystemPath": "/ns1", "DataRepositoryPath": "s3://amzn-s3-demo-bucket/data/"在 Amazon S3 和 Amazon FSx 之间完成同步后,您的数据集将保存在 Amazon FSx 中的以下目录中。
/ns1/train # synced with s3://amzn-s3-demo-bucket/data/train /ns1/test # synced with s3://amzn-s3-demo-bucket/data/test
将 Amazon FSx 文件系统路径设置为训练的数据输入通道 SageMaker
以下过程将引导您完成将 Amazon FSx 文件系统设置为 SageMaker 训练作业数据源的过程。