-
Notifications
You must be signed in to change notification settings - Fork 86
/
smpv2.yaml-template
174 lines (173 loc) · 5.08 KB
/
smpv2.yaml-template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
apiVersion: v1
kind: Service
metadata:
name: etcd
spec:
ports:
- name: etcd-client-port
port: 2379
protocol: TCP
targetPort: 2379
selector:
app: etcd
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: etcd
name: etcd
spec:
replicas: 1
selector:
matchLabels:
app: etcd
template:
metadata:
labels:
app: etcd
spec:
containers:
- name: etcd
command: ["/usr/local/bin/etcd"]
args:
- "--data-dir"
- "/var/lib/etcd"
- "--enable-v2"
- "--listen-client-urls"
- "http://0.0.0.0:2379"
- "--advertise-client-urls"
- "http://0.0.0.0:2379"
- "--initial-cluster-state"
- "new"
image: quay.io/coreos/etcd:latest
ports:
- containerPort: 2379
name: client
protocol: TCP
- containerPort: 2380
name: server
protocol: TCP
restartPolicy: Always
---
apiVersion: "kubeflow.org/v1"
kind: PyTorchJob
metadata:
name: ${JOB_NAME}
spec:
elasticPolicy:
rdzvBackend: etcd
rdzvHost: etcd
rdzvPort: 2379
minReplicas: 1
maxReplicas: 64
maxRestarts: 100
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 90
pytorchReplicaSpecs:
Worker:
replicas: $NUM_NODES
restartPolicy: OnFailure
template:
metadata:
labels:
app: ${JOB_NAME}
spec:
volumes:
- name: shmem
hostPath:
path: /dev/shm
- name: local
hostPath:
path: /mnt/k8s-disks/0
- name: hyperpod
hostPath:
path: /var/log/aws/clusters
#nodeSelector:
# node.kubernetes.io/instance-type: "${INSTANCE_TYPE}"
containers:
- name: pytorch
image: ${IMAGE_URI}
imagePullPolicy: Always
resources:
requests:
nvidia.com/gpu: $GPU_PER_NODE
vpc.amazonaws.com/efa: $EFA_PER_NODE
limits:
nvidia.com/gpu: ${GPU_PER_NODE}
vpc.amazonaws.com/efa: ${EFA_PER_NODE}
env:
# for P5 FI_* should be commented out
- name: LOGLEVEL
value: "DEBUG"
#- name: FI_PROVIDER
# value: $FI_PROVIDER
#- name: FI_EFA_USE_DEVICE_RDMA
# value: "1"
#- name: FI_EFA_FORK_SAFE
# value: "1"
#- name: FI_LOG_LEVEL
# value: "1"
#- name: FI_EFA_ENABLE_SHM_TRANSFER
# value: "1"
- name: TORCH_DISTRIBUTED_DEBUG
value: "DETAIL"
- name: TORCH_NCCL_ENABLE_MONITORING
value: "1"
- name: TORCH_NCCL_TRACE_BUFFER_SIZE
value: "20000"
- name: TORCH_NCCL_DUMP_ON_TIMEOUT
value: "1"
- name: TORCH_NCCL_DEBUG_INFO_TEMP_FILE
value: "/local/nccl_trace_rank_"
- name: PYTORCH_CUDA_ALLOC_CONF
value: "expandable_segments:True"
- name: NCCL_DEBUG
value: "INFO"
- name: NCCL_SOCKET_IFNAME
value: "^lo"
- name: TORCH_NCCL_ASYNC_ERROR_HANDLING
value: "1"
#- name: TORCH_DIST_INIT_BARRIER
# value: "1"
#- name: NCCL_IGNORE_DISABLED_P2P
# value: "1"
#- name: NCCL_NVLS_ENABLE
# value: "0"
command:
- torchrun
- --nproc_per_node=$GPU_PER_NODE
- --nnodes=$NUM_NODES
- /workspace/train_external.py
- --train_batch_size=${TRAIN_BATCH_SIZE}
- --max_steps 100
- --hidden_width=${HIDDEN_WIDTH}
- --num_layers=${NUM_LAYERS}
- --num_heads=${NUM_HEADS}
- --llama_intermediate_size=${LLAMA_INTERMEDIATE_SIZE}
- --shard_degree=${SHARD_DEGREE}
- --model_type=llama_v2
- --profile_nsys=1
- --use_smp_implementation=1
- --max_context_width=4096
- --tensor_parallel_degree=1
- --use_synthetic_data=${USE_SYNTHETIC_DATA}
- --training_dir=${TRAINING_DIR}
- --test_dir=${TEST_DIR}
- --dataset_type=hf
- --checkpoint_dir=${CHECKPOINT_DIR}
- --checkpoint_freq=100
- --intermediate_size=11008
- --fp8=${USE_FP8}
volumeMounts:
- name: shmem
mountPath: /dev/shm
- name: local
mountPath: /local
- name: hyperpod
mountPath: /var/log/aws/clusters