Configuring storage for SageMaker HyperPod clusters orchestrated by Amazon EKS
Cluster admin needs to configure storage for data scientist users to manage input and output data and storing checkpoints during training on SageMaker HyperPod clusters.
Handling large datasets (input/output data)
-
Data access and management: Data scientists often work with large datasets that are required for training machine learning models. Specifying storage parameters in the job submission allows them to define where these datasets are located (e.g., Amazon S3 buckets, persistent volumes in Kubernetes) and how they are accessed during the job execution.
-
Performance optimization: The efficiency of accessing input data can significantly impact the performance of the training job. By optimizing storage parameters, data scientists can ensure that data is read and written efficiently, reducing I/O bottlenecks.
Storing checkpoints
-
Checkpointing in training: During long-running training jobs, it’s common practice to save checkpoints—intermediate states of the model. This allows data scientists to resume training from a specific point in case of a failure, rather than starting from scratch.
-
Data recovery and experimentation: By specifying the storage location for checkpoints, data scientists can ensure that these checkpoints are securely stored, potentially in a distributed storage system that offers redundancy and high availability. This is crucial for recovering from interruptions and for experimenting with different training strategies.
For a hands-on experience and guidance on how to set up storage for SageMaker HyperPod
cluster orchestrated with Amazon EKS, see the following sections in the Amazon EKS Support in SageMaker HyperPod workshop
Using EFA with Amazon FSx for Lustre
If you mount an Amazon FSx for Lustre file system with the FSx for Lustre CSI driver, HyperPod configures Elastic Fabric Adapter (EFA) for the Lustre client on each node, so that file system traffic uses EFA instead of TCP. You don't need to run the FSx for Lustre EFA configuration scripts from your lifecycle scripts, you don't change your CreateCluster or UpdateCluster request, and you don't change how you create persistent volumes.
This feature requires clusters to run on AMIs released after November 1, 2026.
When a node starts, before it joins your Amazon EKS cluster, HyperPod checks that the instance has an EFA device and that its operating system is supported. If both conditions are met, HyperPod configures EFA for the Lustre client on the node. This happens on every node, whether or not a pod mounts an FSx for Lustre file system.
HyperPod doesn't know which file system the CSI driver mounts later. For this reason, it doesn't check that the file system is EFA enabled or in the node's Availability Zone, and it doesn't test the transfer. If the setup fails, HyperPod reports a warning and the node still joins the cluster.
To ensure that HyperPod can configure EFA, make sure that:
-
The FSx for Lustre CSI driver is installed. Install it as an Amazon EKS add-on. For more information, see Amazon FSx for Lustre CSI driver in the Amazon EKS User Guide. Static provisioning needs no additional IAM role for the driver.
-
The file system is created with EFA enabled and is in the same Availability Zone as the node.
-
The instance type has EFA and supports FSx for Lustre with EFA, and the operating system is supported. Instance types without EFA are not configured and report no warning.
-
The security groups of the file system and of the cluster allow all traffic between them, including EFA traffic.
-
The HyperPod execution role needs no additional IAM permissions.
The following example mounts a file system in a pod with static provisioning. Replace the file system ID, DNS name, and mount name with your own values, which you can find in the Amazon FSx console or by running aws fsx describe-file-systems.
apiVersion: v1 kind: PersistentVolume metadata: name: fsx-pv spec: capacity: storage: 1200Gi volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain storageClassName: "" mountOptions: - flock claimRef: namespace: default name: fsx-pvc csi: driver: fsx.csi.aws.com volumeHandle:fs-12345678a90b01cdevolumeAttributes: dnsname:fs-12345678a90b01cde.fsx.us-west-2.amazonaws.com mountname:1abcdefg--- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: fsx-pvc namespace: default spec: accessModes: - ReadWriteMany storageClassName: "" volumeName: fsx-pv resources: requests: storage: 1200Gi --- apiVersion: v1 kind: Pod metadata: name: fsx-app namespace: default spec: containers: - name: app image: public.ecr.aws/amazonlinux/amazonlinux:2023 command: ["sleep", "infinity"] volumeMounts: - name: fsx mountPath: /data volumes: - name: fsx persistentVolumeClaim: claimName: fsx-pvc
If you set up EFA for FSx for Lustre in your lifecycle scripts, you can remove those steps. HyperPod detects that EFA is already configured and skips its own setup, so it does not override your configuration. The lifecycle script that the console provides when you create a cluster with the quick-create option includes an EFA step for FSx for Lustre.
To verify that EFA is in use, connect to the node (see Accessing SageMaker HyperPod cluster nodes) after a pod has mounted the file system, and run the following commands. An EFA network with status: up, an @efa address in the list, and a Lustre mount mean that the node is set up for EFA and the file system is mounted. The mount source still shows the file system address with @tcp. That is expected, because Lustre chooses the network for each transfer.
sudo lnetctl net show --net efa sudo lctl list_nids findmnt -t lustre
To check that traffic uses EFA, compare the send counters of the efa and tcp networks before and after you read or write a large file in the pod. During a large transfer the efa counter grows much faster than the tcp counter.
sudo lnetctl net show --net efa -v 4 | grep send_count sudo lnetctl net show --net tcp -v 4 | grep send_count
If the EFA setup fails on a node, HyperPod reports a Warn event ("FSx Lustre EFA setup failed" or "FSx Lustre EFA client package missing") and the node still joins the cluster. For more information, see FSx for Lustre EFA events. If the pod mounts the file system but traffic uses TCP, check that the file system is EFA enabled (aws fsx describe-file-systems, EfaEnabled), that it is in the same Availability Zone as the node, and that the security groups allow all traffic between the file system and the cluster. HyperPod does not check these on Amazon EKS.
Create an EFA-enabled file system in the console
When you create a cluster in the SageMaker AI console with Custom setup, the console can create a new FSx for Lustre file system with EFA enabled. In the Storage section, choose Provision a new FSx for Lustre file system, and for Elastic Fabric Adapter (EFA), select Enable EFA. The option isn't available in Regions where FSx for Lustre Persistent 2 file systems aren't offered. Selecting Enable EFA sets Throughput per unit of storage to 1,000 MB/s/TiB, and you can choose a different throughput. On Amazon EKS, Storage capacity is read-only and shows the minimum for the selected throughput: 38.4, 19.2, 9.6, or 4.8 TB for 125, 250, 500, or 1,000 MB/s/TiB. You can't change EFA or the throughput after the file system is created. The console creates the file system in the Availability Zone of the first instance group, so make sure that the instance groups that mount it are in that Availability Zone. If you choose your own security group, it must allow all inbound and outbound traffic from itself. For instructions, see Create an EFA-enabled file system in the console.