forked from rampasek/GraphGPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analysis.py
283 lines (251 loc) · 10.3 KB
/
analysis.py
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import matplotlib
font = {'family' : 'normal',
'size' : 13}
matplotlib.rc('font', **font)
# seconds
SINGLE_BATCH_256_TRAIN_TIME_SMALL = 1.0084445476531982
SINGLE_BATCH_256_TRAIN_TIME_VSMALL_HEADS = 1.0015337467193604
SINGLE_BATCH_256_TRAIN_TIME_VSMALL_DIMS = 1.004216194152832
SINGLE_BATCH_256_TRAIN_TIME_VSMALL_LAYERS = 1.0355498790740967
SINGLE_BATCH_256_TRAIN_TIME_VSMALL_BS = None # doesn't exist
SINGLE_BATCH_256_TRAIN_TIME_VVSMALL_HEADS = 0.9982786178588867
SINGLE_BATCH_256_TRAIN_TIME_VVSMALL_DIMS = 0.9732253551483154
SINGLE_BATCH_256_TRAIN_TIME_VVSMALL_LAYERS = 0.9351785182952881
SINGLE_BATCH_256_TRAIN_TIME_VVSMALL_BS = None # doesn't exist
# # heads, dims, layers
# df = pd.DataFrame([
# ["S", 0, 0, 1.00844454765319820],
# ["V-S", 1.0015337467193604, 1.004216194152832, 1.0355498790740967],
# ["VV-S", 0.9982786178588867, 0.9732253551483154, 0.9351785182952881]
# ], columns=["Model", "# Heads", "Embed Dims", "# Layers"])
# df.plot(x='Model',
# # y='Wall clock time (seconds)',
# kind='bar',
# stacked=False,
# title='Wall clock timings B=256')
# plt.xticks(rotation = 45)
# plt.show()
# --------------------------------------------------------------------
"""
DEFAULT SMALL
***LOCAL MESSAGE PASSING TIME: 0.006574392318725586
***TIME FOR GLOBAL MP: 0.004009723663330078
***LOCAL MESSAGE PASSING TIME: 0.002140522003173828
***TIME FOR GLOBAL MP: 0.0014035701751708984
***LOCAL MESSAGE PASSING TIME: 0.0018091201782226562
***TIME FOR GLOBAL MP: 0.0013108253479003906
***LOCAL MESSAGE PASSING TIME: 0.0018603801727294922
***TIME FOR GLOBAL MP: 0.0013709068298339844
***LOCAL MESSAGE PASSING TIME: 0.0021233558654785156
***TIME FOR GLOBAL MP: 0.0013146400451660156
"""
"""
VSMALL-HEADS
***LOCAL MESSAGE PASSING TIME: 0.002469778060913086
***TIME FOR GLOBAL MP: 0.001718282699584961
***LOCAL MESSAGE PASSING TIME: 0.001939535140991211
***TIME FOR GLOBAL MP: 0.0013890266418457031
***LOCAL MESSAGE PASSING TIME: 0.0016720294952392578
***TIME FOR GLOBAL MP: 0.0013582706451416016
***LOCAL MESSAGE PASSING TIME: 0.0016193389892578125
***TIME FOR GLOBAL MP: 0.0013918876647949219
***LOCAL MESSAGE PASSING TIME: 0.0018353462219238281
***TIME FOR GLOBAL MP: 0.0013759136199951172
"""
"""
VSMALL-DIMS
***LOCAL MESSAGE PASSING TIME: 0.0019409656524658203
***TIME FOR GLOBAL MP: 0.0012433528900146484
***LOCAL MESSAGE PASSING TIME: 0.0012507438659667969
***TIME FOR GLOBAL MP: 0.0009102821350097656
***LOCAL MESSAGE PASSING TIME: 0.0013573169708251953
***TIME FOR GLOBAL MP: 0.0011572837829589844
***LOCAL MESSAGE PASSING TIME: 0.0012180805206298828
***TIME FOR GLOBAL MP: 0.0008742809295654297
***LOCAL MESSAGE PASSING TIME: 0.001337289810180664
***TIME FOR GLOBAL MP: 0.0009407997131347656
"""
"""
VSMALL-LAYERS
***LOCAL MESSAGE PASSING TIME: 0.0025093555450439453
***TIME FOR GLOBAL MP: 0.0015192031860351562
***LOCAL MESSAGE PASSING TIME: 0.0015668869018554688
***TIME FOR GLOBAL MP: 0.0011320114135742188
***LOCAL MESSAGE PASSING TIME: 0.0017757415771484375
***TIME FOR GLOBAL MP: 0.0010657310485839844
"""
"""
VVSMALL-HEADS
***LOCAL MESSAGE PASSING TIME: 0.0025796890258789062
***TIME FOR GLOBAL MP: 0.001486063003540039
***LOCAL MESSAGE PASSING TIME: 0.0018987655639648438
***TIME FOR GLOBAL MP: 0.0013988018035888672
***LOCAL MESSAGE PASSING TIME: 0.001589059829711914
***TIME FOR GLOBAL MP: 0.0011355876922607422
***LOCAL MESSAGE PASSING TIME: 0.0016620159149169922
***TIME FOR GLOBAL MP: 0.0013828277587890625
***LOCAL MESSAGE PASSING TIME: 0.0018913745880126953
***TIME FOR GLOBAL MP: 0.0012438297271728516
"""
"""
VVSMALL-DIMS
***LOCAL MESSAGE PASSING TIME: 0.001840353012084961
***TIME FOR GLOBAL MP: 0.001302480697631836
***LOCAL MESSAGE PASSING TIME: 0.0011196136474609375
***TIME FOR GLOBAL MP: 0.0008313655853271484
***LOCAL MESSAGE PASSING TIME: 0.0011119842529296875
***TIME FOR GLOBAL MP: 0.0006880760192871094
***LOCAL MESSAGE PASSING TIME: 0.0012025833129882812
***TIME FOR GLOBAL MP: 0.0009164810180664062
***LOCAL MESSAGE PASSING TIME: 0.0010628700256347656
***TIME FOR GLOBAL MP: 0.0010035037994384766
"""
"""
VVSMALL-LAYERS
***LOCAL MESSAGE PASSING TIME: 0.002499818801879883
***TIME FOR GLOBAL MP: 0.0015349388122558594
"""
# # heads, dims, layers
# df = pd.DataFrame([
# ["S", 0.006574392318725586, 0.004009723663330078],
# ["VS-Heads", 0.002469778060913086, 0.001718282699584961],
# ["VS-Dims", 0.0019409656524658203, 0.0012433528900146484],
# ["VS-Layers", 0.0025093555450439453, 0.0015192031860351562],
# ["VVS-Heads", 0.0025796890258789062, 0.001486063003540039],
# ["VVS-Dims", 0.001840353012084961, 0.001302480697631836],
# ["VVS-Layers", 0.002499818801879883, 0.0015349388122558594]
# ], columns=["Model", "Local", "Global"])
# df.plot(x='Model',
# kind='bar',
# stacked=False,
# title='Wall clock timings B=256 | Layer=1')
# plt.xticks(rotation = 45)
# plt.show()
# --------------------------------------------------------------------
"""
DEFAULT SMALL
***LOCAL MESSAGE PASSING TIME: 0.006574392318725586
***TIME FOR GLOBAL MP: 0.004009723663330078
***LOCAL MESSAGE PASSING TIME: 0.002140522003173828
***TIME FOR GLOBAL MP: 0.0014035701751708984
***LOCAL MESSAGE PASSING TIME: 0.0018091201782226562
***TIME FOR GLOBAL MP: 0.0013108253479003906
***LOCAL MESSAGE PASSING TIME: 0.0018603801727294922
***TIME FOR GLOBAL MP: 0.0013709068298339844
***LOCAL MESSAGE PASSING TIME: 0.0021233558654785156
***TIME FOR GLOBAL MP: 0.0013146400451660156
"""
"""
VSMALL-HEADS
***LOCAL MESSAGE PASSING TIME: 0.002469778060913086
***TIME FOR GLOBAL MP: 0.001718282699584961
***LOCAL MESSAGE PASSING TIME: 0.001939535140991211
***TIME FOR GLOBAL MP: 0.0013890266418457031
***LOCAL MESSAGE PASSING TIME: 0.0016720294952392578
***TIME FOR GLOBAL MP: 0.0013582706451416016
***LOCAL MESSAGE PASSING TIME: 0.0016193389892578125
***TIME FOR GLOBAL MP: 0.0013918876647949219
***LOCAL MESSAGE PASSING TIME: 0.0018353462219238281
***TIME FOR GLOBAL MP: 0.0013759136199951172
"""
"""
VSMALL-DIMS
***LOCAL MESSAGE PASSING TIME: 0.0019409656524658203
***TIME FOR GLOBAL MP: 0.0012433528900146484
***LOCAL MESSAGE PASSING TIME: 0.0012507438659667969
***TIME FOR GLOBAL MP: 0.0009102821350097656
***LOCAL MESSAGE PASSING TIME: 0.0013573169708251953
***TIME FOR GLOBAL MP: 0.0011572837829589844
***LOCAL MESSAGE PASSING TIME: 0.0012180805206298828
***TIME FOR GLOBAL MP: 0.0008742809295654297
***LOCAL MESSAGE PASSING TIME: 0.001337289810180664
***TIME FOR GLOBAL MP: 0.0009407997131347656
"""
"""
VSMALL-LAYERS
***LOCAL MESSAGE PASSING TIME: 0.0025093555450439453
***TIME FOR GLOBAL MP: 0.0015192031860351562
***LOCAL MESSAGE PASSING TIME: 0.0015668869018554688
***TIME FOR GLOBAL MP: 0.0011320114135742188
***LOCAL MESSAGE PASSING TIME: 0.0017757415771484375
***TIME FOR GLOBAL MP: 0.0010657310485839844
"""
"""
VVSMALL-HEADS
***LOCAL MESSAGE PASSING TIME: 0.0025796890258789062
***TIME FOR GLOBAL MP: 0.001486063003540039
***LOCAL MESSAGE PASSING TIME: 0.0018987655639648438
***TIME FOR GLOBAL MP: 0.0013988018035888672
***LOCAL MESSAGE PASSING TIME: 0.001589059829711914
***TIME FOR GLOBAL MP: 0.0011355876922607422
***LOCAL MESSAGE PASSING TIME: 0.0016620159149169922
***TIME FOR GLOBAL MP: 0.0013828277587890625
***LOCAL MESSAGE PASSING TIME: 0.0018913745880126953
***TIME FOR GLOBAL MP: 0.0012438297271728516
"""
"""
VVSMALL-DIMS
***LOCAL MESSAGE PASSING TIME: 0.001840353012084961
***TIME FOR GLOBAL MP: 0.001302480697631836
***LOCAL MESSAGE PASSING TIME: 0.0011196136474609375
***TIME FOR GLOBAL MP: 0.0008313655853271484
***LOCAL MESSAGE PASSING TIME: 0.0011119842529296875
***TIME FOR GLOBAL MP: 0.0006880760192871094
***LOCAL MESSAGE PASSING TIME: 0.0012025833129882812
***TIME FOR GLOBAL MP: 0.0009164810180664062
***LOCAL MESSAGE PASSING TIME: 0.0010628700256347656
***TIME FOR GLOBAL MP: 0.0010035037994384766
"""
"""
VVSMALL-LAYERS
***LOCAL MESSAGE PASSING TIME: 0.002499818801879883
***TIME FOR GLOBAL MP: 0.0015349388122558594
"""
# heads, dims, layers
df = pd.DataFrame([
["S-L1", 0.006574392318725586, 0.004009723663330078],
["S-L2", 0.002140522003173828, 0.0014035701751708984],
["S-L3", 0.0018091201782226562, 0.0013108253479003906],
["S-L4", 0.0018603801727294922, 0.0013709068298339844],
["S-L5", 0.0021233558654785156, 0.0013146400451660156],
["VS-Hds-L1", 0.002469778060913086, 0.001718282699584961],
["VS-Hds-L2", 0.001939535140991211, 0.0013890266418457031],
["VS-Hds-L3", 0.0016720294952392578, 0.0013582706451416016],
["VS-Hds-L4", 0.0016193389892578125, 0.0013918876647949219],
["VS-Hds-L5", 0.0018353462219238281, 0.0013759136199951172],
["VVS-Hds-L1", 0.0025796890258789062, 0.001486063003540039],
["VVS-Hds-L2", 0.0018987655639648438, 0.0013988018035888672],
["VVS-Hds-L3", 0.001589059829711914, 0.0011355876922607422],
["VVS-Hds-L4", 0.0016620159149169922, 0.0013828277587890625],
["VVS-Hds-L5", 0.0018913745880126953, 0.0012438297271728516]
], columns=["Model", "Local", "Global"])
df.plot(x='Model',
kind='bar',
stacked=True,
title='Layer-wise clock timings B=256')
plt.xticks(rotation = 45)
plt.show()
# --------------------------------------------------------------------
SINGLE_BATCH_256_LMP_INFERENCE_TIME_SMALL = None
SINGLE_BATCH_256_LMP_INFERENCE_TIME_VSMALL_HEADS = None
SINGLE_BATCH_256_LMP_INFERENCE_TIME_VSMALL_DIMS = None
SINGLE_BATCH_256_LMP_INFERENCE_TIME_VSMALL_LAYERS = None
SINGLE_BATCH_256_LMP_INFERENCE_TIME_VSMALL_BS = None
SINGLE_BATCH_256_GMP_INFERENCE_TIME_SMALL = None
SINGLE_BATCH_256_GMP_INFERENCE_TIME_VSMALL_HEADS = None
SINGLE_BATCH_256_GMP_INFERENCE_TIME_VSMALL_DIMS = None
SINGLE_BATCH_256_GMP_INFERENCE_TIME_VSMALL_LAYERS = None
SINGLE_BATCH_256_GMP_INFERENCE_TIME_VSMALL_BS = None
SINGLE_BATCH_256_ATTENTION_DOTPRODUCT_STEP_TIME_SMALL = None
SINGLE_BATCH_256_ATTENTION_DOTPRODUCT_STEP_TIME_VSMALL_HEADS = None
SINGLE_BATCH_256_ATTENTION_DOTPRODUCT_STEP_TIME_VSMALL_DIMS = None
SINGLE_BATCH_256_ATTENTION_DOTPRODUCT_STEP_TIME_VSMALL_LAYERS = None
SINGLE_BATCH_256_ATTENTION_DOTPRODUCT_STEP_TIME_VSMALL_BS = None
SINGLE_BATCH_256_ATTENTION_PROJECTION_STEP_TIME_SMALL = None
SINGLE_BATCH_256_ATTENTION_PROJECTION_STEP_TIME_VSMALL_HEADS = None
SINGLE_BATCH_256_ATTENTION_PROJECTION_STEP_TIME_VSMALL_DIMS = None
SINGLE_BATCH_256_ATTENTION_PROJECTION_STEP_TIME_VSMALL_LAYERS = None
SINGLE_BATCH_256_ATTENTION_PROJECTION_STEP_TIME_VSMALL_BS = None