Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 20 min read Deep dive hardMaster

Building Blocks for Foundation Model Training and Inference on AWS

Foundation-model pre-training, post-training and test-time inference now converge on the same infrastructure needs: tightly coupled accelerators, high-bandwidth low-latency networking, tiered distributed storage, orchestration and observability. On AWS this maps to P5/P6 GPU instances (H100 through B300, with dense FLOPS, HBM and NVLink/EFA bandwidth compared), EFA's OS-bypass SRD networking, NVMe plus FSx for Lustre plus S3 storage tiers, UltraClusters, and GB200 NVL72 UltraServers that widen the NVLink domain for communication-heavy workloads such as MoE all-to-all. Orchestration is handled by Slurm (job-level atomic allocation, backfill, topology-aware placement, GRES) and Kubernetes, deployed via ParallelCluster, PCS or SageMaker HyperPod. As models scale, step time is increasingly bound by collective communication and memory movement rather than raw compute, so scale-up and scale-out bandwidth deserve explicit accounting.

Related posts

  • Scale distributed AI workloads with Ray and Anyscale on Amazon EC2

    AWS Architecture Blog easyNovice

    Ray, run as the managed Anyscale service inside your own AWS account, can carry a multimodal AI/ML pipeline from a single instance to multi-node clusters without code changes. There are three deployment paths: plain EC2 with EFA as the default, EKS with Karpenter for Kubernetes shops, and SageMaker HyperPod for long, failure-sensitive training runs. Each Ray library is mapped to suitable hardware: Graviton and Spot for Ray Data preprocessing, GPUs and Trainium for Ray Train, and Inferentia or Graviton for Ray Serve. Costs are layered as Savings Plans plus Spot (with head nodes kept On-Demand and checkpoint-based recovery), Capacity Blocks for scheduled training, and On-Demand for bursts.

  • Inside multi-node training: How to scale model training across GPU clusters

    Together AI mediumAdept

    Multi-node GPU training spreads foundation model training across many 8-GPU servers by combining data, tensor and pipeline parallelism over NVLink within nodes and InfiniBand/RoCE between them, with periodic checkpointing to survive the near-daily hardware failures of 100-node clusters. A Qwen2.5-72B example on 16 nodes of B300 GPUs (TP=8, PP=2) reached 45-50% MFU and about 2,500 tokens/s/GPU, with PCIe errors, NVLink drops and gradient-sync congestion as recurring problems. Before a full run, verify NVLink and inter-node bandwidth with tools like ib_write_bw, set up NCCL and test checkpoint resume, then scale from 2 nodes upward while targeting over 80% scaling efficiency.

  • Reinforcement learning is an infrastructure problem

    Modal mediumAdept

    RL post-training of LLMs is bottlenecked by infrastructure rather than algorithms: training engines, rollout inference and isolated environments must all scale together, and once training goes multi-node, trainer-to-rollout weight sync dominates. Measured estimates show RDMA cutting weight transfer roughly 60x versus TCP (e.g. GLM 4.7 from 115 s to 1.8 s per step), and delta compression shrinking WAN transfers for disaggregated setups by about 98%. Teams commonly struggle with glue code, cluster queueing and GPUs starved by environments; the guidance is to keep at least one sandbox per rollout plus headroom for failures. Modal recommends building on open-source frameworks like slime and verl, upstreams improvements such as delta compression, and introduces Modal Dojo, an experimental library for defining RL jobs in under 100 lines.

  • Configuring Dedicated Model Inference

    Together AI mediumAdept

    Together AI's Dedicated Model Inference separates a stable endpoint name, disposable deployments (model revision + config + autoscaling replicas), and immutable config revisions that specify engine, GPU type/count, parallelism and a latency/throughput/balanced profile. Traffic splits use per-replica weights, so routing follows effective capacity (weight × ready replicas): autoscaling shifts traffic automatically, and unready deployments receive none. A live test with two H100 deployments matched expected shares (69.4/30.6 measured vs 66.7/33.3 expected after scaling one deployment to two replicas). A concurrency sweep showed one profile scaling to 1,464 tok/s at c=16 while another, faster at c=4, saturated and halved its throughput, which makes the case for load-testing configs at realistic concurrency.

  • Accelerating Hugging Face Transformers with AWS Inferentia2

    Hugging Face easyNovice

    Hugging Face benchmarked popular Transformer models on AWS Inferentia2 (inf2.xlarge) against Inferentia1 (inf1.2xlarge) and an NVIDIA A10G GPU (g5.2xlarge), running 144 p95-latency experiments at batch size 1 across six architectures and sequence lengths from 8 to 512. On average Inferentia2 delivered 4.5x lower latency than the A10G and 4x lower than Inferentia1, with BERT-base about 6x faster up to sequence length 256 and ViT-base about 2x faster than the GPU. The GPU runs were unoptimized fp32. Models compile for Inferentia2 through Optimum Neuron and the AWS Neuron SDK, and instances start at $0.76/hour.

The quest for software engineering knowledge.

Look:
Layout: