-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathcomplete-train.yaml
232 lines (232 loc) · 7.88 KB
/
complete-train.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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
##############################################
##
## complete-train-pipeline:
##
## - presteps (collect metrics at idle state and record start time)
## - run stressng workloads (tasks/stressng-task.yaml)
## - collect metrics (record end time and collect metrics when running stressng)
## - run original model server pipeline which produces AbsPower and DynPower
## for all available feature groups
##
##############################################
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: complete-train-pipeline
spec:
workspaces:
- name: mnt
description: Mount path
params:
- name: MODEL_SERVER_IMAGE
description: Specify model server image
default: quay.io/sustainable_computing_io/kepler_model_server:latest
- name: PIPELINE_NAME
description: Specify pipeline name (output prefix/folder)
- name: ENERGY_SOURCE
description: Specify target energy sources (check https://sustainable-computing.io/kepler_model_server/pipeline/#energy-source)
default: acpi,rapl-sysfs
- name: IDLE_COLLECT_INTERVAL
description: Specify interval time to collect profile (idle) data before start the workload
default: 100
- name: STRESS_BREAK_INTERVAL
description: Specify break interval between each stress load
default: 5
- name: STRESS_TIMEOUT
description: Specify stress duration (timeout to stop stress)
default: 30
- name: STRESS_ARGS
description: List arguments for CPU frequency and stressng workload (CPU_FREQUENCY;STRESS_LOAD;STRESS_INSTANCE_NUM;STRESS_EXTRA_PARAM_KEYS;STRESS_EXTRA_PARAM_VALS)
type: array
default:
- cpu;none;none
- branch;none;none
- regs;none;none
- l1cache;none;none
- cache;none;none
- stream;none;none
- vm-rw;vm-rw-bytes;4G
- sctp;none;none
- name: EXTRACTOR
description: Specify extractor class (default or smooth)
default: default
- name: ISOLATOR
description: Specify isolator class (none, min, profile, or trainer (if ABS_PIPELINE_NAME is set)
default: min
- name: ABS_TRAINERS
description: Specify trainer names for AbsPower training (use comma(,) as delimiter)
default: default
- name: DYN_TRAINERS
description: Specify trainer names for DynPower training (use comma(,) as delimiter)
default: default
- name: THIRDPARTY_METRICS
description: Specify list of third party metric to export (required only for ThirdParty feature group)
default: ""
- name: ABS_PIPELINE_NAME
description: Specify pipeline name to be used for initializing trainer isolator
default: ""
- name: COS_PROVIDER
description: Specify COS provider (supported choices are ibmcloud, aws)
default: ""
- name: COS_SECRET_NAME
description: Specify COS secret name
default: ""
- name: MACHINE_ID
description: Specify machine id to group model result in bucket
default: ""
- name: CPU_FREQUENCY_ENABLED
description: Enable/Disable CPU Frequency Steps
default: true
tasks:
- name: presteps
params:
- name: IDLE_COLLECT_INTERVAL
value: $(params.IDLE_COLLECT_INTERVAL)
- name: THIRDPARTY_METRICS
value: $(params.THIRDPARTY_METRICS)
- name: MODEL_SERVER_IMAGE
value: $(params.MODEL_SERVER_IMAGE)
- name: MACHINE_ID
value: $(params.MACHINE_ID)
taskSpec:
workspaces:
- name: mnt
optional: true
params:
- name: IDLE_COLLECT_INTERVAL
- name: THIRDPARTY_METRICS
- name: MODEL_SERVER_IMAGE
- name: MACHINE_ID
results:
- name: stress-start-time
description: The time recorded before running the workload
steps:
- name: collect-idle
image: $(params.MODEL_SERVER_IMAGE)
args:
- query
- --data-path=$(workspaces.mnt.path)/data
- --interval=$(params.IDLE_COLLECT_INTERVAL)
- --thirdparty-metrics="$(params.THIRDPARTY_METRICS)"
- --benchmark=idle
- -o=idle
- --id=$(params.MACHINE_ID)
command: [kepler-model]
env:
- name: PROM_SERVER
value: http://prometheus-k8s.monitoring.svc:9090
- name: record-start-time
image: bash:5.2
script: |
#!/usr/bin/env bash
echo -n $(date +%Y-%m-%dT%H:%M:%SZ) > $(results.stress-start-time.path)
- name: run-stressng
runAfter: [presteps]
taskRef:
name: run-stressng
timeout: 5h
params:
- name: INTERVAL
value: $(params.STRESS_BREAK_INTERVAL)
- name: TIMEOUT
value: $(params.STRESS_TIMEOUT)
- name: arguments
value: $(params.STRESS_ARGS[*])
- name: CPU_FREQUENCY_ENABLED
value: $(params.CPU_FREQUENCY_ENABLED)
- name: collect-metric
runAfter: [run-stressng]
params:
- name: THIRDPARTY_METRICS
value: $(params.THIRDPARTY_METRICS)
- name: MODEL_SERVER_IMAGE
value: $(params.MODEL_SERVER_IMAGE)
- name: MACHINE_ID
value: $(params.MACHINE_ID)
taskSpec:
workspaces:
- name: mnt
optional: true
params:
- name: BENCHMARK
default: stressng
- name: THIRDPARTY_METRICS
- name: MODEL_SERVER_IMAGE
- name: MACHINE_ID
steps:
- name: collect-stressng
image: $(params.MODEL_SERVER_IMAGE)
args:
- query
- --data-path=$(workspaces.mnt.path)/data
- --start-time=$(tasks.presteps.results.stress-start-time)
- --end-time=$(tasks.run-stressng.results.stress-end-time)
- --thirdparty-metrics="$(params.THIRDPARTY_METRICS)"
- --benchmark=stressng
- -o=kepler_query
- --id=$(params.MACHINE_ID)
command: [kepler-model]
env:
- name: PROM_SERVER
value: http://prometheus-k8s.monitoring.svc:9090
- name: train-from-query
runAfter: [collect-metric]
workspaces:
- name: mnt
taskRef:
name: original-pipeline-task
params:
- name: MODEL_SERVER_IMAGE
value: $(params.MODEL_SERVER_IMAGE)
- name: PIPELINE_NAME
value: $(params.PIPELINE_NAME)
- name: EXTRACTOR
value: $(params.EXTRACTOR)
- name: ISOLATOR
value: $(params.ISOLATOR)
- name: ABS_TRAINERS
value: $(params.ABS_TRAINERS)
- name: DYN_TRAINERS
value: $(params.DYN_TRAINERS)
- name: ENERGY_SOURCE
value: $(params.ENERGY_SOURCE)
- name: THIRDPARTY_METRICS
value: $(params.THIRDPARTY_METRICS)
- name: MACHINE_ID
value: $(params.MACHINE_ID)
- name: ibmcloud-s3-push
runAfter: [train-from-query]
when:
- input: $(params.COS_PROVIDER)
operator: in
values: [ibmcloud]
- input: $(params.COS_SECRET_NAME)
operator: notin
values: [""]
workspaces:
- name: mnt
params:
- name: COS_SECRET_NAME
value: $(params.COS_SECRET_NAME)
- name: MACHINE_ID
value: $(params.MACHINE_ID)
taskRef:
name: ibmcloud-s3-push
- name: aws-s3-push
runAfter: [train-from-query]
when:
- input: $(params.COS_PROVIDER)
operator: in
values: [aws]
- input: $(params.COS_SECRET_NAME)
operator: notin
values: [""]
workspaces:
- name: mnt
params:
- name: COS_SECRET_NAME
value: $(params.COS_SECRET_NAME)
- name: MACHINE_ID
value: $(params.MACHINE_ID)
taskRef:
name: aws-s3-push