Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
InfrastructureAPI / Product · ActionableAWS Machine Learning Blog→ original

AWS Releases Ready-Made Image for 8-GPU Training: Kubernetes Setup Costs $9.50 an Hour

Training a neural network across several servers requires a container where CUDA, PyTorch, NCCL and the EFA fast-network drivers all match in version, and teams usually build that image themselves. AWS has released a ready-made Ray Train image. In its example, Qwen2.5-1.5B is fine-tuned on eight L4 GPUs across two servers in the Amazon EKS Kubernetes service. The whole setup costs about $9.50 an hour. That leaves developers with a simpler job: describe the cluster in a manifest and write the training function, not assemble the image.

AI-processed from AWS Machine Learning Blog; edited by Hamidun News
AWS Releases Ready-Made Image for 8-GPU Training: Kubernetes Setup Costs $9.50 an Hour
Source: AWS Machine Learning Blog. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceAWS Machine Learning Blog ↗
Editor-in-Chief
Key metric #1The image includes Ray 2.58.0, PyTorch 2.13.0, CUDA 13.0.2 and NCCL 2.29.7
Key metric #2FSDP splits the 12 GB of model state across 8 GPUs, about 1.5 GB per L4
Key metric #3If versions don't match, networking silently falls back to TCP, and training runs slower

Imagine this: a model already trains on one GPU, and you decide to move it to a cluster of two servers. The code barely changes, but the container becomes a separate project. CUDA, a PyTorch build compiled for that CUDA version, NCCL (the collective communication library through which GPUs exchange data), the AWS fast-network drivers called EFA (Elastic Fabric Adapter), the AWS OFI NCCL plugin that connects NCCL to EFA, and the Ray version your cluster operator agrees on all have to work together. Update one component and you have to rebuild the image. None of this has anything to do with the model itself.

AWS wants to take this work off teams' hands. The Ray Train Deep Learning Container (DLC) is a ready-made image: AWS assembles the stack, tests it as a single unit, publishes it to Amazon ECR Public, and updates it with patches. In the example from the AWS blog, Qwen2.5-1.5B is fine-tuned this way on eight NVIDIA L4 GPUs (8 GPUs) across two g6.12xlarge servers. Everything runs in Amazon EKS, AWS's managed Kubernetes service. The whole setup costs about $9.50 an hour, including both GPU servers, the EKS control plane and a NAT Gateway.

What's inside the image

The tag used in the example is public.ecr.aws/deep-learning-containers/ray:train-ml-cuda-v1.1. It contains Ray 2.58.0 with Train, Tune and Data, PyTorch 2.13.0, torchvision 0.28.0, CUDA 13.0.2 and NCCL 2.29.7. It also includes the EFA stack, the AWS OFI NCCL plugin, GDRCopy, DeepSpeed, flash-attn, Transformer Engine, PyTorch Lightning and Hugging Face libraries. NCCL diagnostics, including all_reduce_perf, are already in the image.

Networking is the most unpleasant part. If library versions don't match, you get no error. NCCL quietly switches to ordinary TCP sockets, and training finishes, but many times slower. AWS tests each release for multi-node training over EFA and through KubeRay, using the same scenarios as this example.

There are smaller conveniences too. The image is public, so nodes can pull it without credentials. At startup, the entrypoint checks the NVIDIA driver on the host and, if the driver is newer than the CUDA in the image, enables the built-in compatibility libraries itself. The image has no fixed role: one tag works both as the Ray head (the coordinator) and as a Ray worker (a GPU worker node), and the role is set by the ray start command.

Configure, don't rebuild

Everything that distinguishes one run from another is set from outside the image. A pod's role is set through KubeRay parameters. KubeRay is an open-source Kubernetes operator that creates and maintains a cluster from a single RayCluster manifest. The GPU count and EFA interface are set through Kubernetes resource requests (nvidia.com/gpu: 4 and vpc.amazonaws.com/efa: 1). The network transport is set through the FI_PROVIDER, NCCL_NET_PLUGIN, NCCL_SOCKET_IFNAME and NCCL_DEBUG variables. Missing Python packages are installed for the duration of the job through runtime_env, and the image stays unchanged.

Pin the version. The vX.Y tag moves forward with rebuilds for security patches, while the full vX.Y.Z tag stays frozen at its original build. If you need a byte-for-byte identical run, pin the digest.

The cluster in the example is laid out as follows. An m7i.xlarge node runs the KubeRay operator and the Ray head without a GPU, so training doesn't land on it. Two g6.12xlarge nodes (four L4s, 48 vCPUs, 192 GiB of memory and one EFA interface each) sit in the same availability zone, because EFA traffic does not cross zones. Each runs one Ray worker pod that takes all four GPUs and the EFA interface. Jobs are submitted from inside the head pod via kubectl exec, so port 8265 on the job server is not exposed externally.

What the code looks like

Ray Train removes the need for a launcher. In multi-node PyTorch you normally start one process per GPU by hand and pass each one its rank, the group size and a rendezvous address. Here you write a train_func function and pass it to a TorchTrainer along with a ScalingConfig. Ray starts one worker per GPU, assembles the torch.distributed group and calls the function on each rank. The number of workers comes from the cluster's resources, so the same script runs on one node or several.

The example enables FSDP (Fully Sharded Data Parallel). Weights, gradients and optimizer state are split across all eight GPUs rather than copied to each one. For Qwen2.5-1.5B in bfloat16, that is about 12 GB, which comes to roughly 1.5 GB per card after splitting across eight. The cost is network traffic: at each step, a layer's weights are gathered before use and the gradients are then scattered back, so the whole model moves between ranks. Between the two servers, EFA carries that traffic.

What to keep in mind

The example builds its batches from random tokens (torch.randint), so it tests the infrastructure, not fine-tuning quality. For a real task, replace the random tensor with a Ray Data or DataLoader pipeline; the rest of the function stays the same.

You'll need AWS CLI v2, eksctl, kubectl, Helm and envsubst beforehand, plus a quota of 96 On-Demand vCPUs for the G instance family. If you already have an On-Demand Capacity Reservation, set CAPACITY_RESERVATION_ID, and the scripts will skip the search for available servers.

The practical takeaway: if a cluster launch gets stuck on a tangle of CUDA, NCCL and EFA versions, start with the ready-made image and pin its tag. Spend your time on data and the model, not on building containers.

Story

Key Questions Answered

What's inside the image?

The tag used in the example is public.ecr.aws/deep-learning-containers/ray:train-ml-cuda-v1.1. It contains Ray 2.58.0 with Train, Tune and Data, PyTorch 2.13.0, torchvision 0.28.0, CUDA 13.0.2 and NCCL 2.29.7. It also includes the EFA stack, the AWS OFI NCCL plugin, GDRCopy, DeepSpeed, flash-attn, Transformer Engine, PyTorch Lightning and Hugging Face libraries. NCCL diagnostics, including all_reduce_perf, are already in the image. Networking is the most unpleasant part.

What are the key details on Configure, don't rebuild?

Everything that distinguishes one run from another is set from outside the image. A pod's role is set through KubeRay parameters. KubeRay is an open-source Kubernetes operator that creates and maintains a cluster from a single RayCluster manifest. The GPU count and EFA interface are set through Kubernetes resource requests (nvidia.com/gpu: 4 and vpc.amazonaws.com/efa: 1). The network transport is set through the FI_PROVIDER, NCCL_NET_PLUGIN, NCCL_SOCKET_IFNAME and NCCL_DEBUG variables.

What the code looks like?

Ray Train removes the need for a launcher. In multi-node PyTorch you normally start one process per GPU by hand and pass each one its rank, the group size and a rendezvous address. Here you write a train_func function and pass it to a TorchTrainer along with a ScalingConfig. Ray starts one worker per GPU, assembles the torch.distributed group and calls the function on each rank. The number of workers comes from the cluster's resources, so the same script runs on one node or several.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — AWS Releases Ready-Made Image for 8-GPU Training: Kubernetes Setup Costs $9.50 an Hour https://news.hamidun.com/en/news/17562/aws-releases-ready-made-image-for-8-gpu-training-kubernetes

What do you think?
Loading comments…