Generalize distributed PyTorch training example#588
Conversation
…premises support This PR generalizes the PyTorch distributed training example to support multiple cloud providers (GKE, EKS, AKS) and on-premises Kubernetes deployments. The changes make cloud-specific configurations explicit through comments while maintaining backward compatibility and adding clear guidance for different deployment environments. Key changes: - Added on-premises Kubernetes nodeSelector examples and reorganized cloud provider configurations - Added comprehensive comments explaining storage access modes and StorageClass options - Updated documentation to cover all major cloud providers and on-premises deployments equally Benefits: - Multi-cloud support with clear guidance for GKE, EKS, AKS, and on-premises - Better documentation with comprehensive comments - Easier adoption with environment-specific configuration examples - Backward compatible - all existing configurations remain functional
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jayeshmahajan The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
soltysh
left a comment
There was a problem hiding this comment.
This PR has several problems:
- It uses
scheduling.k8s.io/v1alpha1. I prefer our examples use stable APIs that k8s supports. - The kustomiztion is pointing to non-existing files. Have you tried if this example works?
- Why both train.py and training-script-configmap.yaml are needed? I haven't compared them line-by-line, but I'd prefer to have a single copy, and if needed just use
kubectl create configmapto populate the necessary resource.
|
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Summary
This PR adds a new example demonstrating distributed training with PyTorch's Distributed Data Parallel (DDP) on Kubernetes. The example showcases multi-node, multi-GPU training using Kubernetes Jobs with comprehensive support for major cloud providers (GKE, EKS, AKS) and on-premises deployments.
What This Example Demonstrates
completionMode: IndexedKey Features
1. Distributed Training Setup
2. Kubernetes Resources
3. Multi-Cloud and On-Premises Support
4. Training Script
Files Included
training-job.yaml- Main Kubernetes Job configurationtrain.py- PyTorch DDP training scripttraining-script-configmap.yaml- Training script as ConfigMapservice.yaml- Headless Service for pod communicationdata-pvc.yaml/output-pvc.yaml- Persistent storagetrain-config.yaml- Training hyperparametersworkload.yaml- Workload-aware scheduling configurationkustomization.yaml- Kustomize base configurationREADME.md- Comprehensive documentation