ai.onnx.MaxPool / build /webgpu /bench.json
Xenova's picture
Xenova HF Staff
sync 6fdf6301e2bb
05aa647 verified
Raw History Blame
14.1 kB
{
"cases": [
{
"name": "nchw_1x64x112x112",
"preset": "smoke",
"attrs": { "kernel_shape": [3, 3], "strides": [2, 2], "pads": [1, 1, 1, 1] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 64, 112, 112] } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 64, 56, 56] } }
},
{
"name": "nchw_8x64x112x112_k2s2_unrolled",
"preset": "smoke",
"vars": { "batch": 8, "channels": 64, "inH": 112, "inW": 112 },
"attrs": { "kernel_shape": [2, 2], "strides": [2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [8, 64, 112, 112], "dist": "normal", "seed": 204 } },
"outputs": { "y": { "dtype": "float32", "shape": [8, 64, 56, 56], "dist": "empty" } },
"bench": {
"primary": true,
"metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 4" }]
}
},
{
"name": "nchw_f16_8x64x112x112_k2s2",
"preset": "smoke",
"vars": { "batch": 8, "channels": 64, "inH": 112, "inW": 112 },
"attrs": { "kernel_shape": [2, 2], "strides": [2, 2] },
"inputs": { "x": { "dtype": "float16", "shape": [8, 64, 112, 112], "dist": "normal", "seed": 208 } },
"outputs": { "y": { "dtype": "float16", "shape": [8, 64, 56, 56], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 2" }] }
},
{
"name": "nchw_f16_8x64x112x114_k2s2_walign_cliff",
"preset": "smoke",
"vars": { "batch": 8, "channels": 64, "inH": 112, "inW": 114 },
"attrs": { "kernel_shape": [2, 2], "strides": [2, 2] },
"inputs": { "x": { "dtype": "float16", "shape": [8, 64, 112, 114], "dist": "normal", "seed": 209 } },
"outputs": { "y": { "dtype": "float16", "shape": [8, 64, 56, 57], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 2" }] }
},
{
"name": "nchw_f32_1x256x56x56_k5s2pad2_generic_loop",
"preset": "smoke",
"vars": { "batch": 1, "channels": 256, "inH": 56, "inW": 56 },
"attrs": { "kernel_shape": [5, 5], "strides": [2, 2], "pads": [2, 2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 256, 56, 56], "dist": "normal", "seed": 211 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 256, 28, 28], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 4" }] }
},
{
"name": "nchw_f32_1x256x56x56_k3s2pad1_unrolled_sibling",
"preset": "smoke",
"vars": { "batch": 1, "channels": 256, "inH": 56, "inW": 56 },
"attrs": { "kernel_shape": [3, 3], "strides": [2, 2], "pads": [1, 1, 1, 1] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 256, 56, 56], "dist": "normal", "seed": 212 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 256, 28, 28], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 4" }] }
},
{
"name": "ncl1d_f32_8x256x4096_k2s2",
"preset": "smoke",
"vars": { "batch": 8, "channels": 256, "inW": 4096 },
"attrs": { "kernel_shape": [2], "strides": [2] },
"inputs": { "x": { "dtype": "float32", "shape": [8, 256, 4096], "dist": "normal", "seed": 213 } },
"outputs": { "y": { "dtype": "float32", "shape": [8, 256, 2048], "dist": "empty" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "(args.batch * args.channels * args.inW + numel(shapes.y)) * 4" }]
}
},
{
"name": "ncdhw3d_f32_1x32x32x32x32_k2s2",
"preset": "smoke",
"vars": { "batch": 1, "channels": 32, "inD": 32, "inH": 32, "inW": 32 },
"attrs": { "kernel_shape": [2, 2, 2], "strides": [2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 32, 32, 32, 32], "dist": "normal", "seed": 214 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 32, 16, 16, 16], "dist": "empty" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inD * args.inH * args.inW * 4" }]
}
},
{
"name": "nchw_f16_8x128x112x112_k3s2pad1_unrolled",
"preset": "smoke",
"vars": { "batch": 8, "channels": 128, "inH": 112, "inW": 112 },
"attrs": { "kernel_shape": [3, 3], "strides": [2, 2], "pads": [1, 1, 1, 1] },
"inputs": { "x": { "dtype": "float16", "shape": [8, 128, 112, 112], "dist": "normal", "seed": 208 } },
"outputs": { "y": { "dtype": "float16", "shape": [8, 128, 56, 56], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 2" }] }
},
{
"name": "nchw_f32_1x128x160x160_k11s2pad5_generic_bigwindow",
"preset": "stress",
"vars": { "batch": 1, "channels": 128, "inH": 160, "inW": 160 },
"attrs": { "kernel_shape": [11, 11], "strides": [2, 2], "pads": [5, 5, 5, 5] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 128, 160, 160], "dist": "normal", "seed": 301, "scale": 2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 128, 80, 80], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 4" }] }
},
{
"name": "nchw_int8_1x64x224x224_k7s2pad3_generic_widened",
"preset": "stress",
"vars": { "batch": 1, "channels": 64, "inH": 224, "inW": 224 },
"attrs": { "kernel_shape": [7, 7], "strides": [2, 2], "pads": [3, 3, 3, 3] },
"inputs": {
"x": { "dtype": "int8", "shape": [1, 64, 224, 224], "dist": "randint", "seed": 302, "min": -120, "max": 120 }
},
"outputs": { "y": { "dtype": "int8", "shape": [1, 64, 112, 112], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW" }] }
},
{
"name": "ncdhw3d_f32_1x16x48x48x48_k5s1pad2_generic_3d",
"preset": "stress",
"vars": { "batch": 1, "channels": 16, "inD": 48, "inH": 48, "inW": 48 },
"attrs": { "kernel_shape": [5, 5, 5], "pads": [2, 2, 2, 2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 16, 48, 48, 48], "dist": "normal", "seed": 303, "scale": 2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 16, 48, 48, 48], "dist": "empty" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inD * args.inH * args.inW * 4" }]
}
},
{
"name": "ncdhw3d_f32_1x16x49x48x48_k5s1pad2_tiled_depth_tail",
"preset": "stress",
"vars": { "batch": 1, "channels": 16, "inD": 49, "inH": 48, "inW": 48 },
"attrs": { "kernel_shape": [5, 5, 5], "pads": [2, 2, 2, 2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 16, 49, 48, 48], "dist": "normal", "seed": 304, "scale": 2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 16, 49, 48, 48], "dist": "empty" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inD * args.inH * args.inW * 4" }]
}
},
{
"name": "global-maxpool-rank5-serial-reduction-pathology",
"preset": "stress",
"provenance": {
"source": "synthetic benchmark",
"notes": "Rank-5 global max pooling over 131,072 spatial values per plane measures the parallel global-window reduction and its workgroup-tree feature-tier alternative."
},
"vars": { "batch": 1, "channels": 32, "inD": 32, "inH": 64, "inW": 64 },
"attrs": { "kernel_shape": [32, 64, 64] },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 32, 32, 64, 64], "dist": "normal", "seed": 5102, "scale": 0.2 }
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 32, 1, 1, 1], "dist": "empty" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inD * args.inH * args.inW * 4" }]
}
},
{
"name": "nchw_f32_1x128x160x160_k5s2pad2_separable_breakeven",
"preset": "stress",
"vars": { "batch": 1, "channels": 128, "inH": 160, "inW": 160 },
"attrs": { "kernel_shape": [5, 5], "strides": [2, 2], "pads": [2, 2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 128, 160, 160], "dist": "normal", "seed": 307, "scale": 2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 128, 80, 80], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 4" }] }
},
{
"name": "nchw_f32_1x128x160x160_k6s2pad2_separable_gate_floor",
"preset": "stress",
"vars": { "batch": 1, "channels": 128, "inH": 160, "inW": 160 },
"attrs": { "kernel_shape": [6, 6], "strides": [2, 2], "pads": [2, 2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 128, 160, 160], "dist": "normal", "seed": 311, "scale": 2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 128, 80, 80], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.channels * args.inH * args.inW * 4" }] }
},
{
"name": "maxpool-f32-b1c512-20x20-k5s1p2-separable-floor",
"provenance": {
"notes": "Measures max pooling with a 5x5 window and padding 2 over 512 channels of a 20x20 YOLO-class detector feature map, keeping the spatial size unchanged."
},
"attrs": { "kernel_shape": [5, 5], "strides": [1, 1], "pads": [2, 2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 512, 20, 20], "dist": "uniform" } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 512, 20, 20], "dist": "empty" } }
},
{
"name": "maxpool-f32-b8c64-56x56-k7s1-valid-no-pad",
"preset": "edge",
"attrs": { "kernel_shape": [7, 7], "strides": [1, 1] },
"inputs": { "x": { "dtype": "float32", "shape": [8, 64, 56, 56] } },
"outputs": { "y": { "dtype": "float32", "shape": [8, 64, 50, 50] } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.x) + numel(shapes.y)) * 4" }] }
},
{
"name": "maxpool-f32-b8c64-56x56-k7s7-valid-no-pad",
"preset": "edge",
"attrs": { "kernel_shape": [7, 7], "strides": [7, 7] },
"inputs": { "x": { "dtype": "float32", "shape": [8, 64, 56, 56] } },
"outputs": { "y": { "dtype": "float32", "shape": [8, 64, 8, 8] } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.x) + numel(shapes.y)) * 4" }] }
},
{
"name": "max-pool-f32-b1c16-24x24-k12s1p2-window-parallel-starved",
"preset": "stress",
"provenance": {
"source": "synthetic benchmark",
"notes": "Measures max pooling with a 12x12 window and padding 2 over 16 channels of a 24x24 input, producing a 17x17 (289-element) output per channel."
},
"attrs": { "kernel_shape": [12, 12], "strides": [1, 1], "pads": [2, 2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 16, 24, 24], "dist": "normal", "seed": 4311, "scale": 0.2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 16, 17, 17], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.x) + numel(shapes.y)) * 4" }] }
},
{
"name": "max-pool-f32-b1c16-56x56-k28s28-window-parallel-extreme-starved",
"preset": "stress",
"provenance": {
"source": "synthetic benchmark",
"notes": "A 784-tap non-overlapping window leaving 64 outputs. The separable route needs strideH < kernelH, so the serial route is the only alternative here."
},
"attrs": { "kernel_shape": [28, 28], "strides": [28, 28], "pads": [0, 0, 0, 0] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 16, 56, 56], "dist": "normal", "seed": 4312, "scale": 0.2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 16, 2, 2], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.x) + numel(shapes.y)) * 4" }] }
},
{
"name": "max-pool-f32-b1c32-24x24-k12s1p2-serial-side-of-gate",
"preset": "stress",
"provenance": {
"source": "synthetic benchmark",
"notes": "A 9,248-element output measures pooling over many independent windows."
},
"attrs": { "kernel_shape": [12, 12], "strides": [1, 1], "pads": [2, 2, 2, 2] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 32, 24, 24], "dist": "normal", "seed": 4313, "scale": 0.2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 32, 17, 17], "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.x) + numel(shapes.y)) * 4" }] }
},
{
"name": "occupancy-window_parallel_nchw2d_small_output",
"preset": "stress",
"attrs": { "kernel_shape": [12, 12], "strides": [2, 2], "pads": [2, 2, 2, 2], "ceil_mode": 0 },
"inputs": { "x": { "dtype": "float32", "shape": [1, 1, 24, 24], "dist": "normal", "seed": 5482, "scale": 0.2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 9, 9] } }
},
{
"name": "occupancy-window_parallel_outputs_to_taps_boundary_128",
"preset": "stress",
"attrs": { "kernel_shape": [128], "strides": [1] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 1, 255], "dist": "normal", "seed": 5482, "scale": 0.2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 128] } }
},
{
"name": "occupancy-window_parallel_outputs_to_taps_boundary_129",
"preset": "stress",
"attrs": { "kernel_shape": [128], "strides": [1] },
"inputs": { "x": { "dtype": "float32", "shape": [1, 1, 256], "dist": "normal", "seed": 5482, "scale": 0.2 } },
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 129] } }
}
],
"tunableSpace": { "WORKGROUP_SIZE": [64, 128, 256] }
}