Xenova HF Staff commited on
Commit
3cb6621
·
verified ·
1 Parent(s): ddb8d7f

sync 6fdf6301e2bb

Browse files
README.md CHANGED
@@ -42,18 +42,26 @@ Attributes and default values (overridable per request):
42
  | --- | --- |
43
  | `T` | `float32`, `float16`, `int32`, `int16`, `int8`, `uint32`, `uint8`, `bool` |
44
 
 
 
 
 
 
 
 
45
  ## Files
46
 
47
  - [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, per-variant templates, provenance)
48
  - [`manifest.json`](build/webgpu/manifest.json) — the op contract (source of truth)
49
  - [`test.json`](build/webgpu/test.json) — correctness cases
50
- - [`bench.json`](build/webgpu/bench.json) — benchmark + tuning cases
 
51
  - [`space-depth-permute.wgsl.jinja`](build/webgpu/space-depth-permute.wgsl.jinja)
52
 
53
  ## Use with `@huggingface/kernels`
54
 
55
  ```sh
56
- npm install --save-exact @huggingface/kernels@0.0.1-preview.2
57
  ```
58
 
59
  Required output shapes and logical data types are inferred from the supplied inputs and attributes; result tensors are allocated automatically.
 
42
  | --- | --- |
43
  | `T` | `float32`, `float16`, `int32`, `int16`, `int8`, `uint32`, `uint8`, `bool` |
44
 
45
+ ## Implementation variants
46
+
47
+ One implementation is selected per call from the device capabilities, the request shapes and the dtypes; these notes say what each one covers.
48
+
49
+ - `flat_vector` — Groups four flat outputs per invocation, including groups that cross spatial rows or channels. Reuses the shared permutation coordinates and writes one contiguous vector.
50
+ - `collapsed_input_vector` — When one spatial block spans the input plane, reads contiguous vec4 words and writes channel streams. Spatial tiles balance the available channel workgroups; paired f16 channels give each invocation whole output words.
51
+
52
  ## Files
53
 
54
  - [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, per-variant templates, provenance)
55
  - [`manifest.json`](build/webgpu/manifest.json) — the op contract (source of truth)
56
  - [`test.json`](build/webgpu/test.json) — correctness cases
57
+ - [`bench.json`](build/webgpu/bench.json) — benchmark cases
58
+ - [`space-depth-collapsed-input.wgsl.jinja`](build/webgpu/space-depth-collapsed-input.wgsl.jinja)
59
  - [`space-depth-permute.wgsl.jinja`](build/webgpu/space-depth-permute.wgsl.jinja)
60
 
61
  ## Use with `@huggingface/kernels`
62
 
63
  ```sh
64
+ npm install --save-exact @huggingface/kernels@0.0.1-preview.3
65
  ```
66
 
67
  Required output shapes and logical data types are inferred from the supplied inputs and attributes; result tensors are allocated automatically.
build/webgpu/bench.json CHANGED
@@ -43,6 +43,270 @@
43
  },
44
  "outputs": { "output": { "dtype": "float32", "shape": [1, 512, 1024, 3] } },
45
  "bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
  ]
48
  }
 
43
  },
44
  "outputs": { "output": { "dtype": "float32", "shape": [1, 512, 1024, 3] } },
45
  "bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
46
+ },
47
+ {
48
+ "name": "collapsed_float32_n2_c65_b2",
49
+ "attrs": { "blocksize": 2 },
50
+ "inputs": { "input": { "dtype": "float32", "shape": [2, 65, 2, 2], "dist": "normal", "seed": 1827, "scale": 1 } },
51
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 260, 1, 1] } },
52
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "4160" }] }
53
+ },
54
+ {
55
+ "name": "collapsed_float32_n2_c66_b2",
56
+ "attrs": { "blocksize": 2 },
57
+ "inputs": { "input": { "dtype": "float32", "shape": [2, 66, 2, 2], "dist": "normal", "seed": 1827, "scale": 1 } },
58
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 264, 1, 1] } },
59
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "4224" }] }
60
+ },
61
+ {
62
+ "name": "collapsed_float32_n1_c65537_b4",
63
+ "attrs": { "blocksize": 4 },
64
+ "inputs": {
65
+ "input": { "dtype": "float32", "shape": [1, 65537, 4, 4], "dist": "normal", "seed": 1827, "scale": 1 }
66
+ },
67
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1048592, 1, 1] } },
68
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "8388736" }] }
69
+ },
70
+ {
71
+ "name": "collapsed_float32_n1_c65536_b6",
72
+ "attrs": { "blocksize": 6 },
73
+ "inputs": {
74
+ "input": { "dtype": "float32", "shape": [1, 65536, 6, 6], "dist": "normal", "seed": 1827, "scale": 1 }
75
+ },
76
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 2359296, 1, 1] } },
77
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "18874368" }] }
78
+ },
79
+ {
80
+ "name": "collapsed_float32_n1_c65536_b3",
81
+ "attrs": { "blocksize": 3 },
82
+ "inputs": {
83
+ "input": { "dtype": "float32", "shape": [1, 65536, 3, 3], "dist": "normal", "seed": 1827, "scale": 1 }
84
+ },
85
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 589824, 1, 1] } },
86
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "4718592" }] }
87
+ },
88
+ {
89
+ "name": "collapsed_float32_n1_c262143_b2",
90
+ "attrs": { "blocksize": 2 },
91
+ "inputs": {
92
+ "input": { "dtype": "float32", "shape": [1, 262143, 2, 2], "dist": "normal", "seed": 1827, "scale": 1 }
93
+ },
94
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1048572, 1, 1] } },
95
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "8388576" }] }
96
+ },
97
+ {
98
+ "name": "collapsed_float32_n1_c262144_b2",
99
+ "attrs": { "blocksize": 2 },
100
+ "inputs": {
101
+ "input": { "dtype": "float32", "shape": [1, 262144, 2, 2], "dist": "normal", "seed": 1827, "scale": 1 }
102
+ },
103
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1048576, 1, 1] } },
104
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "8388608" }] }
105
+ },
106
+ {
107
+ "name": "flat_float32_n2_c65_6x10_b2",
108
+ "attrs": { "blocksize": 2 },
109
+ "inputs": { "input": { "dtype": "float32", "shape": [2, 65, 6, 10], "dist": "normal", "seed": 1828, "scale": 1 } },
110
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 260, 3, 5] } },
111
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "62400" }] }
112
+ },
113
+ {
114
+ "name": "flat_float32_n1_c64_1024x10_b2",
115
+ "attrs": { "blocksize": 2 },
116
+ "inputs": {
117
+ "input": { "dtype": "float32", "shape": [1, 64, 1024, 10], "dist": "normal", "seed": 1828, "scale": 1 }
118
+ },
119
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 256, 512, 5] } },
120
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "5242880" }] }
121
+ },
122
+ {
123
+ "name": "flat_float32_n2_c64_12x15_b3",
124
+ "attrs": { "blocksize": 3 },
125
+ "inputs": {
126
+ "input": { "dtype": "float32", "shape": [2, 64, 12, 15], "dist": "normal", "seed": 1828, "scale": 1 }
127
+ },
128
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 576, 4, 5] } },
129
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "184320" }] }
130
+ },
131
+ {
132
+ "name": "collapsed_float16_n2_c65_b2",
133
+ "attrs": { "blocksize": 2 },
134
+ "inputs": { "input": { "dtype": "float16", "shape": [2, 65, 2, 2], "dist": "normal", "seed": 1827, "scale": 1 } },
135
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 260, 1, 1] } },
136
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "2080" }] }
137
+ },
138
+ {
139
+ "name": "collapsed_float16_n2_c66_b2",
140
+ "attrs": { "blocksize": 2 },
141
+ "inputs": { "input": { "dtype": "float16", "shape": [2, 66, 2, 2], "dist": "normal", "seed": 1827, "scale": 1 } },
142
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 264, 1, 1] } },
143
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "2112" }] }
144
+ },
145
+ {
146
+ "name": "collapsed_float16_n1_c65537_b4",
147
+ "attrs": { "blocksize": 4 },
148
+ "inputs": {
149
+ "input": { "dtype": "float16", "shape": [1, 65537, 4, 4], "dist": "normal", "seed": 1827, "scale": 1 }
150
+ },
151
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 1048592, 1, 1] } },
152
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "4194368" }] }
153
+ },
154
+ {
155
+ "name": "collapsed_float16_n1_c65536_b6",
156
+ "attrs": { "blocksize": 6 },
157
+ "inputs": {
158
+ "input": { "dtype": "float16", "shape": [1, 65536, 6, 6], "dist": "normal", "seed": 1827, "scale": 1 }
159
+ },
160
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 2359296, 1, 1] } },
161
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "9437184" }] }
162
+ },
163
+ {
164
+ "name": "collapsed_float16_n1_c65536_b3",
165
+ "attrs": { "blocksize": 3 },
166
+ "inputs": {
167
+ "input": { "dtype": "float16", "shape": [1, 65536, 3, 3], "dist": "normal", "seed": 1827, "scale": 1 }
168
+ },
169
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 589824, 1, 1] } },
170
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "2359296" }] }
171
+ },
172
+ {
173
+ "name": "collapsed_float16_n1_c262143_b2",
174
+ "attrs": { "blocksize": 2 },
175
+ "inputs": {
176
+ "input": { "dtype": "float16", "shape": [1, 262143, 2, 2], "dist": "normal", "seed": 1827, "scale": 1 }
177
+ },
178
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 1048572, 1, 1] } },
179
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "4194288" }] }
180
+ },
181
+ {
182
+ "name": "collapsed_float16_n1_c262144_b2",
183
+ "attrs": { "blocksize": 2 },
184
+ "inputs": {
185
+ "input": { "dtype": "float16", "shape": [1, 262144, 2, 2], "dist": "normal", "seed": 1827, "scale": 1 }
186
+ },
187
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 1048576, 1, 1] } },
188
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "4194304" }] }
189
+ },
190
+ {
191
+ "name": "flat_float16_n2_c65_6x10_b2",
192
+ "attrs": { "blocksize": 2 },
193
+ "inputs": { "input": { "dtype": "float16", "shape": [2, 65, 6, 10], "dist": "normal", "seed": 1828, "scale": 1 } },
194
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 260, 3, 5] } },
195
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "31200" }] }
196
+ },
197
+ {
198
+ "name": "flat_float16_n1_c64_1024x10_b2",
199
+ "attrs": { "blocksize": 2 },
200
+ "inputs": {
201
+ "input": { "dtype": "float16", "shape": [1, 64, 1024, 10], "dist": "normal", "seed": 1828, "scale": 1 }
202
+ },
203
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 256, 512, 5] } },
204
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "2621440" }] }
205
+ },
206
+ {
207
+ "name": "flat_float16_n2_c64_12x15_b3",
208
+ "attrs": { "blocksize": 3 },
209
+ "inputs": {
210
+ "input": { "dtype": "float16", "shape": [2, 64, 12, 15], "dist": "normal", "seed": 1828, "scale": 1 }
211
+ },
212
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 576, 4, 5] } },
213
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "92160" }] }
214
+ },
215
+ {
216
+ "name": "spatial_parallel_float32_n1_c1_b64",
217
+ "attrs": { "blocksize": 64 },
218
+ "inputs": { "input": { "dtype": "float32", "shape": [1, 1, 64, 64], "dist": "normal", "seed": 1891, "scale": 1 } },
219
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 4096, 1, 1] } },
220
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "32768" }] }
221
+ },
222
+ {
223
+ "name": "spatial_parallel_float32_n2_c3_b64",
224
+ "attrs": { "blocksize": 64 },
225
+ "inputs": { "input": { "dtype": "float32", "shape": [2, 3, 64, 64], "dist": "normal", "seed": 1891, "scale": 1 } },
226
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 12288, 1, 1] } },
227
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "196608" }] }
228
+ },
229
+ {
230
+ "name": "spatial_parallel_float32_n1_c256_b32",
231
+ "attrs": { "blocksize": 32 },
232
+ "inputs": {
233
+ "input": { "dtype": "float32", "shape": [1, 256, 32, 32], "dist": "normal", "seed": 1891, "scale": 1 }
234
+ },
235
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 262144, 1, 1] } },
236
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "2097152" }] }
237
+ },
238
+ {
239
+ "name": "spatial_parallel_float32_n1_c16_b64",
240
+ "attrs": { "blocksize": 64 },
241
+ "inputs": {
242
+ "input": { "dtype": "float32", "shape": [1, 16, 64, 64], "dist": "normal", "seed": 1891, "scale": 1 }
243
+ },
244
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 65536, 1, 1] } },
245
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "524288" }] }
246
+ },
247
+ {
248
+ "name": "spatial_parallel_float16_n1_c1_b64",
249
+ "attrs": { "blocksize": 64 },
250
+ "inputs": { "input": { "dtype": "float16", "shape": [1, 1, 64, 64], "dist": "normal", "seed": 1891, "scale": 1 } },
251
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 4096, 1, 1] } },
252
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "16384" }] }
253
+ },
254
+ {
255
+ "name": "spatial_parallel_float16_n2_c3_b64",
256
+ "attrs": { "blocksize": 64 },
257
+ "inputs": { "input": { "dtype": "float16", "shape": [2, 3, 64, 64], "dist": "normal", "seed": 1891, "scale": 1 } },
258
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 12288, 1, 1] } },
259
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "98304" }] }
260
+ },
261
+ {
262
+ "name": "spatial_parallel_float16_n1_c256_b32",
263
+ "attrs": { "blocksize": 32 },
264
+ "inputs": {
265
+ "input": { "dtype": "float16", "shape": [1, 256, 32, 32], "dist": "normal", "seed": 1891, "scale": 1 }
266
+ },
267
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 262144, 1, 1] } },
268
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "1048576" }] }
269
+ },
270
+ {
271
+ "name": "spatial_parallel_float16_n1_c16_b64",
272
+ "attrs": { "blocksize": 64 },
273
+ "inputs": {
274
+ "input": { "dtype": "float16", "shape": [1, 16, 64, 64], "dist": "normal", "seed": 1891, "scale": 1 }
275
+ },
276
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 65536, 1, 1] } },
277
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "262144" }] }
278
+ },
279
+ {
280
+ "name": "spatial_partial_float32_n2_c129_b4",
281
+ "attrs": { "blocksize": 4 },
282
+ "tunables": { "WORKGROUP_SIZE": 64 },
283
+ "inputs": { "input": { "dtype": "float32", "shape": [2, 129, 4, 4], "dist": "normal", "seed": 1892, "scale": 1 } },
284
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 2064, 1, 1] } },
285
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "33024" }] }
286
+ },
287
+ {
288
+ "name": "spatial_partial_float32_n2_c257_b6",
289
+ "attrs": { "blocksize": 6 },
290
+ "tunables": { "WORKGROUP_SIZE": 64 },
291
+ "inputs": { "input": { "dtype": "float32", "shape": [2, 257, 6, 6], "dist": "normal", "seed": 1892, "scale": 1 } },
292
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 9252, 1, 1] } },
293
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "148032" }] }
294
+ },
295
+ {
296
+ "name": "spatial_partial_float16_n2_c258_b4",
297
+ "attrs": { "blocksize": 4 },
298
+ "tunables": { "WORKGROUP_SIZE": 64 },
299
+ "inputs": { "input": { "dtype": "float16", "shape": [2, 258, 4, 4], "dist": "normal", "seed": 1892, "scale": 1 } },
300
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 4128, 1, 1] } },
301
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "33024" }] }
302
+ },
303
+ {
304
+ "name": "spatial_partial_float16_n2_c514_b6",
305
+ "attrs": { "blocksize": 6 },
306
+ "tunables": { "WORKGROUP_SIZE": 64 },
307
+ "inputs": { "input": { "dtype": "float16", "shape": [2, 514, 6, 6], "dist": "normal", "seed": 1892, "scale": 1 } },
308
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 18504, 1, 1] } },
309
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "148032" }] }
310
  }
311
  ]
312
  }
build/webgpu/manifest.json CHANGED
@@ -15,17 +15,79 @@
15
  "typeConstraints": { "T": ["float32", "float16", "int32", "int16", "int8", "uint32", "uint8", "bool"] },
16
  "tunables": { "WORKGROUP_SIZE": { "default": 256 } },
17
  "derive": {
 
18
  "shapeContract": "attrs.blocksize > 0 and ranks.input == 4 and ranks.output == 4 and dim(shapes.output, 0) == dim(shapes.input, 0) and dim(shapes.output, 1) == dim(shapes.input, 1) * attrs.blocksize * attrs.blocksize and dim(shapes.output, 2) * attrs.blocksize == dim(shapes.input, 2) and dim(shapes.output, 3) * attrs.blocksize == dim(shapes.input, 3) and f16Ok(dtypes.T)",
19
  "reportedWideExecution": "has(device.adapterInfo, \"subgroupMinSize\") and device.adapterInfo.subgroupMinSize >= 32",
20
- "f16VectorPermutationPreferred": "dtypes.T != \"f16\" or device.features.has(\"subgroups\") or reportedWideExecution"
 
 
 
 
21
  },
22
  "when": ["shapeContract"],
23
- "bindings": { "output": { "buffer": "storage", "elementType": "$outputElement" } },
24
  "variants": [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  {
26
  "id": "nchw_vec4",
27
  "priority": 20,
28
  "when": ["dim(shapes.output, 3) % 4 == 0", "f16VectorPermutationPreferred"],
 
29
  "derive": { "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"" },
30
  "passes": [
31
  {
@@ -33,17 +95,11 @@
33
  "name": "SpaceToDepth",
34
  "shader": "space-depth-permute.wgsl.jinja",
35
  "derive": {
36
- "direction": "\"spaceToDepth\"",
37
- "modeSpec": "\"DCR\"",
38
  "vectorizedSpec": true,
39
- "blocksize": "attrs.blocksize",
40
  "count": "numel(shapes.output) / 4",
41
  "outWUnits": "dim(shapes.output, 3) / 4",
42
  "outH": "dim(shapes.output, 2)",
43
- "outC": "dim(shapes.output, 1)",
44
- "inC": "dim(shapes.input, 1)",
45
- "inH": "dim(shapes.input, 2)",
46
- "inW": "dim(shapes.input, 3)"
47
  },
48
  "bindings": ["input", "output"],
49
  "dispatch": {
@@ -64,17 +120,11 @@
64
  "name": "SpaceToDepth",
65
  "shader": "space-depth-permute.wgsl.jinja",
66
  "derive": {
67
- "direction": "\"spaceToDepth\"",
68
- "modeSpec": "\"DCR\"",
69
  "vectorizedSpec": false,
70
- "blocksize": "attrs.blocksize",
71
  "count": "numel(shapes.output)",
72
  "outWUnits": "dim(shapes.output, 3)",
73
  "outH": "dim(shapes.output, 2)",
74
- "outC": "dim(shapes.output, 1)",
75
- "inC": "dim(shapes.input, 1)",
76
- "inH": "dim(shapes.input, 2)",
77
- "inW": "dim(shapes.input, 3)"
78
  },
79
  "bindings": ["input", "output"],
80
  "dispatch": {
 
15
  "typeConstraints": { "T": ["float32", "float16", "int32", "int16", "int8", "uint32", "uint8", "bool"] },
16
  "tunables": { "WORKGROUP_SIZE": { "default": 256 } },
17
  "derive": {
18
+ "variableSubgroup16To32": "device.features.has(\"subgroups\") and has(device.adapterInfo, \"subgroupMinSize\") and has(device.adapterInfo, \"subgroupMaxSize\") and device.adapterInfo.subgroupMinSize == 16 and device.adapterInfo.subgroupMaxSize == 32",
19
  "shapeContract": "attrs.blocksize > 0 and ranks.input == 4 and ranks.output == 4 and dim(shapes.output, 0) == dim(shapes.input, 0) and dim(shapes.output, 1) == dim(shapes.input, 1) * attrs.blocksize * attrs.blocksize and dim(shapes.output, 2) * attrs.blocksize == dim(shapes.input, 2) and dim(shapes.output, 3) * attrs.blocksize == dim(shapes.input, 3) and f16Ok(dtypes.T)",
20
  "reportedWideExecution": "has(device.adapterInfo, \"subgroupMinSize\") and device.adapterInfo.subgroupMinSize >= 32",
21
+ "f16VectorPermutationPreferred": "dtypes.T != \"f16\" or device.features.has(\"subgroups\") or reportedWideExecution",
22
+ "blocksize": "attrs.blocksize",
23
+ "inC": "dim(shapes.input, 1)",
24
+ "inH": "dim(shapes.input, 2)",
25
+ "inW": "dim(shapes.input, 3)"
26
  },
27
  "when": ["shapeContract"],
28
+ "bindings": { "output": { "elementType": "$outputElement" } },
29
  "variants": [
30
+ {
31
+ "id": "flat_vector",
32
+ "priority": 25,
33
+ "when": ["numel(shapes.output) % 4 == 0", "dim(shapes.output, 3) % 4 != 0", "f16VectorPermutationPreferred"],
34
+ "derive": {
35
+ "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"",
36
+ "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"",
37
+ "count": "numel(shapes.output) / 4",
38
+ "outH": "dim(shapes.output, 2)",
39
+ "outC": "dim(shapes.output, 1)",
40
+ "vectorizedSpec": false,
41
+ "flatVectorSpec": true,
42
+ "outWUnits": "dim(shapes.output, 3)"
43
+ },
44
+ "passes": [
45
+ {
46
+ "id": "main",
47
+ "shader": "space-depth-permute.wgsl.jinja",
48
+ "bindings": ["input", "output"],
49
+ "dispatch": {
50
+ "x": "min(ceilDiv((count), (tunables.WORKGROUP_SIZE)), 65535)",
51
+ "y": "ceilDiv(ceilDiv((count), (tunables.WORKGROUP_SIZE)), 65535)",
52
+ "z": 1
53
+ },
54
+ "name": "SpaceToDepth.FlatVector"
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ "id": "collapsed_input_vector",
60
+ "priority": 30,
61
+ "when": ["dim(shapes.output, 2) == 1", "dim(shapes.output, 3) == 1", "attrs.blocksize % 2 == 0", "dtypes.T != \"f16\" or dim(shapes.input, 1) % 2 == 0"],
62
+ "derive": {
63
+ "channelPack": "2 if dtypes.T == \"f16\" else 1",
64
+ "outputElement": "\"vec2<f16>\" if dtypes.T == \"f16\" else dtypes.T",
65
+ "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"",
66
+ "channelCount": "dim(shapes.input, 0) * dim(shapes.input, 1) / channelPack",
67
+ "blockArea": "attrs.blocksize * attrs.blocksize",
68
+ "inChannels": "dim(shapes.input, 1) / channelPack",
69
+ "wordTile": "min(blockArea / 4, max(1, ceilDiv(inChannels, tunables.WORKGROUP_SIZE)))",
70
+ "wordChunks": "ceilDiv(blockArea / 4, wordTile)"
71
+ },
72
+ "passes": [
73
+ {
74
+ "id": "main",
75
+ "shader": "space-depth-collapsed-input.wgsl.jinja",
76
+ "bindings": [{ "arg": "input", "elementType": "$vectorScalar" }, "output"],
77
+ "dispatch": {
78
+ "x": "min(ceilDiv((channelCount * wordChunks), (tunables.WORKGROUP_SIZE)), 65535)",
79
+ "y": "ceilDiv(ceilDiv((channelCount * wordChunks), (tunables.WORKGROUP_SIZE)), 65535)",
80
+ "z": 1
81
+ },
82
+ "name": "SpaceToDepth.CollapsedInput"
83
+ }
84
+ ]
85
+ },
86
  {
87
  "id": "nchw_vec4",
88
  "priority": 20,
89
  "when": ["dim(shapes.output, 3) % 4 == 0", "f16VectorPermutationPreferred"],
90
+ "demoteWhen": ["variableSubgroup16To32 and dtypes.T == \"f16\""],
91
  "derive": { "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"" },
92
  "passes": [
93
  {
 
95
  "name": "SpaceToDepth",
96
  "shader": "space-depth-permute.wgsl.jinja",
97
  "derive": {
 
 
98
  "vectorizedSpec": true,
 
99
  "count": "numel(shapes.output) / 4",
100
  "outWUnits": "dim(shapes.output, 3) / 4",
101
  "outH": "dim(shapes.output, 2)",
102
+ "outC": "dim(shapes.output, 1)"
 
 
 
103
  },
104
  "bindings": ["input", "output"],
105
  "dispatch": {
 
120
  "name": "SpaceToDepth",
121
  "shader": "space-depth-permute.wgsl.jinja",
122
  "derive": {
 
 
123
  "vectorizedSpec": false,
 
124
  "count": "numel(shapes.output)",
125
  "outWUnits": "dim(shapes.output, 3)",
126
  "outH": "dim(shapes.output, 2)",
127
+ "outC": "dim(shapes.output, 1)"
 
 
 
128
  },
129
  "bindings": ["input", "output"],
130
  "dispatch": {
build/webgpu/metadata.json CHANGED
@@ -1,21 +1,27 @@
1
  {
2
  "name": "ai.onnx.SpaceToDepth",
3
- "id": "_ai_onnx_spacetodepth_webgpu_6bff23a",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "backend": { "type": "webgpu" },
7
  "digest": {
8
  "algorithm": "sha256",
9
  "files": {
10
- "bench.json": "myGa4HIZfSdpBZs8GbVV6ft8zVGVqZEoEu7w6utliEQ=",
11
- "manifest.json": "QWMgtc+Yf2KOKYOyuriO1foyZEnYQRhRg+jrBgNSwdI=",
12
- "space-depth-permute.wgsl.jinja": "Ju6qlxve31dB+p7oMoI/6Y8IlmMjeQM22fFpFX7FomU=",
13
- "test.json": "dCIM8ExjNSAfPfl+rfxsNdlw897HmaSgBr2GgL2Kf9o="
 
14
  }
15
  },
16
- "provenance": { "kernel": { "sha": "91d990483a174128daf7673f3f37a7c890493ae1", "dirty": false } },
17
  "webgpu": {
18
- "manifestSpec": "2.0",
19
- "variants": { "nchw_vec4": ["space-depth-permute.wgsl.jinja"], "nchw_const": ["space-depth-permute.wgsl.jinja"] }
 
 
 
 
 
20
  }
21
  }
 
1
  {
2
  "name": "ai.onnx.SpaceToDepth",
3
+ "id": "_ai_onnx_spacetodepth_webgpu_4eebc5c",
4
  "version": 1,
5
  "license": "Apache-2.0",
6
  "backend": { "type": "webgpu" },
7
  "digest": {
8
  "algorithm": "sha256",
9
  "files": {
10
+ "bench.json": "B+hk3GtNTeUm6v61/3CKUrrttyjtP5WyibudxoqGY2g=",
11
+ "manifest.json": "g/1ubiwGGpjaR7Ybs7Fbqyzy6xmG6YKQlrNrr+ucDHw=",
12
+ "space-depth-collapsed-input.wgsl.jinja": "pdLUu9ZKhcDKGa5pY8q3rT/RPobF/9VyvzG4wWrWmes=",
13
+ "space-depth-permute.wgsl.jinja": "0JmPkn28PRyut+7IECJ/8KCJUVf3PJcvOnNYkUKOlLY=",
14
+ "test.json": "9sDs1EYNjkx5T7kjJaFkBUN7ghzjdoqHlhotuD+CyTA="
15
  }
16
  },
17
+ "provenance": { "kernel": { "sha": "6fdf6301e2bbcc2f03bf1eaf493b7ad55ef33afc", "dirty": false } },
18
  "webgpu": {
19
+ "manifestSpec": "2.1",
20
+ "variants": {
21
+ "flat_vector": ["space-depth-permute.wgsl.jinja"],
22
+ "collapsed_input_vector": ["space-depth-collapsed-input.wgsl.jinja"],
23
+ "nchw_vec4": ["space-depth-permute.wgsl.jinja"],
24
+ "nchw_const": ["space-depth-permute.wgsl.jinja"]
25
+ }
26
  }
27
  }
build/webgpu/space-depth-collapsed-input.wgsl.jinja ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% macro flat_index_2d(workgroupSize, name="i", bound="params.count", guardInline=false) %}
2
+ {% set wgTerm = workgroupSize ~ "u" if workgroupSize is number else workgroupSize %}
3
+ // 2D-folded flat index: gid.y carries the high bits past the dispatch's
4
+ // per-axis workgroup fold width.
5
+ let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ wgTerm }};
6
+ if ({{ name }} >= {{ bound }}) {
7
+ return;
8
+ }{% endmacro %}
9
+ {{ env.wgsl.resourceDeclarations }}
10
+ // A channel/block transpose with spatial tiles for few-channel inputs.
11
+ // Pair f16 channels so each invocation owns complete output words.
12
+ const COUNT: u32 = {{ channelCount * wordChunks }}u;
13
+ const CHANNELS: u32 = max(1u, {{ inChannels }}u);
14
+ const AREA: u32 = {{ blockArea }}u;
15
+ {% if wordChunks > 1 %}
16
+ const WORD_TILE: u32 = {{ wordTile }}u;
17
+ const WORD_CHUNKS: u32 = {{ wordChunks }}u;
18
+ {% endif %}
19
+ @compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})
20
+ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
21
+ {% if wordChunks > 1 %}
22
+ {{ flat_index_2d(tunables.WORKGROUP_SIZE, "tile_lane", "COUNT") }}
23
+ let c = tile_lane % CHANNELS;
24
+ let tile = tile_lane / CHANNELS;
25
+ let n = tile / WORD_CHUNKS;
26
+ let channel = n * CHANNELS + c;
27
+ let word_begin = (tile % WORD_CHUNKS) * WORD_TILE;
28
+ for (var word = word_begin; word < min(word_begin + WORD_TILE, AREA / 4u); word++) {
29
+ {% else %}
30
+ {{ flat_index_2d(tunables.WORKGROUP_SIZE, "channel", "COUNT") }}
31
+ let c = channel % CHANNELS;
32
+ let n = channel / CHANNELS;
33
+ for (var word = 0u; word < AREA / 4u; word++) {
34
+ {% endif %}
35
+ {% if channelPack == 2 %}
36
+ let a = input[channel * 2u * (AREA / 4u) + word];
37
+ let b = input[(channel * 2u + 1u) * (AREA / 4u) + word];
38
+ {% else %}
39
+ let values = input[channel * (AREA / 4u) + word];
40
+ {% endif %}
41
+ {% for lane in range(4) %}
42
+ output[(n * AREA + word * 4u + {{ lane }}u) * CHANNELS + c] ={% if channelPack == 2 %} vec2<f16>(a[{{ lane }}], b[{{ lane }}]){% else %} values[{{ lane }}]{% endif %};
43
+ {% endfor %}
44
+ }
45
+ }
build/webgpu/space-depth-permute.wgsl.jinja CHANGED
@@ -1,36 +1,12 @@
1
- {% macro flat_index_2d(name="i", bound="params.count", guardInline=false, note="dispatch-limit") %}
2
- {% if note == "dispatch-limit" %}
3
- // 2D-folded flat index: gid.y carries the high bits past the dispatch's
4
- // per-axis workgroup fold width (outputs > 16.7M elements).
5
- {% elif note == "limit" %}
6
- // 2D-folded flat index: gid.y carries the high bits past the dispatch's
7
- // per-axis workgroup fold width.
8
- {% elif note == "device-axis" %}
9
- // The flat dispatch is folded across x/y at a fixed per-axis workgroup
10
- // width; gid.y carries the high portion of the output index.
11
- {% elif note == "vec4-limit" %}
12
- // 2D-folded flat vec4 index: gid.y carries the high bits past the dispatch's
13
- // per-axis workgroup fold width (the dispatch caps x and spills into y).
14
- {% elif note == "element-limit" %}
15
- // 2D-folded flat element index: gid.y carries the high bits past the
16
- // dispatch's per-axis workgroup fold width.
17
- {% elif note == "dispatch" %}
18
  // 2D-folded flat index: gid.y carries the high bits past the dispatch's
19
  // per-axis workgroup fold width.
20
- {% endif %}
21
- {% if bound == "" %}
22
- let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ tunables.WORKGROUP_SIZE }}u;
23
- {%- elif guardInline %}
24
- let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ tunables.WORKGROUP_SIZE }}u;
25
- if ({{ name }} >= {{ bound }}) { return; }
26
- {%- else %}
27
- let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ tunables.WORKGROUP_SIZE }}u;
28
  if ({{ name }} >= {{ bound }}) {
29
  return;
30
- }
31
- {%- endif %}
32
- {% endmacro %}
33
-
34
  {{ env.wgsl.resourceDeclarations }}
35
 
36
  // Specializing all geometry lets division and modulo lower to constant
@@ -47,10 +23,18 @@ const BLOCK_SIZE: u32 = {{ blocksize }}u;
47
 
48
  @compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})
49
  fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
50
- {{ flat_index_2d("out_unit", "COUNT", note="") }}
 
 
 
 
 
 
 
 
51
 
52
- let ow_unit = out_unit % OUT_W_UNITS;
53
- var remaining = out_unit / OUT_W_UNITS;
54
  let oh = remaining % OUT_H;
55
  remaining /= OUT_H;
56
  let oc = remaining % OUT_C;
@@ -69,9 +53,18 @@ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
69
  let value{{ lane }} = input[input_base + ow{{ lane }} * BLOCK_SIZE];
70
  {% endfor %}
71
 
 
 
 
 
72
  {% if vectorizedSpec %}
73
  output[out_unit] = {{ vectorScalar }}(value0, value1, value2, value3);
74
  {% else %}
75
  output[out_unit] = value0;
76
  {% endif %}
 
 
 
 
 
77
  }
 
1
+ {% set flatVector = flatVectorSpec is defined and flatVectorSpec %}
2
+ {% macro flat_index_2d(workgroupSize, name="i", bound="params.count", guardInline=false) %}
3
+ {% set wgTerm = workgroupSize ~ "u" if workgroupSize is number else workgroupSize %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  // 2D-folded flat index: gid.y carries the high bits past the dispatch's
5
  // per-axis workgroup fold width.
6
+ let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ wgTerm }};
 
 
 
 
 
 
 
7
  if ({{ name }} >= {{ bound }}) {
8
  return;
9
+ }{% endmacro %}
 
 
 
10
  {{ env.wgsl.resourceDeclarations }}
11
 
12
  // Specializing all geometry lets division and modulo lower to constant
 
23
 
24
  @compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})
25
  fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
26
+ {{ flat_index_2d(tunables.WORKGROUP_SIZE, "out_unit", "COUNT") }}
27
+ {% if flatVector %}
28
+ var packedValues: {{ vectorScalar }};
29
+ {% endif %}
30
+ {% for flatLane in range(4 if flatVector else 1) %}
31
+ {% if flatVector %}
32
+ {
33
+ let element = out_unit * 4u + {{ flatLane }}u;
34
+ {% endif %}
35
 
36
+ let ow_unit = {{ "element" if flatVector else "out_unit" }} % OUT_W_UNITS;
37
+ var remaining = {{ "element" if flatVector else "out_unit" }} / OUT_W_UNITS;
38
  let oh = remaining % OUT_H;
39
  remaining /= OUT_H;
40
  let oc = remaining % OUT_C;
 
53
  let value{{ lane }} = input[input_base + ow{{ lane }} * BLOCK_SIZE];
54
  {% endfor %}
55
 
56
+ {% if flatVector %}
57
+ packedValues[{{ flatLane }}] = value0;
58
+ }
59
+ {% else %}
60
  {% if vectorizedSpec %}
61
  output[out_unit] = {{ vectorScalar }}(value0, value1, value2, value3);
62
  {% else %}
63
  output[out_unit] = value0;
64
  {% endif %}
65
+ {% endif %}
66
+ {% endfor %}
67
+ {% if flatVector %}
68
+ output[out_unit] = packedValues;
69
+ {% endif %}
70
  }
build/webgpu/test.json CHANGED
@@ -355,6 +355,279 @@
355
  }
356
  },
357
  "outputs": { "output": { "dtype": "bool", "shape": [1, 4, 1, 2], "tolerance": 0 } }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  }
359
  ]
360
  }
 
355
  }
356
  },
357
  "outputs": { "output": { "dtype": "bool", "shape": [1, 4, 1, 2], "tolerance": 0 } }
358
+ },
359
+ {
360
+ "name": "permutation_float32_n2_c3_2x2_block2",
361
+ "attrs": { "blocksize": 2 },
362
+ "inputs": {
363
+ "input": {
364
+ "dtype": "float32",
365
+ "shape": [2, 3, 2, 2],
366
+ "data": { "kind": "linspace", "start": -7.0, "end": 11.0 }
367
+ }
368
+ },
369
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 12, 1, 1], "tolerance": 0 } }
370
+ },
371
+ {
372
+ "name": "permutation_float32_n2_c5_4x4_block4",
373
+ "attrs": { "blocksize": 4 },
374
+ "inputs": {
375
+ "input": {
376
+ "dtype": "float32",
377
+ "shape": [2, 5, 4, 4],
378
+ "data": { "kind": "linspace", "start": -7.0, "end": 11.0 }
379
+ }
380
+ },
381
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 80, 1, 1], "tolerance": 0 } }
382
+ },
383
+ {
384
+ "name": "permutation_float16_n2_c4_6x6_block6",
385
+ "attrs": { "blocksize": 6 },
386
+ "inputs": {
387
+ "input": {
388
+ "dtype": "float16",
389
+ "shape": [2, 4, 6, 6],
390
+ "data": { "kind": "linspace", "start": -7.0, "end": 11.0 }
391
+ }
392
+ },
393
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 144, 1, 1], "tolerance": 0 } }
394
+ },
395
+ {
396
+ "name": "permutation_float16_n2_c3_2x2_block2",
397
+ "attrs": { "blocksize": 2 },
398
+ "inputs": {
399
+ "input": {
400
+ "dtype": "float16",
401
+ "shape": [2, 3, 2, 2],
402
+ "data": { "kind": "linspace", "start": -7.0, "end": 11.0 }
403
+ }
404
+ },
405
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 12, 1, 1], "tolerance": 0 } }
406
+ },
407
+ {
408
+ "name": "permutation_float16_n1_c3_3x3_block3",
409
+ "attrs": { "blocksize": 3 },
410
+ "inputs": {
411
+ "input": {
412
+ "dtype": "float16",
413
+ "shape": [1, 3, 3, 3],
414
+ "data": { "kind": "linspace", "start": -7.0, "end": 11.0 }
415
+ }
416
+ },
417
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 27, 1, 1], "tolerance": 0 } }
418
+ },
419
+ {
420
+ "name": "permutation_int32_n2_c5_2x2_block2",
421
+ "attrs": { "blocksize": 2 },
422
+ "inputs": {
423
+ "input": { "dtype": "int32", "shape": [2, 5, 2, 2], "data": { "kind": "linspace", "start": -7, "end": 11 } }
424
+ },
425
+ "outputs": { "output": { "dtype": "int32", "shape": [2, 20, 1, 1], "tolerance": 0 } }
426
+ },
427
+ {
428
+ "name": "permutation_uint32_n1_c7_4x4_block4",
429
+ "attrs": { "blocksize": 4 },
430
+ "inputs": {
431
+ "input": { "dtype": "uint32", "shape": [1, 7, 4, 4], "data": { "kind": "linspace", "start": 0, "end": 11 } }
432
+ },
433
+ "outputs": { "output": { "dtype": "uint32", "shape": [1, 112, 1, 1], "tolerance": 0 } }
434
+ },
435
+ {
436
+ "name": "permutation_float32_n2_c3_6x10_block2",
437
+ "attrs": { "blocksize": 2 },
438
+ "inputs": {
439
+ "input": {
440
+ "dtype": "float32",
441
+ "shape": [2, 3, 6, 10],
442
+ "data": { "kind": "linspace", "start": -7.0, "end": 11.0 }
443
+ }
444
+ },
445
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 12, 3, 5], "tolerance": 0 } }
446
+ },
447
+ {
448
+ "name": "permutation_float16_n4_c3_9x9_block3",
449
+ "attrs": { "blocksize": 3 },
450
+ "inputs": {
451
+ "input": {
452
+ "dtype": "float16",
453
+ "shape": [4, 3, 9, 9],
454
+ "data": { "kind": "linspace", "start": -7.0, "end": 11.0 }
455
+ }
456
+ },
457
+ "outputs": { "output": { "dtype": "float16", "shape": [4, 27, 3, 3], "tolerance": 0 } }
458
+ },
459
+ {
460
+ "name": "permutation_float32_n0_c4_2x2_block2",
461
+ "attrs": { "blocksize": 2 },
462
+ "inputs": {
463
+ "input": {
464
+ "dtype": "float32",
465
+ "shape": [0, 4, 2, 2],
466
+ "data": { "kind": "linspace", "start": -7.0, "end": 11.0 }
467
+ }
468
+ },
469
+ "outputs": { "output": { "dtype": "float32", "shape": [0, 16, 1, 1], "tolerance": 0 } }
470
+ },
471
+ {
472
+ "name": "collapsed_channels_workgroup64_fold_x_to_y",
473
+ "attrs": { "blocksize": 2 },
474
+ "inputs": {
475
+ "input": {
476
+ "dtype": "float32",
477
+ "shape": [1, 4194241, 2, 2],
478
+ "data": { "kind": "linspace", "start": 0.0, "end": 1.0 }
479
+ }
480
+ },
481
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 16776964, 1, 1], "tolerance": 0 } },
482
+ "tunables": { "WORKGROUP_SIZE": 64 }
483
+ },
484
+ {
485
+ "name": "spatial_parallel_float32_n1_c1_b64",
486
+ "attrs": { "blocksize": 64 },
487
+ "inputs": {
488
+ "input": {
489
+ "dtype": "float32",
490
+ "shape": [1, 1, 64, 64],
491
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
492
+ }
493
+ },
494
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 4096, 1, 1], "tolerance": 0 } }
495
+ },
496
+ {
497
+ "name": "spatial_parallel_float32_n2_c3_b64",
498
+ "attrs": { "blocksize": 64 },
499
+ "inputs": {
500
+ "input": {
501
+ "dtype": "float32",
502
+ "shape": [2, 3, 64, 64],
503
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
504
+ }
505
+ },
506
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 12288, 1, 1], "tolerance": 0 } }
507
+ },
508
+ {
509
+ "name": "spatial_parallel_float32_n1_c256_b32",
510
+ "attrs": { "blocksize": 32 },
511
+ "inputs": {
512
+ "input": {
513
+ "dtype": "float32",
514
+ "shape": [1, 256, 32, 32],
515
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
516
+ }
517
+ },
518
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 262144, 1, 1], "tolerance": 0 } }
519
+ },
520
+ {
521
+ "name": "spatial_parallel_float32_n1_c16_b64",
522
+ "attrs": { "blocksize": 64 },
523
+ "inputs": {
524
+ "input": {
525
+ "dtype": "float32",
526
+ "shape": [1, 16, 64, 64],
527
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
528
+ }
529
+ },
530
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 65536, 1, 1], "tolerance": 0 } }
531
+ },
532
+ {
533
+ "name": "spatial_parallel_float16_n1_c1_b64",
534
+ "attrs": { "blocksize": 64 },
535
+ "inputs": {
536
+ "input": {
537
+ "dtype": "float16",
538
+ "shape": [1, 1, 64, 64],
539
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
540
+ }
541
+ },
542
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 4096, 1, 1], "tolerance": 0 } }
543
+ },
544
+ {
545
+ "name": "spatial_parallel_float16_n2_c3_b64",
546
+ "attrs": { "blocksize": 64 },
547
+ "inputs": {
548
+ "input": {
549
+ "dtype": "float16",
550
+ "shape": [2, 3, 64, 64],
551
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
552
+ }
553
+ },
554
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 12288, 1, 1], "tolerance": 0 } }
555
+ },
556
+ {
557
+ "name": "spatial_parallel_float16_n1_c256_b32",
558
+ "attrs": { "blocksize": 32 },
559
+ "inputs": {
560
+ "input": {
561
+ "dtype": "float16",
562
+ "shape": [1, 256, 32, 32],
563
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
564
+ }
565
+ },
566
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 262144, 1, 1], "tolerance": 0 } }
567
+ },
568
+ {
569
+ "name": "spatial_parallel_float16_n1_c16_b64",
570
+ "attrs": { "blocksize": 64 },
571
+ "inputs": {
572
+ "input": {
573
+ "dtype": "float16",
574
+ "shape": [1, 16, 64, 64],
575
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
576
+ }
577
+ },
578
+ "outputs": { "output": { "dtype": "float16", "shape": [1, 65536, 1, 1], "tolerance": 0 } }
579
+ },
580
+ {
581
+ "name": "spatial_partial_float32_n2_c129_b4",
582
+ "attrs": { "blocksize": 4 },
583
+ "inputs": {
584
+ "input": {
585
+ "dtype": "float32",
586
+ "shape": [2, 129, 4, 4],
587
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
588
+ }
589
+ },
590
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 2064, 1, 1], "tolerance": 0 } },
591
+ "tunables": { "WORKGROUP_SIZE": 64 }
592
+ },
593
+ {
594
+ "name": "spatial_partial_float32_n2_c257_b6",
595
+ "attrs": { "blocksize": 6 },
596
+ "inputs": {
597
+ "input": {
598
+ "dtype": "float32",
599
+ "shape": [2, 257, 6, 6],
600
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
601
+ }
602
+ },
603
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 9252, 1, 1], "tolerance": 0 } },
604
+ "tunables": { "WORKGROUP_SIZE": 64 }
605
+ },
606
+ {
607
+ "name": "spatial_partial_float16_n2_c258_b4",
608
+ "attrs": { "blocksize": 4 },
609
+ "inputs": {
610
+ "input": {
611
+ "dtype": "float16",
612
+ "shape": [2, 258, 4, 4],
613
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
614
+ }
615
+ },
616
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 4128, 1, 1], "tolerance": 0 } },
617
+ "tunables": { "WORKGROUP_SIZE": 64 }
618
+ },
619
+ {
620
+ "name": "spatial_partial_float16_n2_c514_b6",
621
+ "attrs": { "blocksize": 6 },
622
+ "inputs": {
623
+ "input": {
624
+ "dtype": "float16",
625
+ "shape": [2, 514, 6, 6],
626
+ "data": { "kind": "linspace", "start": -3.0, "end": 5.0 }
627
+ }
628
+ },
629
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 18504, 1, 1], "tolerance": 0 } },
630
+ "tunables": { "WORKGROUP_SIZE": 64 }
631
  }
632
  ]
633
  }