Xenova's picture
Xenova HF Staff
sync 91d990483a17
59216c2 verified
Raw
History Blame
134 kB
{
"cases": [
{
"name": "linear_zero_state",
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.7, "chunk_size": 17 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 6], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 2, 3], "tolerance": 0.0001 }
}
},
{
"name": "ort_linear_rule_single_token",
"provenance": {
"source": "onnxruntime/test/contrib_ops/linear_attention_op_test.cc",
"test": "ContribOpLinearAttentionTest.LinearRule_SingleToken"
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1, 4],
"data": { "kind": "values", "values": [1.0, 0.0, 0.5, -0.5] }
},
"keyT": { "dtype": "float32", "shape": [1, 1, 4], "data": { "kind": "values", "values": [0.5, 0.5, 0.0, 1.0] } },
"valueT": {
"dtype": "float32",
"shape": [1, 1, 4],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "ort_linear_rule_multi_token",
"provenance": {
"source": "onnxruntime/test/contrib_ops/linear_attention_op_test.cc",
"test": "ContribOpLinearAttentionTest.LinearRule_MultiToken"
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [1.0, 0.0, 0.5, -0.5, 0.5, 1.0, -0.5, 0.0, 0.0, -1.0, 1.0, 0.5] }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [0.5, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 0.5, -0.5, 1.0, 0.5, 0.0] }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 2.0, 1.0, 0.0, 3.0, 3.0, 0.0, 1.0, 2.0] }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "ort_linear_rule_with_initial_state",
"provenance": {
"source": "onnxruntime/test/contrib_ops/linear_attention_op_test.cc",
"test": "ContribOpLinearAttentionTest.LinearRule_WithInitialState"
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "values", "values": [1.0, 0.0, 0.5, -0.5, 0.5, 1.0, -0.5, 0.0] }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "values", "values": [0.5, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 0.5] }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 2.0, 1.0, 0.0, 3.0] }
},
"pastStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "constant", "value": 0.1 } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "ort_gated_rule_single_token",
"provenance": {
"source": "onnxruntime/test/contrib_ops/linear_attention_op_test.cc",
"test": "ContribOpLinearAttentionTest.GatedRule_SingleToken"
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1, 4],
"data": { "kind": "values", "values": [1.0, 0.0, 0.5, -0.5] }
},
"keyT": { "dtype": "float32", "shape": [1, 1, 4], "data": { "kind": "values", "values": [0.5, 0.5, 0.0, 1.0] } },
"valueT": {
"dtype": "float32",
"shape": [1, 1, 4],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] }
},
"pastStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "constant", "value": 1.0 } },
"decayT": {
"dtype": "float32",
"shape": [1, 1, 4],
"data": { "kind": "values", "values": [-0.1, -0.2, -0.05, -0.15] }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "ort_delta_rule_multi_token",
"provenance": {
"source": "onnxruntime/test/contrib_ops/linear_attention_op_test.cc",
"test": "ContribOpLinearAttentionTest.DeltaRule_MultiToken"
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "delta", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [1.0, 0.0, 0.5, -0.5, 0.5, 1.0, -0.5, 0.0, 0.0, -1.0, 1.0, 0.5] }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [0.5, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 0.5, -0.5, 1.0, 0.5, 0.0] }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 2.0, 1.0, 0.0, 3.0, 3.0, 0.0, 1.0, 2.0] }
},
"betaT": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.8, 0.6, 0.9] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "ort_gated_rule_broadcast_decay",
"provenance": {
"source": "onnxruntime/test/contrib_ops/linear_attention_op_test.cc",
"test": "ContribOpLinearAttentionTest.GatedRule_BroadcastDecay"
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [1.0, 0.0, 0.5, -0.5, 0.5, 1.0, -0.5, 0.0, 0.0, -1.0, 1.0, 0.5] }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [0.5, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 0.5, -0.5, 1.0, 0.5, 0.0] }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 2.0, 1.0, 0.0, 3.0, 3.0, 0.0, 1.0, 2.0] }
},
"pastStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "constant", "value": 0.5 } },
"decayT": {
"dtype": "float32",
"shape": [1, 3, 1],
"data": { "kind": "values", "values": [-0.1, -0.2, -0.05] }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "linear_batch2_mqa_head_dim1",
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 2, 2],
"data": { "kind": "values", "values": [1.0, 0.5, -1.0, 2.0, 0.25, -0.75, 1.5, -0.5] }
},
"keyT": {
"dtype": "float32",
"shape": [2, 2, 1],
"data": { "kind": "values", "values": [1.0, 2.0, -1.0, 0.5] }
},
"valueT": {
"dtype": "float32",
"shape": [2, 2, 2],
"data": { "kind": "values", "values": [3.0, -3.0, 4.0, -4.0, 5.0, 6.0, -7.0, 8.0] }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 2, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 2], "tolerance": 0.0001 }
}
},
{
"name": "ort_linear_rule_default_scale",
"provenance": {
"source": "onnxruntime/test/contrib_ops/linear_attention_op_test.cc",
"test": "ContribOpLinearAttentionTest.LinearRule_DefaultScale"
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear" },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1, 4],
"data": { "kind": "values", "values": [1.0, 0.0, 0.5, -0.5] }
},
"keyT": { "dtype": "float32", "shape": [1, 1, 4], "data": { "kind": "values", "values": [0.5, 0.5, 0.0, 1.0] } },
"valueT": {
"dtype": "float32",
"shape": [1, 1, 4],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "ort_linear_rule_multi_batch_multi_head",
"provenance": {
"source": "onnxruntime/test/contrib_ops/linear_attention_op_test.cc",
"test": "ContribOpLinearAttentionTest.LinearRule_MultiBatchMultiHead"
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 2, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 2, 8],
"data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.3, "cosStep": 0.0 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 2, 8],
"data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.0, "cosStep": 0.5 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 2, 8],
"data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.7, "cosStep": 0.13 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 2, 8], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 2, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "gated_delta_scalar_gqa_headdim6_dv_tiled",
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta" },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 5, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.21, "cosStep": 0.33 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 5, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.27 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 5, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.09, "cosStep": 0.43 }
},
"pastStateT": {
"dtype": "float32",
"shape": [2, 2, 6, 10],
"data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.19, "cosStep": 0.37 }
},
"decayT": {
"dtype": "float32",
"shape": [2, 5, 2],
"data": { "kind": "fillFloat32", "scale": 0.15, "offset": -0.2, "sinStep": 0.29, "cosStep": 0.53 }
},
"betaT": {
"dtype": "float32",
"shape": [2, 5, 2],
"data": { "kind": "fillFloat32", "scale": 0.25, "offset": 0.5, "sinStep": 0.37, "cosStep": 0.19 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 5, 40] },
"presentStateT": { "dtype": "float32", "shape": [2, 2, 6, 10] }
}
},
{
"name": "gated_delta_scalar_headdim6_seq128_state",
"provenance": {
"notes": "A compact multi-token gated-delta recurrence uses four query/KV heads, non-four-wide key head size 6, past state, and per-head decay and beta."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 4, "update_rule": "gated_delta", "scale": 0.25 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 128, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.021, "cosStep": 0.033, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 128, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 128, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.043, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 4, 6, 12],
"data": { "kind": "fillFloat32", "scale": 0.02, "sinStep": 0.019, "cosStep": 0.037 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 128, 4],
"data": { "kind": "fillFloat32", "scale": 0.08, "offset": -0.2, "sinStep": 0.029, "cosStep": 0.053 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 128, 4],
"data": { "kind": "fillFloat32", "scale": 0.08, "offset": 0.5, "sinStep": 0.037, "cosStep": 0.019 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 128, 48], "tolerance": 0.00005, "relTolerance": 0.00005 },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 6, 12], "tolerance": 0.00005, "relTolerance": 0.00005 }
}
},
{
"name": "gated_delta_headdim6_seq128_offset_value_scale_lock",
"provenance": {
"notes": "Long-recurrence scale lock at headDimK=6, the non-vec4 width served by the serial-small and scalar gated-delta routes. Scaling the key to |k|^2 about 0.7 and offsetting V to 1.0 makes the 128-step recurrence materially update and converge. Missing or duplicated decay, incorrect beta, and uniform output scaling therefore produce clear output errors."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 4, "update_rule": "gated_delta", "scale": 0.25 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 128, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.021, "cosStep": 0.033, "scale": 1.0 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 128, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 128, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.043, "scale": 0.3, "offset": 1.0 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 4, 6, 12],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.019, "cosStep": 0.037 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 128, 4],
"data": { "kind": "fillFloat32", "scale": 0.08, "offset": -0.2, "sinStep": 0.029, "cosStep": 0.053 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 128, 4],
"data": { "kind": "fillFloat32", "scale": 0.08, "offset": 0.5, "sinStep": 0.037, "cosStep": 0.019 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 128, 48], "tolerance": 0.001, "relTolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 6, 12], "tolerance": 0.001, "relTolerance": 0.001 }
}
},
{
"name": "gated_delta_scalar_elementwise_decay_shared_key_head",
"attrs": { "q_num_heads": 2, "kv_num_heads": 2, "update_rule": "gated_delta", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 4, 10],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 4, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.17 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 4, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.47 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 2, 5, 4],
"data": { "kind": "fillFloat32", "scale": 0.25, "sinStep": 0.27, "cosStep": 0.13 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 4, 10],
"data": { "kind": "fillFloat32", "scale": 0.15, "offset": -0.25, "sinStep": 0.43, "cosStep": 0.61 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 4, 1],
"data": { "kind": "fillFloat32", "scale": 0.2, "offset": 0.45, "sinStep": 0.53, "cosStep": 0.29 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 4, 8] },
"presentStateT": { "dtype": "float32", "shape": [1, 2, 5, 4] }
}
},
{
"name": "gated_delta_vec4_gqa_headdim12_dv_tiled",
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta" },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 6, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.29 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 6, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.15, "cosStep": 0.39 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 6, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.51 }
},
"pastStateT": {
"dtype": "float32",
"shape": [2, 2, 12, 12],
"data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.33, "cosStep": 0.21 }
},
"decayT": {
"dtype": "float32",
"shape": [2, 6, 2],
"data": { "kind": "fillFloat32", "scale": 0.15, "offset": -0.2, "sinStep": 0.47, "cosStep": 0.31 }
},
"betaT": {
"dtype": "float32",
"shape": [2, 6, 2],
"data": { "kind": "fillFloat32", "scale": 0.25, "offset": 0.5, "sinStep": 0.41, "cosStep": 0.23 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 6, 48] },
"presentStateT": { "dtype": "float32", "shape": [2, 2, 12, 12] }
}
},
{
"name": "gated_delta_vec4_elementwise_decay_beta_dim1",
"attrs": { "q_num_heads": 3, "kv_num_heads": 1, "update_rule": "gated_delta", "scale": 0.4 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 5, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.25, "cosStep": 0.37 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 5, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.49 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 5, 9],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.57 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 1, 8, 9],
"data": { "kind": "fillFloat32", "scale": 0.25, "sinStep": 0.21, "cosStep": 0.43 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 5, 8],
"data": { "kind": "fillFloat32", "scale": 0.15, "offset": -0.25, "sinStep": 0.59, "cosStep": 0.27 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 5, 1],
"data": { "kind": "fillFloat32", "scale": 0.2, "offset": 0.5, "sinStep": 0.61, "cosStep": 0.33 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 5, 27] },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 8, 9] }
}
},
{
"name": "linear_zero_scalar_f16_seq128",
"provenance": {
"notes": "Float16 query and state select the scalar linear-rule implementation over a model-shaped 128-token zero-state recurrence."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "scale": 0.25 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 128, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.012, "cosStep": 0.023, "scale": 0.03 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 128, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.014, "cosStep": 0.019, "scale": 0.03 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 128, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.008, "cosStep": 0.017, "scale": 0.03 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 128, 64], "tolerance": 0.00004, "relTolerance": 0.002 },
"presentStateT": { "dtype": "float16", "shape": [1, 2, 16, 16], "tolerance": 0.00004, "relTolerance": 0.002 }
}
},
{
"name": "linear_zero_f16_seq128_offset_value_scale_lock",
"provenance": {
"notes": "A 128-token float16 recurrence omits past state but does not produce zero output. Positive-offset keys and values around 0.5 keep output and present state at order-one magnitude, making multiplicative errors observable on the serial, scalar, and vec4 zero-state routes."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "scale": 0.25 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 128, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.012, "cosStep": 0.023, "scale": 0.2 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 128, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.014, "cosStep": 0.019, "scale": 0.15, "offset": 0.02 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 128, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.008, "cosStep": 0.017, "scale": 0.2, "offset": 0.5 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 128, 64], "tolerance": 0.01, "relTolerance": 0.01 },
"presentStateT": { "dtype": "float16", "shape": [1, 2, 16, 16], "tolerance": 0.01, "relTolerance": 0.01 }
}
},
{
"name": "linear_state_scalar_f16_seq128",
"provenance": {
"notes": "A compact float16 recurrence selects the serial small-key-dimension route and verifies that its supplied initial state is incorporated."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "scale": 0.25 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 128, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.021, "scale": 0.03 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 128, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.015, "cosStep": 0.018, "scale": 0.03 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 128, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.016, "scale": 0.03 }
},
"pastStateT": {
"dtype": "float16",
"shape": [1, 2, 16, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.011, "scale": 0.01 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 128, 64], "tolerance": 0.0002, "relTolerance": 0.004 },
"presentStateT": { "dtype": "float16", "shape": [1, 2, 16, 16], "tolerance": 0.0002, "relTolerance": 0.004 }
}
},
{
"name": "linear_state_f16_seq128_offset_value_scale_lock",
"provenance": {
"notes": "A supplied past state at amplitude 0.3, positive-offset keys, and values around 0.5 keep both outputs at order-one magnitude. Dropping the initial state or uniformly rescaling either output therefore exceeds tolerance."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "scale": 0.25 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 128, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.021, "scale": 0.2 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 128, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.015, "cosStep": 0.018, "scale": 0.15, "offset": 0.02 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 128, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.016, "scale": 0.2, "offset": 0.5 }
},
"pastStateT": {
"dtype": "float16",
"shape": [1, 2, 16, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.011, "scale": 0.3 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 128, 64], "tolerance": 0.01, "relTolerance": 0.01 },
"presentStateT": { "dtype": "float16", "shape": [1, 2, 16, 16], "tolerance": 0.01, "relTolerance": 0.01 }
}
},
{
"name": "empty_zero_dim",
"provenance": {
"notes": "Zero-length batch axis of query/key/value (empty input). head/packed dims stay normal; output=[0,seq,qHeads*vHeadDim] and present_state=[0,kvHeads,headDimK,vHeadDim] => both EMPTY. linear rule, no past state."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.7 },
"inputs": {
"queryT": { "dtype": "float32", "shape": [0, 3, 4], "data": { "kind": "values", "values": [] } },
"keyT": { "dtype": "float32", "shape": [0, 3, 2], "data": { "kind": "values", "values": [] } },
"valueT": { "dtype": "float32", "shape": [0, 3, 3], "data": { "kind": "values", "values": [] } }
},
"outputs": {
"outputT": {
"dtype": "float32",
"shape": [0, 3, 6],
"tolerance": 0,
"data": { "kind": "values", "values": [] }
},
"presentStateT": {
"dtype": "float32",
"shape": [0, 1, 2, 3],
"tolerance": 0,
"data": { "kind": "values", "values": [] }
}
}
},
{
"name": "empty_zero_dim_f16",
"provenance": {
"notes": "Zero-length batch axis of query/key/value (empty input). head/packed dims stay normal; output=[0,seq,qHeads*vHeadDim] and present_state=[0,kvHeads,headDimK,vHeadDim] => both EMPTY. linear rule, no past state. f16 variant."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.7 },
"inputs": {
"queryT": { "dtype": "float16", "shape": [0, 3, 4], "data": { "kind": "values", "values": [] } },
"keyT": { "dtype": "float16", "shape": [0, 3, 2], "data": { "kind": "values", "values": [] } },
"valueT": { "dtype": "float16", "shape": [0, 3, 3], "data": { "kind": "values", "values": [] } }
},
"outputs": {
"outputT": {
"dtype": "float16",
"shape": [0, 3, 6],
"tolerance": 0,
"data": { "kind": "values", "values": [] }
},
"presentStateT": {
"dtype": "float16",
"shape": [0, 1, 2, 3],
"tolerance": 0,
"data": { "kind": "values", "values": [] }
}
}
},
{
"name": "linear_state_zero_seqlen_present_equals_past",
"provenance": {
"notes": "T=0 (zero-length seq axis) with a past_state. outputT=[1,0,8] is EMPTY but presentStateT=[1,1,4,4] is NON-empty, so allOutputsEmpty does NOT short-circuit and the kernel runs with seqLength==0: the recurrence loop runs zero times, so present_state must equal past_state bit-for-bit. linear rule, headDimK=4 (%4==0). Distinct from empty_zero_dim which zeros the batch axis."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": { "dtype": "float32", "shape": [1, 0, 8], "data": { "kind": "values", "values": [] } },
"keyT": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } },
"valueT": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } },
"pastStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "constant", "value": 0.1 } }
},
"outputs": {
"outputT": {
"dtype": "float32",
"shape": [1, 0, 8],
"tolerance": 0,
"data": { "kind": "values", "values": [] }
},
"presentStateT": {
"dtype": "float32",
"shape": [1, 1, 4, 4],
"tolerance": 0,
"data": { "kind": "constant", "value": 0.1 }
}
}
},
{
"name": "linear_zero_zero_seqlen_present_all_zeros",
"provenance": {
"notes": "T=0 (zero-length seq axis), no past_state. outputT=[1,0,8] EMPTY, presentStateT=[1,1,4,4] NON-empty must be all zeros (state zero-initialized, zero-trip recurrence). linear rule, headDimK=4 (%4==0). Exercises zero-init path with a live kernel dispatch."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": { "dtype": "float32", "shape": [1, 0, 8], "data": { "kind": "values", "values": [] } },
"keyT": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } },
"valueT": { "dtype": "float32", "shape": [1, 0, 4], "data": { "kind": "values", "values": [] } }
},
"outputs": {
"outputT": {
"dtype": "float32",
"shape": [1, 0, 8],
"tolerance": 0,
"data": { "kind": "values", "values": [] }
},
"presentStateT": {
"dtype": "float32",
"shape": [1, 1, 4, 4],
"tolerance": 0,
"data": { "kind": "constant", "value": 0.0 }
}
}
},
{
"name": "gated_delta_scalar_headdimk_gt_128_partial_dv_tile",
"provenance": {
"notes": "headDimK=130 (not %4 -> scalar variant; >128 so WG=256 with 130 active lanes -> tid<head_dim_k lane masking in tree reduce). headDimV=10, TILE_V=4 -> dv_tiles=3 with a partial last tile (2/4 valid) exercising dv_start+j<head_dim_v guards on output AND present_state. gated_delta rule, per-head decay + per-head beta."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "gated_delta", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 4, 260],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.017, "cosStep": 0.023 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 4, 130],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.013, "cosStep": 0.029 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 4, 10],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.09, "cosStep": 0.43 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 1, 130, 10],
"data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.019, "cosStep": 0.037 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 4, 1],
"data": { "kind": "fillFloat32", "scale": 0.15, "offset": -0.2, "sinStep": 0.29, "cosStep": 0.53 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 4, 1],
"data": { "kind": "fillFloat32", "scale": 0.25, "offset": 0.5, "sinStep": 0.37, "cosStep": 0.19 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 4, 20], "tolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 130, 10], "tolerance": 0.0005 }
}
},
{
"name": "gated_delta_default_rule_no_updateRule_arg",
"provenance": {
"notes": "Omitting `updateRule` selects the schema-default gated-delta recurrence with decay, beta, and past state. Key head size 4 exercises the vec4 route."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.25, "cosStep": 0.37 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.49 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.57 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 1, 4, 4],
"data": { "kind": "fillFloat32", "scale": 0.25, "sinStep": 0.21, "cosStep": 0.43 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 3, 1],
"data": { "kind": "fillFloat32", "scale": 0.15, "offset": -0.25, "sinStep": 0.59, "cosStep": 0.27 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 3, 1],
"data": { "kind": "fillFloat32", "scale": 0.2, "offset": 0.5, "sinStep": 0.61, "cosStep": 0.33 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 8], "tolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0005 }
}
},
{
"name": "gated_delta_f32_dk128_dv128_compact",
"provenance": {
"notes": "A compact gated-delta case preserves Bonsai's 128-wide key/value heads, four query heads, two KV heads, shared GQA state, and the float32 vec4 path."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta", "scale": 0.08838834764831845 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 512],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.03 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.03 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.043, "scale": 0.03 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 2, 128, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.037, "scale": 0.01 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.029, "cosStep": 0.053, "scale": 0.08, "offset": -0.2 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.037, "cosStep": 0.019, "scale": 0.08, "offset": 0.5 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 512], "tolerance": 0.000005, "relTolerance": 0.0005 },
"presentStateT": {
"dtype": "float32",
"shape": [1, 2, 128, 128],
"tolerance": 0.000005,
"relTolerance": 0.0005
}
}
},
{
"name": "gated_delta_f32_dk128_dv128_offset_value_scale_lock",
"provenance": {
"notes": "Scale lock for the f32 dK=dV=128 gated-delta route. Scaling the key to |k|^2 about 0.7 makes the delta correction material, while V around 1.0 and an O(1) query keep outputT well-conditioned. This makes a missing or duplicated decay, incorrect beta, or uniform output scaling observable on outputT rather than relying only on presentStateT."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta", "scale": 0.08838834764831845 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 512],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 1.0 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.1 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.043, "scale": 0.3, "offset": 1.0 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 2, 128, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.037, "scale": 0.3 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.029, "cosStep": 0.053, "scale": 0.08, "offset": -0.2 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.037, "cosStep": 0.019, "scale": 0.08, "offset": 0.5 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 512], "tolerance": 0.001, "relTolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [1, 2, 128, 128], "tolerance": 0.001, "relTolerance": 0.001 }
}
},
{
"name": "gated_delta_f16_dk128_dv128_compact",
"provenance": {
"notes": "Float16 tensors with 128-wide key/value heads exercise the scalar gated-delta route at a compact sequence length."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta", "scale": 0.08838834764831845 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 2, 512],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.03 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.03 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.043, "scale": 0.03 }
},
"pastStateT": {
"dtype": "float16",
"shape": [1, 2, 128, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.037, "scale": 0.01 }
},
"decayT": {
"dtype": "float16",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.029, "cosStep": 0.053, "scale": 0.08, "offset": -0.2 }
},
"betaT": {
"dtype": "float16",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.037, "cosStep": 0.019, "scale": 0.08, "offset": 0.5 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 2, 512], "tolerance": 0.000015, "relTolerance": 0.003 },
"presentStateT": { "dtype": "float16", "shape": [1, 2, 128, 128], "tolerance": 0.0002, "relTolerance": 0.003 }
}
},
{
"name": "gated_delta_f16_dk128_dv128_offset_value_scale_lock",
"provenance": {
"notes": "Float16 dK=dV=128 gated-delta scale lock covering both vec4 and scalar state routes. Scaling the key to |k|^2 about 0.7 makes the delta correction material, while V around 1.0 and an O(1) query keep outputs well-conditioned. Missing or duplicated decay, incorrect beta, and uniform output scaling therefore exceed tolerance on both output and state."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta", "scale": 0.08838834764831845 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 2, 512],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 1.0 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 0.1 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.043, "scale": 0.3, "offset": 1.0 }
},
"pastStateT": {
"dtype": "float16",
"shape": [1, 2, 128, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.037, "scale": 0.3 }
},
"decayT": {
"dtype": "float16",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.029, "cosStep": 0.053, "scale": 0.08, "offset": -0.2 }
},
"betaT": {
"dtype": "float16",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.037, "cosStep": 0.019, "scale": 0.08, "offset": 0.5 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 2, 512], "tolerance": 0.01, "relTolerance": 0.01 },
"presentStateT": { "dtype": "float16", "shape": [1, 2, 128, 128], "tolerance": 0.01, "relTolerance": 0.01 }
}
},
{
"name": "linear_zero_vec4_dk256_wg_gt_subgroup",
"provenance": {
"source": "onnxruntime/contrib_ops/webgpu/bert/linear_attention.wgsl.template",
"test": "two-level subgroup reduction (PR #28412)",
"notes": "The dk reduction must span the whole workgroup. head_dim_k/4 lanes exceed the subgroup size here, so a bare subgroupAdd only sums one subgroup's partial dot products."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear" },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.29 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.15, "cosStep": 0.39 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.51 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 8], "tolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 256, 8], "tolerance": 0.001 }
}
},
{
"name": "gated_delta_vec4_dk132_wg_gt_subgroup",
"provenance": {
"source": "onnxruntime/contrib_ops/webgpu/bert/linear_attention.wgsl.template",
"test": "two-level subgroup reduction (PR #28412)",
"notes": "The dk reduction must span the whole workgroup. head_dim_k/4 lanes exceed the subgroup size here, so a bare subgroupAdd only sums one subgroup's partial dot products."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "gated_delta" },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 264],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.29 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 132],
"data": { "kind": "fillFloat32", "sinStep": 0.15, "cosStep": 0.39 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.51 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 1, 132, 6],
"data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.33, "cosStep": 0.21 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 3, 1],
"data": { "kind": "fillFloat32", "scale": 0.15, "offset": -0.2, "sinStep": 0.47, "cosStep": 0.31 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 3, 1],
"data": { "kind": "fillFloat32", "scale": 0.3, "offset": 0.4, "sinStep": 0.23, "cosStep": 0.17 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 12], "tolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 132, 6], "tolerance": 0.001 }
}
},
{
"name": "linear_zero_vec4_dk2048_wide_workgroup",
"requires": { "limits": { "maxComputeInvocationsPerWorkgroup": 512, "maxComputeWorkgroupSizeX": 512 } },
"provenance": {
"source": "onnxruntime/contrib_ops/webgpu/bert/linear_attention.cc",
"test": "head-size-driven workgroup sizing",
"notes": "One vec4 lane handles four key rows, so key head size 2048 requires a 512-invocation workgroup and declares that adapter limit. Positive query/key cycles of coprime lengths 5 and 6 avoid cancellation while ensuring every four-wide lane sees every value."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear" },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1, 2048],
"data": { "kind": "cycle", "values": [0.25, 0.5, 0.75, 1.0, 0.375] }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1, 2048],
"data": { "kind": "cycle", "values": [0.5, 0.25, 1.0, 0.125, 0.75, 0.625] }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.51 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1, 2], "tolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 2048, 2], "tolerance": 0.001 }
}
},
{
"name": "linear_zero_scalar_dk17_above_serial_cap_unaligned",
"provenance": {
"notes": "headDimK=17 is above serialHeadDimFits (dk<=16) and not %4, so neither linear_zero_serial_small_dk nor linear_zero_vec4 is eligible and the scalar zero-state kernel must run. WG=pow2ceil(17)=32 with 17 active lanes exercises the masked dk reduction; TILE_V=2 covers head_dim_v in one tile."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 17],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.29 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 17],
"data": { "kind": "fillFloat32", "sinStep": 0.15, "cosStep": 0.39 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.51 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 17, 2], "tolerance": 0.001 }
}
},
{
"name": "linear_state_scalar_dk17_above_serial_cap_unaligned",
"provenance": {
"notes": "Key head size 17 exceeds the serial limit and is not divisible by four, selecting the scalar recurrence with a supplied past state."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 17],
"data": { "kind": "fillFloat32", "sinStep": 0.21, "cosStep": 0.33 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 17],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.27 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.09, "cosStep": 0.43 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 1, 17, 2],
"data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.19, "cosStep": 0.37 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 17, 2], "tolerance": 0.001 }
}
},
{
"name": "linear_state_vec4_dk20_above_serial_cap",
"provenance": {
"notes": "A key head dimension of 20 uses five four-value vectors in an eight-lane workgroup, while value head dimension 3 produces a partial output and present-state tile."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.25, "cosStep": 0.37 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.49 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.57 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 1, 20, 3],
"data": { "kind": "fillFloat32", "scale": 0.25, "sinStep": 0.21, "cosStep": 0.43 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 3], "tolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 20, 3], "tolerance": 0.001 }
}
},
{
"name": "linear_state_window2_pinned",
"provenance": {
"notes": "Hand-computed linear-rule window. state += k (outer) v each token, so the state after each token is exact in f32; slot j must hold the state after token (seq - W + j), slot W-1 must equal the unwindowed present_state, and slots below max(0, W - seq) must be zero. A kernel that only wrote the final state would leave the earlier slots untouched."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 1, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 2],
"data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 1.0, 1.0] }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 2],
"data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 1.0, 1.0] }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
}
},
"outputs": {
"outputT": {
"dtype": "float32",
"shape": [1, 3, 2],
"tolerance": 0.00001,
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 14.0, 18.0] }
},
"presentStateT": {
"dtype": "float32",
"shape": [2, 1, 1, 2, 2],
"tolerance": 0.00001,
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 8.0, 10.0] }
}
}
},
{
"name": "linear_state_window4_longer_than_sequence",
"provenance": {
"notes": "Hand-computed linear-rule window. state += k (outer) v each token, so the state after each token is exact in f32; slot j must hold the state after token (seq - W + j), slot W-1 must equal the unwindowed present_state, and slots below max(0, W - seq) must be zero. A kernel that only wrote the final state would leave the earlier slots untouched."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 1, "state_window": 4 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 2],
"data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 1.0, 1.0] }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 2],
"data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 1.0, 1.0] }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
}
},
"outputs": {
"outputT": {
"dtype": "float32",
"shape": [1, 3, 2],
"tolerance": 0.00001,
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 14.0, 18.0] }
},
"presentStateT": {
"dtype": "float32",
"shape": [4, 1, 1, 2, 2],
"tolerance": 0.00001,
"data": {
"kind": "values",
"values": [0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 8.0, 10.0]
}
}
}
},
{
"name": "linear_state_scalar_dk17_window3",
"provenance": {
"notes": "A three-slot window on the scalar, key-head-size-17 route verifies per-token state snapshots and slot indexing with a supplied initial state."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5, "state_window": 3 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 17],
"data": { "kind": "fillFloat32", "sinStep": 0.21, "cosStep": 0.33 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 17],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.27 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.09, "cosStep": 0.43 }
},
"pastStateT": {
"dtype": "float32",
"shape": [3, 1, 1, 17, 2],
"data": { "kind": "fillFloat32", "scale": 0.2, "sinStep": 0.19, "cosStep": 0.37 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [3, 1, 1, 17, 2], "tolerance": 0.001 }
}
},
{
"name": "linear_state_vec4_dk20_window2",
"provenance": {
"notes": "A two-slot window on the vec4, key-head-size-20 route verifies per-token state snapshots and slot indexing with a supplied initial state."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.25, "cosStep": 0.37 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.49 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.57 }
},
"pastStateT": {
"dtype": "float32",
"shape": [2, 1, 1, 20, 3],
"data": { "kind": "fillFloat32", "scale": 0.25, "sinStep": 0.21, "cosStep": 0.43 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 3], "tolerance": 0.001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 20, 3], "tolerance": 0.001 }
}
},
{
"name": "linear_state_serial_window2_past_slot",
"provenance": {
"notes": "A small-head-dimension serial recurrence with a past state and state_window=2 must gather slot stateWindow-1 rather than the unwindowed offset."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "values", "values": [1.0, 0.0, 0.5, -0.5, 0.5, 1.0, -0.5, 0.0] }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "values", "values": [0.5, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 0.5] }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 2.0, 1.0, 0.0, 3.0] }
},
"pastStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 4], "data": { "kind": "constant", "value": 0.1 } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "linear_zero_vec4_window2",
"provenance": {
"notes": "A zero-state linear recurrence writes per-token present-state slots on the vec4 route."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.07, "cosStep": 0.41 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 2], "tolerance": 0.0001 }
}
},
{
"name": "gated_zero_window2_all_routes",
"provenance": {
"notes": "A zero-state gated recurrence exercises window publication on its serial, scalar, and vec4 routes."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.07, "cosStep": 0.41 }
},
"decayT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-0.2, -0.1] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 2], "tolerance": 0.0001 }
}
},
{
"name": "gated_state_window2_all_routes",
"provenance": {
"notes": "A carried-state gated recurrence exercises window publication on its serial, scalar, and vec4 routes."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.07, "cosStep": 0.41 }
},
"pastStateT": {
"dtype": "float32",
"shape": [2, 1, 1, 4, 2],
"data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.13, "cosStep": 0.19 }
},
"decayT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-0.2, -0.1] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 2], "tolerance": 0.0001 }
}
},
{
"name": "delta_zero_window2_all_routes",
"provenance": {
"notes": "A zero-state delta recurrence exercises window publication on its scalar and vec4 routes."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "delta", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.07, "cosStep": 0.41 }
},
"betaT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [0.7, 0.4] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 2], "tolerance": 0.0001 }
}
},
{
"name": "delta_state_window2_all_routes",
"provenance": {
"notes": "A carried-state delta recurrence exercises window publication on its scalar and vec4 routes."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "delta", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.07, "cosStep": 0.41 }
},
"pastStateT": {
"dtype": "float32",
"shape": [2, 1, 1, 4, 2],
"data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.13, "cosStep": 0.19 }
},
"betaT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [0.7, 0.4] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 2], "tolerance": 0.0001 }
}
},
{
"name": "gated_delta_zero_window2_all_routes",
"provenance": {
"notes": "A zero-state gated-delta recurrence exercises window publication on its serial, scalar, and vec4 routes."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated_delta", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.07, "cosStep": 0.41 }
},
"decayT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-0.2, -0.1] } },
"betaT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [0.7, 0.4] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 2], "tolerance": 0.0001 }
}
},
{
"name": "gated_delta_state_window2_all_routes",
"provenance": {
"notes": "A carried-state gated-delta recurrence exercises window publication on its serial, scalar, and vec4 routes."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated_delta", "scale": 0.5, "state_window": 2 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.07, "cosStep": 0.41 }
},
"pastStateT": {
"dtype": "float32",
"shape": [2, 1, 1, 4, 2],
"data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.13, "cosStep": 0.19 }
},
"decayT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-0.2, -0.1] } },
"betaT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [0.7, 0.4] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [2, 1, 1, 4, 2], "tolerance": 0.0001 }
}
},
{
"name": "inverse_gqa_linear_zero_q2_kv4",
"provenance": {
"notes": "Inverse GQA: kvNumHeads exceeds qNumHeads, so the output carries one head per KV head rather than per query head and several KV heads share a query head (KV head h reads query head floor(h * qNumHeads / kvNumHeads)). Linear rule with no carried state; the four KV heads pair onto query heads 0, 0, 1, 1."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "scale": 0.7 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 16], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "inverse_gqa_linear_state_q2_kv4",
"provenance": {
"notes": "Inverse GQA: kvNumHeads exceeds qNumHeads, so the output carries one head per KV head rather than per query head and several KV heads share a query head (KV head h reads query head floor(h * qNumHeads / kvNumHeads)). Linear rule continuing from a carried state, so the state layout is exercised on the KV-head axis while the query axis is narrower."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.29 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.37 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.11 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 4, 4, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 16], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "inverse_gqa_gated_delta_state_q2_kv4",
"provenance": {
"notes": "Inverse GQA: kvNumHeads exceeds qNumHeads, so the output carries one head per KV head rather than per query head and several KV heads share a query head (KV head h reads query head floor(h * qNumHeads / kvNumHeads)). The gated-delta rule, which is the regime the inverse layout exists for."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "gated_delta", "scale": 0.6 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 3, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.21, "cosStep": 0.13 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.09, "cosStep": 0.33 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.27 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 4, 4, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.05 }
},
"decayT": { "dtype": "float32", "shape": [1, 3, 4], "data": { "kind": "linspace", "start": -0.9, "end": -0.1 } },
"betaT": { "dtype": "float32", "shape": [1, 3, 4], "data": { "kind": "linspace", "start": 0.2, "end": 0.8 } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 3, 16], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 4, 4], "tolerance": 0.0001 }
}
},
{
"name": "inverse_gqa_gated_delta_state_q4_kv8_dk8",
"provenance": {
"notes": "Inverse GQA: kvNumHeads exceeds qNumHeads, so the output carries one head per KV head rather than per query head and several KV heads share a query head (KV head h reads query head floor(h * qNumHeads / kvNumHeads)). A head dimension divisible by four and eight KV heads over four query heads, so the vectorized kernel runs the inverse mapping too."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 8, "update_rule": "gated_delta", "scale": 0.4 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 4, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 4, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.29 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 4, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.19 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 8, 8, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.43 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 4, 8],
"data": { "kind": "linspace", "start": -1.1, "end": -0.05 }
},
"betaT": { "dtype": "float32", "shape": [1, 4, 8], "data": { "kind": "linspace", "start": 0.15, "end": 0.85 } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 4, 64], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 8, 8, 8], "tolerance": 0.0001 }
}
},
{
"name": "inverse_gqa_gated_delta_state_dk32_tiled",
"provenance": {
"notes": "Inverse GQA with a head dimension of 32, above the serial kernel's ceiling of 16, so the tiled scalar and vectorized kernels are the ones selected rather than merely eligible."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "gated_delta", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.37 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.11 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.23 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 4, 32, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.31 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "linspace", "start": -0.8, "end": -0.15 }
},
"betaT": { "dtype": "float32", "shape": [1, 2, 4], "data": { "kind": "linspace", "start": 0.25, "end": 0.75 } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 32], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 32, 8], "tolerance": 0.0001 }
}
},
{
"name": "gated_zero_state_without_past",
"provenance": {
"notes": "The public schema defaults an omitted past_state to zeros for every update rule; this covers the gated path without a recurrent-state input."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.3 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.5 }
},
"decayT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-0.2, -0.1] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 3], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 3], "tolerance": 0.0001 }
}
},
{
"name": "gated_delta_zero_state_without_past",
"provenance": {
"notes": "Covers the default gated-delta recurrence with an omitted past_state, which is initialized to zeros by the public contract."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated_delta", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.3 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.5 }
},
"decayT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-0.2, -0.1] } },
"betaT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [0.7, 0.4] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 3], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 3], "tolerance": 0.0001 }
}
},
{
"name": "delta_with_initial_state",
"provenance": {
"notes": "A schema-valid delta recurrence consumes the optional `past_state`, which has consistent meaning across all four update rules."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "delta", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.3 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.5 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 1, 4, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.19, "scale": 0.1 }
},
"betaT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [0.7, 0.4] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 3], "tolerance": 0.0001 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 3], "tolerance": 0.0001 }
}
},
{
"name": "linear_f32_with_f16_state",
"provenance": {
"notes": "Connects the independently typed T and S schema variables: float32 activations consume and return a float16 recurrent state."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.3 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.3 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.3 }
},
"pastStateT": {
"dtype": "float16",
"shape": [1, 1, 4, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.19, "scale": 0.1 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0.0002 },
"presentStateT": { "dtype": "float16", "shape": [1, 1, 4, 4], "tolerance": 0.002, "relTolerance": 0.002 }
}
},
{
"name": "linear_f16_with_f32_state",
"provenance": {
"notes": "Connects the independently typed T and S schema variables in the opposite direction: float16 activations consume and return a float32 recurrent state."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.5 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.3 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.3 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.3 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 1, 4, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.19, "scale": 0.1 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 2, 4], "tolerance": 0.002, "relTolerance": 0.002 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0.0002 }
}
},
{
"name": "gated_delta_zero_scalar_dk17_no_past",
"provenance": {
"notes": "With past state omitted, key head size 17 exceeds the serial limit and is not divisible by four, selecting the scalar zero-state recurrence."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated_delta", "scale": 0.25 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 17],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.3 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 17],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.3 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.3 }
},
"decayT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-0.2, -0.1] } },
"betaT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [0.7, 0.4] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 5], "tolerance": 0.0002 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 17, 5], "tolerance": 0.0002 }
}
},
{
"name": "gated_delta_zero_vec4_dk20_no_past",
"provenance": {
"notes": "Omitted past_state with headDimK=20 crosses the serial-kernel ceiling while retaining vec4 alignment, selecting the vector zero-state recurrence and a partial dV tile."
},
"attrs": { "q_num_heads": 1, "kv_num_heads": 1, "update_rule": "gated_delta", "scale": 0.25 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 2, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.3 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 2, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.3 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 2, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.41, "scale": 0.3 }
},
"decayT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-0.2, -0.1] } },
"betaT": { "dtype": "float32", "shape": [1, 2, 1], "data": { "kind": "values", "values": [0.7, 0.4] } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 2, 6], "tolerance": 0.0002 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 20, 6], "tolerance": 0.0002 }
}
},
{
"name": "gated_zero_chunked_seq1024",
"provenance": {
"notes": "Selects the chunked prefill decomposition, which needs seqLength >= 1024. Compact head dims keep the fixture small while covering the gated rule with a zero entry state and an elementwise decay gate."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "gated", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.12, "cosStep": 0.24000000000000002, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.08, "cosStep": 0.32, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.14, "cosStep": 0.2, "scale": 0.4 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.18000000000000002, "cosStep": 0.42, "scale": 0.1 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 16], "tolerance": 0.0005, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 8, 8], "tolerance": 0.0005, "relTolerance": 0.0005 }
}
},
{
"name": "gated_state_chunked_seq1024",
"provenance": {
"notes": "Selects the chunked prefill decomposition, which needs seqLength >= 1024. Compact head dims keep the fixture small while covering the gated rule with a supplied entry state and a per-head decay gate."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.25, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.09000000000000001, "cosStep": 0.33, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.15, "cosStep": 0.21, "scale": 0.4 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 2, 8, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.39, "scale": 0.2 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 1024, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.43, "scale": 0.1 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 32], "tolerance": 0.0005, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 2, 8, 8], "tolerance": 0.0005, "relTolerance": 0.0005 }
}
},
{
"name": "delta_zero_chunked_seq1024",
"provenance": {
"notes": "Selects the chunked prefill decomposition, which needs seqLength >= 1024. Compact head dims keep the fixture small while covering the delta rule with a zero entry state and a shared beta column."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "delta", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.14, "cosStep": 0.26, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.1, "cosStep": 0.33999999999999997, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.16, "cosStep": 0.22, "scale": 0.4 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 1024, 1],
"data": { "kind": "fillFloat32", "sinStep": 0.26, "cosStep": 0.31999999999999995, "scale": 0.3 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 16], "tolerance": 0.0005, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 8, 8], "tolerance": 0.0005, "relTolerance": 0.0005 }
}
},
{
"name": "delta_state_chunked_seq1024",
"provenance": {
"notes": "Selects the chunked prefill decomposition, which needs seqLength >= 1024. Compact head dims keep the fixture small while covering the delta rule with a supplied entry state and per-head beta."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "delta", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.15, "cosStep": 0.27, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.11000000000000001, "cosStep": 0.35, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.23, "scale": 0.4 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 2, 8, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.32999999999999996, "cosStep": 0.41, "scale": 0.2 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 1024, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.27, "cosStep": 0.32999999999999996, "scale": 0.3 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 32], "tolerance": 0.0005, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 2, 8, 8], "tolerance": 0.0005, "relTolerance": 0.0005 }
}
},
{
"name": "gated_delta_zero_chunked_seq1024",
"provenance": {
"notes": "Selects the chunked prefill decomposition, which needs seqLength >= 1024. Compact head dims keep the fixture small while covering the gated-delta rule with a zero entry state, elementwise decay and a shared beta column."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "gated_delta", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.16, "cosStep": 0.28, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.12000000000000001, "cosStep": 0.36, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.18, "cosStep": 0.24, "scale": 0.4 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": {
"kind": "fillFloat32",
"sinStep": 0.22000000000000003,
"cosStep": 0.45999999999999996,
"scale": 0.1
}
},
"betaT": {
"dtype": "float32",
"shape": [1, 1024, 1],
"data": { "kind": "fillFloat32", "sinStep": 0.28, "cosStep": 0.33999999999999997, "scale": 0.3 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 16], "tolerance": 0.0005, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 8, 8], "tolerance": 0.0005, "relTolerance": 0.0005 }
}
},
{
"name": "linear_zero_chunked_seq1024",
"provenance": {
"notes": "Selects the chunked prefill decomposition, which needs seqLength >= 1024. Compact head dims keep the fixture small while covering the linear rule with a zero entry state."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 1, "update_rule": "linear", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": {
"kind": "fillFloat32",
"sinStep": 0.16999999999999998,
"cosStep": 0.29000000000000004,
"scale": 0.4
}
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.37, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.25, "scale": 0.4 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 16], "tolerance": 0.0005, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 1, 8, 8], "tolerance": 0.0005, "relTolerance": 0.0005 }
}
},
{
"name": "linear_state_chunked_seq1024",
"provenance": {
"notes": "Selects the chunked prefill decomposition, which needs seqLength >= 1024. Compact head dims keep the fixture small while covering the linear rule with a supplied entry state and grouped query heads."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.18, "cosStep": 0.30000000000000004, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.14, "cosStep": 0.38, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.2, "cosStep": 0.26, "scale": 0.4 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 2, 8, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.36, "cosStep": 0.44, "scale": 0.2 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 32], "tolerance": 0.0005, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 2, 8, 8], "tolerance": 0.0005, "relTolerance": 0.0005 }
}
},
{
"name": "gated_delta_state_chunked_seq1024",
"provenance": {
"notes": "Selects the chunked prefill decomposition, which needs seqLength >= 1024. Compact head dims keep the fixture small while covering the gated-delta rule with a supplied entry state, per-head decay and per-head beta."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.31, "scale": 0.4 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.15000000000000002, "cosStep": 0.39, "scale": 0.4 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.21000000000000002, "cosStep": 0.27, "scale": 0.4 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 2, 8, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.45, "scale": 0.2 }
},
"decayT": {
"dtype": "float32",
"shape": [1, 1024, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.25, "cosStep": 0.49, "scale": 0.1 }
},
"betaT": {
"dtype": "float32",
"shape": [1, 1024, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.37, "scale": 0.3 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 32], "tolerance": 0.0005, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 2, 8, 8], "tolerance": 0.0005, "relTolerance": 0.0005 }
}
},
{
"name": "gated_delta_state_chunked_f16_seq1024",
"provenance": {
"notes": "A 1,024-token chunked prefill uses float16 activations and state. Every pass accumulates in float32 and narrows only loads and stores."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta", "scale": 0.35 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 1024, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.27, "scale": 0.4 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.15, "cosStep": 0.33, "scale": 0.4 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.21, "cosStep": 0.25, "scale": 0.4 }
},
"pastStateT": {
"dtype": "float16",
"shape": [1, 2, 8, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.39, "scale": 0.2 }
},
"decayT": {
"dtype": "float16",
"shape": [1, 1024, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.43, "scale": 0.1 }
},
"betaT": {
"dtype": "float16",
"shape": [1, 1024, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.27, "cosStep": 0.35, "scale": 0.3 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 1024, 32], "tolerance": 0.04, "relTolerance": 0.04 },
"presentStateT": { "dtype": "float16", "shape": [1, 2, 8, 8], "tolerance": 0.04, "relTolerance": 0.04 }
}
},
{
"name": "gated_delta_chunked_strong_decay_prefix_underflow",
"provenance": {
"notes": "Per-head decay -8 on every token of a 1024-token prefill: over a 16-token chunk the within-chunk decay prefix reaches exp(-128), below the f32 subnormal floor, so a chunked formulation that divides keys by exp(prefix) produces Inf/NaN while the recurrence itself applies a finite exp(-8) per token. Bounded Q/K/V, beta 0.5, no past state."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta" },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.021, "cosStep": 0.033, "scale": 1.0 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 1.0 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.043, "scale": 1.0 }
},
"decayT": { "dtype": "float32", "shape": [1, 1024, 2], "data": { "kind": "constant", "value": -8.0 } },
"betaT": { "dtype": "float32", "shape": [1, 1024, 2], "data": { "kind": "constant", "value": 0.5 } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 128], "tolerance": 0.0002, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 2, 32, 32], "tolerance": 0.0002, "relTolerance": 0.0005 }
},
"skipGpu": {
"category": "todo",
"reason": "The chunked prefill decomposition materializes a normalized key as k divided by exp(the within-chunk decay prefix). A sustained decay of -8 drives that prefix to -128 over a 16-token chunk, so the exponential underflows to zero and the division returns Inf/NaN, while every pairwise term the decomposition actually needs carries the bounded ratio exp(p_t - p_s) <= 1. The serial route applies a finite exp(-8) per token and stays finite. Fixing this needs the chunk operands re-anchored to a per-chunk pivot, with the entry-state terms kept in their absolute form."
}
},
{
"name": "gated_delta_chunked_moderate_decay_control",
"provenance": {
"notes": "Decay -4 keeps each 16-token chunk prefix at -64, within the float32 exponent range, so `k / exp(prefix)` remains finite. It is the finite-prefix control for `gated_delta_chunked_strong_decay_prefix_underflow`."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "gated_delta" },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 1024, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.021, "cosStep": 0.033, "scale": 1.0 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 1024, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 1.0 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 1024, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.009, "cosStep": 0.043, "scale": 1.0 }
},
"decayT": { "dtype": "float32", "shape": [1, 1024, 2], "data": { "kind": "constant", "value": -4.0 } },
"betaT": { "dtype": "float32", "shape": [1, 1024, 2], "data": { "kind": "constant", "value": 0.5 } }
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 1024, 128], "tolerance": 0.0002, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 2, 32, 32], "tolerance": 0.0002, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float32_float32_g0_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "state_window": 3, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 33, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 33, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 33, 14],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 33, 28] },
"presentStateT": { "dtype": "float32", "shape": [3, 2, 2, 8, 7] }
}
},
{
"name": "linear_geometry_float32_float32_g0_state",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "state_window": 3, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 33, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 33, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 33, 14],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float32",
"shape": [3, 2, 2, 8, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 33, 28] },
"presentStateT": { "dtype": "float32", "shape": [3, 2, 2, 8, 7] }
}
},
{
"name": "linear_geometry_float32_float32_g1_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "state_window": 0, "scale": 0 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 17, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 17, 20] },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 6, 5] }
}
},
{
"name": "linear_geometry_float32_float32_g1_state",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "state_window": 0, "scale": 0 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 17, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 4, 6, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 17, 20] },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 6, 5] }
}
},
{
"name": "linear_geometry_float32_float32_g2_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 3, "kv_num_heads": 3, "update_rule": "linear", "state_window": 2, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 0, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 0, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 0, 27],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 0, 27] },
"presentStateT": { "dtype": "float32", "shape": [2, 2, 3, 16, 9] }
}
},
{
"name": "linear_geometry_float32_float32_g2_state",
"provenance": {
"notes": "A one-token update inside a two-slot state window verifies zero-fill of the leading slot and a nonuniform updated state in the final slot, with shared keys, odd value dimensions, and independent activation/state dtypes."
},
"attrs": { "q_num_heads": 3, "kv_num_heads": 3, "update_rule": "linear", "state_window": 2, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 1, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 1, 27],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float32",
"shape": [2, 2, 3, 16, 9],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 1, 27] },
"presentStateT": { "dtype": "float32", "shape": [2, 2, 3, 16, 9] }
}
},
{
"name": "linear_geometry_float16_float16_g0_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "state_window": 3, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 33, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [2, 33, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [2, 33, 14],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [2, 33, 28], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float16", "shape": [3, 2, 2, 8, 7], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float16_float16_g0_state",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "state_window": 3, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 33, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [2, 33, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [2, 33, 14],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float16",
"shape": [3, 2, 2, 8, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [2, 33, 28], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float16", "shape": [3, 2, 2, 8, 7], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float16_float16_g1_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "state_window": 0, "scale": 0 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 17, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 17, 20], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float16", "shape": [1, 4, 6, 5], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float16_float16_g1_state",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "state_window": 0, "scale": 0 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 17, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float16",
"shape": [1, 4, 6, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 17, 20], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float16", "shape": [1, 4, 6, 5], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float16_float16_g2_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 3, "kv_num_heads": 3, "update_rule": "linear", "state_window": 2, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 0, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [2, 0, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [2, 0, 27],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [2, 0, 27], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float16", "shape": [2, 2, 3, 16, 9], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float16_float16_g2_state",
"provenance": {
"notes": "A one-token update inside a two-slot state window verifies zero-fill of the leading slot and a nonuniform updated state in the final slot, with shared keys, odd value dimensions, and independent activation/state dtypes."
},
"attrs": { "q_num_heads": 3, "kv_num_heads": 3, "update_rule": "linear", "state_window": 2, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 1, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [2, 1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [2, 1, 27],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float16",
"shape": [2, 2, 3, 16, 9],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [2, 1, 27], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float16", "shape": [2, 2, 3, 16, 9], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float16_float32_g0_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "state_window": 3, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 33, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [2, 33, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [2, 33, 14],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [2, 33, 28], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [3, 2, 2, 8, 7] }
}
},
{
"name": "linear_geometry_float16_float32_g0_state",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "state_window": 3, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 33, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [2, 33, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [2, 33, 14],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float32",
"shape": [3, 2, 2, 8, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [2, 33, 28], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [3, 2, 2, 8, 7] }
}
},
{
"name": "linear_geometry_float16_float32_g1_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "state_window": 0, "scale": 0 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 17, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 17, 20], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 6, 5] }
}
},
{
"name": "linear_geometry_float16_float32_g1_state",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "state_window": 0, "scale": 0 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 17, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float32",
"shape": [1, 4, 6, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [1, 17, 20], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [1, 4, 6, 5] }
}
},
{
"name": "linear_geometry_float16_float32_g2_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 3, "kv_num_heads": 3, "update_rule": "linear", "state_window": 2, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 0, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [2, 0, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [2, 0, 27],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [2, 0, 27], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [2, 2, 3, 16, 9] }
}
},
{
"name": "linear_geometry_float16_float32_g2_state",
"provenance": {
"notes": "A one-token update inside a two-slot state window verifies zero-fill of the leading slot and a nonuniform updated state in the final slot, with shared keys, odd value dimensions, and independent activation/state dtypes."
},
"attrs": { "q_num_heads": 3, "kv_num_heads": 3, "update_rule": "linear", "state_window": 2, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 1, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float16",
"shape": [2, 1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float16",
"shape": [2, 1, 27],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float32",
"shape": [2, 2, 3, 16, 9],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [2, 1, 27], "tolerance": 6e-8, "relTolerance": 0.0005 },
"presentStateT": { "dtype": "float32", "shape": [2, 2, 3, 16, 9] }
}
},
{
"name": "linear_geometry_float32_float16_g0_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "state_window": 3, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 33, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 33, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 33, 14],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 33, 28] },
"presentStateT": { "dtype": "float16", "shape": [3, 2, 2, 8, 7], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float32_float16_g0_state",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 4, "kv_num_heads": 2, "update_rule": "linear", "state_window": 3, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 33, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 33, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 33, 14],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float16",
"shape": [3, 2, 2, 8, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 33, 28] },
"presentStateT": { "dtype": "float16", "shape": [3, 2, 2, 8, 7], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float32_float16_g1_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "state_window": 0, "scale": 0 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 17, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 17, 20] },
"presentStateT": { "dtype": "float16", "shape": [1, 4, 6, 5], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float32_float16_g1_state",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 2, "kv_num_heads": 4, "update_rule": "linear", "state_window": 0, "scale": 0 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [1, 17, 12],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [1, 17, 20],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float16",
"shape": [1, 4, 6, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [1, 17, 20] },
"presentStateT": { "dtype": "float16", "shape": [1, 4, 6, 5], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float32_float16_g2_zero",
"provenance": {
"notes": "Small-head linear recurrence with shared keys, standard or inverse query grouping, odd value dimensions, independent state dtype, and retained or empty-sequence state windows."
},
"attrs": { "q_num_heads": 3, "kv_num_heads": 3, "update_rule": "linear", "state_window": 2, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 0, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 0, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 0, 27],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 0, 27] },
"presentStateT": { "dtype": "float16", "shape": [2, 2, 3, 16, 9], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
},
{
"name": "linear_geometry_float32_float16_g2_state",
"provenance": {
"notes": "A one-token update inside a two-slot state window verifies zero-fill of the leading slot and a nonuniform updated state in the final slot, with shared keys, odd value dimensions, and independent activation/state dtypes."
},
"attrs": { "q_num_heads": 3, "kv_num_heads": 3, "update_rule": "linear", "state_window": 2, "scale": 0.375 },
"inputs": {
"queryT": {
"dtype": "float32",
"shape": [2, 1, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.05 }
},
"keyT": {
"dtype": "float32",
"shape": [2, 1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.31, "scale": 0.05 }
},
"valueT": {
"dtype": "float32",
"shape": [2, 1, 27],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.31, "scale": 0.05 }
},
"pastStateT": {
"dtype": "float16",
"shape": [2, 2, 3, 16, 9],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.31, "scale": 0.05 }
}
},
"outputs": {
"outputT": { "dtype": "float32", "shape": [2, 1, 27] },
"presentStateT": { "dtype": "float16", "shape": [2, 2, 3, 16, 9], "tolerance": 6e-8, "relTolerance": 0.0005 }
}
}
]
}