AWS Builder Center

The AI Infra series, read against AWS

The AI Infra series, read against AWS

Chapter 4b: speculative decoding, quantization, KV pooling, MoE

The series' claims. With acceptance α = 0.7, K = 4 and cost ratio c = 0.1, speculative decoding gives about 2×. It quotes acceptance rates: EAGLE-3 70–78%, Medusa-V2 60–70%, DeepSeek's MTP 80%+. PayPal's domain model reportedly reached only about 30% acceptance yet still halved GPU cost. On quantization: FP8 on Hopper gives 1.4–1.7×, FP4 on Blackwell 2–5×, and NVFP4 recovers only about 80% on hard reasoning. On KV pooling: LMCache, Mooncake, Dynamo and Tair KVCache. For MoE, use expert parallelism with a capacity factor of 1.2–1.5. The chapter's order is quantize, then prefix-cache, then speculative decoding.
Precision by AWS family (hardware capability from NVIDIA and AWS specifications):
precision
native on
not native on
FP8
 p5 ,  p5e ,  p5en  (Hopper);  g6e  (Ada L40S);  p6-* ,  g7e  (Blackwell);  trn2 
 p4d / p4de  (A100),  g5  (A10G)
FP4 (NVFP4 / MXFP4)
 p6-b200 ,  p6-b300 ,  p6e-gb200 ;  g7e  (check)
everything Hopper and older
INT4 weights (AWQ/GPTQ)
dequantized before the matmul on every family, as the series says
—
MoE expert parallelism on AWS. This is where the hardware choice matters most:
EP span
AWS shape
all-to-all runs over
≤ 8 GPUs
one P5/P5e/P5en/P6 node
NVLink/NVSwitch
≤ 72 GPUs
one P6e-GB200 UltraServer
NVLink
beyond that
many nodes
EFA
DeepEP's internode kernels, including the  ld.global.nc.l1::no_allocate.l2::256b  trick from chapter 6(2), target InfiniBand through NVSHMEM with IBGDA. On EFA, use an all-to-all library built for libfabric/EFA, or keep EP inside an NVLink domain (check the current state of EFA support in DeepEP and its alternatives).
KV pooling. LMCache's tiers map to AWS like this: CPU memory and local disk on the instance, then a remote tier. For a Redis-compatible remote tier on AWS, see  Redis for LLMs on AWS . For S3, use LMCache's own connector (check).
What AWS does not give you: speculative decoding or quantization as a setting you control on Bedrock, and an EFA-native MoE all-to-all library from AWS.



Chapter 5a: single-node tuning ("eight cards, seven idle")

The series' claims. Local NUMA access takes 80 ns and remote 139 ns. Bind with  numactl --cpunodebind --membind . Pinned memory adds 10–20%. THP should be on for training and off for inference. Set  vm.swappiness=0 . Run  nvidia-persistenced . MPS can bring two 40% processes to 80–90% combined; MIG allows up to 7 slices. Container overhead is under 2%. Use bind mounts,  hostNetwork  for IB, and match CUDA to the driver (CUDA 13 needs R580+).
On EKS. The sharing modes are  covered already . The rest maps like this:
series knob
on EKS
 numactl  binding
the kubelet's CPU Manager  static  policy plus Topology Manager, set through  nodeadm 's  NodeConfig  on AL2023 or through Bottlerocket settings
Topology Manager  single-numa-node 
cannot be satisfied by an 8-GPU pod on a 2-socket P5: the GPUs span both NUMA nodes, so the pod is rejected at admission. Use  restricted  or  best-effort  for whole-node pods, and  single-numa-node  only for pods of 1 to 4 GPUs
THP and  swappiness 
node-level sysctls and boot settings. The EKS-optimized AMIs make their own choices (check before overriding)
 nvidia-persistenced 
the EKS accelerated AMIs ship the driver; check whether persistence mode is on ( nvidia-smi -q | grep Persistence ) before adding a unit
 hostNetwork  for IB
not needed for EFA (chapter 2a)
CUDA 13 needs R580+
the driver comes with the AMI release. Pin the AMI ( AL2023_x86_64_NVIDIA  or  BOTTLEROCKET_x86_64_NVIDIA  AMI types) and read its driver version before moving to a CUDA 13 image
bind-mount datasets
 hostPath  or  emptyDir  on an instance-store-backed kubelet root, or the FSx and Mountpoint CSI drivers
What AWS does not give you: NUMA-aware placement in the default EKS scheduler. The Topology Manager works on the node after scheduling, so a pod can be scheduled onto a node and then rejected there.



Chapter 5b: scheduling ten thousand GPUs

The series' claims. It describes three generations of Kubernetes GPU scheduling: device plugin, then topology-aware, then DRA (GA in 1.34). Queues come from Kueue or Volcano; gang scheduling is "要么一起上,要么都不上" (all or nothing). Use Slurm for large training and Kubernetes for inference, with hybrids such as SUNK and Slinky. Above roughly 5,000 nodes, federate. It quotes a 32 K-GPU run with 678 interruptions, 49.9% of them from HBM, PCIe or NCCL watchdogs. PHOENIX's in-memory checkpoint plus hot-swap recovers in about 40 seconds on 512 A100s. OpenAI reportedly reached 97% effective utilization on 25 K GPUs.
On AWS this chapter has the most managed surface. All of the API names below are in the SageMaker, EKS and Batch models:
series need
SageMaker HyperPod
EKS + Karpenter
AWS Batch
orchestrator
 Orchestrator :  Eks  or  Slurm 
Kubernetes
Batch queues; EKS or ECS compute;  SAGEMAKER_TRAINING  service environments
gang (all or nothing)
task governance, which AWS documents as built on Kueue (check)
you install Kueue or Volcano
multi-node parallel jobs (check support on EKS)
queues, quotas, priority
 CreateClusterSchedulerConfig  →  SchedulerConfig {PriorityClasses, FairShare, IdleResourceSharing} 
Kueue  ClusterQueue  /  LocalQueue 
job queues, fair-share policies
health checks
 OnStartDeepHealthChecks :  InstanceStress ,  InstanceConnectivity ;  StartClusterHealthCheck 
EKS node monitoring agent and node auto repair (GPU faults) (check scope)
—
replace a bad node
 NodeRecovery: Automatic ;  BatchReplaceClusterNodes ,  BatchRebootClusterNodes 
auto repair or Karpenter replacement; resume is your job
retry strategies
in-memory checkpoint tier (PHOENIX-style)
 TieredStorageConfig {Mode, InstanceMemoryAllocationPercentage} , which AWS documents as managed tiered checkpointing (check)
yours
—
capacity reservation
 TrainingPlanArn  on an instance group;  SearchTrainingPlanOfferings 
Capacity Blocks; node group  CAPACITY_BLOCK ; Karpenter reserved capacity (check)
—
autoscaling
 AutoScaling {Mode, AutoScalerType: Karpenter} 
Karpenter
managed compute environments
DRA
—
EKS 1.34+; the NVIDIA DRA driver is yours
—
topology
instance groups in a placement group;  DescribeInstanceTopology 
the same, plus node labels, plus a scheduler that reads them
—
Slurm without Kubernetes
HyperPod Slurm
—
— (AWS Parallel Computing Service is the managed Slurm option; its API is in botocore as  pcs )


Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article