本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
設定資料輸入通道以使用 Amazon FSx for Lustre
了解如何使用 Amazon FSx for Lustre 做為您的資料來源,藉由縮短資料載入的時間,提高輸送量並加快訓練。
注意
當您使用已啟用 EFA 的執行個體 (例如 P4d 和 P3dn) 時,請務必在安全群組中設定適當的輸入和輸出規則。特別需要開啟這些連接埠,SageMaker AI 才能存取訓練任務中的 Amazon FSx 檔案系統。如需進一步了解,請參閱 Amazon VPC 的檔案系統存取控制。
同步 Amazon S3 和 Amazon FSx for Lustre
若要將您的 Amazon S3 連結至 Amazon FSx for Lustre 並上傳您的訓練資料集,請執行下列動作。
-
準備資料集並上傳至 Amazon S3 儲存貯體。例如,假設訓練資料集和測試資料集的 Amazon S3 路徑格式如下。
s3://amzn-s3-demo-bucket/data/train s3://amzn-s3-demo-bucket/data/test
-
若要建立一個與訓練資料使用的 Amazon S3 儲存貯體連結的 FSx for Lustre 檔案系統,請按照 Amazon FSx for Lustre 使用者指南內的連結您的檔案系統至 Amazon S3 儲存貯體的步驟。請務必新增端點至您的 VPC,以允許 Amazon S3 存取。如需詳細資訊,請參閱建立 Amazon S3 VPC 端點。指定資料儲存庫路徑時,請提供包含您的資料集資料夾的 Amazon S3 儲存貯體 URI。例如,根據步驟 1 中的 S3 路徑範例,資料儲存庫路徑應如下所示。
s3://amzn-s3-demo-bucket/data
-
建立 FSx for Lustre 檔案系統之後,請執行下列命令來檢查組態資訊。
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 訓練任務資料來源的程序。