sync 4385228f788d
Browse filesFiles changed (12)
- README.md+35-17
- build/webgpu/average-pool2d-nchw-horizontal-reuse.wgsl.jinja+6-3
- build/webgpu/average-pool2d-nchw-w3s1-reuse.wgsl.jinja+4-3
- build/webgpu/bench.json+3-3
- build/webgpu/manifest.json+1-630
- build/webgpu/metadata.json+1-42
- build/webgpu/pool-global-reduction.wgsl.jinja+17-22
- build/webgpu/pool-window-nd.wgsl.jinja+6-3
- build/webgpu/pool-window-reduction.wgsl.jinja+20-25
- build/webgpu/pool-window-unroll.wgsl.jinja+5-4
- build/webgpu/pool2d-nchw-separable.wgsl.jinja+32-16
- build/webgpu/test.json+175-24
51 unmodified lines525354555657555657585961626364656667686970716061626364656667686970717273747675767778798081828384848585868788899091929394959697989910010110210310410510610710810911011151 unmodified lines
One implementation is selected per call from the device capabilities, the request shapes and the dtypes; these notes say what each one covers.
- `window_parallel_ncl1d` — Workgroup-cooperative average pooling over a 1-D window: one workgroup reduces a single output element's kernel window, its invocations striding the flattened taps. Chosen when the serial one-invocation-per-output route cannot fill the device and the window is long. Padded taps leave the divisor unless `count_include_pad` is set.- `window_parallel_nchw2d` — Workgroup-cooperative average pooling over a 2-D window: one workgroup reduces a single output element's kernel window, its invocations striding the flattened taps. Chosen when the serial one-invocation-per-output route cannot fill the device and the window is long. Padded taps leave the divisor unless `count_include_pad` is set.- `window_parallel_ncdhw3d` — Workgroup-cooperative average pooling over a 3-D window: one workgroup reduces a single output element's kernel window, its invocations striding the flattened taps. Chosen when the serial one-invocation-per-output route cannot fill the device and the window is long. Padded taps leave the divisor unless `count_include_pad` is set.- `window_parallel` — Workgroup-cooperative average pooling over a 1-D, 2-D or 3-D window: one workgroup reduces a single output element's kernel window, its invocations striding the flattened taps. Chosen when the one-invocation-per-output variant cannot fill the device and the window is long. Padded taps leave the divisor unless `count_include_pad` is set.- `nchw2d_k7_reuse` — Average pooling that reuses each loaded input row across four horizontally adjacent outputs: 7x7 windows at stride 1 or 2, and 3-wide stride-1 windows whose input width is not four-aligned. Output widths that are a multiple of four store vec4 values; other outputs store scalars and guard the last quad.
## Files
- [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, per-variant templates, provenance)- [`manifest.json`](build/webgpu/manifest.json) — the op contract (source of truth)- [`test.json`](build/webgpu/test.json) — correctness cases- [`bench.json`](build/webgpu/bench.json) — benchmark cases- [`average-pool2d-nchw-horizontal-reuse.wgsl.jinja`](build/webgpu/average-pool2d-nchw-horizontal-reuse.wgsl.jinja)- [`average-pool2d-nchw-w3s1-reuse.wgsl.jinja`](build/webgpu/average-pool2d-nchw-w3s1-reuse.wgsl.jinja)- [`pool-global-reduction.wgsl.jinja`](build/webgpu/pool-global-reduction.wgsl.jinja)- [`pool-window-nd.wgsl.jinja`](build/webgpu/pool-window-nd.wgsl.jinja)- [`pool-window-reduction.wgsl.jinja`](build/webgpu/pool-window-reduction.wgsl.jinja)- [`pool-window-unroll.wgsl.jinja`](build/webgpu/pool-window-unroll.wgsl.jinja)- [`pool2d-nchw-separable.wgsl.jinja`](build/webgpu/pool2d-nchw-separable.wgsl.jinja)- [`metadata.json`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/metadata.json) — kernel metadata (id, file digests, manifest spec, provenance)- [`manifest.json`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/manifest.json) — the op contract (source of truth)- [`test.json`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/test.json) — correctness cases- [`bench.json`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/bench.json) — benchmark cases- [`average-pool2d-nchw-horizontal-reuse.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/average-pool2d-nchw-horizontal-reuse.wgsl.jinja)- [`average-pool2d-nchw-w3s1-reuse.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/average-pool2d-nchw-w3s1-reuse.wgsl.jinja)- [`pool-global-reduction.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/pool-global-reduction.wgsl.jinja)- [`pool-window-nd.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/pool-window-nd.wgsl.jinja)- [`pool-window-reduction.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/pool-window-reduction.wgsl.jinja)- [`pool-window-unroll.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/pool-window-unroll.wgsl.jinja)- [`pool2d-nchw-separable.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/ai.onnx.AveragePool/blob/v1/build/webgpu/pool2d-nchw-separable.wgsl.jinja)
## Use with `@huggingface/kernels`
```shnpm install --save-exact @huggingface/kernels@0.0.1-preview.3npm install --save-exact @huggingface/kernels@0.0.1-preview.4```
Paste the example into a browser app that resolves npm imports. Serve the app over HTTPS or localhost with WebGPU available.
Required output shapes and logical data types are inferred from the supplied inputs and attributes; result tensors are allocated automatically.
The `version: 1` option selects the published kernel contract; it is independent of any operator opset, contrib `since_version`, or model version.It follows the `v1` branch as fixes land. To pin exact artifact bytes, pass a 40-character commit `revision` instead of `version`.
Replace each `*Data` placeholder with a typed array containing the corresponding input data.
```jsimport { getKernel } from "@huggingface/kernels";
const kernel = await getKernel("webgpu-kernels/ai.onnx.AveragePool", { version: 1 });
const xData = Float32Array.of( 1.7640524, 0.4001572, 0.978738, 2.2408931, 1.867558, -0.9772779, 0.95008844, -0.1513572, -0.10321885, 0.41059852, 0.14404356, 1.4542735, 0.7610377, 0.121675014, 0.44386324, 0.33367434, 1.4940791, -0.20515826, 0.3130677, -0.85409576, -2.5529897, 0.6536186, 0.8644362, -0.742165, 2.2697546, -1.4543657, 0.045758516, -0.18718386, 1.5327792, 1.4693588, 0.15494743, 0.37816253, -0.88778573, -1.9807965, -0.34791216, 0.15634897, 1.2302907, 1.2023798, -0.3873268, -0.30230275, -1.048553, -1.420018, -1.7062702, 1.9507754, -0.5096522, -0.4380743, -1.2527953, 0.7774904, -1.6138978, -0.21274029, -0.89546657, 0.3869025, -0.51080513, -1.1806322, -0.028182229, 0.42833188, 0.06651722, 0.3024719, -0.6343221, -0.36274117, -0.67246044, -0.35955316, -0.8131463, -1.7262826, 0.17742614, -0.40178093, -1.6301984, 0.46278226, -0.9072984, 0.051945396, 0.7290906, 0.12898292, 1.1394007, -1.2348258, 0.40234163, -0.6848101, -0.87079716, -0.5788497, -0.31155252, 0.05616534, -1.1651498, 0.9008265, 0.46566245, -1.5362437, 1.4882522, 1.8958892, 1.1787796, -0.17992483, -1.0707526, 1.0544517, -0.40317693, 1.222445, 0.20827498, 0.97663903, 0.3563664, 0.7065732,);
const { y } = await kernel({ x: { data: xData, shape: [1, 3, 32] } }, { attrs: { kernel_shape: [2] },});console.log({ y });```1123456678910111218 unmodified lines3132333134353637{% macro flat_index_2d(workgroupSize, name="i", bound="params.count", guardInline=false) %}{% macro flat_index_2d(workgroupSize, name="i", bound="params.count") %}{% set wgTerm = workgroupSize ~ "u" if workgroupSize is number else workgroupSize %} // 2D-folded flat index: gid.y carries the high bits past the dispatch's // per-axis workgroup fold width. let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ wgTerm }}; if ({{ name }} >= {{ bound }}) { return; }{% endmacro %} if ({{ name }} >= {{ bound }}) { return; }{% endmacro %}{{ env.wgsl.resourceDeclarations }}
// Four adjacent windows share source columns. For a K-wide, dilation-D window18 unmodified lines
@compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})fn main(@builtin(global_invocation_id) gid: vec3<u32>) {{{ flat_index_2d("WG", "q", "COUNT4", guardInline=true) }}{{ flat_index_2d("WG", "q", "COUNT4") }}
let ow0 = (q % OUT_W4) * 4u; var t = q / OUT_W4;1123456788910111213 unmodified lines2627282829303132{% macro flat_index_2d(workgroupSize, name="i", bound="params.count", guardInline=false) %}{% macro flat_index_2d(workgroupSize, name="i", bound="params.count") %}{% set wgTerm = workgroupSize ~ "u" if workgroupSize is number else workgroupSize %} // 2D-folded flat index: gid.y carries the high bits past the dispatch's // per-axis workgroup fold width. let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ wgTerm }}; if ({{ name }} >= {{ bound }}) { return; } }{% endmacro %}{% endmacro %}{{ env.wgsl.resourceDeclarations }}
// 2D NCHW AveragePool specialised for a 3-wide / stride-1 / pad-1 / dilation-113 unmodified linesconst PAD_TOP: i32 = {{ padTopSpec }};
// Load input element at (rowBase, col), returning 0 outside [0, IN_W). The row// is already gated, so only the horizontal bound is checked here.// is already bounds-checked, so only the horizontal bound is checked here.fn load_col(rowValid: bool, rowBase: u32, col: i32) -> f32 { if (rowValid && col >= 0 && col < IN_W) { return f32(x[rowBase + u32(col)]);161 unmodified lines16216316416516516616716870 unmodified lines2392402412422422432442455 unmodified lines251252253254254255256257161 unmodified lines "preset": "stress", "provenance": { "source": "synthetic benchmark", "notes": "Rank-5 global pooling over 131,072 spatial values per plane exercises the parallel global-window reduction and its feature-tier alternatives." "notes": "Rank-5 global average pooling over [1,32,32,64,64] float32, 131,072 spatial values per channel plane; the metric is input bandwidth." }, "vars": { "batch": 1, "channels": 32, "inD": 32, "inH": 64, "inW": 64 }, "attrs": {70 unmodified lines "preset": "stress", "provenance": { "source": "synthetic benchmark", "notes": "A 784-tap non-overlapping window leaving 64 outputs: the serial route dispatches a single workgroup and loops 784 taps on each of 64 invocations." "notes": "A 28x28 non-overlapping window (stride 28) over [1,16,56,56] float32, leaving 64 outputs that each average 784 taps." }, "attrs": { "count_include_pad": 0, "kernel_shape": [28, 28], "strides": [28, 28], "pads": [0, 0, 0, 0] }, "inputs": { "x": { "dtype": "float32", "shape": [1, 16, 56, 56], "dist": "normal", "seed": 4303, "scale": 0.2 } },5 unmodified lines "preset": "stress", "provenance": { "source": "synthetic benchmark", "notes": "A padded near-global pool from a classifier head: a 196-tap window over a 14x14 map with pad 6 leaves 10816 outputs, 43 serial dispatch groups." "notes": "A padded near-global pool from a classifier head: a 14x14 window with stride 1 and pad 6 over a [1,64,14,14] map, giving 10816 outputs of up to 196 taps each." }, "attrs": { "count_include_pad": 0, "kernel_shape": [14, 14], "strides": [1, 1], "pads": [6, 6, 6, 6] }, "inputs": { "x": { "dtype": "float32", "shape": [1, 64, 14, 14], "dist": "normal", "seed": 4304, "scale": 0.2 } },1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296301{ "domain": "ai.onnx", "name": "AveragePool", "sinceVersion": 19, "inputs": { "x": { "onnx": "X", "dtype": "T" } }, "outputs": { "y": { "onnx": "Y", "dtype": "T", "rank": "ranks.x", "shape": "poolOutputShape" } }, "attributes": { "auto_pad": { "default": "NOTSET" }, "count_include_pad": { "default": 0 }, "ceil_mode": { "default": 0 }, "kernel_shape": {}, "strides": {}, "pads": {}, "dilations": {} }, "attributeConstraints": { "auto_pad": { "values": ["NOTSET", "SAME_UPPER", "SAME_LOWER", "VALID"] }, "ceil_mode": { "values": [0, 1] }, "count_include_pad": { "values": [0, 1] }, "kernel_shape": { "required": true } }, "typeConstraints": { "T": ["float32", "float16"] }, "tunables": { "WORKGROUP_SIZE": { "default": 256 }, "SEPARABLE_MIN_WINDOW": { "default": 25 }, "WINDOW_PARALLEL_MIN_TAPS": { "default": 128 }, "WINDOW_PARALLEL_MAX_SERIAL_GROUPS": { "default": 64 } }, "derive": { "spatialRank": "ranks.x - 2", "narrowSubgroupRange": "has(device.adapterInfo, \"subgroupMinSize\") and has(device.adapterInfo, \"subgroupMaxSize\") and device.adapterInfo.subgroupMinSize < device.adapterInfo.subgroupMaxSize and device.adapterInfo.subgroupMaxSize <= 16", "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", "kernelShapeLengthOk": "not has(attrs, \"kernel_shape\") or (attrs.kernel_shape | length) == spatialRank", "stridesLengthOk": "not has(attrs, \"strides\") or (attrs.strides | length) == spatialRank", "dilationsLengthOk": "not has(attrs, \"dilations\") or (attrs.dilations | length) == spatialRank", "padsLengthOk": "not has(attrs, \"pads\") or (attrs.pads | length) == 2 * spatialRank", "kernelD": "attrs.kernel_shape[0] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank == 3 else 1", "kernelH": "attrs.kernel_shape[spatialRank - 2] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank >= 2 else 1", "kernelW": "attrs.kernel_shape[spatialRank - 1] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank >= 1 else 1", "strideD": "attrs.strides[0] if stridesLengthOk and has(attrs, \"strides\") and spatialRank == 3 else 1", "strideH": "attrs.strides[spatialRank - 2] if stridesLengthOk and has(attrs, \"strides\") and spatialRank >= 2 else 1", "strideW": "attrs.strides[spatialRank - 1] if stridesLengthOk and has(attrs, \"strides\") and spatialRank >= 1 else 1", "dilationD": "attrs.dilations[0] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank == 3 else 1", "dilationH": "attrs.dilations[spatialRank - 2] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank >= 2 else 1", "dilationW": "attrs.dilations[spatialRank - 1] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank >= 1 else 1", "padFront": "attrs.pads[0] if padsLengthOk and has(attrs, \"pads\") and spatialRank == 3 else 0", "padTop": "attrs.pads[spatialRank - 2] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 2 else 0", "padLeft": "attrs.pads[spatialRank - 1] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 1 else 0", "padBack": "attrs.pads[spatialRank] if padsLengthOk and has(attrs, \"pads\") and spatialRank == 3 else 0", "padBottom": "attrs.pads[2 * spatialRank - 2] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 2 else 0", "padRight": "attrs.pads[2 * spatialRank - 1] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 1 else 0", "explicitOutW": "min(ceil((dim(shapes.x, ranks.x - 1) + padLeft + padRight - ((kernelW - 1) * dilationW + 1)) / strideW) + 1, ceil((dim(shapes.x, ranks.x - 1) + padLeft) / strideW)) if attrs.ceil_mode != 0 else floor((dim(shapes.x, ranks.x - 1) + padLeft + padRight - ((kernelW - 1) * dilationW + 1)) / strideW) + 1", "explicitOutH": "min(ceil((dim(shapes.x, ranks.x - 2) + padTop + padBottom - ((kernelH - 1) * dilationH + 1)) / strideH) + 1, ceil((dim(shapes.x, ranks.x - 2) + padTop) / strideH)) if attrs.ceil_mode != 0 else floor((dim(shapes.x, ranks.x - 2) + padTop + padBottom - ((kernelH - 1) * dilationH + 1)) / strideH) + 1", "explicitOutD": "(min(ceil((dim(shapes.x, 2) + padFront + padBack - ((kernelD - 1) * dilationD + 1)) / strideD) + 1, ceil((dim(shapes.x, 2) + padFront) / strideD)) if attrs.ceil_mode != 0 else floor((dim(shapes.x, 2) + padFront + padBack - ((kernelD - 1) * dilationD + 1)) / strideD) + 1) if ranks.x == 5 else 0", "inferredOutW": "ceil(dim(shapes.x, ranks.x - 1) / strideW) if attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\" else explicitOutW", "inferredOutH": "ceil(dim(shapes.x, ranks.x - 2) / strideH) if attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\" else explicitOutH", "inferredOutD": "ceil(dim(shapes.x, 2) / strideD) if attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\" else explicitOutD", "poolOutputShape": "[dim(shapes.x, 0), dim(shapes.x, 1), inferredOutW] if ranks.x == 3 else ([dim(shapes.x, 0), dim(shapes.x, 1), inferredOutH, inferredOutW] if ranks.x == 4 else [dim(shapes.x, 0), dim(shapes.x, 1), inferredOutD, inferredOutH, inferredOutW])", "autoPadTotalD": "max(0, (dim(shapes.y, 2) - 1) * strideD + ((kernelD - 1) * dilationD + 1) - dim(shapes.x, 2)) if ranks.x == 5 else 0", "autoPadTotalH": "max(0, (dim(shapes.y, ranks.x - 2) - 1) * strideH + ((kernelH - 1) * dilationH + 1) - dim(shapes.x, ranks.x - 2)) if ranks.x >= 4 else 0", "autoPadTotalW": "max(0, (dim(shapes.y, ranks.x - 1) - 1) * strideW + ((kernelW - 1) * dilationW + 1) - dim(shapes.x, ranks.x - 1))", "effectivePadD": "(floor(autoPadTotalD / 2) if attrs.auto_pad == \"SAME_UPPER\" else autoPadTotalD - floor(autoPadTotalD / 2)) if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padFront", "effectivePadH": "(floor(autoPadTotalH / 2) if attrs.auto_pad == \"SAME_UPPER\" else autoPadTotalH - floor(autoPadTotalH / 2)) if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padTop", "effectivePadW": "(floor(autoPadTotalW / 2) if attrs.auto_pad == \"SAME_UPPER\" else autoPadTotalW - floor(autoPadTotalW / 2)) if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padLeft", "windowTaps": "kernelD * kernelH * kernelW", "windowParallelEligible": "numel(shapes.y) > 0 and windowTaps >= tunables.WINDOW_PARALLEL_MIN_TAPS and ceilDiv(numel(shapes.y), tunables.WORKGROUP_SIZE) < tunables.WINDOW_PARALLEL_MAX_SERIAL_GROUPS and numel(shapes.y) <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) and numel(shapes.y) <= windowTaps", "separableTmpElements": "dim(shapes.x, 0) * dim(shapes.x, 1) * dim(shapes.x, 2) * dim(shapes.y, 3)", "separableFits": "separableTmpElements * 4 <= min(device.limits.maxStorageBufferBindingSize, device.limits.maxBufferSize) and ceilDiv(separableTmpElements, tunables.WORKGROUP_SIZE) <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) * min(device.limits.maxComputeWorkgroupsPerDimension, 65535)", "poolBaseOk": "f16Ok(dtypes.T) and ranks.x >= 3 and ranks.x <= 5 and ranks.y == ranks.x and has(attrs, \"kernel_shape\") and kernelShapeLengthOk and stridesLengthOk and dilationsLengthOk and padsLengthOk and kernelD > 0 and kernelH > 0 and kernelW > 0 and strideD > 0 and strideH > 0 and strideW > 0 and dilationD > 0 and dilationH > 0 and dilationW > 0 and padFront >= 0 and padTop >= 0 and padLeft >= 0 and padBack >= 0 and padBottom >= 0 and padRight >= 0 and (attrs.auto_pad == \"NOTSET\" or not has(attrs, \"pads\")) and dim(shapes.y, 0) == dim(shapes.x, 0) and dim(shapes.y, 1) == dim(shapes.x, 1)", "effectivePadBack": "autoPadTotalD - effectivePadD if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padBack", "effectivePadBottom": "autoPadTotalH - effectivePadH if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padBottom", "effectivePadRight": "autoPadTotalW - effectivePadW if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padRight", "narrowF32W3UnrolledPreferred": "narrowSubgroupRange and dtypes.T == \"f32\"", "globalWindowParallelCovered": "poolBaseOk and numel(shapes.y) == dim(shapes.x, 0) * dim(shapes.x, 1) and numel(shapes.y) <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) and attrs.auto_pad == \"NOTSET\" and strideD == 1 and strideH == 1 and strideW == 1 and dilationD == 1 and dilationH == 1 and dilationW == 1 and padFront == 0 and padTop == 0 and padLeft == 0 and padBack == 0 and padBottom == 0 and padRight == 0 and ((ranks.x == 3 and kernelW == dim(shapes.x, 2)) or (ranks.x == 4 and kernelH == dim(shapes.x, 2) and kernelW == dim(shapes.x, 3)) or (ranks.x == 5 and kernelD == dim(shapes.x, 2) and kernelH == dim(shapes.x, 3) and kernelW == dim(shapes.x, 4))) and inner(shapes.x, 1) >= 256", "wholeWindowDenominator": "attrs.ceil_mode == 0 and (attrs.count_include_pad == 1 or (effectivePadH == 0 and effectivePadW == 0 and effectivePadBottom == 0 and effectivePadRight == 0))", "scalar": "dtypes.T", "inH": "dim(shapes.x, 2)", "inPlane": "dim(shapes.x, 2) * dim(shapes.x, 3)", "inW": "dim(shapes.x, 3)", "outH": "dim(shapes.y, 2)", "outW": "dim(shapes.y, 3)" }, "bindings": { "y_main": { "name": "y", "elementType": "$outputElement" }, "params_window_ncl1d": { "name": "params", "struct": [ { "name": "channels", "type": "u32", "value": "dim(shapes.x, 1)" }, { "name": "inW", "type": "u32", "value": "dim(shapes.x, 2)" }, { "name": "outW", "type": "u32", "value": "dim(shapes.y, 2)" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padW", "type": "i32", "value": "effectivePadW" } ] }, "params_window_nchw2d": { "name": "params", "struct": [ { "name": "channels", "type": "u32", "value": "dim(shapes.x, 1)" }, { "name": "inH", "type": "u32", "value": "dim(shapes.x, 2)" }, { "name": "inW", "type": "u32", "value": "dim(shapes.x, 3)" }, { "name": "outH", "type": "u32", "value": "dim(shapes.y, 2)" }, { "name": "outW", "type": "u32", "value": "dim(shapes.y, 3)" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padH", "type": "i32", "value": "effectivePadH" }, { "name": "padW", "type": "i32", "value": "effectivePadW" } ] }, "params_window_ncdhw3d": { "name": "params", "struct": [ { "name": "channels", "type": "u32", "value": "dim(shapes.x, 1)" }, { "name": "inD", "type": "u32", "value": "dim(shapes.x, 2)" }, { "name": "inH", "type": "u32", "value": "dim(shapes.x, 3)" }, { "name": "inW", "type": "u32", "value": "dim(shapes.x, 4)" }, { "name": "outD", "type": "u32", "value": "dim(shapes.y, 2)" }, { "name": "outH", "type": "u32", "value": "dim(shapes.y, 3)" }, { "name": "outW", "type": "u32", "value": "dim(shapes.y, 4)" }, { "name": "strideD", "type": "u32", "value": "strideD" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationD", "type": "u32", "value": "dilationD" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padD", "type": "i32", "value": "effectivePadD" }, { "name": "padH", "type": "i32", "value": "effectivePadH" }, { "name": "padW", "type": "i32", "value": "effectivePadW" } ] } }, "variants": [ { "id": "global_window_parallel", "priority": 50, "when": ["globalWindowParallelCovered"], "derive": { "xElem": "(\"vec4<f16>\" if dtypes.T == \"f16\" else \"vec4<f32>\") if inner(shapes.x, 1) % 4 == 0 else dtypes.T" }, "passes": [ { "id": "main", "name": "AveragePool.GlobalWindowParallel", "shader": "pool-global-reduction.wgsl.jinja", "derive": { "op": "\"average\"", "vec4": "inner(shapes.x, 1) % 4 == 0", "workgroupSizeSpec": "tunables.WORKGROUP_SIZE", "useSubgroups": "device.features.has(\"subgroups\")" }, "bindings": [ { "arg": "x", "elementType": "$xElem" }, { "arg": "y", "elementType": "$scalar" }, { "name": "params", "struct": [{ "name": "spatial", "type": "u32", "value": "inner(shapes.x, 1)" }] } ], "dispatch": { "x": "numel(shapes.y)" } } ] }, { "id": "window_parallel_ncl1d", "priority": 28, "when": ["poolBaseOk", "ranks.x == 3", "dim(shapes.y, 2) == inferredOutW", "attrs.count_include_pad == 0 or attrs.ceil_mode == 0", "windowParallelEligible"], "supersededBy": ["global_window_parallel"], "passes": [ { "id": "main", "name": "AveragePool.WindowParallelNcl1d", "shader": "pool-window-reduction.wgsl.jinja", "derive": { "op": "\"average\"", "spatialRankSpec": 1, "kernelDSpec": "kernelD", "kernelHSpec": "kernelH", "kernelWSpec": "kernelW", "workgroupSizeSpec": "tunables.WORKGROUP_SIZE", "useSubgroups": "device.features.has(\"subgroups\")", "countIncludePad": "attrs.count_include_pad != 0" }, "bindings": ["x", "y", "params_window_ncl1d"], "dispatch": { "x": "numel(shapes.y)" } } ] }, { "id": "window_parallel_nchw2d", "priority": 28, "when": ["poolBaseOk", "ranks.x == 4", "dim(shapes.y, 2) == inferredOutH", "dim(shapes.y, 3) == inferredOutW", "attrs.count_include_pad == 0 or attrs.ceil_mode == 0", "windowParallelEligible"], "supersededBy": ["global_window_parallel"], "passes": [ { "id": "main", "name": "AveragePool.WindowParallelNchw2d", "shader": "pool-window-reduction.wgsl.jinja", "derive": { "op": "\"average\"", "spatialRankSpec": 2, "kernelDSpec": "kernelD", "kernelHSpec": "kernelH", "kernelWSpec": "kernelW", "workgroupSizeSpec": "tunables.WORKGROUP_SIZE", "useSubgroups": "device.features.has(\"subgroups\")", "countIncludePad": "attrs.count_include_pad != 0" }, "bindings": ["x", "y", "params_window_nchw2d"], "dispatch": { "x": "numel(shapes.y)" } } ] }, { "id": "window_parallel_ncdhw3d", "priority": 28, "when": ["poolBaseOk", "ranks.x == 5", "dim(shapes.y, 2) == inferredOutD", "dim(shapes.y, 3) == inferredOutH", "dim(shapes.y, 4) == inferredOutW", "attrs.count_include_pad == 0 or attrs.ceil_mode == 0", "windowParallelEligible"], "supersededBy": ["global_window_parallel"], "passes": [ { "id": "main", "name": "AveragePool.WindowParallelNcdhw3d", "shader": "pool-window-reduction.wgsl.jinja", "derive": { "op": "\"average\"", "spatialRankSpec": 3, "kernelDSpec": "kernelD", "kernelHSpec": "kernelH", "kernelWSpec": "kernelW", "workgroupSizeSpec": "tunables.WORKGROUP_SIZE", "useSubgroups": "device.features.has(\"subgroups\")", "countIncludePad": "attrs.count_include_pad != 0" }, "bindings": ["x", "y", "params_window_ncdhw3d"], "dispatch": { "x": "numel(shapes.y)" } } ] }, { "id": "nchw2d_k7s1_reuse_tail", "priority": 34, "when": ["poolBaseOk", "ranks.x == 4", "kernelH == 7", "kernelW == 7", "strideH == 1", "strideW == 1", "dilationH == 1", "dilationW == 1", "effectivePadH == 3", "effectivePadBottom == 3", "effectivePadW == 3", "effectivePadRight == 3", "attrs.count_include_pad == 0", "attrs.ceil_mode == 0", "dim(shapes.x, 3) % 4 != 0", "dim(shapes.y, 2) == dim(shapes.x, 2)", "dim(shapes.y, 3) == dim(shapes.x, 3)", "dim(shapes.y, 2) > 0", "dim(shapes.y, 3) > 0"], "derive": { "outputElement": "dtypes.T" }, "passes": [ { "id": "main", "name": "AveragePool.Nchw2dK7s1ReuseTail", "shader": "average-pool2d-nchw-horizontal-reuse.wgsl.jinja", "derive": { "kernelHSpec": 7, "kernelWSpec": 7, "strideHSpec": 1, "strideWSpec": 1, "dilationHSpec": 1, "dilationWSpec": 1, "padTopSpec": 3, "padLeftSpec": 3, "outW4": "ceilDiv(dim(shapes.y, 3), 4)", "count4": "dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)", "scalarOutput": true }, "bindings": ["x", "y_main"], "dispatch": { "x": "min(ceilDiv((dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "nchw2d_w3s1_reuse", "priority": 30, "when": ["poolBaseOk", "ranks.x == 4", "kernelW == 3", "strideW == 1", "dilationW == 1", "effectivePadW == 1", "effectivePadRight == 1", "kernelH >= 1", "kernelH <= 3", "strideH == 1", "dilationH >= 1", "attrs.count_include_pad == 0", "attrs.ceil_mode == 0", "dim(shapes.x, 3) % 4 == 0", "dim(shapes.y, 2) == dim(shapes.x, 2) + effectivePadH + effectivePadBottom - ((kernelH - 1) * dilationH + 1) + 1", "dim(shapes.y, 3) == dim(shapes.x, 3)", "dim(shapes.y, 2) > 0", "dim(shapes.y, 3) > 0"], "demoteWhen": ["narrowF32W3UnrolledPreferred", "variableSubgroup16To32 and dtypes.T == \"f16\""], "passes": [ { "id": "main", "name": "AveragePool.Nchw2dW3s1Reuse", "shader": "average-pool2d-nchw-w3s1-reuse.wgsl.jinja", "derive": { "kernelHSpec": "kernelH", "dilationHSpec": "dilationH", "padTopSpec": "effectivePadH", "outWQuarter": "floor(dim(shapes.y, 3) / 4)" }, "bindings": [ "x", "y", { "name": "params", "struct": [{ "name": "tileCount", "type": "u32", "value": "numel(shapes.y) / 4" }] } ], "dispatch": { "x": "min(ceilDiv((numel(shapes.y) / 4), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((numel(shapes.y) / 4), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "nchw2d_w3s1_reuse_tail", "priority": 29, "when": ["poolBaseOk", "ranks.x == 4", "kernelW == 3", "strideW == 1", "dilationW == 1", "effectivePadW == 1", "effectivePadRight == 1", "kernelH >= 1", "kernelH <= 3", "strideH == 1", "dilationH >= 1", "attrs.count_include_pad == 0", "attrs.ceil_mode == 0", "dim(shapes.x, 3) % 4 != 0", "dim(shapes.y, 2) == dim(shapes.x, 2) + effectivePadH + effectivePadBottom - ((kernelH - 1) * dilationH + 1) + 1", "dim(shapes.y, 3) == dim(shapes.x, 3)", "dim(shapes.y, 2) > 0", "dim(shapes.y, 3) > 0"], "derive": { "outputElement": "dtypes.T" }, "passes": [ { "id": "main", "name": "AveragePool.Nchw2dW3s1ReuseTail", "shader": "average-pool2d-nchw-horizontal-reuse.wgsl.jinja", "derive": { "kernelHSpec": "kernelH", "kernelWSpec": 3, "strideHSpec": 1, "strideWSpec": 1, "dilationHSpec": "dilationH", "dilationWSpec": 1, "padTopSpec": "effectivePadH", "padLeftSpec": 1, "outW4": "ceilDiv(dim(shapes.y, 3), 4)", "count4": "dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)", "scalarOutput": true }, "bindings": ["x", "y_main"], "dispatch": { "x": "min(ceilDiv((dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "nchw2d_separable", "priority": 22, "when": ["poolBaseOk", "ranks.x == 4", "ranks.y == 4", "dim(shapes.y, 2) == inferredOutH", "dim(shapes.y, 3) == inferredOutW", "dim(shapes.y, 2) > 0", "dim(shapes.y, 3) > 0", "kernelH > 1", "kernelW > 1", "kernelH * kernelW >= tunables.SEPARABLE_MIN_WINDOW", "strideH < kernelH", "wholeWindowDenominator", "separableFits"], "derive": { "scalar": "dtypes.T" }, "intermediates": [{ "id": "tmp", "dtype": "float32", "shape": "[separableTmpElements]" }], "passes": [ { "id": "reduce_w", "name": "AveragePool.SeparableW", "shader": "pool2d-nchw-separable.wgsl.jinja", "derive": { "axisSpec": "\"w\"", "op": "\"avg\"", "windowArea": "kernelH * kernelW" }, "bindings": [ "x", { "name": "tmp", "elementType": "f32" }, { "name": "params", "struct": [ { "name": "inH", "type": "u32", "value": "dim(shapes.x, 2)" }, { "name": "inW", "type": "u32", "value": "dim(shapes.x, 3)" }, { "name": "outW", "type": "u32", "value": "dim(shapes.y, 3)" }, { "name": "kernelW", "type": "u32", "value": "kernelW" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padW", "type": "i32", "value": "effectivePadW" }, { "name": "tmpCount", "type": "u32", "value": "separableTmpElements" } ] } ], "dispatch": { "x": "min(ceilDiv((separableTmpElements), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((separableTmpElements), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } }, { "id": "reduce_h", "name": "AveragePool.SeparableH", "shader": "pool2d-nchw-separable.wgsl.jinja", "derive": { "axisSpec": "\"h\"", "op": "\"avg\"", "windowArea": "kernelH * kernelW" }, "bindings": [ { "name": "tmp", "buffer": "read-only-storage", "elementType": "f32" }, "y", { "name": "params", "struct": [ { "name": "inH", "type": "u32", "value": "dim(shapes.x, 2)" }, { "name": "outH", "type": "u32", "value": "dim(shapes.y, 2)" }, { "name": "outW", "type": "u32", "value": "dim(shapes.y, 3)" }, { "name": "kernelH", "type": "u32", "value": "kernelH" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "padH", "type": "i32", "value": "effectivePadH" }, { "name": "count", "type": "u32", "value": "numel(shapes.y)" } ] } ], "dispatch": { "x": "min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "nchw2d_unrolled", "priority": 25, "when": ["poolBaseOk", "ranks.x == 4", "dim(shapes.y, 2) == inferredOutH", "dim(shapes.y, 3) == inferredOutW", "kernelH >= 1", "kernelH <= 3", "kernelW >= 1", "kernelW <= 3", "strideH >= 1", "strideW >= 1", "dilationH >= 1", "dilationW >= 1", "dim(shapes.y, 2) > 0", "dim(shapes.y, 3) > 0"], "passes": [ { "id": "main", "name": "AveragePool.Nchw2dUnrolled", "shader": "pool-window-unroll.wgsl.jinja", "derive": { "op": "\"average\"", "kernelHSpec": "kernelH", "kernelWSpec": "kernelW", "strideHSpec": "strideH", "strideWSpec": "strideW", "dilationHSpec": "dilationH", "dilationWSpec": "dilationW", "padTopSpec": "effectivePadH", "padLeftSpec": "effectivePadW", "inH": "dim(shapes.x, 2)", "inW": "dim(shapes.x, 3)", "outH": "dim(shapes.y, 2)", "outW": "dim(shapes.y, 3)", "padBottomSpec": "effectivePadBottom", "padRightSpec": "effectivePadRight", "countIncludePad": "attrs.count_include_pad != 0" }, "bindings": [ "x", "y", { "name": "params", "struct": [{ "name": "count", "type": "u32", "value": "numel(shapes.y)" }] } ], "dispatch": { "x": "min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "ncl1d", "priority": 10, "when": ["poolBaseOk", "ranks.x == 3", "dim(shapes.y, 2) == inferredOutW"], "passes": [ { "id": "main", "name": "AveragePool.Ncl1d", "shader": "pool-window-nd.wgsl.jinja", "derive": { "op": "\"average\"", "spatialRankSpec": 1 }, "bindings": [ "x", "y", { "name": "params", "struct": [ { "name": "channels", "type": "u32", "value": "dim(shapes.x, 1)" }, { "name": "inW", "type": "u32", "value": "dim(shapes.x, 2)" }, { "name": "outW", "type": "u32", "value": "dim(shapes.y, 2)" }, { "name": "kernelW", "type": "u32", "value": "kernelW" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padLeft", "type": "i32", "value": "effectivePadW" }, { "name": "padRight", "type": "i32", "value": "effectivePadRight" }, { "name": "countIncludePad", "type": "u32", "value": "attrs.count_include_pad" }, { "name": "count", "type": "u32", "value": "numel(shapes.y)" } ] } ], "dispatch": { "x": "min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "nchw2d", "when": ["poolBaseOk", "ranks.x == 4", "((dim(shapes.y, 2) == explicitOutH and dim(shapes.y, 3) == explicitOutW) or ((attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") and dim(shapes.y, 2) == ceil(dim(shapes.x, 2) / strideH) and dim(shapes.y, 3) == ceil(dim(shapes.x, 3) / strideW)))"], "passes": [ { "id": "main", "name": "AveragePool.Nchw2d", "shader": "pool-window-nd.wgsl.jinja", "derive": { "op": "\"average\"", "spatialRankSpec": 2 }, "bindings": [ "x", "y", { "name": "params", "struct": [ { "name": "channels", "type": "u32", "value": "dim(shapes.x, 1)" }, { "name": "inH", "type": "u32", "value": "dim(shapes.x, 2)" }, { "name": "inW", "type": "u32", "value": "dim(shapes.x, 3)" }, { "name": "outH", "type": "u32", "value": "dim(shapes.y, 2)" }, { "name": "outW", "type": "u32", "value": "dim(shapes.y, 3)" }, { "name": "kernelH", "type": "u32", "value": "kernelH" }, { "name": "kernelW", "type": "u32", "value": "kernelW" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padTop", "type": "i32", "value": "effectivePadH" }, { "name": "padLeft", "type": "i32", "value": "effectivePadW" }, { "name": "padBottom", "type": "i32", "value": "effectivePadBottom" }, { "name": "padRight", "type": "i32", "value": "effectivePadRight" }, { "name": "countIncludePad", "type": "u32", "value": "attrs.count_include_pad" }, { "name": "count", "type": "u32", "value": "numel(shapes.y)" } ] } ], "dispatch": { "x": "min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "ncdhw3d", "priority": 10, "when": ["poolBaseOk", "ranks.x == 5", "dim(shapes.y, 2) == inferredOutD", "dim(shapes.y, 3) == inferredOutH", "dim(shapes.y, 4) == inferredOutW"], "supersededBy": ["global_window_parallel"], "passes": [ { "id": "main", "name": "AveragePool.Ncdhw3d", "shader": "pool-window-nd.wgsl.jinja", "derive": { "op": "\"average\"", "spatialRankSpec": 3 }, "bindings": [ "x", "y", { "name": "params", "struct": [ { "name": "channels", "type": "u32", "value": "dim(shapes.x, 1)" }, { "name": "inD", "type": "u32", "value": "dim(shapes.x, 2)" }, { "name": "inH", "type": "u32", "value": "dim(shapes.x, 3)" }, { "name": "inW", "type": "u32", "value": "dim(shapes.x, 4)" }, { "name": "outD", "type": "u32", "value": "dim(shapes.y, 2)" }, { "name": "outH", "type": "u32", "value": "dim(shapes.y, 3)" }, { "name": "outW", "type": "u32", "value": "dim(shapes.y, 4)" }, { "name": "kernelD", "type": "u32", "value": "kernelD" }, { "name": "kernelH", "type": "u32", "value": "kernelH" }, { "name": "kernelW", "type": "u32", "value": "kernelW" }, { "name": "strideD", "type": "u32", "value": "strideD" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationD", "type": "u32", "value": "dilationD" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padFront", "type": "i32", "value": "effectivePadD" }, { "name": "padTop", "type": "i32", "value": "effectivePadH" }, { "name": "padLeft", "type": "i32", "value": "effectivePadW" }, { "name": "padBack", "type": "i32", "value": "effectivePadBack" }, { "name": "padBottom", "type": "i32", "value": "effectivePadBottom" }, { "name": "padRight", "type": "i32", "value": "effectivePadRight" }, { "name": "countIncludePad", "type": "u32", "value": "attrs.count_include_pad" }, { "name": "count", "type": "u32", "value": "numel(shapes.y)" } ] } ], "dispatch": { "x": "min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "nchw2d_k7s2_reuse", "priority": 36, "when": ["poolBaseOk", "ranks.x == 4", "kernelH == 7", "kernelW == 7", "strideH == 2", "strideW == 2", "dilationH == 1", "dilationW == 1", "effectivePadH == 3", "effectivePadBottom == 3", "effectivePadW == 3", "effectivePadRight == 3", "attrs.count_include_pad == 0", "attrs.ceil_mode == 0", "dim(shapes.y, 2) == inferredOutH", "dim(shapes.y, 3) == inferredOutW", "dim(shapes.y, 3) % 4 == 0", "dim(shapes.y, 2) > 0", "dim(shapes.y, 3) > 0"], "derive": { "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"" }, "passes": [ { "id": "main", "name": "AveragePool.Nchw2dK7s2Reuse", "shader": "average-pool2d-nchw-horizontal-reuse.wgsl.jinja", "derive": { "kernelHSpec": 7, "kernelWSpec": 7, "strideHSpec": 2, "strideWSpec": 2, "dilationHSpec": 1, "dilationWSpec": 1, "padTopSpec": 3, "padLeftSpec": 3, "outW4": "dim(shapes.y, 3) / 4", "count4": "numel(shapes.y) / 4" }, "bindings": ["x", "y_main"], "dispatch": { "x": "min(ceilDiv((numel(shapes.y) / 4), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((numel(shapes.y) / 4), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] }, { "id": "nchw2d_k7s1_reuse", "priority": 35, "when": ["poolBaseOk", "ranks.x == 4", "kernelH == 7", "kernelW == 7", "strideH == 1", "strideW == 1", "dilationH == 1", "dilationW == 1", "effectivePadH == 3", "effectivePadBottom == 3", "effectivePadW == 3", "effectivePadRight == 3", "attrs.count_include_pad == 0", "attrs.ceil_mode == 0", "dim(shapes.x, 3) % 4 == 0", "dim(shapes.y, 2) == dim(shapes.x, 2)", "dim(shapes.y, 3) == dim(shapes.x, 3)", "dim(shapes.y, 2) > 0", "dim(shapes.y, 3) > 0"], "derive": { "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"" }, "passes": [ { "id": "main", "name": "AveragePool.Nchw2dK7s1Reuse", "shader": "average-pool2d-nchw-horizontal-reuse.wgsl.jinja", "derive": { "kernelHSpec": 7, "kernelWSpec": 7, "strideHSpec": 1, "strideWSpec": 1, "dilationHSpec": 1, "dilationWSpec": 1, "padTopSpec": 3, "padLeftSpec": 3, "outW4": "dim(shapes.y, 3) / 4", "count4": "numel(shapes.y) / 4" }, "bindings": ["x", "y_main"], "dispatch": { "x": "min(ceilDiv((numel(shapes.y) / 4), (tunables.WORKGROUP_SIZE)), 65535)", "y": "ceilDiv(ceilDiv((numel(shapes.y) / 4), (tunables.WORKGROUP_SIZE)), 65535)", "z": 1 } } ] } ]}{"domain":"ai.onnx","name":"AveragePool","sinceVersion":19,"inputs":{"x":{"onnx":"X","dtype":"T"}},"outputs":{"y":{"onnx":"Y","dtype":"T","rank":"ranks.x","shape":"poolOutputShape"}},"attributes":{"auto_pad":{"default":"NOTSET"},"count_include_pad":{"default":0},"ceil_mode":{"default":0},"kernel_shape":{},"strides":{},"pads":{},"dilations":{}},"attributeConstraints":{"auto_pad":{"values":["NOTSET","SAME_UPPER","SAME_LOWER","VALID"]},"ceil_mode":{"values":[0,1]},"count_include_pad":{"values":[0,1]},"kernel_shape":{"required":true}},"typeConstraints":{"T":["float32","float16"]},"tunables":{"WORKGROUP_SIZE":{"default":256},"SEPARABLE_MIN_WINDOW":{"default":25},"WINDOW_PARALLEL_MIN_TAPS":{"default":128},"WINDOW_PARALLEL_MAX_SERIAL_GROUPS":{"default":64}},"derive":{"spatialRank":"ranks.x - 2","narrowSubgroupRange":"has(device.adapterInfo, \"subgroupMinSize\") and has(device.adapterInfo, \"subgroupMaxSize\") and device.adapterInfo.subgroupMinSize < device.adapterInfo.subgroupMaxSize and device.adapterInfo.subgroupMaxSize <= 16","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","kernelShapeLengthOk":"not has(attrs, \"kernel_shape\") or (attrs.kernel_shape | length) == spatialRank","stridesLengthOk":"not has(attrs, \"strides\") or (attrs.strides | length) == spatialRank","dilationsLengthOk":"not has(attrs, \"dilations\") or (attrs.dilations | length) == spatialRank","padsLengthOk":"not has(attrs, \"pads\") or (attrs.pads | length) == 2 * spatialRank","kernelD":"attrs.kernel_shape[0] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank == 3 else 1","kernelH":"attrs.kernel_shape[spatialRank - 2] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank >= 2 else 1","kernelW":"attrs.kernel_shape[spatialRank - 1] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank >= 1 else 1","strideD":"attrs.strides[0] if stridesLengthOk and has(attrs, \"strides\") and spatialRank == 3 else 1","strideH":"attrs.strides[spatialRank - 2] if stridesLengthOk and has(attrs, \"strides\") and spatialRank >= 2 else 1","strideW":"attrs.strides[spatialRank - 1] if stridesLengthOk and has(attrs, \"strides\") and spatialRank >= 1 else 1","dilationD":"attrs.dilations[0] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank == 3 else 1","dilationH":"attrs.dilations[spatialRank - 2] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank >= 2 else 1","dilationW":"attrs.dilations[spatialRank - 1] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank >= 1 else 1","padFront":"attrs.pads[0] if padsLengthOk and has(attrs, \"pads\") and spatialRank == 3 else 0","padTop":"attrs.pads[spatialRank - 2] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 2 else 0","padLeft":"attrs.pads[spatialRank - 1] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 1 else 0","padBack":"attrs.pads[spatialRank] if padsLengthOk and has(attrs, \"pads\") and spatialRank == 3 else 0","padBottom":"attrs.pads[2 * spatialRank - 2] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 2 else 0","padRight":"attrs.pads[2 * spatialRank - 1] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 1 else 0","explicitOutW":"min(ceil((dim(shapes.x, ranks.x - 1) + padLeft + padRight - ((kernelW - 1) * dilationW + 1)) / strideW) + 1, ceil((dim(shapes.x, ranks.x - 1) + padLeft) / strideW)) if attrs.ceil_mode != 0 else floor((dim(shapes.x, ranks.x - 1) + padLeft + padRight - ((kernelW - 1) * dilationW + 1)) / strideW) + 1","explicitOutH":"min(ceil((dim(shapes.x, ranks.x - 2) + padTop + padBottom - ((kernelH - 1) * dilationH + 1)) / strideH) + 1, ceil((dim(shapes.x, ranks.x - 2) + padTop) / strideH)) if attrs.ceil_mode != 0 else floor((dim(shapes.x, ranks.x - 2) + padTop + padBottom - ((kernelH - 1) * dilationH + 1)) / strideH) + 1","explicitOutD":"(min(ceil((dim(shapes.x, 2) + padFront + padBack - ((kernelD - 1) * dilationD + 1)) / strideD) + 1, ceil((dim(shapes.x, 2) + padFront) / strideD)) if attrs.ceil_mode != 0 else floor((dim(shapes.x, 2) + padFront + padBack - ((kernelD - 1) * dilationD + 1)) / strideD) + 1) if ranks.x == 5 else 0","inferredOutW":"ceil(dim(shapes.x, ranks.x - 1) / strideW) if attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\" else explicitOutW","inferredOutH":"ceil(dim(shapes.x, ranks.x - 2) / strideH) if attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\" else explicitOutH","inferredOutD":"ceil(dim(shapes.x, 2) / strideD) if attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\" else explicitOutD","poolOutputShape":"[dim(shapes.x, 0), dim(shapes.x, 1), inferredOutW] if ranks.x == 3 else ([dim(shapes.x, 0), dim(shapes.x, 1), inferredOutH, inferredOutW] if ranks.x == 4 else [dim(shapes.x, 0), dim(shapes.x, 1), inferredOutD, inferredOutH, inferredOutW])","autoPadTotalD":"max(0, (dim(shapes.y, 2) - 1) * strideD + ((kernelD - 1) * dilationD + 1) - dim(shapes.x, 2)) if ranks.x == 5 else 0","autoPadTotalH":"max(0, (dim(shapes.y, ranks.x - 2) - 1) * strideH + ((kernelH - 1) * dilationH + 1) - dim(shapes.x, ranks.x - 2)) if ranks.x >= 4 else 0","autoPadTotalW":"max(0, (dim(shapes.y, ranks.x - 1) - 1) * strideW + ((kernelW - 1) * dilationW + 1) - dim(shapes.x, ranks.x - 1))","effectivePadD":"(floor(autoPadTotalD / 2) if attrs.auto_pad == \"SAME_UPPER\" else autoPadTotalD - floor(autoPadTotalD / 2)) if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padFront","effectivePadH":"(floor(autoPadTotalH / 2) if attrs.auto_pad == \"SAME_UPPER\" else autoPadTotalH - floor(autoPadTotalH / 2)) if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padTop","effectivePadW":"(floor(autoPadTotalW / 2) if attrs.auto_pad == \"SAME_UPPER\" else autoPadTotalW - floor(autoPadTotalW / 2)) if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padLeft","windowTaps":"kernelD * kernelH * kernelW","windowParallelEligible":"numel(shapes.y) > 0 and windowTaps >= tunables.WINDOW_PARALLEL_MIN_TAPS and ceilDiv(numel(shapes.y), tunables.WORKGROUP_SIZE) < tunables.WINDOW_PARALLEL_MAX_SERIAL_GROUPS and numel(shapes.y) <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) and numel(shapes.y) <= windowTaps","separableTmpElements":"dim(shapes.x, 0) * dim(shapes.x, 1) * dim(shapes.x, 2) * dim(shapes.y, 3)","separableFits":"separableTmpElements * 4 <= min(device.limits.maxStorageBufferBindingSize, device.limits.maxBufferSize) and ceilDiv(separableTmpElements, tunables.WORKGROUP_SIZE) <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) * min(device.limits.maxComputeWorkgroupsPerDimension, 65535)","poolBaseOk":"f16Ok(dtypes.T) and ranks.x >= 3 and ranks.x <= 5 and ranks.y == ranks.x and has(attrs, \"kernel_shape\") and kernelShapeLengthOk and stridesLengthOk and dilationsLengthOk and padsLengthOk and kernelD > 0 and kernelH > 0 and kernelW > 0 and strideD > 0 and strideH > 0 and strideW > 0 and dilationD > 0 and dilationH > 0 and dilationW > 0 and padFront >= 0 and padTop >= 0 and padLeft >= 0 and padBack >= 0 and padBottom >= 0 and padRight >= 0 and (attrs.auto_pad == \"NOTSET\" or not has(attrs, \"pads\")) and dim(shapes.y, 0) == dim(shapes.x, 0) and dim(shapes.y, 1) == dim(shapes.x, 1)","effectivePadBack":"autoPadTotalD - effectivePadD if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padBack","effectivePadBottom":"autoPadTotalH - effectivePadH if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padBottom","effectivePadRight":"autoPadTotalW - effectivePadW if (attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") else padRight","narrowF32W3UnrolledPreferred":"narrowSubgroupRange and dtypes.T == \"f32\"","globalWindowParallelCovered":"poolBaseOk and numel(shapes.y) == dim(shapes.x, 0) * dim(shapes.x, 1) and numel(shapes.y) <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) and attrs.auto_pad == \"NOTSET\" and strideD == 1 and strideH == 1 and strideW == 1 and dilationD == 1 and dilationH == 1 and dilationW == 1 and padFront == 0 and padTop == 0 and padLeft == 0 and padBack == 0 and padBottom == 0 and padRight == 0 and ((ranks.x == 3 and kernelW == dim(shapes.x, 2)) or (ranks.x == 4 and kernelH == dim(shapes.x, 2) and kernelW == dim(shapes.x, 3)) or (ranks.x == 5 and kernelD == dim(shapes.x, 2) and kernelH == dim(shapes.x, 3) and kernelW == dim(shapes.x, 4))) and inner(shapes.x, 1) >= 256","wholeWindowDenominator":"attrs.ceil_mode == 0 and (attrs.count_include_pad == 1 or (effectivePadH == 0 and effectivePadW == 0 and effectivePadBottom == 0 and effectivePadRight == 0))","scalar":"dtypes.T","inH":"dim(shapes.x, 2)","inPlane":"dim(shapes.x, 2) * dim(shapes.x, 3)","inW":"dim(shapes.x, 3)","outH":"dim(shapes.y, 2)","outW":"dim(shapes.y, 3)"},"bindings":{"y_main":{"name":"y","elementType":"$outputElement"},"params_window_ncl1d":{"name":"params","when":"ranks.x == 3","struct":[{"name":"channels","type":"u32","value":"dim(shapes.x, 1)"},{"name":"inW","type":"u32","value":"dim(shapes.x, 2)"},{"name":"outW","type":"u32","value":"dim(shapes.y, 2)"},{"name":"strideW","type":"u32","value":"strideW"},{"name":"dilationW","type":"u32","value":"dilationW"},{"name":"padW","type":"i32","value":"effectivePadW"}]},"params_window_nchw2d":{"name":"params","when":"ranks.x == 4","struct":[{"name":"channels","type":"u32","value":"dim(shapes.x, 1)"},{"name":"inH","type":"u32","value":"dim(shapes.x, 2)"},{"name":"inW","type":"u32","value":"dim(shapes.x, 3)"},{"name":"outH","type":"u32","value":"dim(shapes.y, 2)"},{"name":"outW","type":"u32","value":"dim(shapes.y, 3)"},{"name":"strideH","type":"u32","value":"strideH"},{"name":"strideW","type":"u32","value":"strideW"},{"name":"dilationH","type":"u32","value":"dilationH"},{"name":"dilationW","type":"u32","value":"dilationW"},{"name":"padH","type":"i32","value":"effectivePadH"},{"name":"padW","type":"i32","value":"effectivePadW"}]},"params_window_ncdhw3d":{"name":"params","when":"ranks.x == 5","struct":[{"name":"channels","type":"u32","value":"dim(shapes.x, 1)"},{"name":"inD","type":"u32","value":"dim(shapes.x, 2)"},{"name":"inH","type":"u32","value":"dim(shapes.x, 3)"},{"name":"inW","type":"u32","value":"dim(shapes.x, 4)"},{"name":"outD","type":"u32","value":"dim(shapes.y, 2)"},{"name":"outH","type":"u32","value":"dim(shapes.y, 3)"},{"name":"outW","type":"u32","value":"dim(shapes.y, 4)"},{"name":"strideD","type":"u32","value":"strideD"},{"name":"strideH","type":"u32","value":"strideH"},{"name":"strideW","type":"u32","value":"strideW"},{"name":"dilationD","type":"u32","value":"dilationD"},{"name":"dilationH","type":"u32","value":"dilationH"},{"name":"dilationW","type":"u32","value":"dilationW"},{"name":"padD","type":"i32","value":"effectivePadD"},{"name":"padH","type":"i32","value":"effectivePadH"},{"name":"padW","type":"i32","value":"effectivePadW"}]}},"variants":[{"id":"global_window_parallel","priority":50,"when":["globalWindowParallelCovered"],"derive":{"xElem":"(\"vec4<f16>\" if dtypes.T == \"f16\" else \"vec4<f32>\") if inner(shapes.x, 1) % 4 == 0 else dtypes.T"},"passes":[{"id":"main","name":"AveragePool.GlobalWindowParallel","shader":"pool-global-reduction.wgsl.jinja","derive":{"op":"\"average\"","vec4":"inner(shapes.x, 1) % 4 == 0","workgroupSizeSpec":"tunables.WORKGROUP_SIZE","useSubgroups":"device.features.has(\"subgroups\")"},"bindings":[{"arg":"x","elementType":"$xElem"},{"arg":"y","elementType":"$scalar"},{"name":"params","struct":[{"name":"spatial","type":"u32","value":"inner(shapes.x, 1)"}]}],"dispatch":{"x":"numel(shapes.y)"}}]},{"id":"window_parallel","priority":28,"when":["poolBaseOk","attrs.count_include_pad == 0 or attrs.ceil_mode == 0","(ranks.x == 3 and dim(shapes.y, 2) == inferredOutW) or (ranks.x == 4 and dim(shapes.y, 2) == inferredOutH and dim(shapes.y, 3) == inferredOutW) or (ranks.x == 5 and dim(shapes.y, 2) == inferredOutD and dim(shapes.y, 3) == inferredOutH and dim(shapes.y, 4) == inferredOutW)","windowParallelEligible"],"supersededBy":["global_window_parallel"],"passes":[{"id":"main","name":"AveragePool.WindowParallel","shader":"pool-window-reduction.wgsl.jinja","derive":{"op":"\"average\"","spatialRankSpec":"ranks.x - 2","kernelDSpec":"kernelD","kernelHSpec":"kernelH","kernelWSpec":"kernelW","workgroupSizeSpec":"tunables.WORKGROUP_SIZE","useSubgroups":"device.features.has(\"subgroups\")","countIncludePad":"attrs.count_include_pad != 0"},"bindings":["x","y","params_window_ncl1d","params_window_nchw2d","params_window_ncdhw3d"],"dispatch":{"x":"numel(shapes.y)"}}]},{"id":"nchw2d_k7_reuse","priority":35,"when":["poolBaseOk","ranks.x == 4","(kernelH == 7 and kernelW == 7 and strideH == strideW and (strideH == 1 or (strideH == 2 and dim(shapes.y, 3) % 4 == 0)) and dilationH == 1 and dilationW == 1 and effectivePadH == 3 and effectivePadBottom == 3 and effectivePadW == 3 and effectivePadRight == 3 and dim(shapes.y, 2) == inferredOutH and dim(shapes.y, 3) == inferredOutW) or (kernelW == 3 and strideW == 1 and dilationW == 1 and effectivePadW == 1 and effectivePadRight == 1 and kernelH >= 1 and kernelH <= 3 and strideH == 1 and dilationH >= 1 and dim(shapes.x, 3) % 4 != 0 and dim(shapes.y, 2) == dim(shapes.x, 2) + effectivePadH + effectivePadBottom - ((kernelH - 1) * dilationH + 1) + 1 and dim(shapes.y, 3) == dim(shapes.x, 3))","attrs.count_include_pad == 0","attrs.ceil_mode == 0","dim(shapes.y, 2) > 0","dim(shapes.y, 3) > 0"],"derive":{"scalarOutput":"kernelW == 3 or dim(shapes.y, 3) % 4 != 0","vectorScalar":"\"vec4<\" ~ dtypes.T ~ \">\"","outputElement":"dtypes.T if scalarOutput else vectorScalar"},"passes":[{"id":"main","name":"AveragePool.Nchw2dK7Reuse","shader":"average-pool2d-nchw-horizontal-reuse.wgsl.jinja","derive":{"kernelHSpec":"kernelH","kernelWSpec":"kernelW","strideHSpec":"strideH","strideWSpec":"strideW","dilationHSpec":"dilationH","dilationWSpec":"dilationW","padTopSpec":"effectivePadH","padLeftSpec":"effectivePadW","outW4":"ceilDiv(dim(shapes.y, 3), 4)","count4":"dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)"},"bindings":["x","y_main"],"dispatch":{"x":"min(ceilDiv((dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)), (tunables.WORKGROUP_SIZE)), 65535)","y":"ceilDiv(ceilDiv((dim(shapes.y, 0) * dim(shapes.y, 1) * dim(shapes.y, 2) * ceilDiv(dim(shapes.y, 3), 4)), (tunables.WORKGROUP_SIZE)), 65535)","z":1}}]},{"id":"nchw2d_w3s1_reuse","priority":30,"when":["poolBaseOk","ranks.x == 4","kernelW == 3","strideW == 1","dilationW == 1","effectivePadW == 1","effectivePadRight == 1","kernelH >= 1","kernelH <= 3","strideH == 1","dilationH >= 1","attrs.count_include_pad == 0","attrs.ceil_mode == 0","dim(shapes.x, 3) % 4 == 0","dim(shapes.y, 2) == dim(shapes.x, 2) + effectivePadH + effectivePadBottom - ((kernelH - 1) * dilationH + 1) + 1","dim(shapes.y, 3) == dim(shapes.x, 3)","dim(shapes.y, 2) > 0","dim(shapes.y, 3) > 0"],"demoteWhen":["narrowF32W3UnrolledPreferred","variableSubgroup16To32 and dtypes.T == \"f16\""],"passes":[{"id":"main","name":"AveragePool.Nchw2dW3s1Reuse","shader":"average-pool2d-nchw-w3s1-reuse.wgsl.jinja","derive":{"kernelHSpec":"kernelH","dilationHSpec":"dilationH","padTopSpec":"effectivePadH","outWQuarter":"floor(dim(shapes.y, 3) / 4)"},"bindings":["x","y",{"name":"params","struct":[{"name":"tileCount","type":"u32","value":"numel(shapes.y) / 4"}]}],"dispatch":{"x":"min(ceilDiv((numel(shapes.y) / 4), (tunables.WORKGROUP_SIZE)), 65535)","y":"ceilDiv(ceilDiv((numel(shapes.y) / 4), (tunables.WORKGROUP_SIZE)), 65535)","z":1}}]},{"id":"nchw2d_separable","priority":22,"when":["poolBaseOk","ranks.x == 4","ranks.y == 4","dim(shapes.y, 2) == inferredOutH","dim(shapes.y, 3) == inferredOutW","dim(shapes.y, 2) > 0","dim(shapes.y, 3) > 0","kernelH > 1","kernelW > 1","kernelH * kernelW >= tunables.SEPARABLE_MIN_WINDOW","strideH < kernelH","wholeWindowDenominator","separableFits"],"derive":{"scalar":"dtypes.T","sepInW":"dim(shapes.x, 3)","sepInH":"dim(shapes.x, 2)","sepOutW":"dim(shapes.y, 3)","sepOutH":"dim(shapes.y, 2)"},"intermediates":[{"id":"tmp","dtype":"float32","shape":"[separableTmpElements]"}],"passes":[{"id":"reduce_w","name":"AveragePool.SeparableW","shader":"pool2d-nchw-separable.wgsl.jinja","derive":{"axisSpec":"\"w\"","op":"\"avg\"","windowArea":"kernelH * kernelW"},"bindings":["x",{"name":"tmp","elementType":"f32"},{"name":"params","struct":[{"name":"tmpCount","type":"u32","value":"separableTmpElements"}]}],"dispatch":{"x":"min(ceilDiv((separableTmpElements), (tunables.WORKGROUP_SIZE)), 65535)","y":"ceilDiv(ceilDiv((separableTmpElements), (tunables.WORKGROUP_SIZE)), 65535)","z":1}},{"id":"reduce_h","name":"AveragePool.SeparableH","shader":"pool2d-nchw-separable.wgsl.jinja","derive":{"axisSpec":"\"h\"","op":"\"avg\"","windowArea":"kernelH * kernelW"},"bindings":[{"name":"tmp","buffer":"read-only-storage","elementType":"f32"},"y",{"name":"params","struct":[{"name":"count","type":"u32","value":"numel(shapes.y)"}]}],"dispatch":{"x":"min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)","y":"ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)","z":1}}]},{"id":"nchw2d_unrolled","priority":25,"when":["poolBaseOk","ranks.x == 4","dim(shapes.y, 2) == inferredOutH","dim(shapes.y, 3) == inferredOutW","kernelH >= 1","kernelH <= 3","kernelW >= 1","kernelW <= 3","strideH >= 1","strideW >= 1","dilationH >= 1","dilationW >= 1","dim(shapes.y, 2) > 0","dim(shapes.y, 3) > 0"],"passes":[{"id":"main","name":"AveragePool.Nchw2dUnrolled","shader":"pool-window-unroll.wgsl.jinja","derive":{"op":"\"average\"","kernelHSpec":"kernelH","kernelWSpec":"kernelW","strideHSpec":"strideH","strideWSpec":"strideW","dilationHSpec":"dilationH","dilationWSpec":"dilationW","padTopSpec":"effectivePadH","padLeftSpec":"effectivePadW","inH":"dim(shapes.x, 2)","inW":"dim(shapes.x, 3)","outH":"dim(shapes.y, 2)","outW":"dim(shapes.y, 3)","padBottomSpec":"effectivePadBottom","padRightSpec":"effectivePadRight","countIncludePad":"attrs.count_include_pad != 0"},"bindings":["x","y",{"name":"params","struct":[{"name":"count","type":"u32","value":"numel(shapes.y)"}]}],"dispatch":{"x":"min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)","y":"ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)","z":1}}]},{"id":"window_1d_2d","priority":10,"when":["poolBaseOk","(ranks.x == 3 and dim(shapes.y, 2) == inferredOutW) or (ranks.x == 4 and ((dim(shapes.y, 2) == explicitOutH and dim(shapes.y, 3) == explicitOutW) or ((attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\") and dim(shapes.y, 2) == ceil(dim(shapes.x, 2) / strideH) and dim(shapes.y, 3) == ceil(dim(shapes.x, 3) / strideW))))"],"passes":[{"id":"main","name":"AveragePool.Window","shader":"pool-window-nd.wgsl.jinja","derive":{"op":"\"average\"","spatialRankSpec":"spatialRank"},"bindings":["x","y",{"name":"params","when":"ranks.x == 3","struct":[{"name":"channels","type":"u32","value":"dim(shapes.x, 1)"},{"name":"inW","type":"u32","value":"dim(shapes.x, 2)"},{"name":"outW","type":"u32","value":"dim(shapes.y, 2)"},{"name":"kernelW","type":"u32","value":"kernelW"},{"name":"strideW","type":"u32","value":"strideW"},{"name":"dilationW","type":"u32","value":"dilationW"},{"name":"padLeft","type":"i32","value":"effectivePadW"},{"name":"padRight","type":"i32","value":"effectivePadRight"},{"name":"countIncludePad","type":"u32","value":"attrs.count_include_pad"},{"name":"count","type":"u32","value":"numel(shapes.y)"}]},{"name":"params","when":"ranks.x == 4","struct":[{"name":"channels","type":"u32","value":"dim(shapes.x, 1)"},{"name":"inH","type":"u32","value":"dim(shapes.x, 2)"},{"name":"inW","type":"u32","value":"dim(shapes.x, 3)"},{"name":"outH","type":"u32","value":"dim(shapes.y, 2)"},{"name":"outW","type":"u32","value":"dim(shapes.y, 3)"},{"name":"kernelH","type":"u32","value":"kernelH"},{"name":"kernelW","type":"u32","value":"kernelW"},{"name":"strideH","type":"u32","value":"strideH"},{"name":"strideW","type":"u32","value":"strideW"},{"name":"dilationH","type":"u32","value":"dilationH"},{"name":"dilationW","type":"u32","value":"dilationW"},{"name":"padTop","type":"i32","value":"effectivePadH"},{"name":"padLeft","type":"i32","value":"effectivePadW"},{"name":"padBottom","type":"i32","value":"effectivePadBottom"},{"name":"padRight","type":"i32","value":"effectivePadRight"},{"name":"countIncludePad","type":"u32","value":"attrs.count_include_pad"},{"name":"count","type":"u32","value":"numel(shapes.y)"}]}],"dispatch":{"x":"min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)","y":"ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)","z":1}}]},{"id":"ncdhw3d","priority":10,"when":["poolBaseOk","ranks.x == 5","dim(shapes.y, 2) == inferredOutD","dim(shapes.y, 3) == inferredOutH","dim(shapes.y, 4) == inferredOutW"],"supersededBy":["global_window_parallel"],"passes":[{"id":"main","name":"AveragePool.Ncdhw3d","shader":"pool-window-nd.wgsl.jinja","derive":{"op":"\"average\"","spatialRankSpec":3},"bindings":["x","y",{"name":"params","struct":[{"name":"channels","type":"u32","value":"dim(shapes.x, 1)"},{"name":"inD","type":"u32","value":"dim(shapes.x, 2)"},{"name":"inH","type":"u32","value":"dim(shapes.x, 3)"},{"name":"inW","type":"u32","value":"dim(shapes.x, 4)"},{"name":"outD","type":"u32","value":"dim(shapes.y, 2)"},{"name":"outH","type":"u32","value":"dim(shapes.y, 3)"},{"name":"outW","type":"u32","value":"dim(shapes.y, 4)"},{"name":"kernelD","type":"u32","value":"kernelD"},{"name":"kernelH","type":"u32","value":"kernelH"},{"name":"kernelW","type":"u32","value":"kernelW"},{"name":"strideD","type":"u32","value":"strideD"},{"name":"strideH","type":"u32","value":"strideH"},{"name":"strideW","type":"u32","value":"strideW"},{"name":"dilationD","type":"u32","value":"dilationD"},{"name":"dilationH","type":"u32","value":"dilationH"},{"name":"dilationW","type":"u32","value":"dilationW"},{"name":"padFront","type":"i32","value":"effectivePadD"},{"name":"padTop","type":"i32","value":"effectivePadH"},{"name":"padLeft","type":"i32","value":"effectivePadW"},{"name":"padBack","type":"i32","value":"effectivePadBack"},{"name":"padBottom","type":"i32","value":"effectivePadBottom"},{"name":"padRight","type":"i32","value":"effectivePadRight"},{"name":"countIncludePad","type":"u32","value":"attrs.count_include_pad"},{"name":"count","type":"u32","value":"numel(shapes.y)"}]}],"dispatch":{"x":"min(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)","y":"ceilDiv(ceilDiv((numel(shapes.y)), (tunables.WORKGROUP_SIZE)), 65535)","z":1}}]}]}1234567891011121314151617181920212223242526272829303132333435363738394041421{ "name": "ai.onnx.AveragePool", "id": "_ai_onnx_averagepool_webgpu_6441176", "version": 1, "license": "Apache-2.0", "backend": { "type": "webgpu" }, "digest": { "algorithm": "sha256", "files": { "average-pool2d-nchw-horizontal-reuse.wgsl.jinja": "heeYKFbnmrXdEohH7tUG5PzItrk5yPz3hEgnuNihBWg=", "average-pool2d-nchw-w3s1-reuse.wgsl.jinja": "D4razLs8qLkk5zubCU+wUa9OVgFisNZ95cGwXipOvwI=", "bench.json": "ZvF9gqBTship90W+TiMfWNyrdsJYyEAwZAdZ5r6/vc0=", "manifest.json": "/fTFl6NMtKYnbxuSbihY039sqo+P8xhGXVjFtj2gA6c=", "pool-global-reduction.wgsl.jinja": "uCrSccgj/Fibd866kxpiYkprR8g6q1vofgQZZ/oxGkE=", "pool-window-nd.wgsl.jinja": "QCtdlEJy4LmSU9g7oUOR0YbZ9cZuxH6P1ERT3m7YACY=", "pool-window-reduction.wgsl.jinja": "Jv5CY3dfoWUzgoxb4H35nlKspu9GKe10Z1bRjGQ4DPk=", "pool-window-unroll.wgsl.jinja": "UWhk8iANx6euYlJV5W31BP0D4FaJEC+lV/3y95T2wOQ=", "pool2d-nchw-separable.wgsl.jinja": "GgafQWV6Pn5SqSn5gMns0EJEHGqk2WkdCdVurt3MgA8=", "test.json": "zw4aG7ZsPYmGpRG2g8Yi++TwV5Fvas/zLR5Gesmxys8=" } }, "provenance": { "kernel": { "sha": "6fdf6301e2bbcc2f03bf1eaf493b7ad55ef33afc", "dirty": false } }, "webgpu": { "manifestSpec": "2.1", "variants": { "global_window_parallel": ["pool-global-reduction.wgsl.jinja"], "window_parallel_ncl1d": ["pool-window-reduction.wgsl.jinja"], "window_parallel_nchw2d": ["pool-window-reduction.wgsl.jinja"], "window_parallel_ncdhw3d": ["pool-window-reduction.wgsl.jinja"], "nchw2d_k7s1_reuse_tail": ["average-pool2d-nchw-horizontal-reuse.wgsl.jinja"], "nchw2d_w3s1_reuse": ["average-pool2d-nchw-w3s1-reuse.wgsl.jinja"], "nchw2d_w3s1_reuse_tail": ["average-pool2d-nchw-horizontal-reuse.wgsl.jinja"], "nchw2d_separable": ["pool2d-nchw-separable.wgsl.jinja"], "nchw2d_unrolled": ["pool-window-unroll.wgsl.jinja"], "ncl1d": ["pool-window-nd.wgsl.jinja"], "nchw2d": ["pool-window-nd.wgsl.jinja"], "ncdhw3d": ["pool-window-nd.wgsl.jinja"], "nchw2d_k7s2_reuse": ["average-pool2d-nchw-horizontal-reuse.wgsl.jinja"], "nchw2d_k7s1_reuse": ["average-pool2d-nchw-horizontal-reuse.wgsl.jinja"] } }}{"name":"ai.onnx.AveragePool","id":"_ai_onnx_averagepool_webgpu_490ec23","version":1,"license":"Apache-2.0","backend":{"type":"webgpu"},"digest":{"algorithm":"sha256","files":{"average-pool2d-nchw-horizontal-reuse.wgsl.jinja":"IfANXrrdFnM9fsBaQjmRR6fA8xseHKJi50pPjHixtr0=","average-pool2d-nchw-w3s1-reuse.wgsl.jinja":"GYBJUzeLpwAGa+RuBUtLRaej2ioghMu7701hVM+xBSM=","bench.json":"5mAVvSp24MYBXgUukXuaAE+dosi1lbrCN6X8u7U8q4o=","manifest.json":"1h+vebL2pcVkbRF7s2Eqcd5vlc5oe1yAf/nS2/nHvSM=","pool-global-reduction.wgsl.jinja":"9Z1xncXFtYnai8nRoLYKG5yyfZvomYsfvCuxlt8tXnE=","pool-window-nd.wgsl.jinja":"pI2wc4Pm+gfG3cFta5j7cOd65hdrwk7C717qTIBRN0o=","pool-window-reduction.wgsl.jinja":"2QFXer1twXw/w4GuaMzH+gL0NSidQFPVgkdoYSV2gvc=","pool-window-unroll.wgsl.jinja":"NAC5GuPYeJNSyijrTRlC+X5XexTAA8Jmq1dvIf6LQrI=","pool2d-nchw-separable.wgsl.jinja":"G0AJzjQFMlrEyqHBCf3eQ0gQvADv3A8l8WLn8oEID74=","test.json":"sX1QgEkQgM7SI6jCGwnof+nRj1IkbUggn1Mpe/CQccU="}},"provenance":{"kernel":{"sha":"4385228f788ddaa1bd7aec6a80a20f3ddffd8011","dirty":false}},"webgpu":{"manifestSpec":"2.2"}}24 unmodified lines25262728292829303117 unmodified lines495051535455565758596061626364656667686970525354555657585960616263646566676873697071727773747524 unmodified lines@compute @workgroup_size(WG)fn main(@builtin(workgroup_id) wid: vec3<u32>, @builtin(local_invocation_id) lid: vec3<u32>{% if useSubgroups %}, @builtin(subgroup_invocation_id) sg_lane: u32, @builtin(subgroup_size) sg_size: u32{% endif %}) { @builtin(subgroup_invocation_id) sg_lane: u32{% endif %}) { let plane = wid.x; let tid = lid.x; var partial = 0.0;17 unmodified lines{% if useSubgroups %}{% filter indent(2, true) %}var total = subgroupAdd(partial);// Cross-subgroup fold that assumes nothing about which invocations share a// subgroup or how many subgroups there are (it does require the uniform// control flow this entry point already has): every invocation owns the slot// at its own index, the elected lane// publishes its subgroup partial there and every other lane publishes the// reduction identity. Each subgroup then folds all WG slots — lane `sg_lane`// walks slots sg_lane, sg_lane + sg_size, ... — and one more collective merges// the lane partials, so every slot is merged exactly once at any legal width.// The coordinates are the BUILTINS, never `subgroupExclusiveAdd(1u)` /// `subgroupAdd(1u)`: those agree with them under this contract, but a driver// in the wild answers a claim derived from them with zero. A one-subgroup// workgroup skips shared memory entirely; that test reads the `subgroup_size`// builtin, which is uniform, because a collective's result is not uniform to// WGSL's analysis and may not guard a barrier.if (sg_size != WG) { let rank = sg_lane; let lanes = sg_size; wg_partials[tid] = select(0.0, total, rank == 0u);// Publish through elected local-id slots; active coordinates cover all slots.{% macro active_lanes(lane, prefix="active") %} let {{ prefix }}Mask = subgroupBallot(true); let {{ prefix }}Word = {{ lane }} / 32u; let {{ prefix }}Lower = (1u << ({{ lane }} % 32u)) - 1u; let {{ prefix }}Count = max(countOneBits({{ prefix }}Mask.x) + countOneBits({{ prefix }}Mask.y) + countOneBits({{ prefix }}Mask.z) + countOneBits({{ prefix }}Mask.w), 1u); var {{ prefix }}Rank = countOneBits({{ prefix }}Mask[{{ prefix }}Word] & {{ prefix }}Lower); for (var word = 0u; word < {{ prefix }}Word; word++) { {{ prefix }}Rank += countOneBits({{ prefix }}Mask[word]); }{% endmacro %}{{ active_lanes("sg_lane") }}let leader = subgroupElect(); wg_partials[tid] = select(0.0, total, leader); workgroupBarrier(); var acc = 0.0; for (var i = rank; i < WG; i = i + lanes) { for (var i = activeRank; i < WG; i = i + activeCount) { acc = acc + wg_partials[i]; } total = subgroupAdd(acc);}{% endfilter %} if (tid == 0u) {{% else %}1123456678910111213141215161718{% macro flat_index_2d(workgroupSize, name="i", bound="params.count", guardInline=false) %}{% macro flat_index_2d(workgroupSize, name="i", bound="params.count") %}{% set wgTerm = workgroupSize ~ "u" if workgroupSize is number else workgroupSize %} // 2D-folded flat index: gid.y carries the high bits past the dispatch's // per-axis workgroup fold width. let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ wgTerm }}; if ({{ name }} >= {{ bound }}) { return; }{% endmacro %} if ({{ name }} >= {{ bound }}) { return; }{% endmacro %}{{ env.wgsl.resourceDeclarations }}
// Direct spatial-pooling traversal for a channels-first tensor.@compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})fn main(@builtin(global_invocation_id) gid: vec3<u32>) {{{ flat_index_2d(tunables.WORKGROUP_SIZE, "index", guardInline=true) }}{{ flat_index_2d(tunables.WORKGROUP_SIZE, "index") }}
let ow = index % params.outW; var t = index / params.outW;4 unmodified lines567889101110 unmodified lines222324252526272815 unmodified lines44454647484748495075 unmodified lines1261271281301311321331341351361371381391401411421431441451461471291301311321331341351361371381391401411421431441491451461471481491501511561521531541553 unmodified lines1591601611661621631644 unmodified lines{{ env.wgsl.resourceDeclarations }}
// Workgroup-cooperative windowed pooling: one workgroup reduces the kernel// window of ONE output element. The serial route gives each output element a// window of ONE output element. The serial variant gives each output element a// single invocation that loops the whole window, so its only parallelism is the// output element count; when that count launches too few workgroups and the window is// long, the window itself is the parallelism worth spending. Threads here stride10 unmodified lines{% else %}// count_include_pad == 0 divides by the in-bounds tap count, which is reduced// across the workgroup alongside the sum. An output whose window is entirely// out of bounds writes 0, matching the serial route. The tree changes the// out of bounds writes 0, matching the serial variant. The tree changes the// association of additions.{% endif %}const WG: u32 = {{ workgroupSizeSpec }}u;15 unmodified lines@compute @workgroup_size(WG)fn main(@builtin(workgroup_id) wid: vec3<u32>, @builtin(local_invocation_id) lid: vec3<u32>{% if useSubgroups %}, @builtin(subgroup_invocation_id) sg_lane: u32, @builtin(subgroup_size) sg_size: u32{% endif %}) { @builtin(subgroup_invocation_id) sg_lane: u32{% endif %}) { // One workgroup per output element: the dispatch is exactly numel(y), so no // bounds guard is needed here. let index = wid.x;75 unmodified lines{% if needsCount %}var countTotal = subgroupAdd(counted);{% endif %}// Cross-subgroup fold that assumes nothing about which invocations share a// subgroup or how many subgroups there are (it does require the uniform// control flow this entry point already has): every invocation owns the slot// at its own index, the elected lane// publishes its subgroup partial there and every other lane publishes the// reduction identity. Each subgroup then folds all WG slots — lane `sg_lane`// walks slots sg_lane, sg_lane + sg_size, ... — and one more collective merges// the lane partials, so every slot is merged exactly once at any legal width.// The coordinates are the BUILTINS, never `subgroupExclusiveAdd(1u)` /// `subgroupAdd(1u)`: those agree with them under this contract, but a driver// in the wild answers a claim derived from them with zero. A one-subgroup// workgroup skips shared memory entirely; that test reads the `subgroup_size`// builtin, which is uniform, because a collective's result is not uniform to// WGSL's analysis and may not guard a barrier.if (sg_size != WG) { let rank = sg_lane; let lanes = sg_size; wg_partials[tid] = select(0.0, total, rank == 0u);// Publish through elected local-id slots; active coordinates cover all slots.{% macro active_lanes(lane, prefix="active") %} let {{ prefix }}Mask = subgroupBallot(true); let {{ prefix }}Word = {{ lane }} / 32u; let {{ prefix }}Lower = (1u << ({{ lane }} % 32u)) - 1u; let {{ prefix }}Count = max(countOneBits({{ prefix }}Mask.x) + countOneBits({{ prefix }}Mask.y) + countOneBits({{ prefix }}Mask.z) + countOneBits({{ prefix }}Mask.w), 1u); var {{ prefix }}Rank = countOneBits({{ prefix }}Mask[{{ prefix }}Word] & {{ prefix }}Lower); for (var word = 0u; word < {{ prefix }}Word; word++) { {{ prefix }}Rank += countOneBits({{ prefix }}Mask[word]); }{% endmacro %}{{ active_lanes("sg_lane") }}let leader = subgroupElect(); wg_partials[tid] = select(0.0, total, leader);{% if needsCount %} wg_counts[tid] = select(0.0, countTotal, rank == 0u); wg_counts[tid] = select(0.0, countTotal, leader);{% endif %} workgroupBarrier(); var acc = 0.0;{% if needsCount %} var countAcc = 0.0;{% endif %} for (var i = rank; i < WG; i = i + lanes) { for (var i = activeRank; i < WG; i = i + activeCount) { acc = acc + wg_partials[i];{% if needsCount %} countAcc = countAcc + wg_counts[i];3 unmodified lines{% if needsCount %} countTotal = subgroupAdd(countAcc);{% endif %}}{% endfilter %}{% else %} // No-subgroups fallback: full workgroup-tree reduction of the per-thread12334567891010111213146 unmodified lines212223232425262732 unmodified lines6061626263646566// Compile-time-unrolled 2D NCHW pooling for small windows. Accumulation remains// kh-major/kw-minor, matching the loop-based implementations.{% macro flat_index_2d(workgroupSize, name="i", bound="params.count", guardInline=false) %}{% macro flat_index_2d(workgroupSize, name="i", bound="params.count") %}{% set wgTerm = workgroupSize ~ "u" if workgroupSize is number else workgroupSize %} // 2D-folded flat index: gid.y carries the high bits past the dispatch's // per-axis workgroup fold width. let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ wgTerm }}; if ({{ name }} >= {{ bound }}) { return; } }{% endmacro %}{% endmacro %}{{ env.wgsl.resourceDeclarations }}
const OUT_W: u32 = {{ outW }}u;6 unmodified linesconst STRIDE_W: u32 = {{ strideWSpec }}u;const PAD_TOP: i32 = {{ padTopSpec }};const PAD_LEFT: i32 = {{ padLeftSpec }};{% if op == "average" and countIncludePad %}{% if countIncludePad %}const PAD_BOTTOM: i32 = {{ padBottomSpec }};const PAD_RIGHT: i32 = {{ padRightSpec }};{% endif %}32 unmodified lines{% endfor %} }{% endfor %}{% if op == "average" and countIncludePad %}{% if countIncludePad %}
var denominator = 0u;{% for kh in range(kernelHSpec) %}1234567891011121314151617181911 unmodified lines3132331819202134353637383924252627404142434445464748333435364950515253543940414255565758596061{% set staticGeometry = true %}{% set geometryInW = (sepInW ~ "u") if staticGeometry else "params.inW" %}{% set geometryInH = (sepInH ~ "u") if staticGeometry else "params.inH" %}{% set geometryOutW = (sepOutW ~ "u") if staticGeometry else "params.outW" %}{% set geometryOutH = (sepOutH ~ "u") if staticGeometry else "params.outH" %}{% set geometryKernelW = (kernelW ~ "u") if staticGeometry else "params.kernelW" %}{% set geometryKernelH = (kernelH ~ "u") if staticGeometry else "params.kernelH" %}{% set geometryStrideW = (strideW ~ "u") if staticGeometry else "params.strideW" %}{% set geometryStrideH = (strideH ~ "u") if staticGeometry else "params.strideH" %}{% set geometryDilationW = (dilationW ~ "u") if staticGeometry else "params.dilationW" %}{% set geometryDilationH = (dilationH ~ "u") if staticGeometry else "params.dilationH" %}{% set geometryPadW = (effectivePadW ~ "") if staticGeometry else "params.padW" %}{% set geometryPadH = (effectivePadH ~ "") if staticGeometry else "params.padH" %}{% set divisorInH = (max(sepInH, 1) ~ "u") if staticGeometry else geometryInH %}{% set divisorOutW = (max(sepOutW, 1) ~ "u") if staticGeometry else geometryOutW %}{% set divisorOutH = (max(sepOutH, 1) ~ "u") if staticGeometry else geometryOutH %}{{ env.wgsl.resourceDeclarations }}
// Separable NCHW pooling: one spatial axis per pass.11 unmodified lines{% if axisSpec == "w" %} if (index >= params.tmpCount) { return; } // One cell per (batch, channel, input row, output column). let ow = index % params.outW; let t = index / params.outW; let ih = t % params.inH; let nc = t / params.inH; let ow = index % {{ divisorOutW }}; let t = index / {{ divisorOutW }}; let ih = t % {{ divisorInH }}; let nc = t / {{ divisorInH }};
var acc = 0.0; for (var kw = 0u; kw < params.kernelW; kw += 1u) { let iw = i32(ow * params.strideW + kw * params.dilationW) - params.padW; if (iw < 0 || iw >= i32(params.inW)) { continue; } let value = f32(x[(nc * params.inH + ih) * params.inW + u32(iw)]); for (var kw = 0u; kw < {{ geometryKernelW }}; kw += 1u) { let iw = i32(ow * {{ geometryStrideW }} + kw * {{ geometryDilationW }}) - {{ geometryPadW }}; if (iw < 0 || iw >= i32({{ geometryInW }})) { continue; } let value = f32(x[(nc * {{ geometryInH }} + ih) * {{ geometryInW }} + u32(iw)]); acc += value; } tmp[index] = acc;{% else %} if (index >= params.count) { return; } let ow = index % params.outW; let t = index / params.outW; let oh = t % params.outH; let nc = t / params.outH; let ow = index % {{ divisorOutW }}; let t = index / {{ divisorOutW }}; let oh = t % {{ divisorOutH }}; let nc = t / {{ divisorOutH }};
var acc = 0.0; for (var kh = 0u; kh < params.kernelH; kh += 1u) { let ih = i32(oh * params.strideH + kh * params.dilationH) - params.padH; if (ih < 0 || ih >= i32(params.inH)) { continue; } let partial = tmp[(nc * params.inH + u32(ih)) * params.outW + ow]; for (var kh = 0u; kh < {{ geometryKernelH }}; kh += 1u) { let ih = i32(oh * {{ geometryStrideH }} + kh * {{ geometryDilationH }}) - {{ geometryPadH }}; if (ih < 0 || ih >= i32({{ geometryInH }})) { continue; } let partial = tmp[(nc * {{ geometryInH }} + u32(ih)) * {{ geometryOutW }} + ow]; acc += partial; }
3 unmodified lines45677891011636 unmodified lines64864965065065165265365413 unmodified lines6686696706706716726736716726736742 unmodified lines67767867968268068168268315 unmodified lines699700701704702703704705140 unmodified lines84684784885185285385484985085185225 unmodified lines87887988088688188288388415 unmodified lines90090190290890390490590616 unmodified lines923924925931926927928929116 unmodified lines10461047104810541049105010511052101 unmodified lines1154115511561162115711581159116048 unmodified lines1209121012111217121212131214121515 unmodified lines123112321233123912341235123612378 unmodified lines124612471248125412491250125112528 unmodified lines1261126212631269126412651266126727 unmodified lines1295129612971303129812991300130136 unmodified lines1338133913401346134113421343134435 unmodified lines1380138113821388138313841385138660 unmodified lines1447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716083 unmodified lines "onnx_backend_averagepool_2d_pads_input_x": [1.764052391052246, 0.40015721321105957, 0.978738009929657, 2.2408931255340576, 1.8675580024719238, -0.9772778749465942, 0.9500884413719177, -0.15135720372200012, -0.10321885347366333, 0.4105985164642334, 0.14404356479644775, 1.4542734622955322, 0.7610377073287964, 0.12167501449584961, 0.44386324286460876, 0.3336743414402008, 1.4940791130065918, -0.2051582634449005, 0.3130677044391632, -0.8540957570075989, -2.5529897212982178, 0.653618574142456, 0.8644362092018127, -0.7421650290489197, 2.269754648208618, -1.4543657302856445, 0.04575851559638977, -0.18718385696411133, 1.5327792167663574, 1.4693588018417358, 0.154947429895401, 0.37816253304481506, -0.8877857327461243, -1.980796456336975, -0.34791216254234314, 0.15634897351264954, 1.2302906513214111, 1.202379822731018, -0.38732680678367615, -0.302302747964859, -1.0485529899597168, -1.420017957687378, -1.7062702178955078, 1.950775384902954, -0.5096521973609924, -0.4380742907524109, -1.2527953386306763, 0.7774903774261475, -1.6138978004455566, -0.21274028718471527, -0.8954665660858154, 0.38690251111984253, -0.5108051300048828, -1.18063223361969, -0.02818222902715206, 0.4283318817615509, 0.06651721894741058, 0.30247190594673157, -0.6343221068382263, -0.3627411723136902, -0.6724604368209839, -0.35955315828323364, -0.8131462931632996, -1.7262825965881348, 0.17742614448070526, -0.4017809331417084, -1.630198359489441, 0.46278226375579834, -0.9072983860969543, 0.05194539576768875, 0.7290905714035034, 0.12898291647434235, 1.1394007205963135, -1.234825849533081, 0.4023416340351105, -0.6848101019859314, -0.8707971572875977, -0.5788496732711792, -0.3115525245666504, 0.056165341287851334, -1.1651498079299927, 0.9008265137672424, 0.4656624495983124, -1.5362436771392822, 1.4882521629333496, 1.895889163017273, 1.1787796020507812, -0.1799248307943344, -1.0707526206970215, 1.0544517040252686, -0.4031769335269928, 1.222445011138916, 0.2082749754190445, 0.9766390323638916, 0.3563663959503174, 0.7065731883049011, 0.01050002034753561, 1.7858705520629883, 0.12691208720207214, 0.4019893705844879, 1.8831506967544556, -1.3477590084075928, -1.2704850435256958, 0.969396710395813, -1.1731233596801758, 1.9436211585998535, -0.4136189818382263, -0.747454822063446, 1.922942042350769, 1.4805147647857666, 1.8675589561462402, 0.9060446619987488, -0.8612256646156311, 1.910064935684204, -0.26800337433815, 0.8024563789367676, 0.9472519755363464, -0.15501008927822113, 0.6140793561935425, 0.922206699848175, 0.37642553448677063, -1.0994007587432861, 0.29823818802833557, 1.3263858556747437, -0.694567859172821, -0.14963454008102417, -0.4351535439491272, 1.8492637872695923, 0.6722947359085083, 0.40746182203292847, -0.7699160575866699, 0.5392491817474365, -0.6743326783180237, 0.0318305566906929, -0.6358460783958435, 0.676433265209198, 0.5765908360481262, -0.20829875767230988, 0.39600670337677, -1.0930615663528442, -1.4912575483322144, 0.43939170241355896, 0.16667349636554718, 0.6350314617156982, 2.3831448554992676, 0.9444794654846191, -0.9128222465515137, 1.117016315460205, -1.31590735912323, -0.46158459782600403, -0.06824160367250443, 1.7133426666259766, -0.7447548508644104, -0.8264385461807251, -0.09845252335071564, -0.6634783148765564, 1.1266359090805054, -1.0799314975738525, -1.1474686861038208, -0.43782004714012146, -0.49803245067596436, 1.9295320510864258, 0.9494208097457886, 0.08755124360322952, -1.225435495376587, 0.8443629741668701, -1.0002152919769287, -1.5447710752487183, 1.1880297660827637, 0.31694260239601135, 0.9208588004112244, 0.31872764229774475, 0.8568305969238281, -0.6510255932807922, -1.034242868423462, 0.6815944910049438, -0.8034096360206604, -0.6895498037338257, -0.4555324912071228, 0.01747915893793106, -0.3539939224720001, -1.3749512434005737, -0.6436184048652649, -2.223403215408325, 0.6252314448356628, -1.602057695388794, -1.1043833494186401, 0.05216507986187935, -0.73956298828125, 1.543014645576477, -1.2928569316864014, 0.2670508623123169, -0.039282817393541336, -1.1680934429168701, 0.523276686668396, -0.1715463250875473, 0.7717905640602112, 0.8235041499137878, 2.163235902786255, 1.336527943611145, -0.3691818416118622, -0.2393791824579239, 1.0996595621109009, 0.6552637219429016, 0.6401315331459045, -1.6169559955596924, -0.024326125159859657, -0.7380309104919434, 0.279924601316452, -0.09815038740634918, 0.9101788997650146, 0.31721821427345276, 0.7863279581069946, -0.4664191007614136, -0.9444462656974792, -0.410049706697464, -0.017020413652062416, 0.37915173172950745, 2.2593090534210205, -0.0422571524977684, -0.9559450149536133, -0.34598177671432495, -0.463595986366272, 0.4814814627170563, -1.5407969951629639, 0.06326199322938919, 0.15650653839111328, 0.23218104243278503, -0.5973160862922668, -0.23792172968387604, -1.4240609407424927, -0.49331986904144287, -0.5428614616394043, 0.4160500466823578, -1.1561824083328247, 0.7811980843544006, 1.494484543800354, -2.0699849128723145, 0.42625874280929565, 0.676908016204834, -0.6374370455741882, -0.3972718119621277, -0.1328805834054947, -0.29779088497161865, -0.3090129792690277, -1.6760038137435913, 1.1523315906524658, 1.0796185731887817, -0.8133642673492432, -1.4664243459701538, 0.5210648775100708, -0.5757879614830017, 0.14195317029953003, -0.3193284273147583, 0.6915387511253357, 0.694749116897583, -0.7255973815917969, -1.383363962173462, -1.5829384326934814, 0.6103793978691101, -1.188859224319458, -0.5068163275718689, -0.596314013004303, -0.05256729573011398, -1.9362797737121582, 0.1887785941362381, 0.523891031742096, 0.08842208981513977, -0.3108861744403839, 0.09740016609430313, 0.3990463316440582, -2.772592782974243, 1.9559123516082764, 0.3900933265686035, -0.6524085998535156, -0.3909533619880676, 0.4937417805194855, -0.11610393971204758, -2.030684471130371, 2.06449294090271, -0.11054065823554993, 1.0201727151870728, -0.6920498609542847, 1.5363770723342896, 0.28634369373321533, 0.6088438630104065, -1.0452533960342407, 1.211145281791687, 0.6898181438446045, 1.3018462657928467, -0.62808758020401, -0.48102712631225586, 2.3039166927337646, -1.0600157976150513, -0.13594970107078552, 1.1368913650512695, 0.09772496670484543, 0.582953691482544, -0.39944902062416077, 0.3700558841228485, -1.3065268993377686, 1.6581306457519531, -0.1181640475988388, -0.6801782250404358, 0.6663830876350403, -0.4607197940349579, -1.3342584371566772, -1.3467174768447876, 0.6937731504440308, -0.15957343578338623, -0.13370156288146973, 1.0777437686920166, -1.1268258094787598, -0.7306777238845825, -0.38487979769706726, 0.09435158967971802, -0.042171452194452286, -0.28688719868659973, -0.06162640079855919, -0.10730527341365814, -0.7196043729782104, -0.8129929900169373, 0.27451634407043457, -0.8909150958061218, -1.1573553085327148, -0.3122922480106354, -0.15766701102256775, 2.256723403930664, -0.7047002911567688, 0.9432607293128967, 0.7471883296966553, -1.188944935798645, 0.7732529640197754, -1.1838806867599487, -2.659172296524048, 0.6063195466995239, -1.7558906078338623, 0.4509344696998596, -0.684010922908783, 1.6595507860183716, 1.0685093402862549, -0.4533858001232147, -0.6878376007080078, -1.214077353477478, -0.4409226179122925, -0.2803554832935333, -0.3646935522556305, 0.1567038595676422, 0.5785214900970459, 0.3496544659137726, -0.7641439437866211, -1.4377914667129517, 1.3645318746566772, -0.6894491910934448, -0.6522936224937439, -0.5211893320083618, -1.8430695533752441, -0.477973997592926, -0.47965580224990845, 0.6203582882881165, 0.6984571218490601, 0.003770889015868306, 0.9318483471870422, 0.33996498584747314, -0.01568211242556572, 0.1609281748533249, -0.1906534880399704, -0.3948495090007782, -0.26773354411125183, -1.1280113458633423, 0.2804417014122009, -0.9931235909461975, 0.841631293296814, -0.24945858120918274, 0.04949498176574707, 0.49383679032325745, 0.6433144807815552, -1.5706233978271484, -0.20690368115901947, 0.8801789283752441, -1.698105812072754, 0.3872804641723633, -2.2555642127990723, -1.022506833076477, 0.03863055258989334, -1.6567151546478271, -0.9855107665061951, -1.4718350172042847, 1.6481349468231201, 0.16422775387763977, 0.5672903060913086, -0.22267509996891022, -0.353431761264801, -1.6164741516113281, -0.2918373644351959, -0.7614921927452087, 0.8579239249229431, 1.1411018371582031, 1.466578722000122, 0.8525519371032715, -0.5986539125442505, -1.1158969402313232, 0.7666631937026978, 0.35629281401634216, -1.768538475036621, 0.3554818034172058, 0.8145198225975037, 0.05892558768391609, -0.18505367636680603, -0.8076484799385071, -1.4465347528457642, 0.8002979755401611, -0.3091144561767578, -0.23346665501594543, 1.732721209526062, 0.6845011115074158, 0.37082499265670776, 0.14206179976463318, 1.519994854927063, 1.719589352607727, 0.9295051097869873, 0.5822246074676514, -2.0946030616760254, 0.12372191250324249, -0.13010695576667786, 0.09395322948694229, 0.9430460929870605, -2.7396771907806396, -0.5693120360374451, 0.26990434527397156, -0.4668455421924591, -1.4169061183929443, 0.8689634799957275, 0.276871919631958, -0.9711045622825623, 0.3148171901702881, 0.8215857148170471, 0.005292646121233702, 0.8005648255348206, 0.07826017588376999, -0.3952289819717407, -1.1594204902648926, -0.08593076467514038, 0.19429293274879456, 0.875832736492157, -0.1151074692606926, 0.4574156105518341, -0.9646120071411133, -0.782629132270813, -0.11038929969072342, -1.0546284914016724, 0.8202478289604187, 0.46313032507896423, 0.27909576892852783, 0.33890411257743835, 2.021043539047241, -0.46886420249938965, -2.2014412879943848, 0.19930019974708557, -0.05060354247689247, -0.5175190567970276, -0.9788298606872559, -0.43918952345848083, 0.18133842945098877, -0.5028166770935059, 2.4124536514282227, -0.9605043530464172, -0.793117344379425, -2.2886199951171875, 0.2514844238758087, -2.016406536102295, -0.5394546389579773, -0.27567052841186523, -0.709727942943573, 1.7388726472854614, 0.9943943619728088, 1.3191368579864502, -0.8824188113212585, 1.1285940408706665, 0.4960009455680847, 0.7714059352874756, 1.029438853263855, -0.9087632298469543, -0.4243176281452179, 0.8625960350036621, -2.6556191444396973, 1.5133280754089355, 0.5531320571899414, -0.045703962445259094, 0.2205076515674591, -1.0299352407455444, -0.3499433696269989, 1.1002843379974365, 1.2980220317840576, 2.6962239742279053, -0.07392466813325882, -0.6585529446601868, -0.5142339468002319, -1.0180418491363525, -0.07785475254058838, 0.38273242115974426, -0.03424227982759476, 1.0963468551635742, -0.23421579599380493, -0.3474506437778473, -0.5812684893608093, -1.6326345205307007, -1.5677677392959595, -1.1791579723358154, 1.3014280796051025, 0.8952602744102478, 1.3749641180038452, -1.3322116136550903, -1.9686247110366821, -0.6600562930107117, 0.17581894993782043, 0.49869027733802795, 1.0479722023010254, 0.2842796742916107, 1.7426687479019165, -0.22260567545890808, -0.9130792021751404, -1.6812182664871216, -0.8889713287353516, 0.2421179562807083, -0.8887202739715576, 0.9367424845695496, 1.4123276472091675, -2.369586944580078, 0.8640522956848145, -2.2396039962768555, 0.40149906277656555, 1.2248705625534058, 0.06485610455274582, -1.2796891927719116, -0.5854312181472778, -0.26164543628692627, -0.18224477767944336, -0.2028968334197998, -0.10988277941942215, 0.21348005533218384, -1.2085736989974976, -0.24201983213424683, 1.518261194229126, -0.3846454322338104, -0.4438360929489136, 1.0781973600387573, -2.5591845512390137, 1.1813786029815674, -0.6319037675857544, 0.1639285683631897, 0.09632135927677155, 0.9424681067466736, -0.26759475469589233, -0.6780257821083069, 1.2978458404541016, -2.3641738891601562, 0.020334182307124138, -1.3479254245758057, -0.7615733742713928, 2.011256694793701, -0.04459542781114578, 0.19506970047950745, -1.7815628051757812, -0.7290446758270264, 0.1965574026107788, 0.354757696390152, 0.616886556148529, 0.00862789899110794, 0.5270041823387146, 0.4537819027900696, -1.8297404050827026, 0.037005722522735596, 0.7679024338722229, 0.5898798108100891, -0.36385881900787354, -0.8056265115737915, -1.118311882019043, -0.13105401396751404, 1.1330798864364624, -1.9518041610717773, -0.6598917245864868, -1.1398024559020996, 0.7849575281143188, -0.554309606552124, -0.47063764929771423, -0.21694956719875336, 0.44539326429367065, -0.3923889994621277, -3.046143054962158, 0.5433118939399719, 0.43904295563697815, -0.2195410281419754, -1.0840365886688232, 0.35178011655807495, 0.37923553586006165, -0.47003287076950073, -0.2167314738035202, -0.9301565289497375, -0.1785890907049179, -1.550429344177246, 0.41731882095336914, -0.9443684816360474, 0.23810315132141113, -1.4059629440307617, -0.5900576710700989, -0.11048940569162369, -1.6606998443603516, 0.11514787375926971, -0.37914755940437317, -1.7423561811447144, -1.303242802619934, 0.605120062828064, 0.8955559730529785, -0.13190864026546478, 0.40476182103157043, 0.2238435596227646, 0.3296229839324951, 1.2859840393066406, -1.5069984197616577, 0.6764607429504395, -0.38200896978378296, -0.2242589294910431, -0.3022497296333313, -0.37514710426330566, -1.2261961698532104, 0.1833391934633255, 1.670943021774292, -0.05613302066922188, -0.0013850427931174636, -0.6872990131378174, -0.11747454851865768, 0.4661664366722107, -0.3702424466609955, -0.45380404591560364, 0.4032645523548126, -0.9180047512054443, 0.2524966299533844, 0.820321798324585, 1.3599485158920288, -0.09038200974464417, 1.367597222328186, 1.0344098806381226, -0.9962126612663269, -1.2179385423660278, -0.3049636483192444, 1.0289355516433716, -0.07228700816631317, -0.60065758228302, 1.5522432327270508, 0.2869044840335846, -2.320594310760498, 0.31716063618659973, 0.5200406312942505, 0.22560866177082062, 0.4497120976448059, -0.06727560609579086, -1.3183958530426025, -0.3707039952278137, -0.9456157684326172, -0.9327409267425537, -1.2630683183670044, 0.45248907804489136, 0.09789614379405975, -0.4481653571128845, -0.6493379473686218, -0.023423105478286743, 1.0791947841644287, -2.004215717315674, 0.3768765330314636, -0.5457119941711426, -1.8845858573913574, -1.9457030296325684, -0.9127835035324097, 0.219509556889534, 0.39306291937828064, -0.9389815926551819, 1.0170209407806396, 1.4229835271835327, 0.39608657360076904, -0.5914026498794556, 1.1244192123413086, 0.7553957104682922, 0.8674074411392212, -0.6564636826515198, -2.834554433822632, 2.116791009902954, -1.610878348350525, -0.03576807305216789, 2.3807454109191895, 0.33057674765586853, 0.9492464661598206, -1.502396583557129, -1.7776669263839722, -0.5327028036117554, 1.090749740600586, -0.34624946117401123, -0.7946363091468811, 0.1979672908782959, 1.081935167312622, -1.444940209388733, -1.2105430364608765, -0.788669228553772, 1.0946383476257324, 0.23482152819633484, 2.1321535110473633, 0.9364457130432129, -0.035095177590847015, 1.265077829360962, 0.2114970088005066, -0.7049213647842407, 0.6799748539924622, -0.6963266730308533, -0.29039710760116577, 1.3277827501296997, -0.10128148645162582, -0.8031414151191711, -0.46433767676353455, 1.021790623664856, -0.55254065990448, -0.3868708610534668, -0.5102927684783936, 0.18392549455165863, -0.3854897618293762, -1.601836085319519, -0.8871809244155884, -0.9327890276908875, 1.2433193922042847, 0.8126740455627441, 0.5872593522071838, -0.5053583383560181, -0.8157915472984314, -0.5075175762176514, -1.051880121231079, 2.4972004890441895, -2.245321750640869, 0.5640085339546204, -1.2845523357391357, -0.1043434888124466, -0.9880019426345825, -1.177628993988037, -1.1401963233947754, 1.7549861669540405, -0.13298842310905457, -0.7657021880149841, 0.5557869672775269, 0.010349314659833908, 0.7200337648391724, -1.8242566585540771, 0.3036039173603058, 0.7726948261260986, -1.6615983247756958, 0.44819527864456177, 1.6961815357208252, -0.014857703819870949, 0.8214059472084045, 0.670570433139801, -0.7075057029724121, 0.03976673632860184, -1.5669946670532227, -0.45130303502082825, 0.2656879723072052, 0.723100483417511, 0.024612125009298325, 0.7199837565422058, -1.1029062271118164, -0.10169727355241776, 0.01927938498556614, 1.8495912551879883, -0.21416665613651276, -0.4990166425704956, 0.021351223811507225, -0.9191134572029114, 0.1927538514137268, -0.3650552034378052, -1.7913275957107544, -0.05858655273914337, -0.317543089389801, -1.6324232816696167, -0.06713415682315826, 1.4893559217453003, 0.5213037729263306, 0.6119272112846375, -1.3414967060089111, 0.4768983721733093, 0.1484495848417282, 0.5290452241897583, 0.42262861132621765, -1.3597806692123413, -0.041400812566280365, -0.7578708529472351, -0.05008409544825554, -0.8974009156227112, 1.3124703168869019, -0.8589723706245422, -0.8989421725273132, 0.0745864063501358, -1.077099084854126, -0.4246633052825928, -0.8299645781517029, 1.4111720323562622, 0.7858038544654846, -0.05746951699256897, -0.39121705293655396, 0.9409176111221313, 0.40520408749580383, 0.4980524182319641, -0.026192236691713333, -1.688230037689209, -0.1124659851193428, -0.5324898958206177, 0.6450552940368652, 1.0118424892425537, -0.6579510569572449, 0.4683852195739746, 1.7358789443969727, -0.6677127480506897, 1.6819217205047607, -0.8525858521461487, 0.0229597557336092, -0.011145612224936485, 0.011498900130391121, -0.8376780152320862, -0.5911831259727478, -0.6677202582359314, 0.32696259021759033, 0.33003512024879456, 2.2259442806243896, 1.3709889650344849, -0.5098432302474976, 0.3248696029186249, 0.9971179962158203, 0.030601823702454567, -0.06964157521724701, 0.0515749417245388, 0.8672766089439392, -0.8483205437660217, -0.32566946744918823, 0.47043314576148987, 0.3114470839500427, 0.23958276212215424, -0.3698011636734009, 0.9725357890129089, 2.1338682174682617, 0.40641549229621887, -0.19317670166492462, 0.7557402849197388, -0.5391326546669006, -0.7496903538703918, 0.03280874714255333, -2.582796573638916, -1.1539503335952759, -0.3479618430137634, -1.3533889055252075, -1.0326430797576904, -0.43674832582473755, -1.642965316772461, -0.4060717821121216, -0.5352701544761658, 0.02540520764887333, 1.1541839838027954, 0.17250441014766693, 0.02106202207505703, 0.09945445507764816, 0.22739277780056, -1.0167386531829834, -0.11477532237768173, 0.30875125527381897, -1.3707599639892578, 0.8656529188156128, 1.081376075744629, -0.6313759684562683, -0.24133779108524323, -0.8781903386116028, 0.6993804574012756, -1.0612223148345947, -0.2224770039319992, -0.8589199185371399, 0.05095427855849266, -1.79422926902771, 1.326461672782898, -0.9646064043045044, 0.059894684702157974, -0.21252304315567017, -0.7621145248413086, -0.8877801299095154, 0.9363985657691956, -0.525640606880188, 0.2711701989173889, -0.8014968633651733, -0.6471814513206482, 0.4722471535205841, 0.9304084777832031, -0.17531640827655792, -1.421919822692871, 1.9979560375213623, -0.8565493226051331, -1.5415873527526855, 2.5944244861602783, -0.40403228998184204, -1.4617327451705933, -0.6834397912025452, 0.36754488945007324, 0.19031155109405518, -0.8517292141914368, 1.822723627090454, -0.5215796828269958, -1.184686541557312, 0.9606934189796448, 1.329062819480896, -0.8174930810928345, -1.401347279548645, 1.0304383039474487, -2.047323703765869, -1.2266216278076172, 0.9674461483955383, -0.05535254627466202, -0.2639373540878296, 0.3528166115283966, -0.15277442336082458, -1.2986867427825928, 1.2760753631591797, 1.3250139951705933, 0.20533256232738495, 0.04513401538133621, 2.3396248817443848, -0.2764328420162201, -0.2595769762992859, 0.36448124051094055, 1.471321940422058, 1.5927706956863403, -0.25857263803482056, 0.3083312511444092, -1.3780834674835205, -0.3119761049747467, -0.840290367603302, -1.0068317651748657, 1.6815767288208008, -0.7922866344451904, -0.5316058993339539, 0.3658487796783447, 1.2978252172470093, 0.4811151325702667, 2.759355068206787, -0.07466797530651093, 0.2587164342403412, 0.2756006717681885, 1.4350494146347046, 0.5072389245033264, -0.11622969806194305, -0.9474886059761047, 0.24444346129894257, 1.4013447761535645, -0.4103817939758301, 0.5289435982704163, 0.2461477816104889, 0.8635196685791016, -0.8047537207603455, 2.346647024154663, -1.2791610956192017, -0.36555108428001404, 0.9380925297737122, 0.29673317074775696, 0.8299861550331116, -0.49610233306884766, -0.07480498403310776, 0.012231983244419098, 1.5692596435546875, 0.6904290318489075, 0.7966721057891846, -0.657926082611084, 0.9688826203346252, 0.22558166086673737, 1.3891453742980957, 2.0140602588653564, -0.30676576495170593, -0.40630313754081726, -0.8640449643135071, -0.14357951283454895, -0.38202545046806335, 0.3595044016838074, -0.14456681907176971, -0.36159926652908325, 1.0645850896835327, -0.9378802180290222, 0.4331079423427582, -0.4059417247772217, 0.7243685126304626, 1.3852615356445312, -0.30309826135635376, 0.44103291630744934, 0.17879286408424377, -0.7994223833084106, 0.24078750610351562, 0.28912049531936646, 0.4128708243370056, -0.1983989030122757, 0.09419230371713638, -1.1476109027862549, -0.3581140637397766, 0.5559626817703247, 0.8924738764762878, -0.4223148226737976, 0.10471402853727341, 0.22805333137512207, 0.2014799416065216, 0.5407735705375671, -1.8180776834487915, -0.049324069172143936, 0.23903359472751617, -1.0003303289413452, 1.6739857196807861, 0.16155926883220673, 1.5634047985076904, -0.7905229926109314, -0.9073001146316528, 0.22425222396850586, -1.678688406944275, 0.2149655967950821, 0.09721922874450684, 1.0156652927398682, 0.7010413408279419, -0.4174773395061493, -1.0974966287612915, 1.7123051881790161, -0.7921150326728821, -1.0455245971679688, -1.0848560333251953, 1.1173052787780762, -0.5189002156257629, -0.7537044882774353, 0.13768982887268066, -0.20694470405578613, -0.6780954599380493, 0.7539914846420288, 1.0653154850006104, 0.9853175282478333, 0.7669196724891663, 0.40262553095817566, -1.7758879661560059, 1.6692508459091187, 0.30198919773101807, 0.6081564426422119, 1.1149623394012451, 1.4333524703979492, 0.41839802265167236, 0.4355461597442627, -0.5992242693901062, 0.03308974951505661, -0.854161262512207, -0.7199405431747437, -0.8935744166374207, -0.15602388978004456, 1.049093246459961, 3.1709747314453125, 0.189499631524086, -1.348413109779358, 1.2649832963943481, -0.3007838726043701, -0.6606085896492004, 0.20984947681427002, -1.2406245470046997, 0.22246316075325012, -0.088375523686409, 0.09837790578603745, 0.3814162611961365, 0.06749225407838821, 0.016338083893060684, 0.28431451320648193, 0.4154006242752075, -1.031482458114624, -1.4299912452697754, -0.06163805350661278, -1.4327354431152344, 0.08753146976232529, 0.9387468695640564, 0.6071116924285889, -1.0481704473495483, -0.8602624535560608, 0.3283012807369232, -0.40129780769348145, -0.31665530800819397, 0.5969064831733704, -0.9872866868972778, -0.4012347161769867, -0.8000825047492981, -1.0431294441223145, -0.8570781946182251, 0.6774621605873108, 0.05182038992643356, -0.8791606426239014, -0.2311016023159027, -1.6388072967529297, -0.7333127856254578, 2.1495745182037354, -0.09024384617805481, 0.731658935546875, -0.06548837572336197, 0.3481692373752594, 0.6632580757141113, -1.104616641998291, -0.030936257913708687, 1.5788651704788208, -0.7955005764961243, -0.5664398670196533, -0.3076912760734558, 0.2690240740776062, 0.5249178409576416, 1.267411708831787, 0.49949824810028076, -0.062053125351667404, 1.2591670751571655, 0.7041110396385193, -1.495679497718811, 2.5263681411743164, 1.7699214220046997, -0.16821421682834625, 0.3779101073741913, 1.3243587017059326, -0.17220079898834229, 0.7303518056869507, 1.1045784950256348, -1.0148259401321411, -0.6023318767547607, 0.9214084148406982, 0.4608144760131836, 0.923796534538269, -0.13256801664829254, -0.28900521993637085, -1.998639464378357, -1.1460003852844238, 0.0470660962164402, 0.8245572447776794, 0.53117835521698, -0.12824197113513947, -0.2717715799808502, 0.21717962622642517, 0.07821118086576462, 1.404545545578003, 0.1464407742023468, -1.481245994567871, -1.2725580930709839, 1.5187593698501587, -1.1711604595184326, 0.7644974589347839, -0.2683727443218231, -0.16975829005241394, -0.13413278758525848, 1.2213850021362305, -0.19284182786941528, -0.03331928327679634, -1.5308034420013428, 0.20669050514698029, 0.5310425162315369, 0.23914557695388794, 1.3978962898254395, 0.05517135560512543, 0.29897746443748474, 1.6485040187835693, -1.5500141382217407, -0.4558253586292267, 1.4261587858200073, 0.9361291527748108, 0.6783800721168518, 0.8326507210731506, 0.32706621289253235, 1.6315973997116089, 0.3777591586112976, 0.23986710608005524, 0.15895867347717285, 0.19286395609378815, -1.1570172309875488, 0.7706730365753174, -0.13043972849845886, 1.8219151496887207, -0.07565046846866608, 0.4209182858467102, 0.24660219252109528, -0.625557005405426, 0.9921368360519409, 1.9050636291503906, -0.014777219854295254, -0.3004787862300873, -0.3550287187099457, -1.8923618793487549, -0.17781314253807068, 0.2509981095790863, 1.0547579526901245, 0.960047721862793, -0.4164990782737732, -0.2768229842185974, 1.1239053010940552, -0.17346389591693878, -0.5100295543670654, 1.392518401145935, 1.0375856161117554, 0.018791791051626205, -0.5937774181365967, -2.011880397796631, 0.5897036194801331, -0.8963696956634521, -1.962731957435608, 1.5848205089569092, 0.6479678153991699, -1.1390081644058228, -1.214401364326477, 0.8709617853164673, -0.8779706358909607, 1.2961498498916626, 0.616459310054779, 0.5365965366363525, 0.40469545125961304, 0.19145087897777557, 0.8805112242698669, -0.45408037304878235, 0.08595197647809982, 0.7519465684890747, 0.5629897117614746, -1.1949868202209473, -0.5004096627235413, 0.2528035044670105, -0.408014714717865, 1.7746585607528687, -0.39315319061279297, -0.16221845149993896, 0.7694301605224609, 0.3305327296257019, -0.14527446031570435, -0.7564935088157654, 0.30151405930519104, 1.039096474647522, 0.4790952205657959, -0.7781835198402405, 1.7367749214172363, -1.4465779066085815, -1.5826855897903442, 0.960557222366333, 0.2258404791355133, -0.5494985580444336, -1.098570704460144, 2.3207998275756836, 0.1170908734202385, 0.5342011451721191, 0.3178851008415222, 0.4348079562187195, 0.5400944352149963, 0.7324240207672119, -0.37522241473197937, -0.2916419804096222, -1.7410228252410889, -0.7803044319152832, 0.2711127996444702, 1.0450233221054077, 0.5990395545959473, -0.34069234132766724, -1.2631728649139404, -2.7773592472076416, 1.1517339944839478, -0.5892289876937866, -0.4484650194644928, 0.13157397508621216, -1.40556001663208, -0.34978216886520386, 2.0234718322753906, 0.5053869485855103, 0.35924914479255676, -1.5824944972991943, 2.2436017990112305, -1.4227949380874634, 1.922324776649475, -2.115056037902832, 1.4053654670715332, 1.6180542707443237, -0.8244091272354126, 0.422580361366272, 0.547480583190918, -0.8137944936752319, -1.449117660522461, -1.3177173137664795, 0.5410082340240479, -0.08511560410261154, -0.5643010139465332, 0.9667680263519287, 0.5080679059028625, -0.7554627060890198, -1.2012015581130981, 0.5232617259025574, -0.5375833511352539, 0.09920486062765121, 1.5762989521026611, 0.5023282170295715, -0.862267017364502, 0.16066119074821472, -0.952644944190979, 1.6085221767425537, -0.5615787506103516, 0.20727074146270752, 0.30773258209228516, 0.15925046801567078, -1.958548903465271, -1.4464210271835327, -0.45235028862953186, 0.3194318413734436, -0.13777922093868256, -0.957147479057312, -1.3484243154525757, -0.4015575349330902, -0.4684760570526123, 0.5128364562988281, -0.3263184726238251, 0.6027076840400696, -0.5946497917175293, -0.2559576630592346, -0.3480463922023773, -0.7823669910430908, 0.6251186728477478, -0.8135960102081299, -0.5216414928436279, -0.0731196478009224, -1.2973796129226685, -0.3249349594116211, -0.7113063335418701, -0.38815417885780334, -0.05992800369858742, -0.7999136447906494, -0.220075786113739, 1.3086687326431274, -0.025798557326197624, 1.1452621221542358, 0.3464944362640381, 0.774160623550415, -0.7744589447975159, 0.10490716248750687, 0.13391292095184326, -0.6126257181167603, -0.8228283524513245, -1.4902653694152832, 1.496139645576477, -0.9724028706550598, 1.3462210893630981, -0.4674931764602661, -0.8624932765960693, 0.6225191354751587, -0.6311919689178467, 0.5684589147567749, -0.33281177282333374, 0.4804244935512543, -0.96818608045578, 0.8313510417938232, 0.4879726767539978, -0.919650673866272, 2.6429357528686523, 0.5401230454444885, 2.2904670238494873, 1.600267767906189, -0.1888347864151001, -0.41227176785469055, -0.40345919132232666, -1.8300285339355469, -0.6958351135253906, 0.24676603078842163, 1.5259575843811035, -0.7727718949317932, 0.8820565938949585, -1.2525933980941772, -0.5863200426101685, -0.4576405882835388, 0.3718110918998718, 0.45730963349342346, 0.9623417258262634, 0.7708369493484497, 0.24316821992397308, 0.39036494493484497, 1.5885306596755981, -0.5109261870384216, 0.7747282981872559, -1.808143973350525, 0.41133424639701843, -0.4832495450973511, 0.0025711823254823685, 1.040086269378662, 0.1646438091993332, 0.885187566280365, 1.4737647771835327, 0.38909396529197693, 1.1710410118103027, -0.32656097412109375, -0.00820988230407238, -0.5226194262504578, 1.0429775714874268, 0.4140913486480713, -0.5072344541549683, 0.15466883778572083, 1.041568398475647, -0.03926799073815346, -0.9489328265190125, 0.1319117546081543, -1.9805655479431152, 0.7687706351280212, -0.4213275909423828, -0.4693107306957245, 0.8756957054138184, -1.3651628494262695, 1.9470986127853394, -0.4802420437335968, -0.523250937461853, 1.0212247371673584, 0.7086952924728394, 2.4512298107147217, -0.21120598912239075, -0.1204066351056099, -1.479315996170044, -0.3321022689342499, -0.721431314945221, -0.4487670063972473, -1.7441877126693726, 1.6606075763702393, -1.416603446006775, -2.8022027015686035, -1.1884244680404663, -0.6038395762443542, -1.1495540142059326, 1.0983035564422607, -0.1378391832113266, 0.025385605171322823, 0.6103917360305786, 0.28601253032684326, 0.9785673022270203, -1.1094775199890137, -0.5475180745124817, 0.6659671664237976, -2.5345544815063477, -1.3751845359802246, 0.5009922385215759, -0.4802490472793579, 0.9361075758934021, 0.8091803193092346, -1.1980929374694824, 0.4066570997238159, 1.201697826385498, 0.14743439853191376, -0.9774648547172546, 0.8793899416923523, 0.6354245543479919, 0.542610764503479, 0.7159388661384583, -2.9946129322052, 0.8809375762939453, 1.8081318140029907, 0.4366384744644165, 0.19272899627685547, 0.6964386701583862, 0.33822548389434814, 0.6517812609672546, 0.0014710002578794956, -0.7667048573493958, -1.0043227672576904, -0.9981917142868042, -1.3730425834655762, -1.0677419900894165, 1.7612661123275757, 0.7540956735610962, -0.6250274181365967, -0.3903926908969879, 0.11255753040313721, -0.6555450558662415, 0.06751685589551926, 0.7776041626930237, -0.035742733627557755, 0.3360157310962677, 0.8864915370941162, -0.2721317708492279, 0.28479060530662537, -0.3093775808811188, -0.028528869152069092, -0.3247302770614624, -0.5288698673248291, 0.1737118512392044, 0.566545307636261, 0.1463044434785843, 0.4987269639968872, -0.7379317879676819, -1.2037352323532104, 0.4170435070991516, 0.6878814101219177, 0.04985726624727249, 1.3480358123779297, 0.9076988101005554, 2.6805708408355713, -0.20080851018428802, -0.9988487958908081, -0.7401368021965027, -0.5654978156089783, 0.4760313928127289, -2.1580686569213867, 1.3185510635375977, -0.2392965853214264, -0.24679355323314667, -1.0793431997299194, -0.11422555148601532, 0.013239767402410507, -0.12194492667913437, 0.3390592634677887, -0.5896320343017578, -0.8958157896995544, 0.5483281016349792, 0.0986674502491951, 0.19718106091022491, 1.0590271949768066, -1.02256441116333, -0.8552404642105103, 1.257219672203064, -1.482883334159851, -1.3094121217727661, 0.8178618550300598, 0.23820018768310547, 0.1052321344614029, -0.09165941178798676, 0.031267546117305756, -0.09211211651563644, 1.3554426431655884, -0.3981481194496155, -0.1613735407590866, 1.7944488525390625, 0.027509702369570732, 2.2320163249969482, -0.10497970134019852, 1.367414951324463, -1.655344009399414, 0.15364445745944977, -1.5844736099243164, 0.844454288482666, -1.2128678560256958, 0.28376954793930054, -0.2821958661079407, -1.1582032442092896, -1.6193599700927734, -0.511040449142456, 1.7406294345855713, -0.29348504543304443, 0.9172215461730957, -0.057042866945266724, 0.8767267465591431, -1.8269113302230835, -0.4031883180141449, 0.9494055509567261, -0.16325494647026062, -0.08645528554916382, -0.43046191334724426, 1.1493793725967407, 0.2975143492221832, 0.04402227699756622, 0.6430545449256897, 0.5882249474525452, 0.21258704364299774, 1.5470315217971802, -0.060287535190582275, 0.2780810594558716, -0.642952561378479, 0.1501152217388153, 1.5877615213394165, -0.6432576179504395, -1.1335928440093994, 0.9967596530914307, -0.1487661451101303, 0.09600420296192169, -0.045113302767276764, 0.07912172377109528, 0.8505306839942932, -0.8391242027282715, -1.0117740631103516, 0.08496813476085663, -1.6064397096633911, -1.3730535507202148, 1.8666831254959106, 0.7574683427810669, -0.010056471452116966, 1.2380069494247437, -1.0405992269515991, -0.3156031370162964, 0.6234536170959473, 0.8906716704368591, 0.5129168629646301, -2.541238784790039, -0.9680821299552917, 0.47706809639930725, -0.3559514880180359, 2.540231704711914, 0.9265583157539368, 0.558081865310669, -1.1169495582580566, -0.035296738147735596, 0.24120396375656128, 1.1277836561203003, 0.881131112575531, 1.0329891443252563, -0.923911988735199, 1.4121516942977905, -1.3804306983947754, -0.5359145402908325, 0.430771142244339, -0.14989158511161804, -1.0060368776321411, -0.8215498328208923, -1.548254370689392, 0.5319746136665344, 1.2605688571929932, -0.10039350390434265, -0.40034881234169006, -1.472322940826416, 0.9132019281387329, 2.2113044261932373, -1.7974557876586914, -1.0634329319000244, -0.679593026638031, -0.5643178820610046, 0.22734594345092773, 1.614249587059021, 1.0085972547531128, 0.5275973677635193, -0.723928689956665, -1.1196281909942627, -0.7967752814292908, 1.5480668544769287, -0.061743300408124924, -0.4468362629413605, -0.18375572562217712, 0.8246182203292847, -1.3128496408462524, 1.4148740768432617, 0.15647625923156738, -0.2163439840078354, 0.4428461194038391, 0.21839706599712372, -0.34419646859169006, -0.2527106702327728, -0.8688625693321228, 0.6563907265663147, -0.5319938063621521, -0.9562584161758423, 0.1658635288476944, 1.3291412591934204, -0.04834462329745293, -0.6081012487411499, 0.4038960337638855, 1.9367125034332275, -1.4519054889678955, 0.38220277428627014, 0.2050866186618805, 1.1615338325500488, 0.9909091591835022, -0.18670910596847534, -1.68451726436615, 0.8065637946128845, -0.8351926803588867, -0.9467403888702393, 1.1483505964279175, -0.9108504056930542, 1.402844786643982, 0.3358447253704071, 0.3191184103488922, 0.3072647750377655, -1.6384236812591553, -1.7763886451721191, 0.21555306017398834, 0.5680073499679565, 0.08261103183031082, -0.8215345144271851, 0.018922103568911552, -0.0820341557264328, -0.957158088684082, 1.0139721632003784, -1.730276107788086, 0.5887424349784851, 0.3843234181404114, 1.0097118616104126, -1.0053118467330933, 0.10140714794397354, 2.1711649894714355, 0.6620742678642273, 0.10058120638132095, 0.5391612648963928, 0.08617684245109558, 2.1908979415893555, 0.983636200428009, -0.08561495691537857, 0.2523314356803894, -0.39079800248146057, 1.2098500728607178, -1.4061048030853271, -1.604738473892212, 1.4587147235870361, 2.1531198024749756, 0.46830490231513977, 0.11273793876171112, 0.657267689704895, -0.6470535397529602, 0.1712435483932495, 0.0389087051153183, 0.6265642642974854, -1.557998538017273, -0.5070347785949707, 0.8449956178665161, -0.6755938529968262, -0.9933613538742065, 2.042072057723999, 0.03811800107359886, -0.5789181590080261, -1.6923704147338867, 0.7293463349342346, 0.6991361379623413, -0.2987596094608307, -1.102230191230774, -0.024549422785639763, -0.8358560800552368, -0.9420936107635498, -0.10321275144815445, -1.0513904094696045, 0.24664895236492157, 0.6079925298690796, -0.8396324515342712, -1.3682451248168945, 1.5612796545028687, -0.9402702450752258, -0.6599426865577698, 0.21301716566085815, 0.5993693470954895, -0.2563169002532959, 0.4607943296432495, -0.4009861648082733, -0.9711706638336182, 1.4263168573379517, 2.4884417057037354, 1.695969581604004, 0.14180663228034973, 1.8334354162216187, 0.3557035028934479, -0.47728627920150757, 0.4663795828819275, -0.09439250826835632, -0.9831181764602661, -0.8983219861984253, 0.8020517230033875, -1.8465319871902466, 0.6041367650032043, -1.6295835971832275, -2.1211764812469482, -1.8388465642929077, 1.966763973236084, -0.19623395800590515, 0.08658318221569061, 1.419255018234253, 0.9341797232627869, -1.391505241394043, 0.869006335735321, 0.18418125808238983, -0.34167808294296265, 0.024290913715958595, 1.279811978340149, -0.8859664797782898, 0.400885671377182, -0.009657236747443676, -1.7971645593643188, -0.8022531867027283, 0.193213552236557, 1.29734206199646, 1.0013309717178345, 0.5972124934196472, -0.8152756690979004, 1.8012139797210693, 0.2152404636144638, -1.0063655376434326, -0.18290497362613678, 0.8962484002113342, 0.007617498282343149, 0.8868646621704102, 1.103693962097168, 0.40053069591522217, -0.8577026128768921, 0.1354546695947647, 0.045165855437517166, 1.8593463897705078, -1.6263219118118286, -0.13482245802879333, -0.5840935707092285, 0.33510562777519226, -2.4375643730163574, 1.1149245500564575, 0.013748487457633018, -1.8447011709213257, -0.36111313104629517, 0.60896235704422, -1.5914478302001953, 0.003222216386348009, -1.0574736595153809, -0.5559850335121155, 0.026738382875919342, 0.18345025181770325, -0.47074249386787415, 0.2727963924407959, 0.8179776072502136, -0.27891427278518677, 1.4315677881240845, 1.4622141122817993, -0.42870205640792847, -0.6378405690193176, -1.6641730070114136, -0.12656933069229126, -0.3634377717971802, 0.7790512442588806, -1.5096615552902222, -0.2773914039134979, 0.9687443971633911, -0.7303571105003357, -0.7623615264892578, -1.446940302848816, 2.6205737590789795, -0.7474731802940369, -1.300346851348877, -0.8038504123687744, -0.7742950916290283, -0.2693897783756256, 0.8253722190856934, -0.2983231544494629, -0.9228233098983765, -1.451338529586792, 0.021857358515262604, 0.0425390750169754, 1.5309323072433472, 0.09244773536920547, -0.09900831431150436, -1.0506538152694702, -0.3059525787830353, -0.4384744465351105, -0.370164155960083, -0.9592553973197937, 0.5383296012878418, -0.1424454152584076, -0.2003534734249115, -1.7140461206436157, 0.4936440885066986, 0.48701533675193787, -0.8391293883323669, 0.9901213645935059, -1.3647582530975342, -0.021869909018278122, -0.271207332611084, -1.3171747922897339, 0.1897026151418686, 1.7025701999664307, 0.0676342323422432, -0.46302175521850586, 0.4470241665840149, 0.10571999847888947, 0.02776213176548481, -0.4255422055721283, 1.4219756126403809, 0.45636335015296936, -0.5286706686019897, -0.10800383985042572, -0.7408667206764221, -0.6082911491394043, -0.6407257318496704, -1.134311556816101, 0.7772769927978516, -0.29104146361351013, 0.55412757396698, -0.6701259016990662, -0.060362495481967926, -0.7110406160354614, 0.7196681499481201, -0.24841929972171783, -0.7308735847473145, -1.6417032480239868, 0.2756665349006653, -0.7083850502967834, -0.015779217705130577, -0.49173009395599365, 0.9541895985603333, 0.5441447496414185, 0.4472121000289917, -0.6161211133003235, 0.46629005670547485, 1.7148315906524658, -0.8321860432624817, 0.17233914136886597, -1.6492170095443726, 1.3985620737075806, -0.39791208505630493, 0.7825788855552673, -1.7232282161712646, 1.7975393533706665, -0.35687151551246643, 0.5456573367118835, 0.15081819891929626, -0.25547078251838684, 1.685792326927185, -1.6480462551116943, 0.29871365427970886, 0.9106456637382507, -0.02985612116754055, -0.11817078292369843, -0.14268770813941956, -1.227636456489563, 0.03812738507986069, 0.5127175450325012, 0.06859922409057617, -0.2722761034965515, -0.4897250235080719, -0.2792966663837433, 1.2577441930770874, -2.086634874343872, 0.040071457624435425, -0.3277549147605896, 1.4558079242706299, 0.05549222603440285, 1.484925627708435, -2.123889923095703, 0.45958489179611206, 0.2800578474998474, 1.3905339241027832, -1.6413486003875732, -0.1550358086824417, 0.06606025993824005, -0.49579548835754395, 1.2165777683258057, -0.3386821746826172, 2.0347626209259033, 1.0541778802871704, 0.9508336782455444, 0.5592989921569824, -1.0636955499649048, -0.4310963451862335, 0.5727513432502747, 0.6775570511817932, 1.307183861732483, -0.46744102239608765, -0.8601533770561218, 0.8591042160987854, -0.809626579284668, 0.8733118176460266, 1.1997361183166504, 0.4561530351638794, -0.3575790226459503, 0.0410822257399559, 0.5934659242630005, 0.01018551830202341, 2.198296308517456, -0.990670919418335, -1.0026686191558838, -0.9768953919410706, -0.5895799398422241, -2.178931474685669, -0.6296504139900208, -0.6532847285270691, 0.07851402461528778, 0.41780057549476624, -1.2402163743972778, 0.9000542163848877, 1.8022422790527344, -0.2082851082086563, 1.5743712186813354, 0.19898949563503265, 1.988731861114502, 1.1172834634780884, -1.5639046430587769, 0.01862736977636814, 1.054324984550476, 0.030546581372618675, -0.036883529275655746, 1.26976478099823, -0.7098541855812073, 0.01751561276614666, 0.323625773191452, -0.33379095792770386, -0.02012910321354866, 0.7750232815742493, 0.4328376352787018, -0.8087175488471985, -1.1041239500045776, -0.7891021966934204, 0.0012484558392316103, -0.15993978083133698, -0.8319575190544128, -0.5981504321098328, -1.5200393199920654, 0.4178537130355835, -0.040018726140260696, -1.2597873210906982, 0.028620503842830658, 1.3426220417022705, -0.7399358749389648, 1.3151376247406006, -0.3234574794769287, 0.19782817363739014, 0.09775080531835556, 1.401523470878601, 0.15843383967876434, -1.1419013738632202, -1.310970425605774, -1.5329210758209229, -1.7119702100753784, 0.046135060489177704, -0.9583745002746582, -0.08081161230802536, -0.7038590312004089, -0.770784318447113, -0.4808453321456909, 0.7035855650901794, 0.9291451573371887, 0.37117254734039307, -0.9898225665092468, 0.6436312794685364, 0.688896656036377, 0.27464720606803894, -0.6036204099655151, 0.7088595628738403, 0.4228185713291168, -3.116856575012207, 0.6444520354270935, -1.9137426614761353, 0.6635615825653076, -0.15407240390777588, 1.1936116218566895, -0.09816121309995651, -0.8866142630577087, -0.1473536640405655, 1.0598063468933105, 0.02624661847949028, -0.11433515697717667, 0.7435535192489624, 0.2103593647480011, -0.005927405785769224, 1.3660600185394287, 1.5551140308380127, 0.6133262515068054, -0.2859591543674469, 1.4969110488891602, 1.183119535446167, 0.7188971638679504, -1.2160766124725342, 0.14067190885543823, -0.7436721920967102, -0.15901225805282593, 0.24005693197250366, 0.1001594066619873, -0.4751751124858856, 1.272953748703003, -1.6961312294006348, 0.7301835417747498, -1.8574832677841187, 0.3825981318950653, -0.8869042992591858, 0.8783037662506104, 0.08645252138376236, 0.24770638346672058, -1.0182793140411377, -0.6545701622962952, 0.20721739530563354, 0.5835699439048767, 2.929096221923828, 0.22285832464694977, 0.9760375022888184, -1.556933879852295, -1.3298919200897217, -0.35549476742744446, -1.197427749633789, 1.4863992929458618, -0.4102186858654022, 1.3821818828582764, 1.486782431602478, 0.042779721319675446, 0.5017997622489929, -0.05609947443008423, 0.538437008857727, 0.48334184288978577, -0.12364962697029114, 0.5049699544906616, 1.723696231842041, 0.7130162119865417, 0.3257996141910553, 0.12476952373981476, -1.0126731395721436, -1.0272969007492065, 0.3233565390110016, -1.3693910837173462, -0.7663276195526123, 1.2815113067626953, 1.9142297506332397, -1.6659560203552246, 1.6266496181488037, -0.21143829822540283, -0.015005087479948997, -0.11341162770986557, 1.080544114112854, -1.60767662525177, 0.456163614988327, -0.9448701739311218, 0.5707885026931763, 1.5427963733673096, -0.0004173264023847878, 0.37415507435798645, 0.4095517694950104, -0.7995935082435608, 1.5116393566131592, 1.7064682245254517, 0.7017833590507507, 0.07328543066978455, -0.46189382672309875, -0.6264902353286743, 1.7108365297317505, 1.4144150018692017, -0.06366148591041565, -1.5799305438995361, -2.8320119380950928, -1.0834267139434814, -0.13062039017677307, 1.4006890058517456, -0.6516562104225159, 0.5048154592514038, 1.3031809329986572, 0.12853631377220154, -0.14244787395000458, -1.3087635040283203, -1.2024753093719482, 0.4160996377468109, -0.20090752840042114, 0.12253131717443466, -0.04727771505713463, 0.6641440391540527, -0.7846873998641968, -0.33558064699172974, 1.8961821794509888, -0.7997861504554749, -0.28157544136047363, -0.5893867015838623, 0.4447813630104065, 1.0223922729492188, -0.4982116222381592, -0.43141433596611023, -0.27898159623146057, 0.5298337936401367, -0.7393953204154968, -0.37595996260643005, -2.3721938133239746, -1.3817449808120728, -0.11244375258684158, 0.8978641629219055, 0.29507577419281006, -1.0987684726715088, -1.4002561569213867, 0.17468009889125824, -1.652803659439087, 1.0659267902374268, 0.06389619410037994, -1.6073201894760132, -0.9659538865089417, -0.7243112921714783, -0.7731925249099731, -1.4899330139160156, -0.8746625185012817, -0.6844015717506409, -0.7112857699394226, 1.1279566287994385, 0.10482780635356903, -0.9932572245597839, -0.3346216082572937, -0.8795570731163025, -0.3000066578388214, 0.8755091428756714, 0.25227078795433044, 2.2856011390686035, 0.3759274184703827, -0.9135944843292236, 0.8097407221794128, 1.0799312591552734, 1.0941669940948486, -1.0942409038543701, -0.14763741195201874, 1.1318119764328003, -1.684728980064392, -0.4994167685508728, -1.4269376993179321, -0.932570219039917, -1.0124571323394775, 1.2505698204040527, -0.2345380336046219, -0.8633555769920349, -1.035605788230896, 0.1416671723127365, -0.011135627515614033, 1.3440743684768677, 0.5000166893005371, -1.431797742843628, -0.6289806962013245, 1.0700725317001343, -0.6210827231407166, 1.734572172164917, -1.0982894897460938, 0.5726133584976196, -0.8612155318260193, -0.5095951557159424, 1.0985816717147827, -0.12706716358661652, 0.8134522438049316, 0.4732905924320221, 0.753865659236908, -0.8881881833076477, -0.22157439589500427, 0.42425262928009033, -0.8490728735923767, 1.6295000314712524, -0.777228057384491, -0.3000035881996155, -1.0065590143203735, -2.143308162689209, 1.796918511390686, -0.204338937997818, -0.44791483879089355, -0.19871506094932556, 1.4198639392852783, -0.9651066064834595, 0.6795678734779358, -0.42378824949264526, -0.5966708660125732, 0.5670582056045532, 0.9882405996322632, -0.5139029622077942, -0.7688491344451904, -1.169095754623413, 1.1035038232803345, -0.5752559900283813, -1.8491307497024536, 1.409952163696289, -1.3698594570159912, 0.7794605493545532, 0.18342864513397217, 0.28791543841362, -0.584375262260437, 0.36559146642684937, -1.6677799224853516, 0.5880377292633057, 1.5570100545883179, 0.8840271830558777, -2.0195400714874268, -0.9842090010643005, -0.18779492378234863, 0.4869373142719269, -0.10665267705917358, -0.4932143986225128, 0.5953003168106079, 1.1641517877578735, -0.2322940081357956, 0.728929877281189, -2.5790507793426514, -0.9375093579292297, -0.32125893235206604, -0.48856621980667114, 0.33279821276664734, 1.0137505531311035, 0.5066690444946289, -0.6222254633903503, -1.5227681398391724, 0.556964099407196, -1.8381767272949219, 0.6530373096466064, -0.18844908475875854, -1.1758350133895874, 0.2872573137283325, -0.00287610269151628, -0.03659729287028313, -0.08422330021858215, 0.41952410340309143, 0.9244340062141418, 0.4966152012348175, 1.012133240699768, -0.04413972049951553, 1.6184593439102173, 0.5711098313331604, -0.543694019317627, -1.0938950777053833, 0.20579680800437927, -1.3065215349197388, -0.9733759760856628, 0.2390870749950409, -0.6078874468803406, -0.9333162307739258, -0.03447504714131355, 0.07267789542675018, -0.2058340311050415, -0.37754690647125244, 0.8546427488327026, 0.3424273431301117, -0.22342611849308014, 2.4643218517303467, 0.19383174180984497, 1.1320050954818726, -0.5609809756278992, -1.3629409074783325, -0.7917565107345581, -0.2680097818374634, -0.4966081976890564, 1.3363862037658691, -0.120041124522686, 0.4614688754081726, -0.04648115485906601, -0.4335543215274811, 0.03799601271748543, 1.7140514850616455, -0.767948567867279, 0.7669904232025146, -1.0260072946548462, -0.4596264362335205, 0.0035832058638334274, 0.3263750970363617, 1.4831286668777466, -0.05008264258503914, -0.8436155915260315, 0.6500419974327087, -0.36416980624198914, 0.23868156969547272, -0.11622244119644165, -1.9434568881988525, 0.5082991719245911, 0.5833680033683777, 0.9266047477722168, 1.8004627227783203, -1.1951037645339966, 0.5165074467658997, 0.409294992685318, -0.41908198595046997, 0.39710623025894165, 0.49964696168899536, -1.2186838388442993, 0.24622276425361633, -0.9179843068122864, -0.6518564820289612, -1.7747448682785034, -0.47336092591285706, -0.2035706788301468, 0.5498568415641785, 0.0008999266428872943, -1.5422881841659546, 0.8621480464935303, -0.11858662217855453, 0.4883705973625183, 0.9659361243247986, 1.4226047992706299, 1.9612269401550293, -0.07223875820636749, 0.31112444400787354, -1.0783610343933105], "ceil_mode_partial_windows_input_x": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "ort_fp16_ceil_mode_2d_input_x": [1, 3, 2, 4, 5, 7, 6, 8, 9, 11, 10, 12, 13, 15, 14, 16], "onnx_backend_precomputed_pads_input_x": [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] "onnx_backend_precomputed_pads_input_x": [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], "autopad_3d_same_upper_input_x": [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] }, "cases": [ {636 unmodified lines "name": "onnx_backend_averagepool_3d_default_shape", "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_averagepool_3d_default", "notes": "Uses the official rank-5 shape and default attributes with deterministic generated data to avoid committing the large random tensor literal." "notes": "Uses the official rank-5 shape and default attributes with deterministic generated input values." }, "attrs": { "kernel_shape": [2, 2, 2] }, "inputs": {13 unmodified lines "x": { "dtype": "float32", "shape": [1, 1, 4, 4, 4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0] } "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/ceil_mode_partial_windows_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "tolerance": 0.000001 } }2 unmodified lines "name": "onnx_backend_averagepool_3d_dilations_ceil_large_exclude_pad", "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_0_ceil_mode_is_True", "notes": "Uses the official rank-5 shape and dilated ceil-mode attributes with deterministic generated data to avoid committing the large random tensor literal." "notes": "Uses the official rank-5 shape and dilated ceil-mode attributes with deterministic generated input values." }, "attrs": { "count_include_pad": 0,15 unmodified lines "name": "onnx_backend_averagepool_3d_dilations_ceil_large_include_pad", "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_1_ceil_mode_is_True", "notes": "Uses the official rank-5 shape and dilated ceil-mode attributes with deterministic generated data to avoid committing the large random tensor literal." "notes": "Uses the official rank-5 shape and dilated ceil-mode attributes with deterministic generated input values." }, "attrs": { "count_include_pad": 1,140 unmodified lines "x": { "dtype": "float32", "shape": [1, 1, 4, 4, 4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0, 64.0] } "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/autopad_3d_same_upper_input_x" } } } }, "outputs": {25 unmodified lines "name": "onnx_backend_averagepool_3d_dilations_floor_large_exclude_pad", "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_0_ceil_mode_is_False", "notes": "Uses the official rank-5 shape and dilated floor-mode attributes with deterministic generated data to avoid committing the large random tensor literal." "notes": "Uses the official rank-5 shape and dilated floor-mode attributes with deterministic generated input values." }, "attrs": { "count_include_pad": 0,15 unmodified lines "name": "onnx_backend_averagepool_3d_dilations_floor_large_include_pad", "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_1_ceil_mode_is_False", "notes": "Uses the official rank-5 shape and dilated floor-mode attributes with deterministic generated data to avoid committing the large random tensor literal." "notes": "Uses the official rank-5 shape and dilated floor-mode attributes with deterministic generated input values." }, "attrs": { "count_include_pad": 1,16 unmodified lines "provenance": { "source": "onnxruntime/test/providers/cpu/nn/pool_op_test.cc", "test": "PoolTest.AveragePool3D_CountIncludePad_AsymmetricPads", "notes": "Asymmetric back and bottom padding exercises count_include_pad divisors on the three-dimensional path." "notes": "A 3D [1,1,2,2,2] input of ones with a 2x2x2 window, stride 1 and asymmetric padding (one extra at the back and bottom) with count_include_pad=1, so padded positions count in the divisors." }, "attrs": { "count_include_pad": 1, "kernel_shape": [2, 2, 2], "strides": [1, 1, 1], "pads": [0, 0, 0, 1, 1, 0] }, "inputs": {116 unmodified lines { "name": "f16_ncdhw3d_k2s2_b1c16_16x16x16", "provenance": { "notes": "Exercises the f16 NCDHW 3D route with a 2x2x2 kernel and stride 2, reducing [1,16,16,16,16] to [1,16,8,8,8] across all three spatial axes." "notes": "float16 3D pooling with a 2x2x2 window and stride 2, reducing [1,16,16,16,16] to [1,16,8,8,8] across all three spatial axes." }, "attrs": { "count_include_pad": 0, "kernel_shape": [2, 2, 2], "strides": [2, 2, 2], "pads": [0, 0, 0, 0, 0, 0] }, "inputs": {101 unmodified lines { "name": "w3s1p1_unaligned_width_horizontal_reuse_f32", "provenance": { "notes": "Compact width-not-divisible-by-four route fixture for the horizontal 3x3 reuse tail used by the 112x114 case." "notes": "Compact 3x3 pooling (stride 1, pad 1) over a 2-channel 8x10 plane whose width 10 is not a multiple of four; the 112x114 case has the same width remainder of 2." }, "attrs": { "count_include_pad": 0, "kernel_shape": [3, 3], "strides": [1, 1], "pads": [1, 1, 1, 1] }, "inputs": {48 unmodified lines { "name": "window_parallel_nchw2d_ceil_mode_dilation_stride_overhang", "provenance": { "notes": "ceil_mode=1 with dilation 2, stride 5 and asymmetric pads: the last window in each axis starts inside the input and runs past both the input and the padded extent, so the cooperative reduction must reduce the in-bounds tap count as well as the sum." "notes": "ceil_mode=1 with dilation 2, stride 5 and asymmetric pads: the last window in each axis starts inside the input and runs past both the input and the padded extent, so the divisor must count only the in-bounds taps, not just the sum." }, "attrs": { "kernel_shape": [12, 12],15 unmodified lines { "name": "window_parallel_ncl1d_k128_at_min_taps", "provenance": { "notes": "A 512-element row is reduced by a 128-element average-pool window to 4 outputs per channel; a 127-element sibling window in this file reduces the same row by one fewer tap." "notes": "A 512-element row is reduced by a 128-element average-pool window to 4 outputs per channel." }, "attrs": { "kernel_shape": [128], "strides": [128], "pads": [0, 0] }, "inputs": {8 unmodified lines { "name": "window_parallel_ncl1d_k127_below_min_taps", "provenance": { "notes": "A 512-element row is reduced by a 127-element average-pool window to 4 outputs per channel; its 128-element sibling in this file uses one more tap over the same row." "notes": "A 512-element row is reduced by a 127-element average-pool window to 4 outputs per channel." }, "attrs": { "kernel_shape": [127], "strides": [127], "pads": [0, 0] }, "inputs": {8 unmodified lines { "name": "window_parallel_ncdhw3d_k8_pads_512_taps", "provenance": { "notes": "A 3-D 8x8x8 window with one pad on every face: 512 taps behind 32 outputs, the shape the serial route parallelises worst." "notes": "A 3D 8x8x8 window (stride 8, one pad on every face) over [1,4,16,16,16] gives 512 taps for each of 32 outputs." }, "attrs": { "kernel_shape": [8, 8, 8], "strides": [8, 8, 8], "pads": [1, 1, 1, 1, 1, 1], "count_include_pad": 0 }, "inputs": {27 unmodified lines { "name": "window_parallel_nchw2d_serial_groups_over_gate", "provenance": { "notes": "One channel more than its sibling puts the output at exactly 64 serial dispatch groups, so the serial route is assumed to fill the device on its own and the cooperative reduction is rejected." "notes": "64 channels with a 12x12 window over a 23x23 input (stride 1, pads 2), giving a 16x16 output per channel." }, "attrs": { "kernel_shape": [12, 12],36 unmodified lines { "name": "window_parallel_nchw2d_f16_k12p2", "provenance": { "notes": "float16 input and output through the cooperative window reduction, which loads and accumulates in f32 and narrows once at the store." "notes": "float16 input and output: a 12x12 window with padding 2 over a 3-channel 24x24 input, giving a 17x17 output." }, "attrs": { "kernel_shape": [12, 12],35 unmodified lines { "name": "window_parallel_nchw2d_f16_k12p2_small_output", "provenance": { "notes": "float16 input and output through the cooperative window reduction, which loads and accumulates in f32 and narrows once at the store." "notes": "float16 input and output: a 12x12 window with stride 2 and padding 2 over a 24x24 input, giving a 9x9 output." }, "attrs": { "kernel_shape": [12, 12],60 unmodified lines } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1] } } }, { "name": "ort_regression_ceil_actual_pad_divisor_2d_include1_float32", "provenance": { "source": "onnxruntime/test/providers/cpu/nn/pool_op_test.cc", "test": "AveragePool_18_ceil_count_include_pad_2d and dimensional/half siblings", "notes": "Values 1 to 4^rank, kernel 3, stride 2, one real pad cell each side. Independent coordinate enumeration excludes samples beyond input plus actual pad. The bottom/right include-pad value is 16/4=4." }, "attrs": { "ceil_mode": 1, "count_include_pad": 1, "kernel_shape": [3, 3], "strides": [2, 2], "pads": [1, 1, 1, 1] }, "inputs": { "x": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ceil_mode_partial_windows_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 1, 3, 3], "data": { "kind": "values", "values": [1.5555555820465088, 3.3333332538604736, 2.0, 6.333333492279053, 11.0, 6.0, 4.5, 7.5, 4.0] }, "tolerance": 0.000001 } } }, { "name": "ort_regression_ceil_actual_pad_divisor_2d_include1_float16", "provenance": { "source": "onnxruntime/test/providers/cpu/nn/pool_op_test.cc", "test": "AveragePool_18_ceil_count_include_pad_2d and dimensional/half siblings", "notes": "Values 1 to 4^rank, kernel 3, stride 2, one real pad cell each side. Independent coordinate enumeration excludes samples beyond input plus actual pad. The bottom/right include-pad value is 16/4=4." }, "attrs": { "ceil_mode": 1, "count_include_pad": 1, "kernel_shape": [3, 3], "strides": [2, 2], "pads": [1, 1, 1, 1] }, "inputs": { "x": { "dtype": "float16", "shape": [1, 1, 4, 4], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ceil_mode_partial_windows_input_x" } } } }, "outputs": { "y": { "dtype": "float16", "shape": [1, 1, 3, 3], "data": { "kind": "values", "values": [1.5556640625, 3.333984375, 2.0, 6.33203125, 11.0, 6.0, 4.5, 7.5, 4.0] }, "tolerance": 0.005 } } }, { "name": "ort_regression_ceil_actual_pad_divisor_3d_include1_float32", "provenance": { "source": "onnxruntime/test/providers/cpu/nn/pool_op_test.cc", "test": "AveragePool_18_ceil_count_include_pad_2d and dimensional/half siblings", "notes": "Values 1 to 4^rank, kernel 3, stride 2, one real pad cell each side. Independent coordinate enumeration excludes samples beyond input plus actual pad. The back/bottom/right include-pad value is 64/8=8." }, "attrs": { "ceil_mode": 1, "count_include_pad": 1, "kernel_shape": [3, 3, 3], "strides": [2, 2, 2], "pads": [1, 1, 1, 1, 1, 1] }, "inputs": { "x": { "dtype": "float32", "shape": [1, 1, 4, 4, 4], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/autopad_3d_same_upper_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 1, 3, 3, 3], "data": { "kind": "values", "values": [3.407407522201538, 5.777777671813965, 3.1111111640930176, 7.777777671813965, 12.666666984558105, 6.666666507720947, 4.777777671813965, 7.666666507720947, 4.0, 15.777777671813965, 24.66666603088379, 12.666666984558105, 27.66666603088379, 43.0, 22.0, 15.166666984558105, 23.5, 12.0, 11.44444465637207, 17.66666603088379, 9.0, 19.16666603088379, 29.5, 15.0, 10.25, 15.75, 8.0] }, "tolerance": 0.000001 } } }, { "name": "ort_regression_ceil_actual_pad_divisor_2d_include0_float32", "provenance": { "source": "onnxruntime/test/providers/cpu/nn/pool_op_test.cc", "test": "AveragePool_18_ceil_count_include_pad_2d and dimensional/half siblings", "notes": "Values 1 to 4^rank, kernel 3, stride 2, one real pad cell each side. Independent coordinate enumeration excludes samples beyond input plus actual pad. Pad cells are not counted, so the bottom/right value is 16/1=16." }, "attrs": { "ceil_mode": 1, "count_include_pad": 0, "kernel_shape": [3, 3], "strides": [2, 2], "pads": [1, 1, 1, 1] }, "inputs": { "x": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ceil_mode_partial_windows_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 1, 3, 3], "data": { "kind": "values", "values": [3.5, 5.0, 6.0, 9.5, 11.0, 12.0, 13.5, 15.0, 16.0] }, "tolerance": 0.000001 } } }, { "name": "separable_k7_valid_varied", "provenance": { "notes": "Separable spatial pooling checks padded/dilated window bounds and the shared two-pass reduction." }, "attrs": { "kernel_shape": [7, 7] }, "inputs": { "x": { "dtype": "float32", "shape": [1, 2, 14, 14], "data": { "kind": "fillFloat32", "sinStep": 0.037, "cosStep": 0.019 } } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 2, 8, 8], "tolerance": 0.000001 } } }, { "name": "separable_k7_dilated_include_pad", "provenance": { "notes": "Separable spatial pooling checks padded/dilated window bounds and the shared two-pass reduction." }, "attrs": { "kernel_shape": [7, 7], "dilations": [2, 2], "pads": [2, 2, 2, 2], "count_include_pad": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [1, 2, 18, 18], "data": { "kind": "fillFloat32", "sinStep": 0.037, "cosStep": 0.019 } } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 2, 10, 10], "tolerance": 0.000001 } } } ]}README.md+35-17
build/webgpu/average-pool2d-nchw-horizontal-reuse.wgsl.jinja+6-3
build/webgpu/average-pool2d-nchw-w3s1-reuse.wgsl.jinja+4-3
build/webgpu/bench.json+3-3
build/webgpu/manifest.json+1-630
build/webgpu/metadata.json+1-42
build/webgpu/pool-global-reduction.wgsl.jinja+17-22
build/webgpu/pool-window-nd.wgsl.jinja+6-3
build/webgpu/pool-window-reduction.wgsl.jinja+20-25
build/webgpu/pool-window-unroll.wgsl.jinja+5-4
build/webgpu/pool2d-nchw-separable.wgsl.jinja+32-16
build/webgpu/test.json+175-24