Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
apiVersion: sagemaker.amazonaws.com/v1 kind: HyperPodPyTorchJob metadata: labels: app.kubernetes.io/name: HyperPod app.kubernetes.io/managed-by: kustomize name: &jobname xxx annotations: XXX: XXX ...... spec: nprocPerNode: "X" replicaSpecs: - name: 'XXX' replicas: 16 template: spec: nodeSelector: beta.kubernetes.io/instance-type: ml.p5.48xlarge containers: - name: XXX image: XXX imagePullPolicy: Always ports: - containerPort: 8080 # This is the port that HyperPodElasticAgent listens to resources: limits: nvidia.com/gpu: 8 hugepages-2Mi: 5120Mi requests: nvidia.com/gpu: 8 hugepages-2Mi: 5120Mi memory: 32000Mi ...... runPolicy: jobMaxRetryCount: 50 restartPolicy: numRestartBeforeFullJobRestart: 3 evalPeriodSeconds: 21600 maxFullJobRestarts: 1 cleanPodPolicy: "All" logMonitoringConfiguration: - name: "JobStart" logPattern: ".*Experiment configuration.*" # This is the start of the training script expectedStartCutOffInSeconds: 120 # Expected match in the first 2 minutes - name: "JobHangingDetection" logPattern: ".*\\[Epoch 0 Batch \\d+.*'training_loss_step': (\\d+(\\.\\d+)?).*" expectedRecurringFrequencyInSeconds: 300 # If next batch is not printed within 5 minute, consider it hangs. Or if loss is not decimal (e.g. nan) for 2 minutes, mark it hang as well. expectedStartCutOffInSeconds: 600 # Allow 10 minutes of job startup time - name: "NoS3CheckpointingDetection" logPattern: ".*The checkpoint is finalized. All shards is written.*" expectedRecurringFrequencyInSeconds: 600 # If next checkpoint s3 upload doesn't happen within 10 mins, mark it hang. expectedStartCutOffInSeconds: 1800 # Allow 30 minutes for first checkpoint upload - name: "LowThroughputDetection" logPattern: ".*\\[Epoch 0 Batch \\d+.*'samples\\/sec': (\\d+(\\.\\d+)?).*" metricThreshold: 80 # 80 samples/sec operator: "lteq" metricEvaluationDataPoints: 25 # if throughput lower than threshold for 25 datapoints, kill the job
logging.basicConfig(format="%(asctime)s [%(levelname)s] %(name)s: %(message)s", level=logging.INFO, stream=sys.stdout)
| Parameter | Penggunaan |
|---|---|
| cleanPodPolicy | |
| logMonitoringConfiguration | |
| expectedRecurringFrequencyInSeconds | |
| expectedStartCutOffInSeconds | |
| Jika tidak ditentukan, default-nya adalah 1. | |
| faultOnMatch |
apiVersion: sagemaker.amazonaws.com/v1 kind: HyperPodPyTorchJob metadata: labels: kueue.x-k8s.io/queue-name: user-queue # Specify the queue to run the job. name: hyperpodpytorchjob-sample spec: nprocPerNode: "1" runPolicy: cleanPodPolicy: "None" replicaSpecs: - name: pods replicas: 1 spares: 1 # Specify how many spare nodes to reserve. template: spec: containers: - name: XXX image: XXX imagePullPolicy: Always ports: - containerPort: 8080 resources: requests: nvidia.com/gpu: "0" limits: nvidia.com/gpu: "0"
Memantau
apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: hyperpod-training-operator namespace: aws-hyperpod spec: ...... endpoints: - port: 8081 path: /metrics interval: 15s
| Peristiwa | Deskripsi |
|---|---|
export AGENT_CMD="--backend=nccl" exec hyperpodrun --server-host=${AGENT_HOST} --server-port=${AGENT_PORT} \ --tee=3 --log_dir=/tmp/hyperpod \ --nnodes=${NNODES} --nproc-per-node=${NPROC_PER_NODE} \ --pre-train-script=/workspace/echo.sh --pre-train-args='Pre-training script' \ --post-train-script=/workspace/echo.sh --post-train-args='Post-training script' \ /workspace/mnist.py --epochs=1000 ${AGENT_CMD}
runPolicy: jobMaxRetryCount: 10 cleanPodPolicy: "None" logMonitoringConfiguration: - name: "JobStartGracePeriod" # Sample log line: [default0]:2025-06-17 05:51:29,300 [INFO] __main__: Train Epoch: 5 [0/60000 (0%)] loss=0.8470 logPattern: ".*Train Epoch.*" expectedStartCutOffInSeconds: 60 - name: "JobHangingDetection" logPattern: ".*Train Epoch.*" expectedRecurringFrequencyInSeconds: 10 # if the next batch is not printed within 10 seconds
runPolicy: jobMaxRetryCount: 10 cleanPodPolicy: "None" logMonitoringConfiguration: - name: "LossSpikeDetection" logPattern: ".*training_loss_step (\\d+(?:\\.\\d+)?).*" # training_loss_step 5.0 metricThreshold: 2.0 operator: "gt" metricEvaluationDataPoints: 5 # if loss higher than threshold for 5 data points, restart the job
runPolicy: jobMaxRetryCount: 10 cleanPodPolicy: "None" logMonitoringConfiguration: - name: "TFLOPs" logPattern: ".* (.+)TFLOPs.*" # Training model, speed: X TFLOPs... expectedRecurringFrequencyInSeconds: 5 metricThreshold: 100 # if Tflops is less than 100 for 5 data points, restart the job operator: "lt" metricEvaluationDataPoints: 5
runPolicy: jobMaxRetryCount: 10 cleanPodPolicy: "None" logMonitoringConfiguration: - name: "GPU Error" logPattern: ".*RuntimeError.*out of memory.*" faultOnMatch: true