- Node group creation: Create a new node group for Trainium and Inferentia instances.
- Device plugin configuration: Provide hardware-specific settings.
- Hardware tier setup: Enable Domino users to use Trainium and Inferentia instances for their workloads.
- Environment configuration: Set up the necessary development tools and software libraries.
Node group creation
To use AWS accelerators, create a new node group that:- Uses one of the instance types in the following table
- Uses the GPU-enabled AMI for your EKS version
- Has a unique node pool label identifying its accelerator type
| Name | vCPU | Memory (GiB) | aws.amazon.com/neuron | Total Neuron Memory (GiB) |
|---|---|---|---|---|
| inf1.xlarge | 4 | 8 | 1 | 8 |
| inf1.2xlarge | 8 | 16 | 1 | 8 |
| inf1.6xlarge | 24 | 48 | 4 | 32 |
| inf1.24xlarge | 96 | 192 | 16 | 128 |
| inf2.xlarge | 4 | 16 | 1 | 32 |
| inf2.8xlarge | 32 | 128 | 1 | 32 |
| inf2.24xlarge | 96 | 384 | 6 | 192 |
| inf2.48xlarge | 192 | 768 | 12 | 384 |
| trn1.2xlarge | 8 | 32 | 1 | 32 |
| trn1.32xlarge | 128 | 512 | 16 | 512 |
k8s.io/cluster-autoscaler/node-template/resources/aws.amazon.com/neuron tag in the table below:
| Key | Value | Tag new instances |
|---|---|---|
| Name | inferentia-test-domino-trn1-Node | Yes |
| alpha.eksctl.io/cluster-name | inferentia-test | Yes |
| alpha.eksctl.io/eksctl-version | 0.155.0 | Yes |
| alpha.eksctl.io/nodegroup-name | domino-trn1 | Yes |
| alpha.eksctl.io/nodegroup-type | unmanaged | Yes |
| aws:cloudformation:logical-id | NodeGroup | Yes |
| aws:cloudformation:stack-id | arn:aws:cloudformation:us-west-2:873872646799:stack/eksctl-inferentia-test-n… | Yes |
| aws:cloudformation:stack-name | eksctl-inferentia-test-nodegroup-domino-trn1 | Yes |
| eksctl.cluster.k8s.io/v1alpha1/cluster-name | inferentia-test | Yes |
| eksctl.io/v1alpha2/nodegroup-name | domino-trn1 | Yes |
| k8s.io/cluster-autoscaler/enabled | true | Yes |
| k8s.io/cluster-autoscaler/inferentia-test | owned | Yes |
| k8s.io/cluster-autoscaler/node-template/label/dominodatalab.com/node-pool | trainium | Yes |
| k8s.io/cluster-autoscaler/node-template/resources/aws.amazon.com/neuron | 1 | Yes |
| kubernetes.io/cluster/inferentia-test | owned | Yes |
Example eksctl node group config
Here’s an example eksctl node group config for Neuron-based node groups:Device plugin deployment
Once your nodes have joined the cluster, deploy the Neuron device plugin DaemonSet using the following specification. You must use version2.17.3.0 or greater for Domino workloads to be correctly processed by the device plugin.
To deploy this DaemonSet:
-
Save the following specification to a file (such as
neuron-device-plugin-ds.yaml). -
Apply the specification with
kubectl apply -f neuron-device-plugin-ds.yaml. -
Once the device plugin DaemonSet is deployed, run
kubectl describe nodeto confirm that you see device plugin daemons running on your Neuron-based instances, and that they advertiseaws.amazon.com/neuronresources to Kubernetes.
aws.amazon.com/neuron resource, and the Domino node pool label identifying the node as Trainium.
Hardware Tier setup
Next, you need to make the node group accessible to your users by creating a Domino hardware tier that does the following:- Targets the node pool label you’ve given to your Neuron-based nodes.
- Requests a suitable amount of the node vCPU and memory, allowing for necessary overhead.
-
Requests a custom GPU resource with the name
aws.amazon.com/neuron.
| Key | Value |
|---|---|
| Cluster Type | Kubernetes |
| ID | trainium |
| Name | Trainium |
| Cores Requested | 5.0 |
| Memory Requested (GiB) | 26.0 |
| Number of GPUs | 1 |
| Use custom GPU name | Yes |
| GPU Resource Name | aws.amazon.com/neuron |
| Cents Per Minute Per Run | 0.0 |
| Node Pool | trainium |
| Restrict to compute cluster | Options: Spark, Ray, Dask, Mpi |
| Maximum Simultaneous Executions | |
| Overprovisioning Pods | 0 |
Environment setup
The AWS Neuron SDK is designed for use with fully integrated frameworks like PyTorch and TensorFlow. When setting up a Domino environment for a new version of Neuron or the integrated framework, you should read the documentation on: As an example, and to facilitate testing, here’s an environment definition for adding PyTorch Neuron to the Domino 5.7 Standard Environment (quay.io/domino/compute-environment-images:ubuntu20-py3.9-r4.3-domino5.7-standard):
Testing Neuron devices in Domino
To test your setup, start a Jupyter workspace using a Neuron-based hardware tier and Neuron-enabled Workspace Environment. Once your workspace has started, open a Python notebook and execute a cell with the command!/opt/aws/neuron/bin/neuron-ls to see mounted Neuron devices.
You can now use the Neuron framework you’ve installed to invoke the mounted accelerator.