diff --git "a/build/webgpu/bench.json" "b/build/webgpu/bench.json" --- "a/build/webgpu/bench.json" +++ "b/build/webgpu/bench.json" @@ -1,10 +1,5 @@ { - "tunableSpace": { - "PREFILL_QUERY_TILE": [16, 32], - "PREFILL_LANES_PER_QUERY": [4, 8], - "CLUSTER_TILE_K_F32": [8, 16, 32], - "NO_SG_TILE_K_MAX": [8, 16] - }, + "tunableSpace": { "PREFILL_QUERY_TILE": [16, 32], "NO_SG_TILE_K_MAX": [8, 16] }, "cases": [ { "name": "gqa-f32-1x64x64-h4kv2d16", @@ -133,7 +128,7 @@ ] }, "provenance": { - "notes": "Long-context decode yields 64 candidate K partitions, exceeding the 16-partition cap and exercising capped split parallelism plus its merge at head size 128." + "notes": "Llama-style decode in float32: one query token, 32 query heads over 8 key/value heads of size 128, with 8192 keys." } }, { @@ -557,89 +552,112 @@ } }, { - "name": "newkv-past-decode-q1p2048", - "preset": "smoke", + "name": "newkv-past0-f16-32h8kv-d128-q512", + "preset": "model", "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { - "dtype": "float32", - "shape": [1, 1, 4096], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "dtype": "float16", + "shape": [1, 512, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.028 } }, "keyT": { - "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.017 } + "dtype": "float16", + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.027000000000000003 } }, "valueT": { - "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.023 } - }, - "pastKeyT": { - "dtype": "float32", - "shape": [1, 8, 2048, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } - }, - "pastValueT": { - "dtype": "float32", - "shape": [1, 8, 2048, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "dtype": "float16", + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.026000000000000002 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2049] } } + "pastKeyT": { "dtype": "float16", "shape": [1, 8, 0, 128], "data": { "kind": "values", "values": [] } }, + "pastValueT": { "dtype": "float16", "shape": [1, 8, 0, 128], "data": { "kind": "values", "values": [] } }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 2049, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 2049, 128] } + "outputT": { "dtype": "float16", "shape": [1, 512, 4096] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 8, 512, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 8, 512, 128] } }, "bench": { "metrics": [ { "type": "gflops", - "value": "4 * dim(shapes.queryT, 1) * dim(shapes.presentKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.presentKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" } ] } }, { - "name": "newkv-past-prefill-q512p512", - "preset": "smoke", - "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845 }, + "name": "newkv-past0-f16-16h8kv-d128-q512", + "preset": "model", + "attrs": { "num_heads": 16, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { - "dtype": "float32", - "shape": [1, 512, 4096], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "dtype": "float16", + "shape": [1, 512, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.028 } }, "keyT": { - "dtype": "float32", + "dtype": "float16", "shape": [1, 512, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.017 } + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.027000000000000003 } }, "valueT": { - "dtype": "float32", + "dtype": "float16", "shape": [1, 512, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.023 } + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.026000000000000002 } }, - "pastKeyT": { - "dtype": "float32", - "shape": [1, 8, 512, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "pastKeyT": { "dtype": "float16", "shape": [1, 8, 0, 128], "data": { "kind": "values", "values": [] } }, + "pastValueT": { "dtype": "float16", "shape": [1, 8, 0, 128], "data": { "kind": "values", "values": [] } }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 512, 2048] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 8, 512, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 8, 512, 128] } + }, + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.presentKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" + } + ] + } + }, + { + "name": "newkv-past0-f16-32h8kv-d64-q1024", + "preset": "model", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.125 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 1024, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.028 } }, - "pastValueT": { - "dtype": "float32", - "shape": [1, 8, 512, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "keyT": { + "dtype": "float16", + "shape": [1, 1024, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.027000000000000003 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 1024, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.026000000000000002 } }, + "pastKeyT": { "dtype": "float16", "shape": [1, 8, 0, 64], "data": { "kind": "values", "values": [] } }, + "pastValueT": { "dtype": "float16", "shape": [1, 8, 0, 64], "data": { "kind": "values", "values": [] } }, "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + "outputT": { "dtype": "float16", "shape": [1, 1024, 2048] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 8, 1024, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 8, 1024, 64] } }, "bench": { "metrics": [ @@ -651,208 +669,157 @@ } }, { - "name": "quant-int8-decode-h8kv2-d128-kv2048", - "preset": "smoke", - "provenance": { - "notes": "Buffer-sharing INT8 decode. The bandwidth metric counts the portable physical minimum: WebGPU exposes each logical INT8 cache element through i32 storage, the past cache is preserved into present K/V, and attention reads K/V once per KV head. It intentionally does not credit duplicate cache reads across grouped query heads." - }, - "attrs": { - "num_heads": 8, - "kv_num_heads": 2, - "kv_cache_bit_width": 8, - "k_quant_type": "PER_TENSOR", - "v_quant_type": "PER_TENSOR" - }, + "name": "newkv-past0-f16-14h2kv-d64-q256", + "preset": "model", + "attrs": { "num_heads": 14, "kv_num_heads": 2, "scale": 0.125 }, "inputs": { "queryT": { - "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "dtype": "float16", + "shape": [1, 256, 896], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.028 } }, "keyT": { - "dtype": "float32", - "shape": [1, 1, 256], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.031 } + "dtype": "float16", + "shape": [1, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.027000000000000003 } }, "valueT": { - "dtype": "float32", - "shape": [1, 1, 256], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.033 } - }, - "pastKeyT": { "dtype": "int8", "shape": [1, 2, 2048, 128], "dist": "uniform", "seed": 880, "min": -8, "max": 8 }, - "pastValueT": { - "dtype": "int8", - "shape": [1, 2, 2048, 128], - "dist": "uniform", - "seed": 881, - "min": -8, - "max": 8 + "dtype": "float16", + "shape": [1, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.026000000000000002 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2047] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } }, - "kScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } }, - "vScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } } + "pastKeyT": { "dtype": "float16", "shape": [1, 2, 0, 64], "data": { "kind": "values", "values": [] } }, + "pastValueT": { "dtype": "float16", "shape": [1, 2, 0, 64], "data": { "kind": "values", "values": [] } }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [255] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [256] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 1024] }, - "presentKeyT": { "dtype": "int8", "shape": [1, 2, 2048, 128] }, - "presentValueT": { "dtype": "int8", "shape": [1, 2, 2048, 128] } + "outputT": { "dtype": "float16", "shape": [1, 256, 896] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 256, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 256, 64] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "4 * (6 * numel(shapes.pastKeyT) + 4 * numel(shapes.keyT) + 2 * numel(shapes.queryT))" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.presentKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" } ] } }, { - "name": "quant-int8-prefill-h32kv8-d128-s512-pathology", - "preset": "stress", - "provenance": { - "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with an int8 quantized key/value cache." - }, - "attrs": { - "num_heads": 32, - "kv_num_heads": 8, - "kv_cache_bit_width": 8, - "k_quant_type": "PER_TENSOR", - "v_quant_type": "PER_TENSOR" - }, + "name": "newkv-past512-f16-32h8kv-d128-q512", + "preset": "model", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { - "dtype": "float32", + "dtype": "float16", "shape": [1, 512, 4096], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.028 } }, "keyT": { - "dtype": "float32", + "dtype": "float16", "shape": [1, 512, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.031 } + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.027000000000000003 } }, "valueT": { - "dtype": "float32", + "dtype": "float16", "shape": [1, 512, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.033 } + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.026000000000000002 } + }, + "pastKeyT": { + "dtype": "float16", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.025 } }, - "pastKeyT": { "dtype": "int8", "shape": [1, 8, 512, 128], "dist": "uniform", "seed": 882, "min": -8, "max": 8 }, "pastValueT": { - "dtype": "int8", + "dtype": "float16", "shape": [1, 8, 512, 128], - "dist": "uniform", - "seed": 883, - "min": -8, - "max": 8 + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.020999999999999998, "cosStep": 0.024 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, - "kScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } }, - "vScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, - "presentKeyT": { "dtype": "int8", "shape": [1, 8, 512, 128] }, - "presentValueT": { "dtype": "int8", "shape": [1, 8, 512, 128] } + "outputT": { "dtype": "float16", "shape": [1, 512, 4096] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 8, 1024, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 8, 1024, 128] } }, "bench": { "metrics": [ { "type": "gflops", - "value": "4 * dim(shapes.queryT, 2) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2" + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.presentKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" } ] } }, { - "name": "quant-int4-prefill-h32kv8-d128-s512-pathology", - "preset": "stress", - "provenance": { - "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with a packed int4 quantized key/value cache." - }, - "attrs": { - "num_heads": 32, - "kv_num_heads": 8, - "kv_cache_bit_width": 4, - "k_quant_type": "PER_TENSOR", - "v_quant_type": "PER_TENSOR" - }, + "name": "newkv-past0-f16-16h8kv-d128-q2048", + "preset": "model", + "attrs": { "num_heads": 16, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { - "dtype": "float32", - "shape": [1, 512, 4096], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "dtype": "float16", + "shape": [1, 2048, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.028 } }, "keyT": { - "dtype": "float32", - "shape": [1, 512, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.031 } + "dtype": "float16", + "shape": [1, 2048, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.027000000000000003 } }, "valueT": { - "dtype": "float32", - "shape": [1, 512, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.033 } - }, - "pastKeyT": { "dtype": "uint8", "shape": [1, 8, 512, 64], "dist": "uniform", "seed": 884, "min": 0, "max": 256 }, - "pastValueT": { - "dtype": "uint8", - "shape": [1, 8, 512, 64], - "dist": "uniform", - "seed": 885, - "min": 0, - "max": 256 + "dtype": "float16", + "shape": [1, 2048, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.026000000000000002 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, - "kScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } }, - "vScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } } + "pastKeyT": { "dtype": "float16", "shape": [1, 8, 0, 128], "data": { "kind": "values", "values": [] } }, + "pastValueT": { "dtype": "float16", "shape": [1, 8, 0, 128], "data": { "kind": "values", "values": [] } }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2047] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, - "presentKeyT": { "dtype": "uint8", "shape": [1, 8, 512, 64] }, - "presentValueT": { "dtype": "uint8", "shape": [1, 8, 512, 64] } + "outputT": { "dtype": "float16", "shape": [1, 2048, 2048] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 8, 2048, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 8, 2048, 128] } }, "bench": { "metrics": [ { "type": "gflops", - "value": "4 * dim(shapes.queryT, 2) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2" + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.presentKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" } ] } }, { - "name": "bias-prefill-cliff-h32kv8-d128-s512", - "preset": "smoke", - "attrs": { "num_heads": 32, "kv_num_heads": 8 }, + "name": "newkv-past0-f32-16h8kv-d128-q512", + "preset": "model", + "attrs": { "num_heads": 16, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 512, 4096], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "shape": [1, 512, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.028 } }, - "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, - "valueT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, - "pastKeyT": { + "keyT": { "dtype": "float32", - "shape": [1, 8, 512, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.027000000000000003 } }, - "pastValueT": { + "valueT": { "dtype": "float32", - "shape": [1, 8, 512, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.026000000000000002 } }, + "pastKeyT": { "dtype": "float32", "shape": [1, 8, 0, 128], "data": { "kind": "values", "values": [] } }, + "pastValueT": { "dtype": "float32", "shape": [1, 8, 0, 128], "data": { "kind": "values", "values": [] } }, "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, - "attentionBiasT": { - "dtype": "float32", - "shape": [1, 32, 512, 512], - "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.007, "cosStep": 0.009 } - } + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, + "outputT": { "dtype": "float32", "shape": [1, 512, 2048] }, "presentKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128] }, "presentValueT": { "dtype": "float32", "shape": [1, 8, 512, 128] } }, @@ -860,204 +827,117 @@ "metrics": [ { "type": "gflops", - "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.pastKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.presentKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" } ] } }, { - "name": "hd16-belowfloor-decode-h8kv2-kv2048", - "preset": "smoke", - "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "name": "newkv-past0-f32-32h8kv-d64-q1024", + "preset": "model", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.125 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "shape": [1, 1024, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.028 } }, - "keyT": { "dtype": "float32", "shape": [1, 0, 32], "data": { "kind": "values", "values": [] } }, - "valueT": { "dtype": "float32", "shape": [1, 0, 32], "data": { "kind": "values", "values": [] } }, - "pastKeyT": { + "keyT": { "dtype": "float32", - "shape": [1, 2, 2048, 16], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 1024, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.027000000000000003 } }, - "pastValueT": { + "valueT": { "dtype": "float32", - "shape": [1, 2, 2048, 16], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "shape": [1, 1024, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.026000000000000002 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2047] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } } + "pastKeyT": { "dtype": "float32", "shape": [1, 8, 0, 64], "data": { "kind": "values", "values": [] } }, + "pastValueT": { "dtype": "float32", "shape": [1, 8, 0, 64], "data": { "kind": "values", "values": [] } }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 128] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 2, 2048, 16] }, - "presentValueT": { "dtype": "float32", "shape": [1, 2, 2048, 16] } + "outputT": { "dtype": "float32", "shape": [1, 1024, 2048] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 64] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 64] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * dim(shapes.pastKeyT, 1) * dim(shapes.pastKeyT, 2) * dim(shapes.pastKeyT, 3) * 4 + 2 * dim(shapes.queryT, 2) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.presentKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" } ] } }, { - "name": "sliding-window-decode-h8kv2-d128-kv2048-w256", + "name": "newkv-past-decode-q1p2048", "preset": "smoke", - "attrs": { "num_heads": 8, "kv_num_heads": 2, "local_window_size": 256 }, + "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 1024], + "shape": [1, 1, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, - "keyT": { "dtype": "float32", "shape": [1, 0, 256], "data": { "kind": "values", "values": [] } }, - "valueT": { "dtype": "float32", "shape": [1, 0, 256], "data": { "kind": "values", "values": [] } }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.017 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.023 } + }, "pastKeyT": { "dtype": "float32", - "shape": [1, 2, 2048, 128], + "shape": [1, 8, 2048, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 2, 2048, 128], + "shape": [1, 8, 2048, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2047] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } } - }, - "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 1024] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 2, 2048, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 2, 2048, 128] } - }, - "bench": { - "metrics": [ - { - "type": "bandwidth", - "value": "2 * dim(shapes.pastKeyT, 1) * dim(shapes.pastKeyT, 2) * dim(shapes.pastKeyT, 3) * 4 + 2 * dim(shapes.queryT, 2) * 4" - } - ] - } - }, - { - "name": "scalar-fallback-decode-hd32-h8kv8-kv4096", - "preset": "stress", - "vars": { "batch": 1, "qSeq": 1, "kvSeq": 4096, "heads": 8, "kvHeads": 8, "headDim": 32 }, - "attrs": { "num_heads": 8, "kv_num_heads": 8, "scale": 0.17677669529663687, "causal": 0 }, - "inputs": { - "queryT": { "shape": [1, 1, 256], "dtype": "float32", "dist": "normal", "seed": 911, "scale": 0.2 }, - "keyT": { "shape": [1, 4096, 256], "dtype": "float32", "dist": "normal", "seed": 912, "scale": 0.2 }, - "valueT": { "shape": [1, 4096, 256], "dtype": "float32", "dist": "normal", "seed": 913, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4095] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4096] } } - }, - "outputs": { - "outputT": { "shape": [1, 1, 256], "dtype": "float32", "dist": "empty" }, - "presentKeyT": { "shape": [1, 8, 4096, 32], "dtype": "float32", "dist": "empty" }, - "presentValueT": { "shape": [1, 8, 4096, 32], "dtype": "float32", "dist": "empty" } - }, - "bench": { - "metrics": [ - { - "type": "bandwidth", - "value": "(4 * dim(shapes.keyT, 1) * attrs.kv_num_heads * (dim(shapes.queryT, 2) / attrs.num_heads) + 2 * dim(shapes.queryT, 2)) * 4" - } - ] - } - }, - { - "name": "scalar-fallback-prefill-hd32-h8kv8-s512", - "preset": "stress", - "vars": { "batch": 1, "qSeq": 512, "kvSeq": 512, "heads": 8, "kvHeads": 8, "headDim": 32 }, - "attrs": { "num_heads": 8, "kv_num_heads": 8, "scale": 0.17677669529663687, "causal": 0 }, - "inputs": { - "queryT": { "shape": [1, 512, 256], "dtype": "float32", "dist": "normal", "seed": 901, "scale": 0.2 }, - "keyT": { "shape": [1, 512, 256], "dtype": "float32", "dist": "normal", "seed": 902, "scale": 0.2 }, - "valueT": { "shape": [1, 512, 256], "dtype": "float32", "dist": "normal", "seed": 903, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2049] } } }, "outputs": { - "outputT": { "shape": [1, 512, 256], "dtype": "float32", "dist": "empty" }, - "presentKeyT": { "shape": [1, 8, 512, 32], "dtype": "float32", "dist": "empty" }, - "presentValueT": { "shape": [1, 8, 512, 32], "dtype": "float32", "dist": "empty" } + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 2049, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 2049, 128] } }, "bench": { "metrics": [ { "type": "gflops", - "value": "4 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * dim(shapes.keyT, 1) * attrs.num_heads * (dim(shapes.queryT, 2) / attrs.num_heads)" + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.presentKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } }, { - "name": "gqa-f32-q31-kv511-h8-kv2-d64-double-threshold-cliff", - "preset": "stress", - "vars": { "batch": 1, "qSeq": 31, "kvSeq": 511, "heads": 8, "kvHeads": 2, "headDim": 64 }, - "attrs": { "num_heads": 8, "kv_num_heads": 2, "scale": 0.125, "causal": 0 }, - "inputs": { - "queryT": { "shape": [1, 31, 512], "dtype": "float32", "dist": "normal", "seed": 921, "scale": 0.2 }, - "keyT": { "shape": [1, 511, 128], "dtype": "float32", "dist": "normal", "seed": 922, "scale": 0.2 }, - "valueT": { "shape": [1, 511, 128], "dtype": "float32", "dist": "normal", "seed": 923, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [510] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } } - }, - "outputs": { - "outputT": { "shape": [1, 31, 512], "dtype": "float32", "dist": "empty" }, - "presentKeyT": { "shape": [1, 2, 511, 64], "dtype": "float32", "dist": "empty" }, - "presentValueT": { "shape": [1, 2, 511, 64], "dtype": "float32", "dist": "empty" } - }, - "bench": { - "primary": true, - "metrics": [ - { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } - ] - } - }, - { - "name": "gqa-f32-q32-kv512-h8-kv2-d64-threshold-control", - "preset": "stress", - "vars": { "batch": 1, "qSeq": 32, "kvSeq": 512, "heads": 8, "kvHeads": 2, "headDim": 64 }, - "attrs": { "num_heads": 8, "kv_num_heads": 2, "scale": 0.125, "causal": 0 }, - "inputs": { - "queryT": { "shape": [1, 32, 512], "dtype": "float32", "dist": "normal", "seed": 924, "scale": 0.2 }, - "keyT": { "shape": [1, 512, 128], "dtype": "float32", "dist": "normal", "seed": 925, "scale": 0.2 }, - "valueT": { "shape": [1, 512, 128], "dtype": "float32", "dist": "normal", "seed": 926, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } - }, - "outputs": { - "outputT": { "shape": [1, 32, 512], "dtype": "float32", "dist": "empty" }, - "presentKeyT": { "shape": [1, 2, 512, 64], "dtype": "float32", "dist": "empty" }, - "presentValueT": { "shape": [1, 2, 512, 64], "dtype": "float32", "dist": "empty" } - }, - "bench": { - "primary": true, - "metrics": [ - { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } - ] - } - }, - { - "name": "headsink-prefill-h32kv8-d128-s512-generic-pathology", - "preset": "stress", - "provenance": { - "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with per-head attention sink logits." - }, - "attrs": { "num_heads": 32, "kv_num_heads": 8 }, + "name": "newkv-past-decode-q1p512", + "preset": "model", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 512, 4096], + "shape": [1, 1, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, - "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, - "valueT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.017 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.023 } + }, "pastKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128], @@ -1068,35 +948,31 @@ "shape": [1, 8, 512, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, - "headSinkT": { "dtype": "float32", "shape": [32], "dist": "normal", "seed": 927, "scale": 0.2 } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [513] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 512, 128] } + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 513, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 513, 128] } }, "bench": { "metrics": [ { "type": "gflops", - "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.pastKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.presentKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } }, { - "name": "bias-headsink-prefill-h32kv8-d128-s512-generic-pathology", - "preset": "stress", - "provenance": { - "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with an additive attention bias and per-head attention sink logits." - }, + "name": "sharedkv-decode-32h8kv-d128-kv512", + "preset": "model", "attrs": { "num_heads": 32, "kv_num_heads": 8 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 512, 4096], + "shape": [1, 1, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, @@ -1112,16 +988,10 @@ "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, - "attentionBiasT": { - "dtype": "float32", - "shape": [1, 32, 512, 512], - "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.007, "cosStep": 0.009 } - }, - "headSinkT": { "dtype": "float32", "shape": [32], "dist": "normal", "seed": 928, "scale": 0.2 } + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, "presentKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128] }, "presentValueT": { "dtype": "float32", "shape": [1, 8, 512, 128] } }, @@ -1129,543 +999,1999 @@ "metrics": [ { "type": "gflops", - "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.pastKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.pastKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } }, { - "name": "softcap-prefill-h32kv8-d128-s512-generic-pathology", - "preset": "stress", - "provenance": { - "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with a logit softcap of 30." - }, - "attrs": { "num_heads": 32, "kv_num_heads": 8, "softcap": 30 }, + "name": "newkv-past-decode-q1p128", + "preset": "model", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 512, 4096], + "shape": [1, 1, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, - "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, - "valueT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.017 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.023 } + }, "pastKeyT": { "dtype": "float32", - "shape": [1, 8, 512, 128], + "shape": [1, 8, 128, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 8, 512, 128], + "shape": [1, 8, 128, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [129] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 512, 128] } + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 129, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 129, 128] } }, "bench": { "metrics": [ { "type": "gflops", - "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.pastKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.presentKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } }, { - "name": "qkv-prefill-f32-h4kv1-d64-s128", + "name": "sharedkv-decode-32h8kv-d128-kv128", "preset": "model", - "provenance": { - "notes": "Lower f32 register-topology boundary comparing the Q32-broadcast and subgroup-cluster routes." - }, - "vars": { "batch": 1, "qSeq": 128, "kvSeq": 128, "heads": 4, "kvHeads": 1, "headDim": 64 }, - "attrs": { "num_heads": 4, "kv_num_heads": 1, "scale": 0.125, "causal": 0 }, - "inputs": { - "queryT": { "shape": [1, 128, 256], "dtype": "float32", "dist": "normal", "seed": 1075, "scale": 0.2 }, - "keyT": { "shape": [1, 128, 64], "dtype": "float32", "dist": "normal", "seed": 1076, "scale": 0.2 }, - "valueT": { "shape": [1, 128, 64], "dtype": "float32", "dist": "normal", "seed": 1077, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [127] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } } - }, - "outputs": { - "outputT": { "shape": [1, 128, 256], "dtype": "float32" }, - "presentKeyT": { "shape": [1, 1, 128, 64], "dtype": "float32" }, - "presentValueT": { "shape": [1, 1, 128, 64], "dtype": "float32" } - }, - "bench": { - "metrics": [ - { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } - ] - } - }, - { - "name": "qkv-prefill-f32-h4kv1-d256-s128", - "preset": "model", - "provenance": { - "notes": "Upper f32 register-topology boundary comparing Q32-broadcast, subgroup-cluster, and generic online routes." - }, - "vars": { "batch": 1, "qSeq": 128, "kvSeq": 128, "heads": 4, "kvHeads": 1, "headDim": 256 }, - "attrs": { "num_heads": 4, "kv_num_heads": 1, "scale": 0.0625, "causal": 0 }, - "inputs": { - "queryT": { "shape": [1, 128, 1024], "dtype": "float32", "dist": "normal", "seed": 1081, "scale": 0.2 }, - "keyT": { "shape": [1, 128, 256], "dtype": "float32", "dist": "normal", "seed": 1082, "scale": 0.2 }, - "valueT": { "shape": [1, 128, 256], "dtype": "float32", "dist": "normal", "seed": 1083, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [127] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } } - }, - "outputs": { - "outputT": { "shape": [1, 128, 1024], "dtype": "float32" }, - "presentKeyT": { "shape": [1, 1, 128, 256], "dtype": "float32" }, - "presentValueT": { "shape": [1, 1, 128, 256], "dtype": "float32" } - }, - "bench": { - "metrics": [ - { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } - ] - } - }, - { - "name": "window-decode-32h8kv-d128-cap1024-w1024", - "preset": "smoke", - "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 1024 }, + "attrs": { "num_heads": 32, "kv_num_heads": 8 }, "inputs": { "queryT": { "dtype": "float32", "shape": [1, 1, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, - "keyT": { - "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } - }, - "valueT": { - "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } - }, + "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "valueT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 8, 1024, 128], + "shape": [1, 8, 128, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 8, 1024, 128], + "shape": [1, 8, 128, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [127] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 128, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 128, 128] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.pastKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } }, { - "name": "window-decode-32h8kv-d128-cap1024-unfilled", + "name": "newkv-past-prefill-q512p512", "preset": "smoke", - "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 1024 }, + "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 4096], + "shape": [1, 512, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.017 } }, "valueT": { "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.019, "cosStep": 0.023 } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 8, 1024, 128], + "shape": [1, 8, 512, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 8, 1024, 128], + "shape": [1, 8, 512, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.presentKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" } ] } }, { - "name": "window-decode-32h8kv-d128-cap256-w256", + "name": "quant-int8-decode-h8kv2-d128-kv2048", "preset": "smoke", - "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 256 }, + "provenance": { + "notes": "INT8-cache decode of one token (8 query heads over 2 key/value heads of size 128) with 2048 cached rows and per-tensor scales. The bandwidth metric counts the cache once per key/value head, plus copying the past cache into the present outputs; it does not credit repeated reads across grouped query heads. Each int8 cache element counts as 4 bytes because WebGPU exposes it through 32-bit integer storage." + }, + "attrs": { + "num_heads": 8, + "kv_num_heads": 2, + "kv_cache_bit_width": 8, + "k_quant_type": "PER_TENSOR", + "v_quant_type": "PER_TENSOR" + }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 4096], + "shape": [1, 1, 1024], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + "shape": [1, 1, 256], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.031 } }, "valueT": { "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } - }, - "pastKeyT": { - "dtype": "float32", - "shape": [1, 8, 256, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 1, 256], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.033 } }, + "pastKeyT": { "dtype": "int8", "shape": [1, 2, 2048, 128], "dist": "uniform", "seed": 880, "min": -8, "max": 8 }, "pastValueT": { - "dtype": "float32", - "shape": [1, 8, 256, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "dtype": "int8", + "shape": [1, 2, 2048, 128], + "dist": "uniform", + "seed": 881, + "min": -8, + "max": 8 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2047] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } }, + "kScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } }, + "vScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 256, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 256, 128] } + "outputT": { "dtype": "float32", "shape": [1, 1, 1024] }, + "presentKeyT": { "dtype": "int8", "shape": [1, 2, 2048, 128] }, + "presentValueT": { "dtype": "int8", "shape": [1, 2, 2048, 128] } }, "bench": { "metrics": [ { "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "value": "4 * (6 * numel(shapes.pastKeyT) + 4 * numel(shapes.keyT) + 2 * numel(shapes.queryT))" } ] } }, { - "name": "window-chunk-prefill-32h8kv-d128-cap1024-q128", - "preset": "smoke", - "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 1024 }, + "name": "quant-int8-prefill-h32kv8-d128-s512-pathology", + "preset": "stress", + "provenance": { + "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with an int8 quantized key/value cache." + }, + "attrs": { + "num_heads": 32, + "kv_num_heads": 8, + "kv_cache_bit_width": 8, + "k_quant_type": "PER_TENSOR", + "v_quant_type": "PER_TENSOR" + }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 128, 4096], + "shape": [1, 512, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float32", - "shape": [1, 128, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.031 } }, "valueT": { "dtype": "float32", - "shape": [1, 128, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } - }, - "pastKeyT": { - "dtype": "float32", - "shape": [1, 8, 1024, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.033 } }, + "pastKeyT": { "dtype": "int8", "shape": [1, 8, 512, 128], "dist": "uniform", "seed": 882, "min": -8, "max": 8 }, "pastValueT": { - "dtype": "float32", - "shape": [1, 8, 1024, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "dtype": "int8", + "shape": [1, 8, 512, 128], + "dist": "uniform", + "seed": 883, + "min": -8, + "max": 8 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, + "kScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } }, + "vScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 128, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, + "presentKeyT": { "dtype": "int8", "shape": [1, 8, 512, 128] }, + "presentValueT": { "dtype": "int8", "shape": [1, 8, 512, 128] } }, "bench": { "metrics": [ - { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" }, { - "type": "bandwidth", - "name": "cache traffic", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2" } ] - }, - "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 32, "headDim": 128 } + } }, { - "name": "window-decode-32h8kv-d128-cap4096-w4096", - "preset": "model", - "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 4096 }, + "name": "quant-int4-prefill-h32kv8-d128-s512-pathology", + "preset": "stress", + "provenance": { + "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with a packed int4 quantized key/value cache." + }, + "attrs": { + "num_heads": 32, + "kv_num_heads": 8, + "kv_cache_bit_width": 4, + "k_quant_type": "PER_TENSOR", + "v_quant_type": "PER_TENSOR" + }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 4096], + "shape": [1, 512, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.013, "cosStep": 0.031 } }, "valueT": { "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } - }, - "pastKeyT": { - "dtype": "float32", - "shape": [1, 8, 4096, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.015, "cosStep": 0.033 } }, + "pastKeyT": { "dtype": "uint8", "shape": [1, 8, 512, 64], "dist": "uniform", "seed": 884, "min": 0, "max": 256 }, "pastValueT": { - "dtype": "float32", - "shape": [1, 8, 4096, 128], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "dtype": "uint8", + "shape": [1, 8, 512, 64], + "dist": "uniform", + "seed": 885, + "min": 0, + "max": 256 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } - }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, + "kScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } }, + "vScaleT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0625] } } + }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 4096, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 4096, 128] } + "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, + "presentKeyT": { "dtype": "uint8", "shape": [1, 8, 512, 64] }, + "presentValueT": { "dtype": "uint8", "shape": [1, 8, 512, 64] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2" } ] } }, { - "name": "window-headsink-rotary-decode-gptoss-64h8kv-d64-cap384-w128", + "name": "bias-prefill-cliff-h32kv8-d128-s512", "preset": "smoke", - "attrs": { - "num_heads": 64, - "kv_num_heads": 8, - "do_rotary": 1, - "sliding_window_cache": 1, - "local_window_size": 128 - }, + "tunableSpace": { "PREFILL_LANES_PER_QUERY": [4] }, + "attrs": { "num_heads": 32, "kv_num_heads": 8 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 4096], + "shape": [1, 512, 4096], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, - "keyT": { - "dtype": "float32", - "shape": [1, 1, 512], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } - }, - "valueT": { - "dtype": "float32", - "shape": [1, 1, 512], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } - }, + "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "valueT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 8, 384, 64], + "shape": [1, 8, 512, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 8, 384, 64], + "shape": [1, 8, 512, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4095] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4096] } }, - "cosCacheT": { - "dtype": "float32", - "shape": [4096, 32], - "data": { "kind": "rotaryCos", "thetaStart": 0.0, "thetaStep": 0.017 } - }, - "sinCacheT": { - "dtype": "float32", - "shape": [4096, 32], - "data": { "kind": "rotarySin", "thetaStart": 0.0, "thetaStep": 0.017 } - }, - "headSinkT": { + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, + "attentionBiasT": { "dtype": "float32", - "shape": [64], - "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.041, "cosStep": 0.011 } + "shape": [1, 32, 512, 512], + "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.007, "cosStep": 0.009 } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 384, 64] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 384, 64] } + "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 512, 128] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.pastKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" } ] } }, { - "name": "sharedkv-chunk-append-32h8kv-d128-cap1024-q128", + "name": "hd16-belowfloor-decode-h8kv2-kv2048", "preset": "smoke", - "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 32, "headDim": 128 }, - "attrs": { "num_heads": 32, "kv_num_heads": 8 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 128, 4096], + "shape": [1, 1, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, - "keyT": { - "dtype": "float32", - "shape": [1, 128, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } - }, - "valueT": { - "dtype": "float32", - "shape": [1, 128, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } - }, + "keyT": { "dtype": "float32", "shape": [1, 0, 32], "data": { "kind": "values", "values": [] } }, + "valueT": { "dtype": "float32", "shape": [1, 0, 32], "data": { "kind": "values", "values": [] } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 8, 1024, 128], + "shape": [1, 2, 2048, 16], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 8, 1024, 128], + "shape": [1, 2, 2048, 16], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2047] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 128, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + "outputT": { "dtype": "float32", "shape": [1, 1, 128] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 2, 2048, 16] }, + "presentValueT": { "dtype": "float32", "shape": [1, 2, 2048, 16] } }, "bench": { "metrics": [ - { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + { + "type": "bandwidth", + "value": "2 * dim(shapes.pastKeyT, 1) * dim(shapes.pastKeyT, 2) * dim(shapes.pastKeyT, 3) * 4 + 2 * dim(shapes.queryT, 2) * 4" + } ] } }, { - "name": "sharedkv-chunk-append-8h2kv-d256-cap1024-q128", + "name": "sliding-window-decode-h8kv2-d128-kv2048-w256", "preset": "smoke", - "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 8, "headDim": 256 }, - "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2, "local_window_size": 256 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 128, 2048], + "shape": [1, 1, 1024], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, - "keyT": { - "dtype": "float32", - "shape": [1, 128, 512], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } - }, - "valueT": { - "dtype": "float32", - "shape": [1, 128, 512], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } - }, + "keyT": { "dtype": "float32", "shape": [1, 0, 256], "data": { "kind": "values", "values": [] } }, + "valueT": { "dtype": "float32", "shape": [1, 0, 256], "data": { "kind": "values", "values": [] } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 2, 1024, 256], + "shape": [1, 2, 2048, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 2, 1024, 256], + "shape": [1, 2, 2048, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2047] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2048] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 128, 2048] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 2, 1024, 256] }, - "presentValueT": { "dtype": "float32", "shape": [1, 2, 1024, 256] } + "outputT": { "dtype": "float32", "shape": [1, 1, 1024] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 2, 2048, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 2, 2048, 128] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * dim(shapes.pastKeyT, 1) * dim(shapes.pastKeyT, 2) * dim(shapes.pastKeyT, 3) * 4 + 2 * dim(shapes.queryT, 2) * 4" + } + ] + } + }, + { + "name": "scalar-fallback-decode-hd32-h8kv8-kv4096", + "preset": "stress", + "vars": { "batch": 1, "qSeq": 1, "kvSeq": 4096, "heads": 8, "kvHeads": 8, "headDim": 32 }, + "attrs": { "num_heads": 8, "kv_num_heads": 8, "scale": 0.17677669529663687, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 1, 256], "dtype": "float32", "dist": "normal", "seed": 911, "scale": 0.2 }, + "keyT": { "shape": [1, 4096, 256], "dtype": "float32", "dist": "normal", "seed": 912, "scale": 0.2 }, + "valueT": { "shape": [1, 4096, 256], "dtype": "float32", "dist": "normal", "seed": 913, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4095] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4096] } } + }, + "outputs": { + "outputT": { "shape": [1, 1, 256], "dtype": "float32", "dist": "empty" }, + "presentKeyT": { "shape": [1, 8, 4096, 32], "dtype": "float32", "dist": "empty" }, + "presentValueT": { "shape": [1, 8, 4096, 32], "dtype": "float32", "dist": "empty" } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "(4 * dim(shapes.keyT, 1) * attrs.kv_num_heads * (dim(shapes.queryT, 2) / attrs.num_heads) + 2 * dim(shapes.queryT, 2)) * 4" + } + ] + } + }, + { + "name": "scalar-fallback-prefill-hd32-h8kv8-s512", + "preset": "stress", + "vars": { "batch": 1, "qSeq": 512, "kvSeq": 512, "heads": 8, "kvHeads": 8, "headDim": 32 }, + "attrs": { "num_heads": 8, "kv_num_heads": 8, "scale": 0.17677669529663687, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 512, 256], "dtype": "float32", "dist": "normal", "seed": 901, "scale": 0.2 }, + "keyT": { "shape": [1, 512, 256], "dtype": "float32", "dist": "normal", "seed": 902, "scale": 0.2 }, + "valueT": { "shape": [1, 512, 256], "dtype": "float32", "dist": "normal", "seed": 903, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + }, + "outputs": { + "outputT": { "shape": [1, 512, 256], "dtype": "float32", "dist": "empty" }, + "presentKeyT": { "shape": [1, 8, 512, 32], "dtype": "float32", "dist": "empty" }, + "presentValueT": { "shape": [1, 8, 512, 32], "dtype": "float32", "dist": "empty" } + }, + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "4 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * dim(shapes.keyT, 1) * attrs.num_heads * (dim(shapes.queryT, 2) / attrs.num_heads)" + } + ] + } + }, + { + "name": "gqa-f32-q31-kv511-h8-kv2-d64-double-threshold-cliff", + "preset": "stress", + "vars": { "batch": 1, "qSeq": 31, "kvSeq": 511, "heads": 8, "kvHeads": 2, "headDim": 64 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2, "scale": 0.125, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 31, 512], "dtype": "float32", "dist": "normal", "seed": 921, "scale": 0.2 }, + "keyT": { "shape": [1, 511, 128], "dtype": "float32", "dist": "normal", "seed": 922, "scale": 0.2 }, + "valueT": { "shape": [1, 511, 128], "dtype": "float32", "dist": "normal", "seed": 923, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [510] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } } + }, + "outputs": { + "outputT": { "shape": [1, 31, 512], "dtype": "float32", "dist": "empty" }, + "presentKeyT": { "shape": [1, 2, 511, 64], "dtype": "float32", "dist": "empty" }, + "presentValueT": { "shape": [1, 2, 511, 64], "dtype": "float32", "dist": "empty" } + }, + "bench": { + "primary": true, + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "gqa-f32-q32-kv512-h8-kv2-d64-threshold-control", + "preset": "stress", + "vars": { "batch": 1, "qSeq": 32, "kvSeq": 512, "heads": 8, "kvHeads": 2, "headDim": 64 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2, "scale": 0.125, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 32, 512], "dtype": "float32", "dist": "normal", "seed": 924, "scale": 0.2 }, + "keyT": { "shape": [1, 512, 128], "dtype": "float32", "dist": "normal", "seed": 925, "scale": 0.2 }, + "valueT": { "shape": [1, 512, 128], "dtype": "float32", "dist": "normal", "seed": 926, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + }, + "outputs": { + "outputT": { "shape": [1, 32, 512], "dtype": "float32", "dist": "empty" }, + "presentKeyT": { "shape": [1, 2, 512, 64], "dtype": "float32", "dist": "empty" }, + "presentValueT": { "shape": [1, 2, 512, 64], "dtype": "float32", "dist": "empty" } }, "bench": { + "primary": true, "metrics": [ { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } ] - }, - "provenance": { - "source": "register-geometry gate asymmetry", - "notes": "Measures cached float32 prefill that appends 128 tokens after 896 cached ones, filling a 1024-slot key/value buffer, with 8 query heads over 2 key/value heads of width 256." } }, { - "name": "bidirectional-share-append-32h8kv-d128-cap1024-q128", + "name": "headsink-prefill-h32kv8-d128-s512-generic-pathology", + "preset": "stress", + "provenance": { + "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with per-head attention sink logits." + }, + "attrs": { "num_heads": 32, "kv_num_heads": 8 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 512, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "valueT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, + "headSinkT": { "dtype": "float32", "shape": [32], "dist": "normal", "seed": 927, "scale": 0.2 } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 512, 128] } + }, + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.pastKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" + } + ] + } + }, + { + "name": "bias-headsink-prefill-h32kv8-d128-s512-generic-pathology", + "preset": "stress", + "provenance": { + "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with an additive attention bias and per-head attention sink logits." + }, + "attrs": { "num_heads": 32, "kv_num_heads": 8 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 512, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "valueT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } }, + "attentionBiasT": { + "dtype": "float32", + "shape": [1, 32, 512, 512], + "data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.007, "cosStep": 0.009 } + }, + "headSinkT": { "dtype": "float32", "shape": [32], "dist": "normal", "seed": 928, "scale": 0.2 } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 512, 128] } + }, + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.pastKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" + } + ] + } + }, + { + "name": "softcap-prefill-h32kv8-d128-s512-generic-pathology", + "preset": "stress", + "provenance": { + "notes": "Measures GroupQueryAttention over a 512-token Llama-sized prefill (32 query heads grouped 4:1 over 8 key/value heads, head width 128) with a logit softcap of 30." + }, + "attrs": { "num_heads": 32, "kv_num_heads": 8, "softcap": 30 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 512, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "valueT": { "dtype": "float32", "shape": [1, 0, 1024], "data": { "kind": "values", "values": [] } }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 512, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 512, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 512, 128] } + }, + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "4 * dim(shapes.queryT, 2) * (dim(shapes.queryT, 1) * (dim(shapes.pastKeyT, 2) - dim(shapes.queryT, 1)) + dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) / 2)" + } + ] + } + }, + { + "name": "qkv-prefill-f32-h4kv1-d64-s128", + "preset": "model", + "provenance": { "notes": "Float32 prefill of 128 tokens with 4 query heads sharing 1 key/value head of size 64." }, + "vars": { "batch": 1, "qSeq": 128, "kvSeq": 128, "heads": 4, "kvHeads": 1, "headDim": 64 }, + "attrs": { "num_heads": 4, "kv_num_heads": 1, "scale": 0.125, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 128, 256], "dtype": "float32", "dist": "normal", "seed": 1075, "scale": 0.2 }, + "keyT": { "shape": [1, 128, 64], "dtype": "float32", "dist": "normal", "seed": 1076, "scale": 0.2 }, + "valueT": { "shape": [1, 128, 64], "dtype": "float32", "dist": "normal", "seed": 1077, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [127] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } } + }, + "outputs": { + "outputT": { "shape": [1, 128, 256], "dtype": "float32" }, + "presentKeyT": { "shape": [1, 1, 128, 64], "dtype": "float32" }, + "presentValueT": { "shape": [1, 1, 128, 64], "dtype": "float32" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "qkv-prefill-f32-h4kv1-d256-s128", + "preset": "model", + "provenance": { + "notes": "Float32 prefill of 128 tokens with 4 query heads sharing 1 key/value head of size 256." + }, + "vars": { "batch": 1, "qSeq": 128, "kvSeq": 128, "heads": 4, "kvHeads": 1, "headDim": 256 }, + "attrs": { "num_heads": 4, "kv_num_heads": 1, "scale": 0.0625, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 128, 1024], "dtype": "float32", "dist": "normal", "seed": 1081, "scale": 0.2 }, + "keyT": { "shape": [1, 128, 256], "dtype": "float32", "dist": "normal", "seed": 1082, "scale": 0.2 }, + "valueT": { "shape": [1, 128, 256], "dtype": "float32", "dist": "normal", "seed": 1083, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [127] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } } + }, + "outputs": { + "outputT": { "shape": [1, 128, 1024], "dtype": "float32" }, + "presentKeyT": { "shape": [1, 1, 128, 256], "dtype": "float32" }, + "presentValueT": { "shape": [1, 1, 128, 256], "dtype": "float32" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "window-decode-32h8kv-d128-cap1024-w1024", + "preset": "smoke", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 1024 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "window-decode-32h8kv-d128-cap1024-unfilled", + "preset": "smoke", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 1024 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "window-decode-32h8kv-d128-cap256-w256", + "preset": "smoke", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 256 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 256, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 256, 128] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "window-chunk-prefill-32h8kv-d128-cap1024-q128", + "preset": "smoke", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 1024 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 128, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 128, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 128, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 128, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" }, + { + "type": "bandwidth", + "name": "cache traffic", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + }, + "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 32, "headDim": 128 } + }, + { + "name": "window-decode-32h8kv-d128-cap4096-w4096", + "preset": "model", + "attrs": { "num_heads": 32, "kv_num_heads": 8, "sliding_window_cache": 1, "local_window_size": 4096 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 4096, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 4096, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 4096, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 4096, 128] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "window-headsink-rotary-decode-gptoss-64h8kv-d64-cap384-w128", + "preset": "smoke", + "attrs": { + "num_heads": 64, + "kv_num_heads": 8, + "do_rotary": 1, + "sliding_window_cache": 1, + "local_window_size": 128 + }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 384, 64], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 384, 64], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4095] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4096] } }, + "cosCacheT": { + "dtype": "float32", + "shape": [4096, 32], + "data": { "kind": "rotaryCos", "thetaStart": 0.0, "thetaStep": 0.017 } + }, + "sinCacheT": { + "dtype": "float32", + "shape": [4096, 32], + "data": { "kind": "rotarySin", "thetaStart": 0.0, "thetaStep": 0.017 } + }, + "headSinkT": { + "dtype": "float32", + "shape": [64], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.041, "cosStep": 0.011 } + } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 384, 64] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 384, 64] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "sharedkv-chunk-append-32h8kv-d128-cap1024-q128", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 32, "headDim": 128 }, + "attrs": { "num_heads": 32, "kv_num_heads": 8 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 128, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 128, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 128, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 128, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "sharedkv-chunk-append-8h2kv-d256-cap1024-q128", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 8, "headDim": 256 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 128, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 128, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 128, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 2, 1024, 256], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 2, 1024, 256], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 128, 2048] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 2, 1024, 256] }, + "presentValueT": { "dtype": "float32", "shape": [1, 2, 1024, 256] } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + }, + "provenance": { + "source": "synthetic", + "notes": "Measures cached float32 prefill that appends 128 tokens after 896 cached ones, filling a 1024-slot key/value buffer, with 8 query heads over 2 key/value heads of width 256." + } + }, + { + "name": "bidirectional-share-append-32h8kv-d128-cap1024-q128", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 32, "headDim": 128 }, + "attrs": { "num_heads": 32, "kv_num_heads": 8, "causal": 0 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 128, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 128, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 128, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 128, 4096] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "bidirectional-share-append-f16-32h8kv-d128-cap512-q64", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 64, "kvSeq": 512, "heads": 32, "headDim": 128 }, + "attrs": { "num_heads": 32, "kv_num_heads": 8, "causal": 0 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 64, 4096], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 64, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 64, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float16", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float16", + "shape": [1, 8, 512, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 64, 4096] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 8, 512, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 8, 512, 128] } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "qwen3-prefill-32h8kv-d128-s256", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 256, "kvSeq": 256, "heads": 32, "kvHeads": 8, "headDim": 128 }, + "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 256, 4096], "dtype": "float32", "dist": "normal", "seed": 960, "scale": 0.2 }, + "keyT": { "shape": [1, 256, 1024], "dtype": "float32", "dist": "normal", "seed": 961, "scale": 0.2 }, + "valueT": { "shape": [1, 256, 1024], "dtype": "float32", "dist": "normal", "seed": 962, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [255] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [256] } } + }, + "outputs": { + "outputT": { "shape": [1, 256, 4096], "dtype": "float32" }, + "presentKeyT": { "shape": [1, 8, 256, 128], "dtype": "float32" }, + "presentValueT": { "shape": [1, 8, 256, 128], "dtype": "float32" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "causal-prefill-f16-h4kv2-d64-q64", + "provenance": { + "source": "synthetic", + "test": "Causal half-precision prompt prefill", + "notes": "Each query attends only itself and earlier key positions. Verify the complete attention output and exact retention of both key/value inputs in the present caches." + }, + "attrs": { "num_heads": 4, "kv_num_heads": 2 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 64, 256], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 64, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 64, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [63] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [64] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 64, 256] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 64, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 64, 64] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "causal-prefill-f16-h4kv2-d128-q65", + "provenance": { + "source": "synthetic", + "test": "Causal half-precision prompt prefill", + "notes": "Each query attends only itself and earlier key positions. Verify the complete attention output and exact retention of both key/value inputs in the present caches." + }, + "attrs": { "num_heads": 4, "kv_num_heads": 2 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 65, 512], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 65, 256], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 65, 256], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [64] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 65, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 65, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 65, 128] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "causal-prefill-f16-h8kv2-d64-q512", + "provenance": { + "source": "synthetic", + "test": "Causal half-precision prompt prefill", + "notes": "Each query attends only itself and earlier key positions. Verify the complete attention output and exact retention of both key/value inputs in the present caches." + }, + "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 512, 512], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 512, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 512, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 512, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 512, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 512, 64] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "prefill-f32-h8kv1-d32-q33", + "preset": "model", + "provenance": { "notes": "Small bidirectional prefill with query tails and varying head widths." }, + "vars": { "batch": 1, "qSeq": 33, "kvSeq": 33, "heads": 8, "kvHeads": 1, "headDim": 32 }, + "attrs": { "num_heads": 8, "kv_num_heads": 1, "scale": 0.125, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 33, 256], "dtype": "float32", "dist": "normal", "seed": 1075, "scale": 0.2 }, + "keyT": { "shape": [1, 33, 32], "dtype": "float32", "dist": "normal", "seed": 1076, "scale": 0.2 }, + "valueT": { "shape": [1, 33, 32], "dtype": "float32", "dist": "normal", "seed": 1077, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [32] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [33] } } + }, + "outputs": { + "outputT": { "shape": [1, 33, 256], "dtype": "float32" }, + "presentKeyT": { "shape": [1, 1, 33, 32], "dtype": "float32" }, + "presentValueT": { "shape": [1, 1, 33, 32], "dtype": "float32" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "prefill-f32-h8kv1-d128-q33", + "preset": "model", + "provenance": { "notes": "Small bidirectional prefill with query tails and varying head widths." }, + "vars": { "batch": 1, "qSeq": 33, "kvSeq": 33, "heads": 8, "kvHeads": 1, "headDim": 128 }, + "attrs": { "num_heads": 8, "kv_num_heads": 1, "scale": 0.125, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 33, 1024], "dtype": "float32", "dist": "normal", "seed": 1075, "scale": 0.2 }, + "keyT": { "shape": [1, 33, 128], "dtype": "float32", "dist": "normal", "seed": 1076, "scale": 0.2 }, + "valueT": { "shape": [1, 33, 128], "dtype": "float32", "dist": "normal", "seed": 1077, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [32] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [33] } } + }, + "outputs": { + "outputT": { "shape": [1, 33, 1024], "dtype": "float32" }, + "presentKeyT": { "shape": [1, 1, 33, 128], "dtype": "float32" }, + "presentValueT": { "shape": [1, 1, 33, 128], "dtype": "float32" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "prefill-f32-h8kv1-d256-q32", + "preset": "model", + "provenance": { "notes": "Small bidirectional prefill with query tails and varying head widths." }, + "vars": { "batch": 1, "qSeq": 32, "kvSeq": 32, "heads": 8, "kvHeads": 1, "headDim": 256 }, + "attrs": { "num_heads": 8, "kv_num_heads": 1, "scale": 0.125, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 32, 2048], "dtype": "float32", "dist": "normal", "seed": 1075, "scale": 0.2 }, + "keyT": { "shape": [1, 32, 256], "dtype": "float32", "dist": "normal", "seed": 1076, "scale": 0.2 }, + "valueT": { "shape": [1, 32, 256], "dtype": "float32", "dist": "normal", "seed": 1077, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [31] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [32] } } + }, + "outputs": { + "outputT": { "shape": [1, 32, 2048], "dtype": "float32" }, + "presentKeyT": { "shape": [1, 1, 32, 256], "dtype": "float32" }, + "presentValueT": { "shape": [1, 1, 32, 256], "dtype": "float32" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "cooperative-window-h4kv2-d122-cap256", + "preset": "smoke", + "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 488], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 244], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 244], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 2, 256, 122], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 2, 256, 122], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 488] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 122] }, + "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 122] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "cooperative-window-h4kv2-d124-cap256", + "preset": "smoke", + "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 496], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 248], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 248], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 2, 256, 124], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 2, 256, 124], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 496] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 124] }, + "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 124] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "cooperative-window-h4kv2-d246-cap256", + "preset": "smoke", + "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 984], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 492], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 492], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 2, 256, 246], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 2, 256, 246], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 984] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 246] }, + "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 246] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "cooperative-window-h4kv2-d248-cap256", + "preset": "smoke", + "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 992], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 496], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 496], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 2, 256, 248], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 2, 256, 248], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 992] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 248] }, + "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 248] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "cooperative-window-h4kv2-d256-cap256", + "preset": "smoke", + "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "inputs": { + "queryT": { + "dtype": "float32", + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float32", + "shape": [1, 1, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float32", + "shape": [1, 1, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float32", + "shape": [1, 2, 256, 256], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float32", + "shape": [1, 2, 256, 256], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + }, + "outputs": { + "outputT": { "dtype": "float32", "shape": [1, 1, 1024] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 256] }, + "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 256] } + }, + "bench": { + "metrics": [ + { + "type": "bandwidth", + "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + } + ] + } + }, + { + "name": "causal-prefill-f16-h8kv2-d64-q128", + "provenance": { + "source": "synthetic", + "test": "Causal prompt prefill with head and query-grid boundaries", + "notes": "Float16 causal prefill of 128 tokens (8 query heads, 2 key/value heads, head size 64): every query attends its complete causal prefix, and the complete present caches are checked." + }, + "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 128, 512], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 128, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 128, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [127] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 128, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 128, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 128, 64] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "causal-prefill-f16-h8kv2-d64-q256", + "provenance": { + "source": "synthetic", + "test": "Causal prompt prefill with head and query-grid boundaries", + "notes": "Float16 causal prefill of 256 tokens (8 query heads, 2 key/value heads, head size 64): every query attends its complete causal prefix, and the complete present caches are checked." + }, + "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 256, 512], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 256, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 256, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [255] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [256] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 256, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 256, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 256, 64] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "causal-prefill-f16-h8kv2-d64-q480", + "provenance": { + "source": "synthetic", + "test": "Causal prompt prefill with head and query-grid boundaries", + "notes": "Float16 causal prefill of 480 tokens (8 query heads, 2 key/value heads, head size 64): every query attends its complete causal prefix, and the complete present caches are checked." + }, + "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 480, 512], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 480, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 480, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [479] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [480] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 480, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 480, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 480, 64] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "causal-prefill-f16-h8kv2-d64-q481", + "provenance": { + "source": "synthetic", + "test": "Causal prompt prefill with head and query-grid boundaries", + "notes": "Float16 causal prefill of 481 tokens (8 query heads, 2 key/value heads, head size 64): every query attends its complete causal prefix, and the complete present caches are checked." + }, + "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 481, 512], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 481, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 481, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [480] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [481] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 481, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 481, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 481, 64] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "causal-prefill-f16-h2kv1-d128-q512", + "provenance": { + "source": "synthetic", + "test": "Causal prompt prefill with head and query-grid boundaries", + "notes": "Float16 causal prefill of 512 tokens (2 query heads, 1 key/value head, head size 128): every query attends its complete causal prefix, and the complete present caches are checked." + }, + "attrs": { "num_heads": 2, "kv_num_heads": 1 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 512, 256], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 512, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 512, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 512, 256] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 1, 512, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 1, 512, 128] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "causal-prefill-f16-h2kv1-d128-q992", + "provenance": { + "source": "synthetic", + "test": "Causal prompt prefill with head and query-grid boundaries", + "notes": "Float16 causal prefill of 992 tokens (2 query heads, 1 key/value head, head size 128): every query attends its complete causal prefix, and the complete present caches are checked." + }, + "attrs": { "num_heads": 2, "kv_num_heads": 1 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 992, 256], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 992, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 992, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [991] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [992] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 992, 256] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 1, 992, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 1, 992, 128] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "causal-prefill-f16-h2kv1-d128-q993", + "provenance": { + "source": "synthetic", + "test": "Causal prompt prefill with head and query-grid boundaries", + "notes": "Float16 causal prefill of 993 tokens (2 query heads, 1 key/value head, head size 128): every query attends its complete causal prefix, and the complete present caches are checked." + }, + "attrs": { "num_heads": 2, "kv_num_heads": 1 }, + "inputs": { + "queryT": { + "dtype": "float16", + "shape": [1, 993, 256], + "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 993, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 993, 128], + "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [992] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [993] } } + }, + "outputs": { + "outputT": { "dtype": "float16", "shape": [1, 993, 256] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 1, 993, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 1, 993, 128] } + }, + "preset": "model", + "bench": { + "metrics": [ + { + "type": "gflops", + "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" + } + ] + } + }, + { + "name": "bidir-grid-b1-q31-cap129-h8-kv2-d64", "preset": "smoke", - "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 32, "headDim": 128 }, - "attrs": { "num_heads": 32, "kv_num_heads": 8, "causal": 0 }, + "vars": { "batch": 1, "qSeq": 31, "kvSeq": 129, "heads": 8, "headDim": 64 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2, "causal": 0 }, "inputs": { "queryT": { - "dtype": "float32", - "shape": [1, 128, 4096], + "dtype": "float16", + "shape": [1, 31, 512], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { - "dtype": "float32", - "shape": [1, 128, 1024], + "dtype": "float16", + "shape": [1, 31, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } }, "valueT": { - "dtype": "float32", - "shape": [1, 128, 1024], + "dtype": "float16", + "shape": [1, 31, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } }, "pastKeyT": { - "dtype": "float32", - "shape": [1, 8, 1024, 128], + "dtype": "float16", + "shape": [1, 2, 129, 64], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { - "dtype": "float32", - "shape": [1, 8, 1024, 128], + "dtype": "float16", + "shape": [1, 2, 129, 64], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [129] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 128, 4096] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, - "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } + "outputT": { "dtype": "float16", "shape": [1, 31, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 129, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 129, 64] } }, "bench": { "metrics": [ @@ -1674,43 +3000,43 @@ } }, { - "name": "bidirectional-share-append-f16-32h8kv-d128-cap512-q64", + "name": "bidir-grid-b1-q65-cap257-h8-kv2-d64", "preset": "smoke", - "vars": { "batch": 1, "qSeq": 64, "kvSeq": 512, "heads": 32, "headDim": 128 }, - "attrs": { "num_heads": 32, "kv_num_heads": 8, "causal": 0 }, + "vars": { "batch": 1, "qSeq": 65, "kvSeq": 257, "heads": 8, "headDim": 64 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2, "causal": 0 }, "inputs": { "queryT": { "dtype": "float16", - "shape": [1, 64, 4096], + "shape": [1, 65, 512], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float16", - "shape": [1, 64, 1024], + "shape": [1, 65, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } }, "valueT": { "dtype": "float16", - "shape": [1, 64, 1024], + "shape": [1, 65, 128], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } }, "pastKeyT": { "dtype": "float16", - "shape": [1, 8, 512, 128], + "shape": [1, 2, 257, 64], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { "dtype": "float16", - "shape": [1, 8, 512, 128], + "shape": [1, 2, 257, 64], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [256] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [257] } } }, "outputs": { - "outputT": { "dtype": "float16", "shape": [1, 64, 4096] }, - "presentKeyT": { "dtype": "float16", "shape": [1, 8, 512, 128] }, - "presentValueT": { "dtype": "float16", "shape": [1, 8, 512, 128] } + "outputT": { "dtype": "float16", "shape": [1, 65, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 257, 64] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 257, 64] } }, "bench": { "metrics": [ @@ -1719,21 +3045,43 @@ } }, { - "name": "qwen3-prefill-32h8kv-d128-s256", + "name": "bidir-grid-b1-q32-cap256-h16-kv4-d128", "preset": "smoke", - "vars": { "batch": 1, "qSeq": 256, "kvSeq": 256, "heads": 32, "kvHeads": 8, "headDim": 128 }, - "attrs": { "num_heads": 32, "kv_num_heads": 8, "scale": 0.08838834764831845, "causal": 0 }, + "vars": { "batch": 1, "qSeq": 32, "kvSeq": 256, "heads": 16, "headDim": 128 }, + "attrs": { "num_heads": 16, "kv_num_heads": 4, "causal": 0 }, "inputs": { - "queryT": { "shape": [1, 256, 4096], "dtype": "float32", "dist": "normal", "seed": 960, "scale": 0.2 }, - "keyT": { "shape": [1, 256, 1024], "dtype": "float32", "dist": "normal", "seed": 961, "scale": 0.2 }, - "valueT": { "shape": [1, 256, 1024], "dtype": "float32", "dist": "normal", "seed": 962, "scale": 0.2 }, + "queryT": { + "dtype": "float16", + "shape": [1, 32, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 32, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 32, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float16", + "shape": [1, 4, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float16", + "shape": [1, 4, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [255] } }, "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [256] } } }, "outputs": { - "outputT": { "shape": [1, 256, 4096], "dtype": "float32" }, - "presentKeyT": { "shape": [1, 8, 256, 128], "dtype": "float32" }, - "presentValueT": { "shape": [1, 8, 256, 128], "dtype": "float32" } + "outputT": { "dtype": "float16", "shape": [1, 32, 2048] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 4, 256, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 4, 256, 128] } }, "bench": { "metrics": [ @@ -1742,148 +3090,133 @@ } }, { - "name": "causal-prefill-f16-h4kv2-d64-q64", - "provenance": { - "source": "synthetic", - "test": "Causal half-precision prompt prefill", - "notes": "Each query attends only itself and earlier key positions. Verify the complete attention output and exact retention of both key/value inputs in the present caches." - }, - "attrs": { "num_heads": 4, "kv_num_heads": 2 }, + "name": "bidir-grid-b1-q63-cap257-h16-kv4-d128", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 63, "kvSeq": 257, "heads": 16, "headDim": 128 }, + "attrs": { "num_heads": 16, "kv_num_heads": 4, "causal": 0 }, "inputs": { "queryT": { "dtype": "float16", - "shape": [1, 64, 256], - "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + "shape": [1, 63, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float16", - "shape": [1, 64, 128], - "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + "shape": [1, 63, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } }, "valueT": { "dtype": "float16", - "shape": [1, 64, 128], - "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + "shape": [1, 63, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [63] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [64] } } + "pastKeyT": { + "dtype": "float16", + "shape": [1, 4, 257, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float16", + "shape": [1, 4, 257, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [256] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [257] } } }, "outputs": { - "outputT": { "dtype": "float16", "shape": [1, 64, 256] }, - "presentKeyT": { "dtype": "float16", "shape": [1, 2, 64, 64] }, - "presentValueT": { "dtype": "float16", "shape": [1, 2, 64, 64] } + "outputT": { "dtype": "float16", "shape": [1, 63, 2048] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 4, 257, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 4, 257, 128] } }, - "preset": "model", "bench": { "metrics": [ - { - "type": "gflops", - "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" - } + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } ] } }, { - "name": "causal-prefill-f16-h4kv2-d128-q65", - "provenance": { - "source": "synthetic", - "test": "Causal half-precision prompt prefill", - "notes": "Each query attends only itself and earlier key positions. Verify the complete attention output and exact retention of both key/value inputs in the present caches." - }, - "attrs": { "num_heads": 4, "kv_num_heads": 2 }, + "name": "bidir-grid-b1-q128-cap1024-h16-kv4-d128", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 128, "kvSeq": 1024, "heads": 16, "headDim": 128 }, + "attrs": { "num_heads": 16, "kv_num_heads": 4, "causal": 0 }, "inputs": { "queryT": { "dtype": "float16", - "shape": [1, 65, 512], - "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + "shape": [1, 128, 2048], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float16", - "shape": [1, 65, 256], - "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + "shape": [1, 128, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } }, "valueT": { "dtype": "float16", - "shape": [1, 65, 256], - "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + "shape": [1, 128, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [64] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65] } } + "pastKeyT": { + "dtype": "float16", + "shape": [1, 4, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float16", + "shape": [1, 4, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1023] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1024] } } }, "outputs": { - "outputT": { "dtype": "float16", "shape": [1, 65, 512] }, - "presentKeyT": { "dtype": "float16", "shape": [1, 2, 65, 128] }, - "presentValueT": { "dtype": "float16", "shape": [1, 2, 65, 128] } + "outputT": { "dtype": "float16", "shape": [1, 128, 2048] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 4, 1024, 128] }, + "presentValueT": { "dtype": "float16", "shape": [1, 4, 1024, 128] } }, - "preset": "model", "bench": { "metrics": [ - { - "type": "gflops", - "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" - } + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } ] } }, { - "name": "causal-prefill-f16-h8kv2-d64-q512", - "provenance": { - "source": "synthetic", - "test": "Causal half-precision prompt prefill", - "notes": "Each query attends only itself and earlier key positions. Verify the complete attention output and exact retention of both key/value inputs in the present caches." - }, - "attrs": { "num_heads": 8, "kv_num_heads": 2 }, + "name": "bidir-grid-b2-q33-cap129-h4-kv2-d128", + "preset": "smoke", + "vars": { "batch": 2, "qSeq": 33, "kvSeq": 129, "heads": 4, "headDim": 128 }, + "attrs": { "num_heads": 4, "kv_num_heads": 2, "causal": 0 }, "inputs": { "queryT": { "dtype": "float16", - "shape": [1, 512, 512], - "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.0625 } + "shape": [2, 33, 512], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { "dtype": "float16", - "shape": [1, 512, 128], - "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0625 } + "shape": [2, 33, 256], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } }, "valueT": { "dtype": "float16", - "shape": [1, 512, 128], - "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.031, "scale": 0.0625 } + "shape": [2, 33, 256], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [511] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [512] } } - }, - "outputs": { - "outputT": { "dtype": "float16", "shape": [1, 512, 512] }, - "presentKeyT": { "dtype": "float16", "shape": [1, 2, 512, 64] }, - "presentValueT": { "dtype": "float16", "shape": [1, 2, 512, 64] } - }, - "preset": "model", - "bench": { - "metrics": [ - { - "type": "gflops", - "value": "2 * dim(shapes.queryT, 0) * dim(shapes.queryT, 1) * (dim(shapes.queryT, 1) + 1) * dim(shapes.queryT, 2)" - } - ] - } - }, - { - "name": "prefill-f32-h8kv1-d32-q33", - "preset": "model", - "provenance": { "notes": "Small bidirectional prefill with query tails and varying head widths." }, - "vars": { "batch": 1, "qSeq": 33, "kvSeq": 33, "heads": 8, "kvHeads": 1, "headDim": 32 }, - "attrs": { "num_heads": 8, "kv_num_heads": 1, "scale": 0.125, "causal": 0 }, - "inputs": { - "queryT": { "shape": [1, 33, 256], "dtype": "float32", "dist": "normal", "seed": 1075, "scale": 0.2 }, - "keyT": { "shape": [1, 33, 32], "dtype": "float32", "dist": "normal", "seed": 1076, "scale": 0.2 }, - "valueT": { "shape": [1, 33, 32], "dtype": "float32", "dist": "normal", "seed": 1077, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [32] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [33] } } + "pastKeyT": { + "dtype": "float16", + "shape": [2, 2, 129, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float16", + "shape": [2, 2, 129, 128], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [128, 128] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [129] } } }, "outputs": { - "outputT": { "shape": [1, 33, 256], "dtype": "float32" }, - "presentKeyT": { "shape": [1, 1, 33, 32], "dtype": "float32" }, - "presentValueT": { "shape": [1, 1, 33, 32], "dtype": "float32" } + "outputT": { "dtype": "float16", "shape": [2, 33, 512] }, + "presentKeyT": { "dtype": "float16", "shape": [2, 2, 129, 128] }, + "presentValueT": { "dtype": "float16", "shape": [2, 2, 129, 128] } }, "bench": { "metrics": [ @@ -1892,22 +3225,43 @@ } }, { - "name": "prefill-f32-h8kv1-d128-q33", - "preset": "model", - "provenance": { "notes": "Small bidirectional prefill with query tails and varying head widths." }, - "vars": { "batch": 1, "qSeq": 33, "kvSeq": 33, "heads": 8, "kvHeads": 1, "headDim": 128 }, - "attrs": { "num_heads": 8, "kv_num_heads": 1, "scale": 0.125, "causal": 0 }, + "name": "bidir-grid-b1-q32-cap129-h8-kv2-d96", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 32, "kvSeq": 129, "heads": 8, "headDim": 96 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2, "causal": 0 }, "inputs": { - "queryT": { "shape": [1, 33, 1024], "dtype": "float32", "dist": "normal", "seed": 1075, "scale": 0.2 }, - "keyT": { "shape": [1, 33, 128], "dtype": "float32", "dist": "normal", "seed": 1076, "scale": 0.2 }, - "valueT": { "shape": [1, 33, 128], "dtype": "float32", "dist": "normal", "seed": 1077, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [32] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [33] } } + "queryT": { + "dtype": "float16", + "shape": [1, 32, 768], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 32, 192], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 32, 192], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float16", + "shape": [1, 2, 129, 96], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float16", + "shape": [1, 2, 129, 96], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [129] } } }, "outputs": { - "outputT": { "shape": [1, 33, 1024], "dtype": "float32" }, - "presentKeyT": { "shape": [1, 1, 33, 128], "dtype": "float32" }, - "presentValueT": { "shape": [1, 1, 33, 128], "dtype": "float32" } + "outputT": { "dtype": "float16", "shape": [1, 32, 768] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 129, 96] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 129, 96] } }, "bench": { "metrics": [ @@ -1916,22 +3270,43 @@ } }, { - "name": "prefill-f32-h8kv1-d256-q32", - "preset": "model", - "provenance": { "notes": "Small bidirectional prefill with query tails and varying head widths." }, - "vars": { "batch": 1, "qSeq": 32, "kvSeq": 32, "heads": 8, "kvHeads": 1, "headDim": 256 }, - "attrs": { "num_heads": 8, "kv_num_heads": 1, "scale": 0.125, "causal": 0 }, + "name": "bidir-grid-b1-q33-cap129-h8-kv2-d192", + "preset": "smoke", + "vars": { "batch": 1, "qSeq": 33, "kvSeq": 129, "heads": 8, "headDim": 192 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2, "causal": 0 }, "inputs": { - "queryT": { "shape": [1, 32, 2048], "dtype": "float32", "dist": "normal", "seed": 1075, "scale": 0.2 }, - "keyT": { "shape": [1, 32, 256], "dtype": "float32", "dist": "normal", "seed": 1076, "scale": 0.2 }, - "valueT": { "shape": [1, 32, 256], "dtype": "float32", "dist": "normal", "seed": 1077, "scale": 0.2 }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [31] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [32] } } + "queryT": { + "dtype": "float16", + "shape": [1, 33, 1536], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + }, + "keyT": { + "dtype": "float16", + "shape": [1, 33, 384], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + }, + "valueT": { + "dtype": "float16", + "shape": [1, 33, 384], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + }, + "pastKeyT": { + "dtype": "float16", + "shape": [1, 2, 129, 192], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + }, + "pastValueT": { + "dtype": "float16", + "shape": [1, 2, 129, 192], + "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [129] } } }, "outputs": { - "outputT": { "shape": [1, 32, 2048], "dtype": "float32" }, - "presentKeyT": { "shape": [1, 1, 32, 256], "dtype": "float32" }, - "presentValueT": { "shape": [1, 1, 32, 256], "dtype": "float32" } + "outputT": { "dtype": "float16", "shape": [1, 33, 1536] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 129, 192] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 129, 192] } }, "bench": { "metrics": [ @@ -1940,239 +3315,432 @@ } }, { - "name": "cooperative-window-h4kv2-d122-cap256", + "name": "bidir-grid-b1-q32-cap129-h8-kv2-d256", "preset": "smoke", - "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "vars": { "batch": 1, "qSeq": 32, "kvSeq": 129, "heads": 8, "headDim": 256 }, + "attrs": { "num_heads": 8, "kv_num_heads": 2, "causal": 0 }, "inputs": { "queryT": { - "dtype": "float32", - "shape": [1, 1, 488], + "dtype": "float16", + "shape": [1, 32, 2048], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } }, "keyT": { - "dtype": "float32", - "shape": [1, 1, 244], + "dtype": "float16", + "shape": [1, 32, 512], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } }, "valueT": { - "dtype": "float32", - "shape": [1, 1, 244], + "dtype": "float16", + "shape": [1, 32, 512], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } }, "pastKeyT": { - "dtype": "float32", - "shape": [1, 2, 256, 122], + "dtype": "float16", + "shape": [1, 2, 129, 256], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } }, "pastValueT": { - "dtype": "float32", - "shape": [1, 2, 256, 122], + "dtype": "float16", + "shape": [1, 2, 129, 256], "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [128] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [129] } } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 488] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 122] }, - "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 122] } + "outputT": { "dtype": "float16", "shape": [1, 32, 2048] }, + "presentKeyT": { "dtype": "float16", "shape": [1, 2, 129, 256] }, + "presentValueT": { "dtype": "float16", "shape": [1, 2, 129, 256] } }, "bench": { "metrics": [ - { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" - } + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } ] } }, { - "name": "cooperative-window-h4kv2-d124-cap256", + "name": "share-append-qknorm-rotary-decode-16h8kv-d128-cap1024-pos730", "preset": "smoke", - "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "attrs": { "num_heads": 16, "kv_num_heads": 8, "do_rotary": 1, "qk_norm_epsilon": 0.000001 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 496], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "shape": [1, 1, 2048], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.013, "cosStep": 0.027 } }, "keyT": { "dtype": "float32", - "shape": [1, 1, 248], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.019, "cosStep": 0.011 } }, "valueT": { "dtype": "float32", - "shape": [1, 1, 248], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.023, "cosStep": 0.007 } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 2, 256, 124], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.017, "cosStep": 0.031 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 2, 256, 124], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.029, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [730] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [731] } }, + "cosCacheT": { + "dtype": "float32", + "shape": [1024, 64], + "data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.031, "cosStep": 0.007 } + }, + "sinCacheT": { + "dtype": "float32", + "shape": [1024, 64], + "data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.013, "cosStep": 0.037 } + }, + "qNormWeightT": { + "dtype": "float32", + "shape": [128], + "data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.05, "cosStep": 0.09 } + }, + "kNormWeightT": { + "dtype": "float32", + "shape": [128], + "data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.07, "cosStep": 0.03 } + } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 496] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 124] }, - "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 124] } + "outputT": { "dtype": "float32", "shape": [1, 1, 2048] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.pastKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } }, { - "name": "cooperative-window-h4kv2-d246-cap256", - "preset": "smoke", - "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "name": "share-append-qknorm-rotary-prefill-16h8kv-d128-q512-cap1024-pos767", + "preset": "all", + "attrs": { "num_heads": 16, "kv_num_heads": 8, "do_rotary": 1, "qk_norm_epsilon": 0.000001 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 984], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "shape": [1, 512, 2048], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.013, "cosStep": 0.027 } }, "keyT": { "dtype": "float32", - "shape": [1, 1, 492], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.019, "cosStep": 0.011 } }, "valueT": { "dtype": "float32", - "shape": [1, 1, 492], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + "shape": [1, 512, 1024], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.023, "cosStep": 0.007 } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 2, 256, 246], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.017, "cosStep": 0.031 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 2, 256, 246], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "shape": [1, 8, 1024, 128], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.029, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [767] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [768] } }, + "cosCacheT": { + "dtype": "float32", + "shape": [1024, 64], + "data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.031, "cosStep": 0.007 } + }, + "sinCacheT": { + "dtype": "float32", + "shape": [1024, 64], + "data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.013, "cosStep": 0.037 } + }, + "qNormWeightT": { + "dtype": "float32", + "shape": [128], + "data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.05, "cosStep": 0.09 } + }, + "kNormWeightT": { + "dtype": "float32", + "shape": [128], + "data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.07, "cosStep": 0.03 } + } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 984] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 246] }, - "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 246] } + "outputT": { "dtype": "float32", "shape": [1, 512, 2048] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 1024, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 1024, 128] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.pastKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } }, { - "name": "cooperative-window-h4kv2-d248-cap256", + "name": "share-append-qknorm-rotary-prefill-16h8kv-d128-q16-cap256-pos14", "preset": "smoke", - "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "attrs": { "num_heads": 16, "kv_num_heads": 8, "do_rotary": 1, "qk_norm_epsilon": 0.000001 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 992], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "shape": [1, 16, 2048], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.013, "cosStep": 0.027 } }, "keyT": { "dtype": "float32", - "shape": [1, 1, 496], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + "shape": [1, 16, 1024], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.019, "cosStep": 0.011 } }, "valueT": { "dtype": "float32", - "shape": [1, 1, 496], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + "shape": [1, 16, 1024], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.023, "cosStep": 0.007 } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 2, 256, 248], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 8, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.017, "cosStep": 0.031 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 2, 256, 248], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "shape": [1, 8, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.029, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [29] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [30] } }, + "cosCacheT": { + "dtype": "float32", + "shape": [256, 64], + "data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.031, "cosStep": 0.007 } + }, + "sinCacheT": { + "dtype": "float32", + "shape": [256, 64], + "data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.013, "cosStep": 0.037 } + }, + "qNormWeightT": { + "dtype": "float32", + "shape": [128], + "data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.05, "cosStep": 0.09 } + }, + "kNormWeightT": { + "dtype": "float32", + "shape": [128], + "data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.07, "cosStep": 0.03 } + } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 992] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 248] }, - "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 248] } + "outputT": { "dtype": "float32", "shape": [1, 16, 2048] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 256, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 256, 128] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.pastKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } }, { - "name": "cooperative-window-h4kv2-d256-cap256", + "name": "share-append-qknorm-rotary-decode-16h8kv-d128-cap256-pos30", "preset": "smoke", - "attrs": { "num_heads": 4, "kv_num_heads": 2, "sliding_window_cache": 1, "local_window_size": 256 }, + "attrs": { "num_heads": 16, "kv_num_heads": 8, "do_rotary": 1, "qk_norm_epsilon": 0.000001 }, "inputs": { "queryT": { "dtype": "float32", - "shape": [1, 1, 1024], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.011, "cosStep": 0.029 } + "shape": [1, 1, 2048], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.013, "cosStep": 0.027 } }, "keyT": { "dtype": "float32", - "shape": [1, 1, 512], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.031, "cosStep": 0.007 } + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.019, "cosStep": 0.011 } }, "valueT": { "dtype": "float32", - "shape": [1, 1, 512], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.037, "cosStep": 0.005 } + "shape": [1, 1, 1024], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.023, "cosStep": 0.007 } }, "pastKeyT": { "dtype": "float32", - "shape": [1, 2, 256, 256], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.017, "cosStep": 0.019 } + "shape": [1, 8, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.017, "cosStep": 0.031 } }, "pastValueT": { "dtype": "float32", - "shape": [1, 2, 256, 256], - "data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.023, "cosStep": 0.013 } + "shape": [1, 8, 256, 128], + "data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.029, "cosStep": 0.013 } }, - "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65535] } }, - "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [65536] } } + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [30] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [31] } }, + "cosCacheT": { + "dtype": "float32", + "shape": [256, 64], + "data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.031, "cosStep": 0.007 } + }, + "sinCacheT": { + "dtype": "float32", + "shape": [256, 64], + "data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.013, "cosStep": 0.037 } + }, + "qNormWeightT": { + "dtype": "float32", + "shape": [128], + "data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.05, "cosStep": 0.09 } + }, + "kNormWeightT": { + "dtype": "float32", + "shape": [128], + "data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.07, "cosStep": 0.03 } + } }, "outputs": { - "outputT": { "dtype": "float32", "shape": [1, 1, 1024] }, - "presentKeyT": { "dtype": "float32", "shape": [1, 2, 256, 256] }, - "presentValueT": { "dtype": "float32", "shape": [1, 2, 256, 256] } + "outputT": { "dtype": "float32", "shape": [1, 1, 2048] }, + "presentKeyT": { "dtype": "float32", "shape": [1, 8, 256, 128] }, + "presentValueT": { "dtype": "float32", "shape": [1, 8, 256, 128] } }, "bench": { "metrics": [ { - "type": "bandwidth", - "value": "2 * 2 * numel(shapes.pastKeyT) * 4 + numel(shapes.queryT) * 4 + numel(shapes.outputT) * 4" + "type": "gflops", + "value": "4 * dim(shapes.queryT, 1) * dim(shapes.pastKeyT, 2) * (dim(shapes.queryT, 2) / attrs.num_heads) * attrs.num_heads" } ] } + }, + { + "name": "direct-f16-prefill-h16kv4-d64-q256-k256", + "preset": "model", + "vars": { "batch": 1, "qSeq": 256, "kvSeq": 256, "heads": 16, "kvHeads": 4, "headDim": 64 }, + "attrs": { "num_heads": 16, "kv_num_heads": 4, "scale": 0.125, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 256, 1024], "dtype": "float16", "dist": "normal", "seed": 370, "scale": 0.2 }, + "keyT": { "shape": [1, 256, 256], "dtype": "float16", "dist": "normal", "seed": 371, "scale": 0.2 }, + "valueT": { "shape": [1, 256, 256], "dtype": "float16", "dist": "normal", "seed": 372, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [255] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [256] } } + }, + "outputs": { + "outputT": { "shape": [1, 256, 1024], "dtype": "float16" }, + "presentKeyT": { "shape": [1, 4, 256, 64], "dtype": "float16" }, + "presentValueT": { "shape": [1, 4, 256, 64], "dtype": "float16" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "direct-f16-prefill-h16kv4-d96-q256-k384", + "preset": "model", + "vars": { "batch": 1, "qSeq": 256, "kvSeq": 384, "heads": 16, "kvHeads": 4, "headDim": 96 }, + "attrs": { "num_heads": 16, "kv_num_heads": 4, "scale": 0.10206207261596577, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 256, 1536], "dtype": "float16", "dist": "normal", "seed": 370, "scale": 0.2 }, + "keyT": { "shape": [1, 384, 384], "dtype": "float16", "dist": "normal", "seed": 371, "scale": 0.2 }, + "valueT": { "shape": [1, 384, 384], "dtype": "float16", "dist": "normal", "seed": 372, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [383] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [384] } } + }, + "outputs": { + "outputT": { "shape": [1, 256, 1536], "dtype": "float16" }, + "presentKeyT": { "shape": [1, 4, 384, 96], "dtype": "float16" }, + "presentValueT": { "shape": [1, 4, 384, 96], "dtype": "float16" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "direct-f16-prefill-h16kv4-d128-q512-k768", + "preset": "model", + "vars": { "batch": 1, "qSeq": 512, "kvSeq": 768, "heads": 16, "kvHeads": 4, "headDim": 128 }, + "attrs": { "num_heads": 16, "kv_num_heads": 4, "scale": 0.08838834764831843, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 512, 2048], "dtype": "float16", "dist": "normal", "seed": 370, "scale": 0.2 }, + "keyT": { "shape": [1, 768, 512], "dtype": "float16", "dist": "normal", "seed": 371, "scale": 0.2 }, + "valueT": { "shape": [1, 768, 512], "dtype": "float16", "dist": "normal", "seed": 372, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [767] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [768] } } + }, + "outputs": { + "outputT": { "shape": [1, 512, 2048], "dtype": "float16" }, + "presentKeyT": { "shape": [1, 4, 768, 128], "dtype": "float16" }, + "presentValueT": { "shape": [1, 4, 768, 128], "dtype": "float16" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "direct-f16-prefill-h4kv2-d128-q96-k256", + "preset": "model", + "vars": { "batch": 1, "qSeq": 96, "kvSeq": 256, "heads": 4, "kvHeads": 2, "headDim": 128 }, + "attrs": { "num_heads": 4, "kv_num_heads": 2, "scale": 0.08838834764831843, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 96, 512], "dtype": "float16", "dist": "normal", "seed": 370, "scale": 0.2 }, + "keyT": { "shape": [1, 256, 256], "dtype": "float16", "dist": "normal", "seed": 371, "scale": 0.2 }, + "valueT": { "shape": [1, 256, 256], "dtype": "float16", "dist": "normal", "seed": 372, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [255] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [256] } } + }, + "outputs": { + "outputT": { "shape": [1, 96, 512], "dtype": "float16" }, + "presentKeyT": { "shape": [1, 2, 256, 128], "dtype": "float16" }, + "presentValueT": { "shape": [1, 2, 256, 128], "dtype": "float16" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } + }, + { + "name": "direct-f16-prefill-h16kv4-d64-q256-k255", + "preset": "model", + "vars": { "batch": 1, "qSeq": 256, "kvSeq": 255, "heads": 16, "kvHeads": 4, "headDim": 64 }, + "attrs": { "num_heads": 16, "kv_num_heads": 4, "scale": 0.125, "causal": 0 }, + "inputs": { + "queryT": { "shape": [1, 256, 1024], "dtype": "float16", "dist": "normal", "seed": 370, "scale": 0.2 }, + "keyT": { "shape": [1, 255, 256], "dtype": "float16", "dist": "normal", "seed": 371, "scale": 0.2 }, + "valueT": { "shape": [1, 255, 256], "dtype": "float16", "dist": "normal", "seed": 372, "scale": 0.2 }, + "seqlensKT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [254] } }, + "totalSequenceLengthT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [255] } } + }, + "outputs": { + "outputT": { "shape": [1, 256, 1024], "dtype": "float16" }, + "presentKeyT": { "shape": [1, 4, 255, 64], "dtype": "float16" }, + "presentValueT": { "shape": [1, 4, 255, 64], "dtype": "float16" } + }, + "bench": { + "metrics": [ + { "type": "gflops", "value": "4 * args.batch * args.qSeq * args.kvSeq * args.heads * args.headDim" } + ] + } } ] }