Generated banner for Hyperpod Nccl
Generated logo for Hyperpod Nccl

Hyperpod Nccl

AWS LabsOfficialPublished by AWS Labs

  • Skill
  • Review and audit
  • Software development
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Diagnose NCCL failures and adjacent training-pod failures on HyperPod GPU clusters (EKS or Slurm) — training hangs, AllReduce / collective-op timeouts, EFA or libfabric errors, rendezvous failures, EFA TCP fallback, /dev/shm or memlock issues, NCCL version mismatch across pods, container OOM / exit-137 / OOMKilled, GPU OOM (CUDA out of memory), CrashLoopBackOff / Pending pods, MASTER_ADDR DNS, NetworkPolicy blocking. Not for single-node hardware faults (→ hyperpod-node-debugger § G) or cluster-creation EFA / SSM failures (→ hyperpod-cluster-debugger § A / § F).
— the description by AWS Labs

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The hyperpod-nccl skill provides a structured, read-only diagnostic workflow for identifying and resolving NCCL and training-pod failures on SageMaker HyperPod clusters (EKS or Slurm). It uses a diagnostic script to analyze infrastructure state, pod logs, and network configurations, mapping identified issues to specific remediation procedures in the provided documentation. The skill emphasizes safe, non-destructive investigation, requiring user approval for any suggested remediation commands.

What it does

  • Automates the collection of cluster, region, and job-specific diagnostic data.
  • Identifies common NCCL failures including timeouts, rendezvous issues, and EFA errors.
  • Detects pod-level issues such as OOMKilled, container crashes, and DNS resolution failures.
  • Maps detected failures to specific, actionable remediation sections in the documentation.
  • Provides a standardized process for escalating unresolved issues to AWS Support.
  • Supports both EKS and Slurm orchestrators with environment-specific diagnostic checks.

When to use it

  • When training jobs hang or experience collective-op timeouts.
  • When encountering EFA, libfabric, or network-related communication errors.
  • When pods fail to start or enter CrashLoopBackOff states.
  • When investigating GPU-related errors like CUDA out of memory or hardware faults.
  • When troubleshooting rendezvous or NCCL version mismatch issues across pods.

Advantages

  • Provides a systematic, read-only approach to complex distributed training debugging.
  • Reduces manual effort by automatically mapping log patterns to known fixes.
  • Ensures safe operations by requiring user approval for all suggested commands.
  • Integrates with existing HyperPod documentation for consistent troubleshooting.
  • Facilitates efficient escalation to AWS Support with pre-formatted diagnostic bundles.

Usage examples

“Run a diagnostic on my EKS HyperPod cluster named 'my-cluster' in 'us-west-2' for a specific job.”
The agent executes the diagnostic script scoped to the provided cluster, region, and job, outputting a list of findings with references to remediation guides.
“I am seeing NCCL timeouts on my Slurm cluster. How do I investigate?”
The agent guides you to run the diagnostic script with the --orchestrator slurm flag and provides instructions on how to interpret the [FAIL] results using the remediation index.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/awslabs/hyperpod-nccl/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip hyperpod-nccl.zip -d .agents/skills

Documentation by AWS Labs

HyperPod NCCL Debugger

Operating policy. Run read-only diagnostics yourself. Never run a command that changes cluster, node, or workload state — present each one as a Suggested command (run this yourself) block and wait for the customer. Destructive order: investigate → reboot → replace (replace destroys root + secondary volumes; not supported on Slurm controller nodes). Never discard training state on speculation.

Diagnose NCCL failures on SageMaker HyperPod (EKS and Slurm). scripts/nccl-diagnose.sh reads state via AWS APIs, kubectl, and SSM, then prints each issue as [FAIL] ... → references/<file>.md § <section>. Read-only.

Signal sourcing: list-cluster-events carries infrastructure-level state only (lifecycle, bootstrap, EFA health check, capacity, replacement, reboot, AMI rollback). It does not carry NCCL timeouts, GPU XID/ECC, or per-pod training signals — those come from pod logs, CloudWatch training streams, on-node SSM probes, and NCCL env audit. "No events" on a training-time NCCL issue is expected, not a clean bill of health.


Workflow

  1. Collect cluster name, region, namespace/job (EKS), exact NCCL error string.

  2. Run the diagnostic (always — the output drives everything else).

  3. For every [FAIL] line, Read the referenced section.

  4. Present finding, root cause, and the Suggested-command block with concrete values (instance IDs, SG IDs, namespaces) filled in from the script output. Wait for customer approval.

  5. Re-run the diagnostic to confirm.

If a finding has no matching section, report it as a bug — do not invent a fix.

Step 1: Authenticate kubectl (EKS)

EKS_ARN=$(aws sagemaker describe-cluster --cluster-name <HYPERPOD-NAME> --region <REGION> \
  --query 'Orchestrator.Eks.ClusterArn' --output text)
EKS_NAME=$(echo "$EKS_ARN" | awk -F'/' '{print $NF}')
aws eks update-kubeconfig --name "$EKS_NAME" --region <REGION>
kubectl get nodes

Step 2: Run the diagnostic

# Basic:
bash scripts/nccl-diagnose.sh --cluster <HYPERPOD-NAME> --region <REGION>

# Scope to an EKS job/namespace:
bash scripts/nccl-diagnose.sh --cluster <NAME> --region <REGION> --namespace <NS> --job <JOB>

# Force orchestrator:
bash scripts/nccl-diagnose.sh --cluster <NAME> --region <REGION> --orchestrator slurm

# Larger hardware sample (default 3):
bash scripts/nccl-diagnose.sh --cluster <NAME> --region <REGION> --sample-nodes 10

# Specific node only:
bash scripts/nccl-diagnose.sh --cluster <NAME> --region <REGION> --node i-0abc123def456

Tags: [PASS] · [FAIL] (counted in Issues Found, has reference pointer) · [WARN] · [INFO]. Priorities: P0 blocks training · P1 degraded · P2 informational.


Remediation index

Each [FAIL] line in the script already points directly at the right section. This table is a lookup for manual triage.

FindingSection
SG missing inbound/outbound self-referenceoperations.md § 8
Blocking NetworkPolicy / allow-all missingoperations.md § 8
Slurm node DOWN / DRAINING / RemoveIPCoperations.md § 7
GPU XID / SYSTEM_ERROR / hardware faulthyperpod-node-debugger § F / § G
GPU row-remap / DCGM Fail / silent NaNshyperpod-node-debugger § G.1.a/b
NCCL timeout / rendezvous / stragglerdebugging-guide.md § 1
EFA configuration / not useddebugging-guide.md § 6
EFA TCP fallback (NET/OFI Using TCP)debugging-guide.md § 13
NCCL version mismatch across podsdebugging-guide.md § 10
Container OOM (pod killed, exit 137)debugging-guide.md § 4
GPU OOM (CUDA out of memory)debugging-guide.md § 11
RDMA memlock / /dev/shm too smalldebugging-guide.md § 17
MASTER_ADDR DNS / headless Servicedebugging-guide.md § 12
NVLS / PXN / topology tuningdebugging-guide.md § 19
Any NCCL / EFA / rendezvous log patternerror-patterns-quick-ref.md
Performance / nccl-tests / bandwidthperformance-testing.md

Prerequisites

  • aws CLI v2.13+ authenticated (aws sts get-caller-identity)

  • jq, python3, bash 4.2+

  • unbuffer (from the expect package: yum install expect / apt install expect)

  • kubectl authenticated to the EKS cluster (K8s checks skipped if absent)

  • session-manager-plugin for on-node hardware checks

Defaults

  • Region — required: pass --region or set $AWS_DEFAULT_REGION.

  • Orchestrator — auto-detected; override with --orchestrator eks|slurm.

  • Namespace / job (EKS) — all namespaces; scope with --namespace <NS> --job <JOB>.

  • Hardware sampling — 3 nodes over SSM (capped at 50). --node <ID> for a specific node. Node probes run serially (180 s per node): --sample-nodes 10 can take ~30 min.

  • CloudWatch window — last 2 hours.

  • Colors — auto-disabled on non-TTY or TERM=dumb.

Error handling

FailureScriptTell the customer
aws sts get-caller-identity failsExit 1 with the AWS error"Fix AWS credentials and rerun."
describe-cluster AccessDeniedWarn, add Missing IAM for sagemaker:DescribeCluster"Grant sagemaker:DescribeCluster (operations.md § 2)."
Cluster not foundExit 1 after listing region's clusters"Confirm HyperPod cluster name and region."
kubectl absent / unauthenticatedWarn, skip K8s checks"aws eks update-kubeconfig --name <EKS> --region <R>."
SSM plugin absentWarn, skip on-node hardware checks"Install session-manager-plugin."
SSM times out (180s)Partial output, mark node unreachable"Rerun with --node <ID> --sample-nodes 1; check SSM agent on the node."
CloudWatch log group not foundSkip CloudWatch scan"Enable CloudWatch on the cluster (operations.md § 4)."
Cluster events API throttledWarn, continue with partial data"Rerun later — script is idempotent."

Exit codes: 0 diagnostic complete · 1 fatal prerequisite missing or cluster unreachable.

IAM permissions

Full policy + RBAC in operations.md § 2. SSM on HyperPod uses start-session against sagemaker-cluster:<cluster-id>_<group>-<iid> targets — grant ssm:StartSession / ssm:TerminateSession, not ssm:SendCommand.

Scale strategy

ScopeMethodCoverage
All nodessagemaker:ListClusterNodes (paginated)100% nodes
All K8s objectskubectl100% pods/nodes/policies
HardwareSSM --sample-nodes N (default 3)Sampled
Node logsCloudWatch100% nodes

Large clusters: the PyTorch NCCL backend defaults to a 10-minute collective-op timeout (per the PyTorch distributed docs). Large clusters routinely exceed that on first rendezvous; raise it via torch.distributed.init_process_group(timeout=timedelta(seconds=<N>)). HyperPod support has also observed NCCL topology-graph-search hangs on 256+ node clusters when memlock is unlimited; using a large fixed memlock (e.g. 8388608) in pod securityContext or /etc/security/limits.conf has cleared these in field cases. This memlock pattern is a field observation, not AWS- or NCCL-documented behavior.

For FSDP, DeepSpeed, or Megatron-LM tuning: debugging-guide.md § 18.

Skill delegation

NeedUse
Cluster creation / deployment failureshyperpod-cluster-debugger (§ A / B / C / H + --validate)
Post-deployment cluster-wide managementhyperpod-cluster-debugger
Per-node issues (disk, lifecycle, hardware)hyperpod-node-debugger
Trainium/Inferentia collective-comm (AWS Neuron Collectives, not NCCL)hyperpod-node-debugger § G.2
Shell on nodeshyperpod-ssm
Version comparison across nodeshyperpod-version-checker
Diagnostic bundle for AWS Supporthyperpod-issue-report
MFU / performance degradationhyperpod-mfu-debugger

Escalate to AWS Support

Escalate when:

  1. All SG rules correct, EFA verified on-node, but NCCL still times out.

  2. Hardware checks pass on all nodes but AllReduce still hangs.

  3. Issues Found: 0 but training still fails.

  4. GPU XID errors persist after node replacement.

  5. Collective-op timeout raised and memlock workaround applied but large-cluster rendezvous still hangs.

Before opening the case
# 1. Cluster identity + status
aws sagemaker describe-cluster --cluster-name <C> --region <R>

# 2. Full NCCL diagnostic (sample more nodes for escalation)
bash scripts/nccl-diagnose.sh --cluster <C> --region <R> --sample-nodes 10 > nccl-diag.txt

# 3. Per-node log/config bundle to S3 (delegates to hyperpod-issue-report)
#    See skills/hyperpod-issue-report/SKILL.md for the exact invocation.
Include in the case
  • Cluster name + ARN and AWS region

  • Orchestrator (EKS or Slurm) and EKS cluster name / Slurm controller node

  • Timestamp window (UTC start / end) of the failure

  • Exact NCCL / libfabric error strings (copy verbatim from pod logs or journalctl)

  • Affected instance IDs / node names / pod names / namespace / job name

  • nccl-diag.txt from step 2 above

  • S3 URI of the hyperpod-issue-report bundle from step 3

  • NCCL env vars in effect (printenv | grep -E '^NCCL|^FI_|^TORCH_' from one pod)

References

Files

references/operations.md

NCCL Operations Reference

Operational procedures and lookup tables for the NCCL skill.


1. Getting cluster names

The HyperPod cluster name ≠ the EKS cluster name.

# List HyperPod clusters:
aws sagemaker list-clusters --region <REGION> \
  --query 'ClusterSummaries[*].[ClusterName,ClusterStatus,CreationTime]' --output table

# EKS cluster behind a HyperPod cluster:
EKS_ARN=$(aws sagemaker describe-cluster \
  --cluster-name <HYPERPOD-NAME> --region <REGION> \
  --query 'Orchestrator.Eks.ClusterArn' --output text)
EKS_NAME=$(echo $EKS_ARN | awk -F'/' '{print $NF}')

aws eks update-kubeconfig --name $EKS_NAME --region <REGION>

2. IAM

Read-only diagnostic
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "NCCLSkillReadOnly",
    "Effect": "Allow",
    "Action": [
      "sagemaker:DescribeCluster",
      "sagemaker:ListClusters",
      "sagemaker:ListClusterNodes",
      "sagemaker:ListClusterEvents",
      "ec2:DescribeSecurityGroups",
      "ec2:DescribeVpcs",
      "ec2:DescribeSubnets",
      "ec2:DescribeInstances",
      "logs:DescribeLogGroups",
      "logs:DescribeLogStreams",
      "logs:FilterLogEvents",
      "logs:GetLogEvents",
      "ssm:StartSession",
      "ssm:DescribeSessions",
      "ssm:TerminateSession"
    ],
    "Resource": "*"
  }]
}
Per-remediation permissions

Granted only if the operator applies the suggested fix:

Suggested commandRequired action
aws ec2 authorize-security-group-{ingress,egress}ec2:AuthorizeSecurityGroupIngress / Egress
aws sagemaker batch-reboot-cluster-nodessagemaker:BatchRebootClusterNodes
aws sagemaker batch-replace-cluster-nodessagemaker:BatchReplaceClusterNodes
aws eks update-kubeconfigeks:DescribeCluster
kubectl delete/create networkpolicyEKS access entry + RBAC on networkpolicies
kubectl RBAC (EKS read — write only if operator applies a fix)
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: nccl-skill-read
rules:
- apiGroups: [""]
  resources: ["nodes", "pods", "pods/log", "namespaces", "services"]
  verbs: ["get", "list", "watch"]
- apiGroups: [""]
  resources: ["pods/exec"]
  verbs: ["create"]
- apiGroups: ["networking.k8s.io"]
  resources: ["networkpolicies"]
  verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
  resources: ["daemonsets"]
  verbs: ["get", "list"]
- apiGroups: ["batch"]
  resources: ["jobs"]
  verbs: ["get", "list"]

If the operator deletes/creates a NetworkPolicy, grant delete/create on networkpolicies scoped to the training namespace.


3. SSM target format (HyperPod)

sagemaker-cluster:<CLUSTER_ID>_<INSTANCE_GROUP>-<INSTANCE_ID>

CLUSTER_ID is the ARN suffix — not the cluster name. Full connect procedure is in the node-debugger skill (references/node-diagnostics-detail.md § K). send-command against a bare instance ID will fail with ValidationException — HyperPod's managed fleet requires start-session with the prefixed target.


4. CloudWatch — NCCL log collection

NCCL logs are not collected by HyperPod by default. Add this to the lifecycle script so logs ship to the same log group as lifecycle/health-monitoring logs:

# Amazon Linux: yum install -y amazon-cloudwatch-agent
# Ubuntu:       apt-get install -y amazon-cloudwatch-agent

cat > /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json <<'EOF'
{
  "logs": {
    "logs_collected": {
      "files": {
        "collect_list": [
          {"file_path": "/var/log/nccl.log",
           "log_group_name": "/aws/sagemaker/Clusters/${CLUSTER_NAME}/${CLUSTER_ID}",
           "log_stream_name": "{instance_id}/nccl"},
          {"file_path": "/var/log/training/*.log",
           "log_group_name": "/aws/sagemaker/Clusters/${CLUSTER_NAME}/${CLUSTER_ID}",
           "log_stream_name": "{instance_id}/training"}
        ]
      }
    }
  }
}
EOF

/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
  -a fetch-config -m ec2 \
  -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s
Query NCCL errors
CLUSTER_ID=$(aws sagemaker describe-cluster --cluster-name <NAME> --region <R> \
  --query 'ClusterArn' --output text | awk -F'/' '{print $NF}')

aws logs filter-log-events \
  --log-group-name "/aws/sagemaker/Clusters/<NAME>/${CLUSTER_ID}" \
  --filter-pattern '"NCCL WARN"' \
  --start-time $(($(date +%s) - 7200))000 \
  --region <R> \
  --query 'events[*].[timestamp,logStreamName,message]' --output table

5. NCCL environment variable reference

Required
VariableValuePurpose
MASTER_ADDRIP or hostname of rank-0 podRendezvous endpoint
MASTER_PORT29500Rendezvous port
WORLD_SIZEpods × GPUs_per_podTotal process count
RANK0 to WORLD_SIZE-1Global rank
LOCAL_RANK0 to GPUs_per_pod-1Local rank
EFA (p4d / p5 / p3dn)
VariableValuePurpose
NCCL_SOCKET_IFNAME^lo,docker,efa,veth,virbrExclude non-VPC interfaces
FI_PROVIDERefaUse EFA libfabric provider
FI_EFA_USE_DEVICE_RDMA1Enable EFA RDMA (required for full bw)
FI_EFA_FORK_SAFE1Required with Python multiprocessing
NCCL_NET_PLUGIN/opt/amazon/ofi-nccl/lib/libnccl-net.soExplicit OFI plugin path
Collective-op timeout (PyTorch)

NCCL_TIMEOUT is not a standard NCCL or PyTorch env var — some launchers (DeepSpeed, AWS samples) wrap it, but setting it alone has no effect in pure PyTorch. Control the collective timeout via init_process_group and the TORCH_* env vars:

# In training code — replaces any NCCL_TIMEOUT env var:
import datetime, torch.distributed as dist
dist.init_process_group("nccl", timeout=datetime.timedelta(seconds=1800))
# Surfaces hangs as Python exceptions instead of silent waits:
export TORCH_NCCL_ASYNC_ERROR_HANDLING=1
export TORCH_NCCL_BLOCKING_WAIT=1   # debug only — has perf cost at scale
Performance tuning
VariableValuePurpose
NCCL_DEBUGWARNProduction-safe logging. INFO / TRACE add runtime overhead; enable only for debug
NCCL_BUFFSIZEbytes (power-of-2)Collective-op buffer size. NCCL default is 4194304 (4 MiB). Tune only after baseline measurement, and align to the NCCL user guide recommendations
NCCL_P2P_LEVELNVL / PIX / otherNVL = P2P only over NVLink; PIX = same PCI switch. See the NCCL user guide for the full LOC/NVL/PIX/PXB/PHB/SYS ladder
TORCH_DISTRIBUTED_DEBUGDETAILPyTorch detailed distributed debug (dev only)
NCCL_CUMEM_HOST_ENABLE0 / 1Default flipped to 1 in NCCL 2.24 when CUDA driver ≥ 12.6 and runtime ≥ 12.2; set 0 to work around NUMA cuMem issues on older stacks
NCCL_IB_DISABLE1Disable InfiniBand verbs; forces IP-socket transport on non-IB/non-EFA clusters
EFA network-card counts per instance type

Used to populate vpc.amazonaws.com/efa requests in K8s pod specs. The canonical EC2 EFA doc enumerates which types support EFA but doesn't always state the per-instance card count; counts below are taken from authoritative AWS sources where available. Always count with ls /dev/infiniband/uverbs* | wc -l on a live node and adjust if your build differs.

Instance typeEFA adaptersAggregate bandwidth
p4d.24xlarge4400 Gbps
p5.48xlarge323200 Gbps
p5e.48xlarge323200 Gbps
p5en.48xlarge163200 Gbps
p6-b200.48xlarge83200 Gbps
p6-b300.48xlarge176400 Gbps
p6e-gb200.36xlarge171600 Gbps EFA

For other types in the EFA-supported list (e.g. p4de.24xlarge, p5.4xlarge, trn1.32xlarge, trn1n.32xlarge, trn2.48xlarge) — check the current EC2 instance-types doc and confirm with ls /dev/infiniband/uverbs* | wc -l on the node before pinning a value.

K8s pod spec (EFA-enabled)
env:
- { name: MASTER_ADDR,            value: "my-job-svc.my-ns.svc.cluster.local" }
- { name: MASTER_PORT,            value: "29500" }
- { name: WORLD_SIZE,             value: "16" }        # 2 nodes × 8 GPUs
- { name: NCCL_SOCKET_IFNAME,     value: "^lo,docker,efa,veth,virbr" }
- { name: FI_PROVIDER,            value: "efa" }
- { name: FI_EFA_USE_DEVICE_RDMA, value: "1" }
- { name: FI_EFA_FORK_SAFE,       value: "1" }
- { name: NCCL_DEBUG,             value: "WARN" }
# Set PyTorch collective timeout via init_process_group(timeout=1800s) in training code
# (NCCL_TIMEOUT env var is a non-standard convention — not read by NCCL or PyTorch directly)
resources:
  limits:
    nvidia.com/gpu: 8
    vpc.amazonaws.com/efa: <N>   # match the EFA-adapter count for the instance type (table above)
  requests:
    nvidia.com/gpu: 8
    vpc.amazonaws.com/efa: <N>
volumes:
- { name: dshm, emptyDir: { medium: Memory, sizeLimit: "10Gi" } }
volumeMounts:
- { name: dshm, mountPath: /dev/shm }

6. HyperPod node health labels (EKS)

LabelValueMeaning
sagemaker.amazonaws.com/node-health-statusSchedulableHealthy, accepts pods
UnschedulableNode is running deep health checks (~2 h stress test); not available for workloads
UnschedulablePendingReplacementFailed health check — will be replaced
UnschedulablePendingRebootRebooting to re-run checks
sagemaker.amazonaws.com/deep-health-check-statusPassed / Failed / InProgressDeep-health-check outcome
sagemaker.amazonaws.com/fault-types(value)High-level fault category (plural label key)
sagemaker.amazonaws.com/fault-reasons(value)Detailed fault reason (plural label key)

HMA also writes a sagemaker.amazonaws.com/fault-details annotation on the node with the full JSON (timestamp, type, reason, message) — see the node-debugger skill § F.

NodeRecovery modes (per instance group): Automatic (replace failed nodes) or None (manual). Toggle via update-cluster — fetch the current instance-group spec first (describe-cluster), edit only NodeRecovery, push back.


7. Slurm — NCCL-specific operations

Diagnose (read-only):

sinfo -o "%10N %10T %10C %30E" --noheader
squeue -o "%10i %20j %8T %12R %N" --noheader
scontrol show node <NODE> | grep Reason
Suggested command — resume a DRAINING node (run this yourself)

Preconditions: the original drain reason no longer applies (the underlying issue — straggler bandwidth, hardware fault, RemoveIPC, etc. — has been investigated and resolved); the customer accepts that pending jobs may schedule onto this node immediately; you are running on the Slurm controller via SSM.

Command:

scontrol update nodename=<NODE> state=resume

Blast radius: node returns to the idle pool. Reversible by setting state=drain again. If the original cause is unfixed, the node will likely re-fail; resume only after a clean diagnostic.

Suggested command — disable RemoveIPC for NCCL persistence (run this yourself)

Preconditions: NCCL job is terminating with "unlink shared memory" or /dev/shm/nccl-* disappearing mid-training; confirmed that RemoveIPC=yes is set in /etc/systemd/logind.conf; node is quiescent or a brief systemd-logind restart is acceptable.

Command:

grep RemoveIPC /etc/systemd/logind.conf   # diagnose
echo "RemoveIPC=no" >> /etc/systemd/logind.conf
sudo systemctl restart systemd-logind

Blast radius: persistent change to the node's systemd configuration — logs out anyone in a systemd user session during the restart. Change survives reboot. For new nodes, add the same commands to the lifecycle script so the setting persists across replacements.

Slurm prolog for NCCL env
#!/bin/bash
# /etc/slurm/prolog.sh
export NCCL_SOCKET_IFNAME=^lo,docker
export FI_PROVIDER=efa
export FI_EFA_USE_DEVICE_RDMA=1
# Collective timeout is set in training code: init_process_group(timeout=timedelta(seconds=1800))
mount -o remount,size=10G /dev/shm 2>/dev/null || true

8. NCCL-specific remediations

Security group self-reference

Detected when: [FAIL] SG sg-xxx missing inbound/outbound self-reference — NCCL rendezvous or EFA RDMA blocked.

Root cause: EFA requires the SG to reference itself with AllTraffic (-1) on both ingress and egress. Without this, NCCL packets between nodes are dropped.

Suggested command — apply self-ref to every cluster SG (run this yourself)

Preconditions: the rule check (e.g. nccl-diagnose.sh Check 4 or hyperpod-node-debugger's check-efa-sg.sh) reports [FAIL] on inbound or outbound self-ref for <SG>; <SG> is one of the security groups attached to the HyperPod cluster (describe-cluster → VpcConfig.SecurityGroupIds); apply once per SG if multiple are attached; for IaC-managed SGs, see the operating-policy IaC note before running directly. Per the HyperPod prerequisites doc, do not add a 0.0.0.0/0 outbound rule on the EFA SG.

Command:

# Inbound self-ref (NCCL rendezvous)
aws ec2 authorize-security-group-ingress --group-id <SG> --region <R> \
  --ip-permissions '[{"IpProtocol":"-1","UserIdGroupPairs":[{"GroupId":"<SG>"}]}]'

# Outbound self-ref (EFA RDMA)
aws ec2 authorize-security-group-egress --group-id <SG> --region <R> \
  --ip-permissions '[{"IpProtocol":"-1","UserIdGroupPairs":[{"GroupId":"<SG>"}]}]'

Blast radius: opens all protocols between instances that share this SG (intended scope for intra-cluster EFA / NCCL). Idempotent: InvalidPermission.Duplicate = the rule already exists. Reversible with revoke-security-group-ingress/revoke-security-group-egress using the same --ip-permissions payload.

NetworkPolicy blocking NCCL

Detected when: [WARN] NetworkPolicies found in <ns> + a [FAIL] indicating blocked inter-pod NCCL traffic.

Before deleting any NetworkPolicy, read it — it may be intentional tenant isolation or compliance-required. Confirm with the customer.

kubectl get networkpolicy -n <NS> -o yaml

Allow-all intra-namespace policy for NCCL training namespaces:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-nccl-intranamespace
  namespace: <NS>
spec:
  podSelector: {}
  policyTypes: ["Ingress", "Egress"]
  ingress:
    - from:
        - namespaceSelector:
            matchLabels: { kubernetes.io/metadata.name: <NS> }
  egress:
    - to:
        - namespaceSelector:
            matchLabels: { kubernetes.io/metadata.name: <NS> }
    - ports:
        - { port: 53, protocol: UDP }
Suggested command — delete a blocking NetworkPolicy (run this yourself)

Preconditions: the policy has been read (kubectl get networkpolicy <NAME> -n <NS> -o yaml) and confirmed not to be intentional tenant isolation or compliance-required; customer has explicitly approved removal; a replacement allow-list policy (if needed) is already applied.

Command:

kubectl delete networkpolicy <NAME> -n <NS>

Blast radius: changes default-deny traffic rules for every pod matched by the policy's podSelector in namespace <NS>. Cannot be reverted by a single command — the original YAML must be re-applied. Misdiagnosis can expose production traffic.

Node reboot / replacement for GPU faults

Ordering and commands are in node-debugger: references/node-diagnostics-detail.md § F. Reboot first (clears transient GPU/EFA faults, preserves data); replace only if reboot doesn't clear the fault.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs a command-line tool, Needs Python, Needs Node.js

Security

What our scanner noticed· Low risk

  • Instructions that use the network
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
AWS Labs
Publisher
AWS Labs (Official)
Source
awslabs/agent-plugins · plugins/sagemaker-ai/skills/hyperpod-nccl · commit fbefb37
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • NOTICE (added by AutoGineer from NOTICE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by AWS Labs or AWS Labs.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download hyperpod-nccl.zip