Skip to main content
Source

This page is generated from skills/eks-genai/references/compute-hardware.md. Edit the source, not this page.

Compute & Hardware — NVIDIA GPU vs AWS Neuron

The single most-impactful decision in any GenAI-on-EKS architecture. Do not reflexively pick NVIDIA GPU. For Transformer-family LLMs, evaluate AWS Neuron (Trainium/Inferentia) first: it often wins on price-performance versus NVIDIA GPU, but validate per workload.

Layer-1 Decision Rule

Right hardware = f(workload type × model family × latency × cost posture × team skill × timeline) — never one dimension alone.

  • Default to AWS Neuron (Trn2/Trn1 training, Inf2 inference) when: model is Transformer-family (Llama, Mistral, Qwen, Falcon) + framework is PyTorch/vLLM + cost-conscious + team can absorb a 1–2 week compilation ramp.
  • Default to NVIDIA GPU (g6/g6e inference, p5/p5e training) when: fastest time-to-first-success matters, CUDA-only dependencies exist, novel/non-Transformer architectures, or multi-modal models.

GPU vs Neuron Decision Matrix

Workload signalRecommend NVIDIA GPU when…Recommend AWS Neuron when…
Training — frontier (70B+) / novel archCustom CUDA kernels; H100/H200 ecosystem dependency; cutting-edge researchModel is Transformer-family — Trn2 delivers up to 50% cost-to-train savings vs comparable GPU (trn1 instance page)
Training — fine-tuning (LoRA/PEFT/full)Fastest time-to-first-success; broadest toolingStrong fit if base model has Neuron support (most popular FMs do)
Inference — high-throughput LLM (7B–70B)g6 (L4) or g6e (L40S) — broad vLLM-native ecosysteminf2 — up to 40% better price-performance for vLLM-supported models (inf2 instance page)
Inference — vision / audio / multi-modalRequired — Neuron support uneven for non-Transformer architecturesLimited — verify model-specific support before committing
Inference — sub-100ms TTFTBest raw latency on H100/H200Acceptable on inf2 with TP/PP tuning + ahead-of-time compilation
Customer skillExisting CUDA / NVIDIA tooling investmentWilling to add Neuron SDK + compilation step (torch-neuronx)
Time-to-first-successFastest path; least new tooling+1–2 weeks ramp; ROI realized at production scale
Production cost optimizationAcceptable but more expensive per tokenRecommend for steady-state production once model is stabilized

NVIDIA GPU Instance Quick-Reference

Network/EFA values are the per-instance maximums from the EC2 instance-type pages; EFA generation follows the Nitro version (Nitro v3 = EFA v1, no RDMA; Nitro v4+ = EFA v2/v3, with RDMA).

InstanceAcceleratorGPU MemoryNetwork / EFABest for
p5.48xlarge8× NVIDIA H100 SXM5640 GB HBM33200 Gbps, EFA v2 (GPUDirect RDMA)Frontier pre-training, 100B+ models, multi-node FSDP
p5e.48xlarge8× NVIDIA H200 SXM5~1.1 TB HBM3e3200 Gbps, EFA v2 (GPUDirect RDMA)Same as p5 + larger memory for longer contexts
g6e.48xlarge8× NVIDIA L40S384 GB GDDR6400 Gbps, EFA v270B inference, multi-GPU PEFT fine-tune
g6e.2xlarge1× NVIDIA L40S48 GB GDDR6Up to 20 Gbps (no EFA)Single-GPU inference (7B–13B), dev/test, workshop validated
g6.12xlarge4× NVIDIA L496 GB GDDR640 Gbps, EFA v27B–30B inference, cost-sensitive production
g6.48xlarge8× NVIDIA L4192 GB GDDR6100 Gbps, EFA v2Larger multi-GPU L4 inference fleets
g5.48xlarge8× NVIDIA A10G192 GB GDDR6100 Gbps, EFA v1 (no RDMA)Multi-modal, NVIDIA NIM, dev/test, legacy workloads

Workshop-validated: The GenAI-on-EKS NVIDIA workshop runs on g6e.2xlarge (1× L40S, 48 GB) on EKS Auto Mode (Kubernetes 1.34) with Bottlerocket. GPU capacity reserved via On-Demand Capacity Reservation (ODCR) patched into the Karpenter EC2NodeClass via capacityReservationSelectorTerms.

AWS Neuron Instance Quick-Reference

Note: Inf2 instances do not support EFA — their inf2.48xlarge chip-to-chip interconnect is NeuronLink (intra-instance), and their external networking is standard ENA. EFA (inter-node fabric) is a Trainium-and-GPU feature.

InstanceAcceleratorHBMNetwork / EFABest for
trn2.48xlarge16× Trainium21.5 TB HBM33.2 Tbps, EFA v3 (RDMA)Pre-training (3× compute vs Trn1), large-scale fine-tuning
trn1.32xlarge16× Trainium512 GB HBM2e800 Gbps, EFA v2Pre-training, fine-tuning — up to 50% cost-to-train savings
inf2.48xlarge12× Inferentia2384 GB HBM2e100 Gbps ENA (no EFA); NeuronLink chip-to-chipHigh-throughput LLM inference (30B–70B)
inf2.8xlarge1× Inferentia232 GB HBM2eUp to 25 Gbps ENA (no EFA)Dev/test inference, smaller models (7B–13B)

When Each Accelerator Wins — Summary

ScenarioWinnerWhy
Cost-sensitive Transformer LLM training at scaleTrainium (Trn2/Trn1)Up to 50% cost-to-train savings; EFA for multi-node
Cost-sensitive Transformer LLM inference at scaleInferentia2 (Inf2)Up to 40% better price-performance; vLLM+Neuron supported
Fastest time-to-production, any modelNVIDIA GPU (g6e/p5)Broadest ecosystem; zero compilation ramp
Novel architecture / custom CUDA kernelsNVIDIA GPUNeuron compilation may not support custom ops
Multi-modal (vision+language, audio)NVIDIA GPUNeuron support is model-specific; verify first
Shared dev cluster, multiple small modelsNVIDIA GPU (g6/g5)MIG/time-slicing enable multi-tenant sharing

GPU Optimization Techniques

Multi-Instance GPU (MIG) — H100/A100 only

Partitions a single physical GPU into up to 7 isolated instances, each with dedicated memory, cache, and compute. Use for:

  • Multi-tenant dev clusters — isolate teams on a single p5 node
  • Small-model inference — run multiple 7B models on one H100 slice
  • Requires NVIDIA device plugin configured with MIG strategy (mixed or single)

MIG profiles on H100 (p5.48xlarge):

ProfileGPU MemoryComputeUse case
1g.10gb10 GB1/7 SMTiny models, embedding inference
2g.20gb20 GB2/7 SM7B quantized inference
3g.40gb40 GB3/7 SM7B–13B FP16 inference
7g.80gb80 GBFull GPUSingle-tenant training/inference

GPU Time-Slicing

Multiplexes multiple pods onto a single GPU via temporal sharing (no memory isolation). Use for:

  • Dev/test environments where isolation is not critical
  • Low-utilization workloads that don't saturate GPU compute
  • Simpler than MIG; no H100/A100 requirement — works on any NVIDIA GPU
  • Configure via nvidia.com/gpu.replicas in the device plugin ConfigMap
# Time-slicing ConfigMap for nvidia-device-plugin
apiVersion: v1
kind: ConfigMap
metadata:
name: nvidia-device-plugin-config
data:
config.yaml: |
version: v1
sharing:
timeSlicing:
replicas: 4 # 4 pods share each physical GPU

Caution: Time-slicing provides no memory isolation — one pod's OOM kills the GPU context for all co-located pods. Use only for dev/test.

Dynamic Resource Allocation (DRA): Kubernetes 1.34+

Fine-grained GPU partitioning managed by the Kubernetes scheduler. Use for:

  • Clusters that need scheduler-aware GPU sharing (vs static MIG)
  • Karpenter static capacity only (no dynamic provisioning); not on Auto Mode. The NVIDIA DRA driver is supported on Karpenter static-capacity NodePools, EKS managed node groups, and self-managed nodes, but does not support dynamic Karpenter provisioning and is not supported on EKS Auto Mode (Manage NVIDIA GPU devices with DRA). On EKS the DRA drivers require Kubernetes 1.34+, where DRA is GA at resource.k8s.io/v1 (used in the example below; the beta resource.k8s.io/v1beta1 API dates to 1.32).
# DRA ResourceClaim example (Karpenter static capacity / managed NG / self-managed; not Auto Mode)
apiVersion: resource.k8s.io/v1
kind: ResourceClaim
metadata:
name: gpu-slice
spec:
devices:
requests:
- name: gpu
exactly: # v1 (GA in K8s 1.34): deviceClassName/selectors/allocationMode nest under exactly
deviceClassName: gpu.nvidia.com

Decision: MIG vs Time-Slicing vs DRA

TechniqueIsolationMemory isolationKarpenter compatibleBest for
MIGHardware-level✅ Yes✅ YesProduction multi-tenant on H100/A100
Time-slicingNone (temporal only)❌ No✅ YesDev/test density, low-utilization workloads
DRAScheduler-managed✅ YesStatic capacity only (no dynamic provisioning); not on Auto ModeFine-grained sharing on Karpenter static NodePools, managed node groups, or self-managed nodes

Neuron Compilation — The Ramp Cost

Neuron requires ahead-of-time compilation (torch-neuronx or neuronx-distributed-inference). This is the primary adoption friction vs NVIDIA GPU.

What to expect:

  • First model compilation: 1–2 weeks (includes learning the SDK, debugging graph breaks, tuning TP/PP)
  • Subsequent model versions: hours to days (incremental, reuse compilation cache)
  • Ship compiled artifacts via S3 or bake into container image — never compile at pod startup

Mitigation: Pre-compile models offline in a CI pipeline. Store compiled .neff files in S3. Reference them from the serving container at startup. This removes compilation from the critical path entirely.

Warning (SDK version skew): Precompiled Neuron artifacts (.neff) must be compiled with a Neuron SDK version compatible with the runtime version on the serving nodes. A compile-vs-runtime SDK mismatch is a common serve-time failure, so pin and match the Neuron SDK across build and serve.

# Neuron pod requesting NeuronCores (device plugin path)
resources:
limits:
aws.amazon.com/neuroncore: "2" # 2 NeuronCores for this workload
requests:
aws.amazon.com/neuroncore: "2"

Capacity Planning Guidance

WorkloadStart withScale signal
Inference (7B)1× g6e.2xlarge or 1× inf2.8xlargeTTFT p99 > target → add replicas
Inference (30B–70B)4× g6e.12xlarge or 1× inf2.48xlargeGPU memory utilization > 85% → upsize
Fine-tuning (7B–13B)1× g6e.48xlarge or 1× trn1.32xlargeTraining throughput (tokens/sec)
Pre-training (70B+)8–64× p5.48xlarge or 4–32× trn2.48xlargeEFA all-reduce latency, loss convergence

Rule: Start small, measure, scale. Over-provisioning GPUs is the second-most-expensive mistake (after wrong hardware family).

Cost-to-Train / Price-Performance Claims (AWS-published)

ClaimSource
Trainium: up to 50% cost-to-train savings vs comparable EC2 GPU instancesaws.amazon.com/ec2/instance-types/trn1
Inferentia2: up to 40% better price-performance vs comparable EC2 GPU instancesaws.amazon.com/ec2/instance-types/inf2
Inferentia2: up to 50% better performance/watt vs comparable EC2 GPUaws.amazon.com/ec2/instance-types/inf2
Capacity Blocks for ML: guaranteed capacity access, upfront market-based pricing (not a guaranteed on-demand discount)aws.amazon.com/ec2/capacityblocks/pricing

Always provide directional ranges with caveats — actual savings depend on model size, traffic pattern, batch size, sequence length, and configuration. Never give point cost estimates.

EKS Auto Mode + GPU Note

On EKS Auto Mode, the NVIDIA driver and device plugin are embedded in the Bottlerocket AMI — no gpu-operator DaemonSet or separate nvidia-device-plugin DaemonSet is needed. The "install nvidia-device-plugin" step you see in most guides applies to self-managed / standard EKS only. Auto Mode also auto-enables SOCI parallel pull and unpack on G/P/Trn instance families with local NVMe (always on as of Nov 19, 2025 — no configuration required), parallelizing image download/decompression for faster GPU-pod starts. Note this is SOCI parallel pull, distinct from SOCI lazy/index-based loading (which still needs a pre-built SOCI index in ECR).

Sources