This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
forked from kubeflow/katib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mxjob-byteps.yaml
85 lines (85 loc) · 2.44 KB
/
mxjob-byteps.yaml
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
apiVersion: kubeflow.org/v1beta1
kind: Experiment
metadata:
namespace: kubeflow
name: mxjob-byteps
spec:
objective:
type: maximize
goal: 0.99
objectiveMetricName: Train-accuracy
algorithm:
algorithmName: random
parallelTrialCount: 1
maxTrialCount: 4
maxFailedTrialCount: 3
parameters:
- name: lr
parameterType: double
feasibleSpace:
min: "0.1"
max: "0.11"
trialTemplate:
primaryContainerName: mxnet
# In this example we can collect metrics only from the Worker pods.
primaryPodLabels:
training.kubeflow.org/replica-type: worker
trialParameters:
- name: learningRate
description: Learning rate for the training model
reference: lr
trialSpec:
apiVersion: kubeflow.org/v1
kind: MXJob
spec:
jobMode: MXTrain
runPolicy:
cleanPodPolicy: None
mxReplicaSpecs:
Scheduler:
replicas: 1
restartPolicy: Never
template:
spec:
containers:
- name: mxnet
image: docker.io/bytepsimage/mxnet
command: ["bpslaunch"]
Server:
replicas: 1
restartPolicy: Never
template:
spec:
containers:
- name: mxnet
image: docker.io/bytepsimage/mxnet
command: ["bpslaunch"]
Worker:
replicas: 1
restartPolicy: Never
template:
spec:
containers:
- name: mxnet
image: docker.io/bytepsimage/mxnet
command: ["bpslaunch"]
args:
[
"python3",
"/usr/local/byteps/example/mxnet/train_imagenet_byteps.py",
"--benchmark",
"1",
"--lr=${trialParameters.learningRate}",
"--num-examples=1000",
"--num-epochs=4",
]
volumeMounts:
- mountPath: /dev/shm
name: dshm
resources:
limits:
nvidia.com/gpu: 1
volumes:
- name: dshm
emptyDir:
medium: Memory