Host profiling with the SageMaker HyperPod observability add-on
With host profiling, the observability add-on samples the CPU stack traces of the processes on the nodes of your cluster and sends the profiles to Amazon CloudWatch. You can use the profiles to help diagnose performance issues in your workloads. Host profiling samples only code that runs on the CPU. It doesn't profile code that runs on the GPU.
Host profiling is available in add-on version v1.4.0-eksbuild.1
and later. The add-on always sends profiles to Amazon CloudWatch. The add-on doesn't profile the
nodes in Restricted Instance Groups (RIGs).
When you turn on host profiling, the add-on does the following:
-
Runs an extended Berkeley Packet Filter (eBPF) profiler in the node collector pod on the cluster's nodes. The profiler samples every process on its node 20 times each second, and sends the profiles every 60 seconds.
-
Gives the node collector pod the access that the profiler needs: the host process ID namespace (
hostPID), read-only access to/syson the host, and the Linux capabilitiesBPF,PERFMON,SYS_PTRACE,SYSLOG,DAC_READ_SEARCH,CHECKPOINT_RESTORE, andSYS_RESOURCE. The pod runs as the root user, but it isn't a privileged pod and it can't escalate privileges. -
Adds 512 MiB to the memory request and the memory limit of the node collector pod. With the default configuration values, the memory request goes from 512 MiB to 1 GiB, and the memory limit goes from 1 GiB to 1.5 GiB. If you set a memory request or a memory limit in
collectorResources.nodeCollector, the add-on uses your value without the extra 512 MiB. In that case, add about 512 MiB to your value.
Each profile has the following attributes, which you can use to find the profiles of a job:
-
service.name– The name of the job that the process belongs to. The add-on reads the name from the following pod labels, in this order, and uses the last label that it finds:batch.kubernetes.io/job-name,jobset.sigs.k8s.io/jobset-name,training.kubeflow.org/job-name, andHPJob. For a process that doesn't belong to a job, the value ishost-system. -
host.name– The name of the node.
On each node, the profiler typically uses a few hundredths of a CPU core.
Each node sends its profiles to Amazon CloudWatch every 60 seconds, so your CloudWatch quotas limit how many nodes you can profile in each AWS account and AWS Region. For more information, see CloudWatch service quotas in the Amazon CloudWatch User Guide.
To turn on host profiling, select Enable host profiling
when you install the add-on on the console. Or set
profilesProvider.hostProfiling.enabled to true
in the add-on configuration values. For more information, see Setting up the SageMaker HyperPod observability add-on.
To turn host profiling on or off for an installed add-on on the SageMaker AI console:
-
Open your cluster on the SageMaker AI console, and choose the Dashboard tab.
-
On the Amazon SageMaker HyperPod observability card, choose Actions, and then choose Edit.
-
Under Host profiling, select or clear Enable host profiling.
-
Choose Save changes.
To turn off host profiling with the AWS CLI, set
profilesProvider.hostProfiling.enabled to
false in the full configuration values of the add-on, and
send them with aws eks update-addon. Keep the other keys of the
configuration.
The add-on role needs the cloudwatch:PutProfileRecords action.
For more information, see Permissions for the observability add-on role.
You can also turn on host profiling from SageMaker HyperPod Insights on the Amazon CloudWatch
console. On the Workload tab of your cluster, select a job, choose
Profile CPU (eBPF), and then choose Start
profiling. This turns on host profiling for the whole cluster, not only for
that job, and host profiling stays on until you turn it off. To use it, the cluster needs add-on
version v1.4.0-eksbuild.1 or later, and your console role needs the
eks:DescribeAddon, eks:DescribeAddonConfiguration,
eks:UpdateAddon, and eks:DescribeUpdate
actions.
To view the profiles, open the Amazon CloudWatch console and choose
Profiles in the navigation pane. Then choose the
service that has the name of your job, or host-system.
You might incur CloudWatch charges for the host profiles that the add-on sends. For
more information, see Amazon CloudWatch
Pricing
Host profiling is available in the AWS Regions where both the observability add-on and CloudWatch Profiles are available.