File size: 16,162 Bytes
a8e6c70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1986f90
a8e6c70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25fac3d
 
 
 
 
1986f90
25fac3d
 
 
 
 
 
 
 
 
 
 
1986f90
25fac3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1986f90
25fac3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1986f90
25fac3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a8e6c70
 
 
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
{
  "tunableSpace": { "WORKGROUP_SIZE": [64, 128, 256] },
  "cases": [
    {
      "name": "softmax-f32-256x1024",
      "preset": "smoke",
      "vars": { "dtype": "float32", "rows": 256, "cols": 1024 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [256, 1024], "dtype": "float32", "dist": "normal", "seed": 107, "scale": 2 } },
      "outputs": { "y": { "shape": [256, 1024], "dtype": "float32" } },
      "bench": {
        "primary": true,
        "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }]
      }
    },
    {
      "name": "softmax-f32-4096x128-max-negative",
      "preset": "smoke",
      "vars": { "dtype": "float32", "rows": 4096, "cols": 128 },
      "attrs": { "axis": 1 },
      "inputs": {
        "x": { "shape": [4096, 128], "dtype": "float32", "dist": "constant", "value": -3.4028234663852886e+38 }
      },
      "outputs": { "y": { "shape": [4096, 128], "dtype": "float32" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-1024x2048",
      "preset": "stress",
      "vars": { "dtype": "float32", "rows": 1024, "cols": 2048 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [1024, 2048], "dtype": "float32", "dist": "normal", "seed": 108, "scale": 2 } },
      "outputs": { "y": { "shape": [1024, 2048], "dtype": "float32" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "gemma4-decode-logits-1x262144",
      "preset": "model",
      "vars": { "dtype": "float32", "rows": 1, "cols": 262144 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [1, 262144], "dtype": "float32", "dist": "normal", "seed": 380, "scale": 4 } },
      "outputs": { "y": { "shape": [1, 262144], "dtype": "float32" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "llama-prefill-attn-scores-16384x512",
      "preset": "model",
      "vars": { "dtype": "float32", "rows": 16384, "cols": 512 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [16384, 512], "dtype": "float32", "dist": "normal", "seed": 381, "scale": 2 } },
      "outputs": { "y": { "shape": [16384, 512], "dtype": "float32" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-8192x1023-odd-cols",
      "preset": "stress",
      "vars": { "dtype": "float32", "rows": 8192, "cols": 1023 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [8192, 1023], "dtype": "float32", "dist": "normal", "seed": 109, "scale": 2 } },
      "outputs": { "y": { "shape": [8192, 1023], "dtype": "float32" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "llama-prefill-attn-scores-16384x512-f16",
      "preset": "model",
      "vars": { "dtype": "float16", "rows": 16384, "cols": 512 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [16384, 512], "dtype": "float16", "dist": "normal", "seed": 382, "scale": 2 } },
      "outputs": { "y": { "shape": [16384, 512], "dtype": "float16" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-2048x8192",
      "preset": "stress",
      "vars": { "dtype": "float32", "rows": 2048, "cols": 8192 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [2048, 8192], "dtype": "float32", "dist": "normal", "seed": 410, "scale": 2 } },
      "outputs": { "y": { "shape": [2048, 8192], "dtype": "float32" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-2048x8191-odd-cols",
      "preset": "stress",
      "vars": { "dtype": "float32", "rows": 2048, "cols": 8191 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [2048, 8191], "dtype": "float32", "dist": "normal", "seed": 411, "scale": 2 } },
      "outputs": { "y": { "shape": [2048, 8191], "dtype": "float32" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-strided-rank3-16x2048x128-axis1",
      "preset": "stress",
      "vars": { "dtype": "float32", "outer": 16, "axisDim": 2048, "inner": 128 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [16, 2048, 128], "dtype": "float32", "dist": "normal", "seed": 412, "scale": 2 } },
      "outputs": { "y": { "shape": [16, 2048, 128], "dtype": "float32" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.outer * args.axisDim * args.inner * dtypeBytes(args.dtype) * 2" }
        ]
      }
    },
    {
      "name": "softmax-f16-2048x8192",
      "preset": "stress",
      "vars": { "dtype": "float16", "rows": 2048, "cols": 8192 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [2048, 8192], "dtype": "float16", "dist": "normal", "seed": 413, "scale": 2 } },
      "outputs": { "y": { "shape": [2048, 8192], "dtype": "float16" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-packed-rows-131072x32-control",
      "preset": "stress",
      "vars": { "dtype": "float32", "rows": 131072, "cols": 32 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [131072, 32], "dtype": "float32", "dist": "normal", "seed": 700, "scale": 2 } },
      "outputs": { "y": { "shape": [131072, 32], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-nosg-2097152x32-stable3pass-launchbound",
      "preset": "stress",
      "vars": { "dtype": "float32", "rows": 2097152, "cols": 32 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [2097152, 32], "dtype": "float32", "dist": "normal", "seed": 701, "scale": 2 } },
      "outputs": { "y": { "shape": [2097152, 32], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f16-strided-rank3-256x2048x130-axis1-uncoalesced",
      "preset": "stress",
      "vars": { "dtype": "float16", "outer": 256, "axisDim": 2048, "inner": 130 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [256, 2048, 130], "dtype": "float16", "dist": "normal", "seed": 702, "scale": 2 } },
      "outputs": { "y": { "shape": [256, 2048, 130], "dtype": "float16", "dist": "empty" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.outer * args.axisDim * args.inner * dtypeBytes(args.dtype) * 2" }
        ]
      }
    },
    {
      "name": "softmax-f32-strided-rank3-256x2048x130-axis1-inner-not-mod4",
      "preset": "stress",
      "vars": { "dtype": "float32", "outer": 256, "axisDim": 2048, "inner": 130 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [256, 2048, 130], "dtype": "float32", "dist": "normal", "seed": 703, "scale": 2 } },
      "outputs": { "y": { "shape": [256, 2048, 130], "dtype": "float32", "dist": "empty" } },
      "bench": {
        "metrics": [
          { "type": "bandwidth", "value": "args.outer * args.axisDim * args.inner * dtypeBytes(args.dtype) * 2" }
        ]
      }
    },
    {
      "name": "softmax-f32-64x262144-longrow-rows",
      "preset": "smoke",
      "vars": { "dtype": "float32", "rows": 2048, "cols": 8192 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [64, 262144], "dtype": "float32", "dist": "normal", "seed": 410, "scale": 2 } },
      "outputs": { "y": { "shape": [64, 262144], "dtype": "float32" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-131072x33-online-row-pathology",
      "preset": "stress",
      "provenance": {
        "notes": "One column past the packed-rows ceiling (<= 32 columns): 33 columns leave online_packed_rows_vec4_nosg for online_wg at one workgroup per row, about 32x the workgroup count of the same-bytes control softmax-f32-packed-rows-131072x32-control for a single added column."
      },
      "vars": { "dtype": "float32", "rows": 131072, "cols": 33 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [131072, 33], "dtype": "float32", "dist": "normal", "seed": 720, "scale": 2 } },
      "outputs": { "y": { "shape": [131072, 33], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-131072x64-subgroup-rows-control",
      "preset": "stress",
      "provenance": {
        "notes": "Measures softmax over 131,072 rows of 64 columns (a multiple of four); its 33-column sibling in this file has the same row count but moves half the bytes, so compare per element rather than per case."
      },
      "vars": { "dtype": "float32", "rows": 131072, "cols": 64 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [131072, 64], "dtype": "float32", "dist": "normal", "seed": 721, "scale": 2 } },
      "outputs": { "y": { "shape": [131072, 64], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-64x50257-vocab-odd-pathology",
      "preset": "stress",
      "provenance": {
        "notes": "GPT-2 vocabulary width 50,257 is not divisible by four, so it exercises scalar online workgroup Softmax. `softmax-f32-64x50260-vocab-control` provides the nearby vector-aligned control."
      },
      "vars": { "dtype": "float32", "rows": 64, "cols": 50257 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [64, 50257], "dtype": "float32", "dist": "normal", "seed": 722, "scale": 4 } },
      "outputs": { "y": { "shape": [64, 50257], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-64x50260-vocab-control",
      "preset": "stress",
      "provenance": {
        "notes": "The next multiple-of-four vocabulary width above the paired 50,257-column case, with nearly the same input bytes."
      },
      "vars": { "dtype": "float32", "rows": 64, "cols": 50260 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [64, 50260], "dtype": "float32", "dist": "normal", "seed": 723, "scale": 4 } },
      "outputs": { "y": { "shape": [64, 50260], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-4096x197-vit-tokens-pathology",
      "preset": "stress",
      "provenance": {
        "notes": "ViT-B/16 token count (196 patches + CLS) as the softmax row width, batched to ~0.8M elements: 197 % 4 != 0 rejects both the subgroup-per-row vec4 route and online_wg_vec4, leaving online_wg scalar. Control: softmax-f32-4096x200-vit-tokens-control."
      },
      "vars": { "dtype": "float32", "rows": 4096, "cols": 197 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [4096, 197], "dtype": "float32", "dist": "normal", "seed": 724, "scale": 2 } },
      "outputs": { "y": { "shape": [4096, 197], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-4096x200-vit-tokens-control",
      "preset": "stress",
      "provenance": {
        "notes": "A 200-column control for the paired 197-column ViT token case; the width changes input size by about 1.5%. Both subgroup and portable tiers must normalize every row."
      },
      "vars": { "dtype": "float32", "rows": 4096, "cols": 200 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [4096, 200], "dtype": "float32", "dist": "normal", "seed": 725, "scale": 2 } },
      "outputs": { "y": { "shape": [4096, 200], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
    },
    {
      "name": "softmax-f32-131072x21-narrow-unaligned-classes",
      "preset": "stress",
      "vars": { "dtype": "float32", "rows": 131072, "cols": 32 },
      "attrs": { "axis": 1 },
      "inputs": { "x": { "shape": [131072, 21], "dtype": "float32", "dist": "normal", "seed": 700, "scale": 2 } },
      "outputs": { "y": { "shape": [131072, 21], "dtype": "float32", "dist": "empty" } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] },
      "provenance": {
        "notes": "A segmentation head with 131,072 rows and 21 unaligned classes exercises the narrow scalar-row geometry."
      }
    },
    {
      "name": "online_stream_axis31_f16",
      "attrs": { "axis": 1 },
      "inputs": { "x": { "dtype": "float16", "shape": [2, 31, 8], "dist": "normal", "seed": 913, "scale": 2 } },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 31, 8] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "numel(shapes.x) * 4" }] }
    },
    {
      "name": "online_stream_axis32_f16",
      "attrs": { "axis": 1 },
      "inputs": { "x": { "dtype": "float16", "shape": [2, 32, 8], "dist": "normal", "seed": 913, "scale": 2 } },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 32, 8] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "numel(shapes.x) * 4" }] }
    },
    {
      "name": "online_stream_axis33_f16",
      "attrs": { "axis": 1 },
      "inputs": { "x": { "dtype": "float16", "shape": [2, 33, 8], "dist": "normal", "seed": 913, "scale": 2 } },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 33, 8] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "numel(shapes.x) * 4" }] }
    },
    {
      "name": "online_stream_axis64_f16",
      "attrs": { "axis": 1 },
      "inputs": { "x": { "dtype": "float16", "shape": [2, 64, 8], "dist": "normal", "seed": 913, "scale": 2 } },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 64, 8] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "numel(shapes.x) * 4" }] }
    },
    {
      "name": "online_stream_axis65_f16",
      "attrs": { "axis": 1 },
      "inputs": { "x": { "dtype": "float16", "shape": [2, 65, 8], "dist": "normal", "seed": 913, "scale": 2 } },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 65, 8] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "numel(shapes.x) * 4" }] }
    },
    {
      "name": "online_stream_columns_tail_f16",
      "attrs": { "axis": 1 },
      "inputs": { "x": { "dtype": "float16", "shape": [129, 67, 130], "dist": "normal", "seed": 913, "scale": 2 } },
      "outputs": { "y": { "dtype": "float16", "shape": [129, 67, 130] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "numel(shapes.x) * 4" }] }
    },
    {
      "name": "online_stream_four_way_tail_f16",
      "attrs": { "axis": 1 },
      "inputs": { "x": { "dtype": "float16", "shape": [2, 129, 8], "dist": "normal", "seed": 913, "scale": 2 } },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 129, 8] } },
      "bench": { "metrics": [{ "type": "bandwidth", "value": "numel(shapes.x) * 4" }] },
      "tunables": { "STRIDED_ONLINE_STREAMS": 4 }
    }
  ]
}