Repository navigation
Open
Labels
Milestone
Description
Summary
spawn has no support for AWS Trainium2 instances — in particular the single-device trn2.3xlarge, which is the cheapest way to get a real Trainium2 chip for ML dev/validation. The Slurm instance-type spec table and shell completion list cover general-purpose, compute, memory, and GPU families, but no Trainium/Inferentia (Neuron) instances at all.
Where this shows up
pkg/slurm/resources.go—getInstanceTypes()listsg5.*,p3.*,p4d.*,p5.*but notrn*/inf*. TheInstanceTypeSpecstruct (VCPUs, MemoryMB, GPUs, GPUType, Price) also has no concept of a Neuron accelerator, so even if added,--gpus-style scheduling wouldn't match.cmd/completion.go—completeInstanceType()'sinstanceTypeslist has notrn/infentries, so there's no shell completion for them.
The immediate ask is trn2.3xlarge; ideally add the Neuron family broadly.
trn2.3xlarge specs (verified via EC2 API, June 2026)
| Field | Value |
|---|---|
| vCPUs | 12 |
| Memory | 131072 MiB (128 GiB) |
| Neuron devices | 1× Trainium2 |
| NeuronCores | 8 (v3) |
| Device memory | 524288 MiB (512 GiB) |
| Regions | sa-east-1, ap-southeast-4 |
| Spot price | ~$0.90/hr (sa-east-1, June 2026) |
For reference, other Neuron single-device / common types worth adding:
trn1.2xlarge— 8 vCPU, 32 GiB, 1× Trainium1 (2 NeuronCores). Regions incl.us-east-1/2,us-west-2. Spot ~$0.13–0.18/hr.trn2.48xlarge— 192 vCPU, 2048 GiB, 16× Trainium2. Region incl.us-east-2.inf2.xlarge/inf2.8xlarge— Inferentia2 inference.
Proposed change
- Add Neuron instances to the
getInstanceTypes()table inpkg/slurm/resources.go. - Extend
InstanceTypeSpec(and the Slurm matcher) with a Neuron accelerator concept — e.g.NeuronDevices int,NeuronCores int,AcceleratorType string("trainium2", "inferentia2") — so jobs can request Neuron the way they request GPUs. (Mapping Slurm--gres/Gres=neuron:Nwould be the natural fit.) - Add the new types to the
completeInstanceType()completion list incmd/completion.go. - Confirm AMI auto-detection resolves a Neuron DLAMI for these types (the Neuron DLAMI SSM path is versioned, e.g.
/aws/service/neuron/dlami/pytorch-2.9/ubuntu-24.04/latest/image_id).
Motivation / context
This is needed to use spawn for the aws-trainium-tutorial-for-research hardware-validation harness, where every tutorial example must run on real Trainium. trn2.3xlarge is the lowest-cost single-Trainium2-device option for that.
Activity