Skip to content

Support AWS Trainium2 instances (trn2.3xlarge single-device) + Neuron family #205

Open

Description

@scttfrdmn

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() lists g5.*, p3.*, p4d.*, p5.* but no trn*/inf*. The InstanceTypeSpec struct (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()'s instanceTypes list has no trn/inf entries, 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

  1. Add Neuron instances to the getInstanceTypes() table in pkg/slurm/resources.go.
  2. 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:N would be the natural fit.)
  3. Add the new types to the completeInstanceType() completion list in cmd/completion.go.
  4. 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

  1. added
    enhancement
    area:launch
    on Jun 17, 2026
  2. added this to the Later milestone on Oct 19, 2026
  3. modified the milestones: Later, Post-1.0 on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:launchenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions