Xenova's picture
Xenova HF Staff
sync 2e7068faf55e
30e6997 verified
Raw
History Blame
11.2 kB
{
"op": "ai.onnx.Transpose",
"tunableSpace": {
"WORKGROUP_SIZE": [64, 128, 256],
"INNER_VEC4_ITEMS_PER_THREAD": [1, 2, 4, 8],
"INNER_VEC4_MIN_THREADS": [16384, 65536, 262144]
},
"cases": [
{
"name": "transpose-f32-1024x1024",
"preset": "smoke",
"vars": { "rows": 1024, "cols": 1024 },
"attrs": { "perm": [1, 0] },
"inputs": { "x": { "shape": [1024, 1024], "dtype": "float32", "dist": "normal", "seed": 120, "scale": 0.2 } },
"outputs": { "y": { "shape": [1024, 1024], "dtype": "float32" } },
"bench": { "primary": true, "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * 4 * 2" }] }
},
{
"name": "transpose-f32-rank1-1m",
"preset": "smoke",
"vars": { "count": 1048576, "dtype": "float32" },
"inputs": { "x": { "shape": [1048576], "dtype": "float32", "dist": "normal", "seed": 121, "scale": 0.2 } },
"outputs": { "y": { "shape": [1048576], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-tiled-f32-2048x2048",
"preset": "smoke",
"vars": { "rows": 2048, "cols": 2048, "dtype": "float32" },
"attrs": { "perm": [1, 0] },
"inputs": { "x": { "shape": [2048, 2048], "dtype": "float32", "dist": "normal", "seed": 122, "scale": 0.2 } },
"outputs": { "y": { "shape": [2048, 2048], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-tiled-f16-4096x1024",
"preset": "smoke",
"vars": { "rows": 4096, "cols": 1024, "dtype": "float16" },
"attrs": { "perm": [1, 0] },
"inputs": { "x": { "shape": [4096, 1024], "dtype": "float16", "dist": "normal", "seed": 123, "scale": 0.2 } },
"outputs": { "y": { "shape": [1024, 4096], "dtype": "float16" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-batched-f32-8x512x256",
"preset": "smoke",
"vars": { "batch": 8, "rows": 512, "cols": 256, "dtype": "float32" },
"attrs": { "perm": [0, 2, 1] },
"inputs": { "x": { "shape": [8, 512, 256], "dtype": "float32", "dist": "normal", "seed": 124, "scale": 0.2 } },
"outputs": { "y": { "shape": [8, 256, 512], "dtype": "float32" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.batch * args.rows * args.cols * dtypeBytes(args.dtype) * 2" }]
}
},
{
"name": "transpose-inner-vec4-f32-8x64x32x128",
"preset": "smoke",
"vars": { "count": 2097152, "dtype": "float32" },
"attrs": { "perm": [0, 2, 1, 3] },
"inputs": { "x": { "shape": [8, 64, 32, 128], "dtype": "float32", "dist": "normal", "seed": 125, "scale": 0.2 } },
"outputs": { "y": { "shape": [8, 32, 64, 128], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-identity-f32-4m",
"preset": "edge",
"vars": { "count": 4194304, "dtype": "float32" },
"attrs": { "perm": [0, 1] },
"inputs": { "x": { "shape": [2048, 2048], "dtype": "float32", "dist": "normal", "seed": 126, "scale": 0.2 } },
"outputs": { "y": { "shape": [2048, 2048], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-scalar-f32-1024x1023",
"preset": "edge",
"vars": { "rows": 1024, "cols": 1023, "dtype": "float32" },
"attrs": { "perm": [1, 0] },
"inputs": { "x": { "shape": [1024, 1023], "dtype": "float32", "dist": "normal", "seed": 130, "scale": 0.2 } },
"outputs": { "y": { "shape": [1023, 1024], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-scalar-f32-768x50257-vocab",
"preset": "edge",
"vars": { "rows": 768, "cols": 50257, "dtype": "float32" },
"attrs": { "perm": [1, 0] },
"inputs": { "x": { "shape": [768, 50257], "dtype": "float32", "dist": "normal", "seed": 131, "scale": 0.2 } },
"outputs": { "y": { "shape": [50257, 768], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-scalar-f32-rank3-8x512x255",
"preset": "edge",
"vars": { "batch": 8, "rows": 512, "cols": 255, "dtype": "float32" },
"attrs": { "perm": [0, 2, 1] },
"inputs": { "x": { "shape": [8, 512, 255], "dtype": "float32", "dist": "normal", "seed": 132, "scale": 0.2 } },
"outputs": { "y": { "shape": [8, 255, 512], "dtype": "float32" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.batch * args.rows * args.cols * dtypeBytes(args.dtype) * 2" }]
}
},
{
"name": "transpose-tiled-i32-1024x1024",
"preset": "edge",
"vars": { "rows": 1024, "cols": 1024, "dtype": "int32" },
"attrs": { "perm": [1, 0] },
"inputs": {
"x": { "shape": [1024, 1024], "dtype": "int32", "dist": "randint", "seed": 133, "min": -1000, "max": 1000 }
},
"outputs": { "y": { "shape": [1024, 1024], "dtype": "int32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-scalar-f32-rank4-nhwc-to-nchw-8x64x96x96",
"preset": "stress",
"vars": { "n": 8, "h": 64, "w": 96, "c": 96, "dtype": "float32" },
"attrs": { "perm": [0, 3, 1, 2] },
"inputs": { "x": { "shape": [8, 64, 96, 96], "dtype": "float32", "dist": "normal", "seed": 140, "scale": 0.2 } },
"outputs": { "y": { "shape": [8, 96, 64, 96], "dtype": "float32" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.n * args.h * args.w * args.c * dtypeBytes(args.dtype) * 2" }]
}
},
{
"name": "transpose-scalar-f32-rank3-default-reverse-96x200x128",
"preset": "stress",
"vars": { "d0": 96, "d1": 200, "d2": 128, "dtype": "float32" },
"inputs": { "x": { "shape": [96, 200, 128], "dtype": "float32", "dist": "normal", "seed": 141, "scale": 0.2 } },
"outputs": { "y": { "shape": [128, 200, 96], "dtype": "float32" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.d0 * args.d1 * args.d2 * dtypeBytes(args.dtype) * 2" }]
}
},
{
"name": "transpose-scalar-f32-rank5-ncdhw-to-ndhwc-volumetric",
"preset": "stress",
"vars": { "count": 8388608, "dtype": "float32" },
"attrs": { "perm": [0, 2, 3, 4, 1] },
"inputs": {
"x": { "shape": [1, 64, 32, 64, 64], "dtype": "float32", "dist": "normal", "seed": 142, "scale": 0.2 }
},
"outputs": { "y": { "shape": [1, 32, 64, 64, 64], "dtype": "float32", "dist": "empty" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-scalar-f32-rank5-ndhwc-to-ncdhw-volumetric",
"preset": "stress",
"vars": { "count": 8388608, "dtype": "float32" },
"attrs": { "perm": [0, 4, 1, 2, 3] },
"inputs": {
"x": { "shape": [1, 32, 64, 64, 64], "dtype": "float32", "dist": "normal", "seed": 143, "scale": 0.2 }
},
"outputs": { "y": { "shape": [1, 64, 32, 64, 64], "dtype": "float32", "dist": "empty" } },
"bench": {
"primary": true,
"metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }]
}
},
{
"name": "transpose-f32-rank4-nchw-to-nhwc-8x64x96x96",
"preset": "stress",
"vars": { "n": 8, "h": 64, "w": 96, "c": 96, "dtype": "float32" },
"attrs": { "perm": [0, 2, 3, 1] },
"inputs": { "x": { "shape": [8, 64, 96, 96], "dtype": "float32", "dist": "normal", "seed": 140, "scale": 0.2 } },
"outputs": { "y": { "shape": [8, 96, 96, 64], "dtype": "float32" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.n * args.h * args.w * args.c * dtypeBytes(args.dtype) * 2" }]
}
},
{
"name": "transpose-unitdim-memcpy-f32-4096x1024x1-perm201",
"preset": "smoke",
"vars": { "tokens": 4096, "hidden": 1024, "dtype": "float32" },
"attrs": { "perm": [2, 0, 1] },
"inputs": { "x": { "shape": [4096, 1024, 1], "dtype": "float32", "dist": "normal", "seed": 141, "scale": 0.2 } },
"outputs": { "y": { "shape": [1, 4096, 1024], "dtype": "float32" } },
"bench": {
"metrics": [{ "type": "bandwidth", "value": "args.tokens * args.hidden * dtypeBytes(args.dtype) * 2" }]
}
},
{
"name": "transpose-inner-vec4-f32-dinov2-qkv-1814x3x6x64",
"preset": "all",
"provenance": {
"source": "Depth Anything V2 Small backbone",
"notes": "Depth Anything V2 Small's stacked q/k/v permute at 518x686, repeated once per DINOv2 layer. It exercises the inner-vec4 route at the model's 1814-row shape."
},
"vars": { "count": 2089728, "dtype": "float32" },
"attrs": { "perm": [1, 2, 0, 3] },
"inputs": { "x": { "shape": [1814, 3, 6, 64], "dtype": "float32", "dist": "normal", "seed": 9411, "scale": 0.2 } },
"outputs": { "y": { "shape": [3, 6, 1814, 64], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-f32-dpt-patchgrid-1813x384",
"preset": "all",
"provenance": {
"source": "Depth Anything V2 Small neck reassemble",
"notes": "Probe pair (a): the real 37x49 patch grid has 1813 rows and is not vec4-aligned. Together with pair (b), it verifies that extent parity does not determine whether the transpose is staged."
},
"vars": { "count": 696192, "dtype": "float32" },
"attrs": { "perm": [1, 0] },
"inputs": { "x": { "shape": [1813, 384], "dtype": "float32", "dist": "normal", "seed": 9441, "scale": 0.2 } },
"outputs": { "y": { "shape": [384, 1813], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
},
{
"name": "transpose-f32-dpt-patchgrid-1812x384-aligned",
"preset": "all",
"provenance": {
"source": "Depth Anything V2 Small neck reassemble",
"notes": "Probe pair (b): the same transpose one row shorter, making the row extent vec4-aligned. It is the aligned control for pair (a)."
},
"vars": { "count": 695808, "dtype": "float32" },
"attrs": { "perm": [1, 0] },
"inputs": { "x": { "shape": [1812, 384], "dtype": "float32", "dist": "normal", "seed": 9451, "scale": 0.2 } },
"outputs": { "y": { "shape": [384, 1812], "dtype": "float32" } },
"bench": { "metrics": [{ "type": "bandwidth", "value": "args.count * dtypeBytes(args.dtype) * 2" }] }
}
]
}