ai.onnx.GRU / build /webgpu /test.json
Xenova's picture
Xenova HF Staff
sync 6fdf6301e2bb
c7919ef verified
Raw History Blame
85.2 kB
{
"fixtureArrays": {
"ort_forward_default_activations_with_bias_batch_parallel_input_b": [-0.01, 0.1, 0.01, -0.2, -0.02, 0.02, 0.3, -0.3, -0.3, -0.03, 0.5, -0.7, 0.05, -0.7, 0.3, 0.07, -0.03, 0.5]
},
"cases": [
{
"name": "forward_default",
"attrs": { "hidden_size": 2 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 1, 2], "data": { "kind": "values", "values": [0.2, -0.4, 0.5, 0.1] } },
"w": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": { "kind": "values", "values": [0.1, 0.3, -0.2, 0.4, 0.5, -0.1, 0.25, 0.2, -0.35, 0.15, 0.45, -0.25] }
},
"r": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": {
"kind": "values",
"values": [0.2, -0.1, 0.05, 0.3, -0.15, 0.25, 0.35, -0.05, 0.12, 0.18, -0.22, 0.28]
}
},
"b": {
"dtype": "float32",
"shape": [1, 12],
"data": {
"kind": "values",
"values": [0.01, -0.03, 0.02, 0.04, -0.01, 0.03, -0.02, 0.01, 0.04, -0.02, 0.03, 0.02]
}
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 1, 2], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 1, 2], "tolerance": 0.000001 }
}
},
{
"name": "multi_batch_state",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [3, 2, 1],
"data": { "kind": "values", "values": [0.1, -0.2, 0.3, -0.4, 0.5, -0.6] }
},
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.4, -0.3, 0.2] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [-0.2, 0.5, 0.35] } },
"b": {
"dtype": "float32",
"shape": [1, 6],
"data": { "kind": "values", "values": [0.01, 0.02, -0.03, 0.04, -0.05, 0.06] }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [3, 1, 2, 1], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 1], "tolerance": 0.000001 }
}
},
{
"name": "tanh_saturation_no_nan",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 1], "data": { "kind": "values", "values": [50.0] } },
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.0, 0.0, 2.0] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "constant", "value": 0.0 } },
"b": { "dtype": "float32", "shape": [1, 6], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 1, 1], "tolerance": 0.0001 },
"y_h": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0.0001 }
}
},
{
"name": "gate_saturation_extremes_no_nan",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "values", "values": [50.0, -50.0, -50.0, 50.0] }
},
"w": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": { "kind": "values", "values": [2.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 2.0] }
},
"r": { "dtype": "float32", "shape": [1, 6, 2], "data": { "kind": "constant", "value": 0.0 } },
"b": { "dtype": "float32", "shape": [1, 12], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.000001 }
}
},
{
"name": "ort_forward_custom_activations",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUOpForwardActivation",
"notes": "Diverges from the upstream test's inputs (inputs.x values [1.0, -1.0] -> constant 1.0); the expected output is recomputed by the CPU reference for the new inputs. Uses ORT's custom-activation surface with Tanh update/reset gates and Sigmoid candidate. All-zero weights make the answer the activation of zero for any input, so the input is uniform."
},
"attrs": {
"layout": 0,
"direction": "forward",
"linear_before_reset": 0,
"hidden_size": 1,
"activations": ["Tanh", "Sigmoid"]
},
"inputs": {
"x": { "dtype": "float32", "shape": [2, 1, 1], "data": { "kind": "constant", "value": 1.0 } },
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "constant", "value": 0.0 } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "constant", "value": 0.0 } },
"b": { "dtype": "float32", "shape": [1, 6], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [2, 1, 1, 1],
"tolerance": 0,
"data": { "kind": "values", "values": [0.5, 0.5] }
},
"y_h": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0, "data": { "kind": "values", "values": [0.5] } }
}
},
{
"name": "ort_forward_activation_alpha_beta",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUPositiveActivationAlphaBeta",
"notes": "The update/reset activation is LeakyRelu(alpha=0.5) and the candidate activation is ScaledTanh(alpha=2,beta=2), exercising activation parameters in a compact forward GRU."
},
"attrs": {
"layout": 0,
"direction": "forward",
"linear_before_reset": 0,
"hidden_size": 1,
"activations": ["LeakyRelu", "ScaledTanh"],
"activation_alpha": [0.5, 2],
"activation_beta": [2]
},
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 1], "data": { "kind": "values", "values": [1.0] } },
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [-2.0, 0.0, 1.0] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "constant", "value": 0.0 } },
"b": { "dtype": "float32", "shape": [1, 6], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [3.8561103203032676] }
},
"y_h": {
"dtype": "float32",
"shape": [1, 1, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [3.8561103203032676] }
}
}
},
{
"name": "ort_bidirectional_per_direction_activations",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUPositiveActivationAlphaBeta",
"notes": "A bidirectional GRU assigns activation slots 0/1 to the forward pass and 2/3 to the reverse pass, consuming alpha and beta in that order. Shared weights and a single timestep make any output difference depend only on the per-direction activations."
},
"attrs": {
"layout": 0,
"direction": "bidirectional",
"linear_before_reset": 0,
"hidden_size": 1,
"activations": ["LeakyRelu", "Tanh", "Sigmoid", "ScaledTanh"],
"activation_alpha": [0.5, 2],
"activation_beta": [2]
},
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 1], "data": { "kind": "values", "values": [1.0] } },
"w": {
"dtype": "float32",
"shape": [2, 3, 1],
"data": { "kind": "values", "values": [-2.0, 0.0, 1.0, -2.0, 0.0, 1.0] }
},
"r": { "dtype": "float32", "shape": [2, 3, 1], "data": { "kind": "constant", "value": 0.0 } },
"b": { "dtype": "float32", "shape": [2, 6], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 2, 1, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [1.5231883119115297, 1.6982253512417371] }
},
"y_h": {
"dtype": "float32",
"shape": [2, 1, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [1.5231883119115297, 1.6982253512417371] }
}
}
},
{
"name": "thresholded_relu_softplus_activations_default_alpha",
"provenance": {
"notes": "ThresholdedRelu gates pair with a Softplus candidate, and omitted activation_alpha uses the ONNX default of 1.0. Gate pre-activations straddle the threshold by at least 0.19, while linear_before_reset=1 exercises the transform-before-reset form."
},
"attrs": {
"layout": 0,
"direction": "forward",
"linear_before_reset": 1,
"hidden_size": 2,
"activations": ["ThresholdedRelu", "Softplus"]
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 2],
"data": { "kind": "values", "values": [-0.5, -1.0, -0.5, -2.0, -1.0, 1.5, -1.0, -2.0] }
},
"w": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": { "kind": "values", "values": [-0.5, -0.75, -0.5, 1.0, 1.0, -0.5, -1.0, -1.0, 0.75, 1.0, 0.5, 0.75] }
},
"r": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": {
"kind": "values",
"values": [-1.0, -1.0, -0.25, 0.75, -1.0, 0.75, 1.0, -1.0, -0.25, -0.25, -0.75, 0.75]
}
},
"b": {
"dtype": "float32",
"shape": [1, 12],
"data": {
"kind": "values",
"values": [0.0, -0.5, -0.5, -0.25, 0.25, -0.75, -0.25, -0.75, 0.25, -0.75, 0.75, 0.5]
}
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [2, 1, 2, 2],
"tolerance": 0.000001,
"data": {
"kind": "values",
"values": [0.28115007, 0.16022422, -0.05641107, 0.16022422, 1.31326169, 0.63259898, -0.14384076, 0.18925121]
}
},
"y_h": {
"dtype": "float32",
"shape": [1, 2, 2],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [1.31326169, 0.63259898, -0.14384076, 0.18925121] }
}
}
},
{
"name": "ort_sequence_lens_partial_zero",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUOpSequenceLengthWithPartialZero",
"notes": "Valid ONNX sequence_lens edge: the second batch has length zero, so Y and Y_h are zero-filled for that batch."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [3, 2, 1],
"data": { "kind": "values", "values": [1.0, 10.0, 2.0, 20.0, 3.0, 30.0] }
},
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.2, -0.1, 0.3] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.05, 0.07, 0.11] } },
"b": { "dtype": "float32", "shape": [1, 6], "data": { "kind": "constant", "value": 0.0 } },
"sequence_lens": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 0] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [3, 1, 2, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [0.13113902509212494, 0.0, 0.29524683952331543, 0.0, 0.0, 0.0] }
},
"y_h": {
"dtype": "float32",
"shape": [1, 2, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [0.29524683952331543, 0.0] }
}
}
},
{
"name": "ort_sequence_lens_shorter_than_input",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUOpSequenceLengthShorterThanInputSequenceLength",
"notes": "Valid ONNX sequence_lens edge: each batch stops before the full input sequence length, so later Y positions are zero-filled and Y_h comes from the last valid timestep."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [3, 2, 1],
"data": { "kind": "values", "values": [1.0, 10.0, 2.0, 20.0, 3.0, 30.0] }
},
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.2, -0.1, 0.3] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.05, 0.07, 0.11] } },
"b": { "dtype": "float32", "shape": [1, 6], "data": { "kind": "constant", "value": 0.0 } },
"sequence_lens": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [3, 1, 2, 1],
"tolerance": 0.000001,
"data": {
"kind": "values",
"values": [0.13113902509212494, 0.11861342191696167, 0.0, 0.13437393307685852, 0.0, 0.0]
}
},
"y_h": {
"dtype": "float32",
"shape": [1, 2, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [0.13113902509212494, 0.13437393307685852] }
}
}
},
{
"name": "ort_sequence_lens_all_zero",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUOpSequenceLengthAllZeros",
"notes": "Diverges from the upstream test's inputs (inputs.w values [0.2, -0.1, 0.3] -> constant 0.2; inputs.x values [1.0, 10.0, 2.0, 20.0, 3.0, 30.0] -> constant 1.0; inputs.r values [0.05, 0.07, 0.11] -> constant 0.05); the expected output is recomputed by the CPU reference for the new inputs. Compact projection of ORT's all-zero sequence_lens edge; all Y and Y_h values must be zero. With every sequence length zero no timestep runs, so the outputs are zero whatever the input and the weights hold and those operands are uniform: a kernel that ignored sequence_lens would emit the nonzero recurrence instead."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [3, 2, 1], "data": { "kind": "constant", "value": 1.0 } },
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "constant", "value": 0.2 } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "constant", "value": 0.05 } },
"b": { "dtype": "float32", "shape": [1, 6], "data": { "kind": "constant", "value": 0.0 } },
"sequence_lens": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [3, 1, 2, 1],
"tolerance": 0.000001,
"data": { "kind": "constant", "value": 0.0 }
},
"y_h": {
"dtype": "float32",
"shape": [1, 2, 1],
"tolerance": 0.000001,
"data": { "kind": "constant", "value": 0.0 }
}
}
},
{
"name": "ort_positive_activation_clipping_projection",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUPositiveActivationClipping",
"notes": "A compact four-input GRU exercises positive activation clipping."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2, "clip": 0.5 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 2, 2],
"data": { "kind": "values", "values": [50.0, -50.0, -50.0, 50.0] }
},
"w": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": { "kind": "values", "values": [2.0, 0.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 2.0] }
},
"r": { "dtype": "float32", "shape": [1, 6, 2], "data": { "kind": "constant", "value": 0.0 } },
"b": { "dtype": "float32", "shape": [1, 12], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.000001 }
}
},
{
"name": "onnx_backend_initial_bias_batch3",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gru_with_initial_bias" },
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 3 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 3, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] }
},
"w": { "dtype": "float32", "shape": [1, 9, 3], "data": { "kind": "constant", "value": 0.1 } },
"r": { "dtype": "float32", "shape": [1, 9, 3], "data": { "kind": "constant", "value": 0.1 } },
"b": {
"dtype": "float32",
"shape": [1, 18],
"data": {
"kind": "values",
"values": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
}
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 3, 3], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 3, 3], "tolerance": 0.000001 }
}
},
{
"name": "ort_forward_default_activations_simple_weights_zero_bias",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/GRU.py",
"test": "GRU_ONNXRuntimeUnitTests.ForwardDefaultActivationsSimpleWeightsNoBiasTwoRows",
"notes": "Supplies an explicit zero-valued B tensor to represent the optional ONNX bias omitted by the upstream case."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 3 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2, 1], "data": { "kind": "values", "values": [1.0, 2.0, 10.0, 11.0] } },
"w": {
"dtype": "float32",
"shape": [1, 9, 1],
"data": { "kind": "values", "values": [0.1, 0.2, 0.3, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0] }
},
"r": { "dtype": "float32", "shape": [1, 9, 3], "data": { "kind": "constant", "value": 0.1 } },
"b": { "dtype": "float32", "shape": [1, 18], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 2, 3], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 3], "tolerance": 0.000001 }
}
},
{
"name": "ort_reverse_default_activations_simple_weights",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ReverseDefaultActivationsSimpleWeightsNoBiasTwoRows",
"notes": "Exercises reverse direction with an explicit zero-valued B tensor representing an omitted optional ONNX bias."
},
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 0, "hidden_size": 3 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2, 1], "data": { "kind": "values", "values": [1.0, 2.0, 10.0, 11.0] } },
"w": {
"dtype": "float32",
"shape": [1, 9, 1],
"data": { "kind": "values", "values": [0.1, 0.2, 0.3, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0] }
},
"r": { "dtype": "float32", "shape": [1, 9, 3], "data": { "kind": "constant", "value": 0.1 } },
"b": { "dtype": "float32", "shape": [1, 18], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [2, 1, 2, 3],
"tolerance": 0.000001,
"data": {
"kind": "values",
"values": [0.6082785, 0.50623393, 0.4426924, 0.5803454, 0.4527356, 0.36886263, 0.26894143, 0.11920292, 0.04742587, 0.24973989, 0.09975048, 0.03557118]
}
},
"y_h": {
"dtype": "float32",
"shape": [1, 2, 3],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [0.6082785, 0.50623393, 0.4426924, 0.5803454, 0.4527356, 0.36886263] }
}
}
},
{
"name": "ort_bidirectional_default_activations_simple_weights",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.BidirectionalDefaultActivationsSimpleWeightsNoBias",
"notes": "Exercises bidirectional execution with an explicit zero-valued B tensor representing an omitted optional ONNX bias."
},
"attrs": { "layout": 0, "direction": "bidirectional", "linear_before_reset": 0, "hidden_size": 3 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2, 1], "data": { "kind": "values", "values": [1.0, 2.0, 10.0, 11.0] } },
"w": {
"dtype": "float32",
"shape": [2, 9, 1],
"data": {
"kind": "values",
"values": [0.1, 0.2, 0.3, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0, 0.1, 0.2, 0.3, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0]
}
},
"r": { "dtype": "float32", "shape": [2, 9, 3], "data": { "kind": "constant", "value": 0.1 } },
"b": { "dtype": "float32", "shape": [2, 18], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [2, 2, 2, 3],
"tolerance": 0.000001,
"data": {
"kind": "values",
"values": [0.4750208, 0.450166, 0.4255575, 0.45016602, 0.40131235, 0.35434368, 0.6082785, 0.50623393, 0.4426924, 0.5803454, 0.4527356, 0.36886263, 0.6027093, 0.5083023, 0.44950223, 0.5754369, 0.45485455, 0.3747841, 0.26894143, 0.11920292, 0.04742587, 0.24973989, 0.09975048, 0.03557118]
}
},
"y_h": {
"dtype": "float32",
"shape": [2, 2, 3],
"tolerance": 0.000001,
"data": {
"kind": "values",
"values": [0.6027093, 0.5083023, 0.44950223, 0.5754369, 0.45485455, 0.3747841, 0.6082785, 0.50623393, 0.4426924, 0.5803454, 0.4527356, 0.36886263]
}
}
}
},
{
"name": "ort_forward_default_activations_with_bias_batch_parallel",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ForwardDefaultActivationsSimpleWeightsWithBiasBatchParallel"
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 3 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2, 1], "data": { "kind": "values", "values": [-0.1, 0.2, -0.3, 0.4] } },
"w": {
"dtype": "float32",
"shape": [1, 9, 1],
"data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.2, 0.3, 0.1, 0.3, 0.1, 0.2] }
},
"r": { "dtype": "float32", "shape": [1, 9, 3], "data": { "kind": "constant", "value": 0.1 } },
"b": {
"dtype": "float32",
"shape": [1, 18],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/ort_forward_default_activations_with_bias_batch_parallel_input_b" }
}
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 2, 3], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 3], "tolerance": 0.000001 }
}
},
{
"name": "ort_forward_default_activations_with_bias_batch_parallel_linear_before_reset",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ForwardDefaultActivationsSimpleWeightsWithBiasBatchParallelLinearBeforeReset"
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 1, "hidden_size": 3 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2, 1], "data": { "kind": "values", "values": [-0.1, 0.2, -0.3, 0.4] } },
"w": {
"dtype": "float32",
"shape": [1, 9, 1],
"data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.2, 0.3, 0.1, 0.3, 0.1, 0.2] }
},
"r": { "dtype": "float32", "shape": [1, 9, 3], "data": { "kind": "constant", "value": 0.1 } },
"b": {
"dtype": "float32",
"shape": [1, 18],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/ort_forward_default_activations_with_bias_batch_parallel_input_b" }
}
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 2, 3], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 3], "tolerance": 0.000001 }
}
},
{
"name": "ort_legacy_forward_basic_zero_initial_full_length",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUOpForwardBasic",
"notes": "Omits sequence_lens and initial_h because the supplied all-full lengths and zero initial state are their ONNX defaults."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 1, 2],
"data": { "kind": "values", "values": [-0.455351, -0.276391, -0.185934, -0.269585] }
},
"w": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": {
"kind": "values",
"values": [-0.494659, 0.0453352, -0.487793, 0.417264, -0.0091708, -0.255364, -0.106952, -0.266717, -0.0888852, -0.428709, -0.283349, 0.208792]
}
},
"r": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": {
"kind": "values",
"values": [0.146626, -0.0620289, -0.0815302, 0.100482, -0.228172, 0.405972, 0.31576, 0.281487, -0.394864, 0.42111, -0.386624, -0.390225]
}
},
"b": {
"dtype": "float32",
"shape": [1, 12],
"data": {
"kind": "values",
"values": [0.381619, 0.0323954, -0.258721, 0.45056, -0.250755, 0.0967895, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
}
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 1, 2], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 1, 2], "tolerance": 0.000001 }
}
},
{
"name": "onnx_backend_gru_defaults_zero_bias",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gru_defaults",
"notes": "Supplies an explicit zero-valued B tensor for the omitted optional bias and requests Y so the fixture checks both sequence and final hidden outputs."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 5 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 3, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
},
"w": { "dtype": "float32", "shape": [1, 15, 2], "data": { "kind": "constant", "value": 0.1 } },
"r": { "dtype": "float32", "shape": [1, 15, 5], "data": { "kind": "constant", "value": 0.1 } },
"b": { "dtype": "float32", "shape": [1, 30], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 3, 5], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 3, 5], "tolerance": 0.000001 }
}
},
{
"name": "onnx_backend_gru_seq_length_full_sequence",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gru_seq_length",
"notes": "The official fixture name is historical; this node has no sequence_lens input. This fixture requests Y in addition to Y_h."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 5 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 3, 3],
"data": {
"kind": "values",
"values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0]
}
},
"w": {
"dtype": "float32",
"shape": [1, 15, 3],
"data": {
"kind": "values",
"values": [1.764052391052246, 0.40015721321105957, 0.978738009929657, 2.2408931255340576, 1.8675580024719238, -0.9772778749465942, 0.9500884413719177, -0.15135720372200012, -0.10321885347366333, 0.4105985164642334, 0.14404356479644775, 1.4542734622955322, 0.7610377073287964, 0.12167501449584961, 0.44386324286460876, 0.3336743414402008, 1.4940791130065918, -0.2051582634449005, 0.3130677044391632, -0.8540957570075989, -2.5529897212982178, 0.653618574142456, 0.8644362092018127, -0.7421650290489197, 2.269754648208618, -1.4543657302856445, 0.04575851559638977, -0.18718385696411133, 1.5327792167663574, 1.4693588018417358, 0.154947429895401, 0.37816253304481506, -0.8877857327461243, -1.980796456336975, -0.34791216254234314, 0.15634897351264954, 1.2302906513214111, 1.202379822731018, -0.38732680678367615, -0.302302747964859, -1.0485529899597168, -1.420017957687378, -1.7062702178955078, 1.950775384902954, -0.5096521973609924]
}
},
"r": {
"dtype": "float32",
"shape": [1, 15, 5],
"data": {
"kind": "values",
"values": [-0.4380742907524109, -1.2527953386306763, 0.7774903774261475, -1.6138978004455566, -0.21274028718471527, -0.8954665660858154, 0.38690251111984253, -0.5108051300048828, -1.18063223361969, -0.02818222902715206, 0.4283318817615509, 0.06651721894741058, 0.30247190594673157, -0.6343221068382263, -0.3627411723136902, -0.6724604368209839, -0.35955315828323364, -0.8131462931632996, -1.7262825965881348, 0.17742614448070526, -0.4017809331417084, -1.630198359489441, 0.46278226375579834, -0.9072983860969543, 0.05194539576768875, 0.7290905714035034, 0.12898291647434235, 1.1394007205963135, -1.234825849533081, 0.4023416340351105, -0.6848101019859314, -0.8707971572875977, -0.5788496732711792, -0.3115525245666504, 0.056165341287851334, -1.1651498079299927, 0.9008265137672424, 0.4656624495983124, -1.5362436771392822, 1.4882521629333496, 1.895889163017273, 1.1787796020507812, -0.1799248307943344, -1.0707526206970215, 1.0544517040252686, -0.4031769335269928, 1.222445011138916, 0.2082749754190445, 0.9766390323638916, 0.3563663959503174, 0.7065731883049011, 0.01050002034753561, 1.7858705520629883, 0.12691208720207214, 0.4019893705844879, 1.8831506967544556, -1.3477590084075928, -1.2704850435256958, 0.969396710395813, -1.1731233596801758, 1.9436211585998535, -0.4136189818382263, -0.747454822063446, 1.922942042350769, 1.4805147647857666, 1.8675589561462402, 0.9060446619987488, -0.8612256646156311, 1.910064935684204, -0.26800337433815, 0.8024563789367676, 0.9472519755363464, -0.15501008927822113, 0.6140793561935425, 0.922206699848175]
}
},
"b": {
"dtype": "float32",
"shape": [1, 30],
"data": {
"kind": "values",
"values": [0.37642553448677063, -1.0994007587432861, 0.29823818802833557, 1.3263858556747437, -0.694567859172821, -0.14963454008102417, -0.4351535439491272, 1.8492637872695923, 0.6722947359085083, 0.40746182203292847, -0.7699160575866699, 0.5392491817474365, -0.6743326783180237, 0.0318305566906929, -0.6358460783958435, 0.676433265209198, 0.5765908360481262, -0.20829875767230988, 0.39600670337677, -1.0930615663528442, -1.4912575483322144, 0.43939170241355896, 0.16667349636554718, 0.6350314617156982, 2.3831448554992676, 0.9444794654846191, -0.9128222465515137, 1.117016315460205, -1.31590735912323, -0.46158459782600403]
}
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 3, 5], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 3, 5], "tolerance": 0.000001 }
}
},
{
"name": "parallel_vec4_hidden4_input4_batch2_seq3",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 4 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [3, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 12, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.2 }
},
"r": {
"dtype": "float32",
"shape": [1, 12, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.2 }
},
"b": {
"dtype": "float32",
"shape": [1, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.1 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [3, 1, 2, 4], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0.000001 }
}
},
{
"name": "parallel_vec4_linear_before_reset_hidden8_input4_batch2_seq2",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 1, "hidden_size": 8 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 24, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.15 }
},
"r": {
"dtype": "float32",
"shape": [1, 24, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.12 }
},
"b": {
"dtype": "float32",
"shape": [1, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.1 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 2, 8], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 8], "tolerance": 0.000001 }
}
},
{
"name": "parallel_hidden10_input7_batch3_seq3_not_divisible_by_4",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 10 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [3, 3, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 30, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.15 }
},
"r": {
"dtype": "float32",
"shape": [1, 30, 10],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.12 }
},
"b": {
"dtype": "float32",
"shape": [1, 60],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.1 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [3, 1, 3, 10], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 3, 10], "tolerance": 0.000001 }
}
},
{
"name": "parallel_linear_before_reset_hidden10_input7_batch2_seq2_scalar",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 1, "hidden_size": 10 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 30, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.15 }
},
"r": {
"dtype": "float32",
"shape": [1, 30, 10],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.12 }
},
"b": {
"dtype": "float32",
"shape": [1, 60],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.1 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 2, 10], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 10], "tolerance": 0.000001 }
}
},
{
"name": "parallel_hidden256_input64_batch4_seq2_shared_mem_edge",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 256 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 4, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 768, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 768, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 1536],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 4, 256], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 4, 256], "tolerance": 0.000001 }
}
},
{
"name": "parallel_batch200_hidden8_input4_seq2",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 8 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 200, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 24, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.15 }
},
"r": {
"dtype": "float32",
"shape": [1, 24, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.12 }
},
"b": {
"dtype": "float32",
"shape": [1, 48],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.1 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 200, 8], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 200, 8], "tolerance": 0.000001 }
}
},
{
"name": "parallel_input_proj_hidden256_input64_batch8_seq8",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 256 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [8, 8, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 768, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 768, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 1536],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [8, 1, 8, 256], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 8, 256], "tolerance": 0.000001 }
}
},
{
"name": "parallel_input_proj_lbr_hidden256_input64_batch8_seq8",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 1, "hidden_size": 256 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [8, 8, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 768, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 768, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 1536],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [8, 1, 8, 256], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 8, 256], "tolerance": 0.000001 }
}
},
{
"name": "forward_large_hidden512_vec4",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 512 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [4, 2, 64],
"data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.013, "cosStep": 0.027 }
},
"w": {
"dtype": "float32",
"shape": [1, 1536, 64],
"data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.011, "cosStep": 0.023 }
},
"r": {
"dtype": "float32",
"shape": [1, 1536, 512],
"data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.007, "cosStep": 0.017 }
},
"b": {
"dtype": "float32",
"shape": [1, 3072],
"data": { "kind": "fillFloat32", "scale": 0.05, "sinStep": 0.005, "cosStep": 0.019 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [4, 1, 2, 512], "tolerance": 0.002 },
"y_h": { "dtype": "float32", "shape": [1, 2, 512], "tolerance": 0.002 }
}
},
{
"name": "packed_recurrent_hidden512_input64_batch4_seq8",
"provenance": { "notes": "A long aligned GRU sequence checks transposed recurrent-weight orientation." },
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 512 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [8, 4, 64],
"data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.013, "cosStep": 0.027 }
},
"w": {
"dtype": "float32",
"shape": [1, 1536, 64],
"data": { "kind": "fillFloat32", "scale": 0.02, "sinStep": 0.011, "cosStep": 0.023 }
},
"r": {
"dtype": "float32",
"shape": [1, 1536, 512],
"data": { "kind": "fillFloat32", "scale": 0.01, "sinStep": 0.007, "cosStep": 0.017 }
},
"b": {
"dtype": "float32",
"shape": [1, 3072],
"data": { "kind": "fillFloat32", "scale": 0.02, "sinStep": 0.005, "cosStep": 0.019 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [8, 1, 4, 512], "tolerance": 0.003 },
"y_h": { "dtype": "float32", "shape": [1, 4, 512], "tolerance": 0.003 }
}
},
{
"name": "packed_recurrent_lbr_hidden512_input64_batch4_seq8",
"provenance": {
"notes": "With linear_before_reset=1, a long GRU sequence checks transposed recurrent-weight orientation."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 1, "hidden_size": 512 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [8, 4, 64],
"data": { "kind": "fillFloat32", "scale": 0.1, "sinStep": 0.017, "cosStep": 0.029 }
},
"w": {
"dtype": "float32",
"shape": [1, 1536, 64],
"data": { "kind": "fillFloat32", "scale": 0.02, "sinStep": 0.013, "cosStep": 0.031 }
},
"r": {
"dtype": "float32",
"shape": [1, 1536, 512],
"data": { "kind": "fillFloat32", "scale": 0.01, "sinStep": 0.011, "cosStep": 0.019 }
},
"b": {
"dtype": "float32",
"shape": [1, 3072],
"data": { "kind": "fillFloat32", "scale": 0.02, "sinStep": 0.007, "cosStep": 0.023 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [8, 1, 4, 512], "tolerance": 0.003 },
"y_h": { "dtype": "float32", "shape": [1, 4, 512], "tolerance": 0.003 }
}
},
{
"name": "ort_forward_initial_hidden_state",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ONNXRuntime_TestGRUOpForwardInitialHiddenState",
"notes": "Valid forward GRU with full sequence_lens and non-zero initial_h."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 1, 2],
"data": { "kind": "values", "values": [-0.455351, -0.276391, -0.185934, -0.269585] }
},
"w": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": {
"kind": "values",
"values": [-0.494659, 0.0453352, -0.487793, 0.417264, -0.0091708, -0.255364, -0.106952, -0.266717, -0.0888852, -0.428709, -0.283349, 0.208792]
}
},
"r": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": {
"kind": "values",
"values": [0.146626, -0.0620289, -0.0815302, 0.100482, -0.228172, 0.405972, 0.31576, 0.281487, -0.394864, 0.42111, -0.386624, -0.390225]
}
},
"b": {
"dtype": "float32",
"shape": [1, 12],
"data": {
"kind": "values",
"values": [0.381619, 0.0323954, -0.258721, 0.45056, -0.250755, 0.0967895, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
}
},
"sequence_lens": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
"initial_h": { "dtype": "float32", "shape": [1, 1, 2], "data": { "kind": "values", "values": [0.5, -0.5] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [2, 1, 1, 2],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [0.2366661, -0.1500429, 0.07378622, -0.02782359] }
},
"y_h": {
"dtype": "float32",
"shape": [1, 1, 2],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [0.07378622, -0.02782359] }
}
}
},
{
"name": "empty_zero_dim",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 0, 2], "data": { "kind": "values", "values": [] } },
"w": { "dtype": "float32", "shape": [1, 6, 2], "data": { "kind": "constant", "value": 0.1 } },
"r": { "dtype": "float32", "shape": [1, 6, 2], "data": { "kind": "constant", "value": 0.1 } },
"b": { "dtype": "float32", "shape": [1, 12], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 0, 2], "tolerance": 0.0001 },
"y_h": { "dtype": "float32", "shape": [1, 0, 2], "tolerance": 0.0001 }
}
},
{
"name": "ort_caseB_empty",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2 },
"inputs": {
"x": { "dtype": "float32", "shape": [0, 1, 2], "data": { "kind": "values", "values": [] } },
"w": { "dtype": "float32", "shape": [1, 6, 2], "data": { "kind": "constant", "value": 0.5 } },
"r": { "dtype": "float32", "shape": [1, 6, 2], "data": { "kind": "constant", "value": 0.5 } },
"b": { "dtype": "float32", "shape": [1, 12], "data": { "kind": "constant", "value": 0.5 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [0, 1, 1, 2], "tolerance": 0 },
"y_h": {
"dtype": "float32",
"shape": [1, 1, 2],
"data": { "kind": "values", "values": [0.0, 0.0] },
"tolerance": 0
}
},
"provenance": {
"notes": "A zero-length sequence produces an empty Y; Y_h equals the implicit zero initial hidden state."
}
},
{
"name": "large_hidden2048_workgroup_storage_boundary",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2048 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [4, 4, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 6144, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.023, "scale": 0.03 }
},
"r": {
"dtype": "float32",
"shape": [1, 6144, 2048],
"data": { "kind": "fillFloat32", "sinStep": 0.007, "cosStep": 0.017, "scale": 0.01 }
},
"b": {
"dtype": "float32",
"shape": [1, 12288],
"data": { "kind": "fillFloat32", "sinStep": 0.005, "cosStep": 0.019, "scale": 0.03 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [4, 1, 4, 2048], "tolerance": 0.003 },
"y_h": { "dtype": "float32", "shape": [1, 4, 2048], "tolerance": 0.003 }
}
},
{
"name": "packed_multiwg_hidden2048_seq2_below_subgroup_gemv_seq_floor",
"provenance": {
"notes": "Two timesteps at hidden=2048 sit below the seqLength>=4 floor of every subgroup-GEMV recurrence, so the multi-workgroup packed path owns the workgroup-storage-exceeding row width."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2048 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 1, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 6144, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.023, "scale": 0.03 }
},
"r": {
"dtype": "float32",
"shape": [1, 6144, 2048],
"data": { "kind": "fillFloat32", "sinStep": 0.007, "cosStep": 0.017, "scale": 0.01 }
},
"b": {
"dtype": "float32",
"shape": [1, 12288],
"data": { "kind": "fillFloat32", "sinStep": 0.005, "cosStep": 0.019, "scale": 0.03 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 1, 2048], "tolerance": 0.003 },
"y_h": { "dtype": "float32", "shape": [1, 1, 2048], "tolerance": 0.003 }
}
},
{
"name": "decode_seq1_scalar_hidden10",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 10 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 4, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"w": {
"dtype": "float32",
"shape": [1, 30, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.15 }
},
"r": {
"dtype": "float32",
"shape": [1, 30, 10],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.12 }
},
"b": {
"dtype": "float32",
"shape": [1, 60],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.17, "scale": 0.1 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 4, 10], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [1, 4, 10], "tolerance": 0.000001 }
}
},
{
"name": "parallel_mixed_vector_hidden6_lbr0",
"provenance": {
"notes": "hidden=6 keeps aligned X/W as vec4<f32> while recurrent rows bind as vec2<f32>. linear_before_reset=0."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 6 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.021, "cosStep": 0.033, "scale": 0.4 }
},
"w": {
"dtype": "float32",
"shape": [1, 18, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.029, "scale": 0.3 }
},
"r": {
"dtype": "float32",
"shape": [1, 18, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.023, "scale": 0.3 }
},
"b": {
"dtype": "float32",
"shape": [1, 36],
"data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.019, "scale": 0.2 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [4, 1, 2, 6], "tolerance": 0.00001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 6], "tolerance": 0.00001 }
}
},
{
"name": "parallel_mixed_vector_hidden6_lbr1",
"provenance": {
"notes": "hidden=6 keeps aligned X/W as vec4<f32> while recurrent rows bind as vec2<f32>. linear_before_reset=1."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 1, "hidden_size": 6 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.021, "cosStep": 0.033, "scale": 0.4 }
},
"w": {
"dtype": "float32",
"shape": [1, 18, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.029, "scale": 0.3 }
},
"r": {
"dtype": "float32",
"shape": [1, 18, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.023, "scale": 0.3 }
},
"b": {
"dtype": "float32",
"shape": [1, 36],
"data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.019, "scale": 0.2 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [4, 1, 2, 6], "tolerance": 0.00001 },
"y_h": { "dtype": "float32", "shape": [1, 2, 6], "tolerance": 0.00001 }
}
},
{
"name": "parallel_input_proj_vector_hidden126_input64_batch17_seq8",
"provenance": {
"notes": "Two-pass mixed-vector branch: aligned X/W bind as vec4<f32>, while even non-vec4 recurrent rows bind as vec2<f32>."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 126 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [8, 17, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 0.2 }
},
"w": {
"dtype": "float32",
"shape": [1, 378, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.007, "cosStep": 0.019, "scale": 0.03 }
},
"r": {
"dtype": "float32",
"shape": [1, 378, 126],
"data": { "kind": "fillFloat32", "sinStep": 0.005, "cosStep": 0.017, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 756],
"data": { "kind": "fillFloat32", "sinStep": 0.003, "cosStep": 0.011, "scale": 0.03 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [8, 1, 17, 126], "tolerance": 0.001 },
"y_h": { "dtype": "float32", "shape": [1, 17, 126], "tolerance": 0.001 }
}
},
{
"name": "subgroup_recurrent_vec2_tail_hidden250_input4_batch1_seq4",
"provenance": { "notes": "Hidden size 250 is even but not divisible by four, leaving one final output pair." },
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 250 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [4, 1, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 0.2 }
},
"w": {
"dtype": "float32",
"shape": [1, 750, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.007, "cosStep": 0.019, "scale": 0.03 }
},
"r": {
"dtype": "float32",
"shape": [1, 750, 250],
"data": { "kind": "fillFloat32", "sinStep": 0.005, "cosStep": 0.017, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 1500],
"data": { "kind": "fillFloat32", "sinStep": 0.003, "cosStep": 0.011, "scale": 0.03 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [4, 1, 1, 250], "tolerance": 0.001 },
"y_h": { "dtype": "float32", "shape": [1, 1, 250], "tolerance": 0.001 }
}
},
{
"name": "empty_seq_hidden4_input4_batch2_vec4_y_h_zero",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 4 },
"inputs": {
"x": { "dtype": "float32", "shape": [0, 2, 4], "data": { "kind": "values", "values": [] } },
"w": { "dtype": "float32", "shape": [1, 12, 4], "data": { "kind": "constant", "value": 0.05 } },
"r": { "dtype": "float32", "shape": [1, 12, 4], "data": { "kind": "constant", "value": 0.01 } },
"b": { "dtype": "float32", "shape": [1, 24], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [0, 1, 2, 4], "data": { "kind": "values", "values": [] }, "tolerance": 0 },
"y_h": { "dtype": "float32", "shape": [1, 2, 4], "data": { "kind": "constant", "value": 0.0 }, "tolerance": 0 }
}
},
{
"name": "layout1_batch_major",
"provenance": {
"source": "ONNX GRU-22 layout semantics and ONNX Runtime's CPU provider through the layout-0 transpose equivalence",
"notes": "Exercises batch-major GRU with batch=2 and sequence length 2. Inline expectations were generated by transposing X to layout 0, running ONNX Runtime's CPU provider, and transposing Y and Y_h back according to the ONNX layout contract."
},
"attrs": { "layout": 1, "direction": "forward", "linear_before_reset": 0, "hidden_size": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2, 1], "data": { "kind": "values", "values": [1.0, 2.0, 10.0, 20.0] } },
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.2, -0.1, 0.3] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.05, 0.07, 0.11] } },
"b": { "dtype": "float32", "shape": [1, 6], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [2, 2, 1, 1],
"data": {
"kind": "values",
"values": [0.13113902509212494, 0.29524683952331543, 0.11861342191696167, 0.13437393307685852]
},
"tolerance": 0.000001
},
"y_h": {
"dtype": "float32",
"shape": [2, 1, 1],
"data": { "kind": "values", "values": [0.29524683952331543, 0.13437393307685852] },
"tolerance": 0.000001
}
}
},
{
"name": "tiled_input_proj_subgroup_gemv_mixed_b5_h250",
"provenance": { "notes": "Hidden size 250 and batch size five exercise recurrent and input tails." },
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 250 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [4, 5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.031, "cosStep": 0.047, "scale": 0.2 }
},
"w": {
"dtype": "float32",
"shape": [1, 750, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.037, "scale": 0.03 }
},
"r": {
"dtype": "float32",
"shape": [1, 750, 250],
"data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.023, "scale": 0.01 }
},
"b": {
"dtype": "float32",
"shape": [1, 1500],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.029, "scale": 0.02 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [4, 1, 5, 250], "tolerance": 0.0005, "relTolerance": 0.0001 },
"y_h": { "dtype": "float32", "shape": [1, 5, 250], "tolerance": 0.0005, "relTolerance": 0.0001 }
}
},
{
"name": "tiled_input_proj_subgroup_batched_tail_b5_h512",
"provenance": {
"notes": "Batch size five, input size 32, and hidden size 512 check that each of the five sequences' single recurrent state updates independently, including the last sequence in the batch."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 512 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [4, 5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.031, "cosStep": 0.047, "scale": 0.2 }
},
"w": {
"dtype": "float32",
"shape": [1, 1536, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.037, "scale": 0.03 }
},
"r": {
"dtype": "float32",
"shape": [1, 1536, 512],
"data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.023, "scale": 0.01 }
},
"b": {
"dtype": "float32",
"shape": [1, 3072],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.029, "scale": 0.02 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [4, 1, 5, 512], "tolerance": 0.0005, "relTolerance": 0.0001 },
"y_h": { "dtype": "float32", "shape": [1, 5, 512], "tolerance": 0.0005, "relTolerance": 0.0001 }
}
},
{
"name": "fast_seqlens_postmask_short_prefix_h4",
"provenance": {
"notes": "A sequence ending after two of four timesteps has a zero Y tail and Y_h from timestep one."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 4 },
"inputs": {
"x": { "dtype": "float32", "shape": [4, 2, 4], "data": { "kind": "constant", "value": 0.0 } },
"w": { "dtype": "float32", "shape": [1, 12, 4], "data": { "kind": "constant", "value": 0.0 } },
"r": { "dtype": "float32", "shape": [1, 12, 4], "data": { "kind": "constant", "value": 0.0 } },
"b": { "dtype": "float32", "shape": [1, 24], "data": { "kind": "constant", "value": 0.1 } },
"sequence_lens": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 0] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [4, 1, 2, 4],
"data": {
"kind": "values",
"values": [0.08885166, 0.08885166, 0.08885166, 0.08885166, 0.0, 0.0, 0.0, 0.0, 0.13770533, 0.13770533, 0.13770533, 0.13770533, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
},
"tolerance": 0.00001
},
"y_h": {
"dtype": "float32",
"shape": [1, 2, 4],
"data": { "kind": "values", "values": [0.13770533, 0.13770533, 0.13770533, 0.13770533, 0.0, 0.0, 0.0, 0.0] },
"tolerance": 0.00001
}
}
},
{
"name": "optional_initial_h_without_sequence_lens",
"provenance": {
"notes": "ONNX GRU input 6 is independently optional: this non-zero initial_h is supplied while input 5 sequence_lens is absent. The two-step scalar recurrence makes ignoring initial_h numerically visible."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 1, 1], "data": { "kind": "values", "values": [0.3, -0.2] } },
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.5, -0.4, 0.3] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [0.1, -0.2, 0.25] } },
"b": {
"dtype": "float32",
"shape": [1, 6],
"data": { "kind": "values", "values": [0.05, -0.03, 0.02, 0.01, -0.02, 0.04] }
},
"initial_h": { "dtype": "float32", "shape": [1, 1, 1], "data": { "kind": "values", "values": [0.6] } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 1, 1, 1], "tolerance": 0.00001 },
"y_h": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0.00001 }
}
},
{
"name": "forward_batch_dispatch_fold_guard_65537",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "hidden_size": 2 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 65537, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.0007, "cosStep": 0.0011, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.03, "cosStep": 0.04, "scale": 0.1 }
},
"r": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.06, "scale": 0.1 }
},
"b": { "dtype": "float32", "shape": [1, 12], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 65537, 2], "tolerance": 0.00001 },
"y_h": { "dtype": "float32", "shape": [1, 65537, 2], "tolerance": 0.00001 }
}
},
{
"name": "forward_layout0_lbr1_scalar_hidden2",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 1, "hidden_size": 2 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 65537, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.0007, "cosStep": 0.0011, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.03, "cosStep": 0.04, "scale": 0.1 }
},
"r": {
"dtype": "float32",
"shape": [1, 6, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.06, "scale": 0.1 }
},
"b": { "dtype": "float32", "shape": [1, 12], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 65537, 2], "tolerance": 0.00001 },
"y_h": { "dtype": "float32", "shape": [1, 65537, 2], "tolerance": 0.00001 }
},
"provenance": {
"notes": "Batch size 65,537 needs more than 65,535 workgroups in one dimension; hidden_size=2 keeps the per-step update scalar rather than vectorized, with linear_before_reset=1."
}
},
{
"name": "forward_layout0_lbr1_vec4_hidden4",
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 1, "hidden_size": 4 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 65537, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.0007, "cosStep": 0.0011, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 12, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.03, "cosStep": 0.04, "scale": 0.1 }
},
"r": {
"dtype": "float32",
"shape": [1, 12, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.05, "cosStep": 0.06, "scale": 0.1 }
},
"b": { "dtype": "float32", "shape": [1, 24], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 65537, 4], "tolerance": 0.00001 },
"y_h": { "dtype": "float32", "shape": [1, 65537, 4], "tolerance": 0.00001 }
},
"provenance": {
"notes": "A single-step forward GRU over 65,537 batch rows with hidden and input sizes of four and linear_before_reset=1 checks Y and Y_h across multiple hidden units."
}
},
{
"name": "hidden_size_and_clip_omitted_infer_h1",
"provenance": {
"source": "ONNX GRU-22 schema and ONNX Runtime's CPU provider",
"notes": "With hidden_size and clip omitted, hidden size is inferred as 1 from W/R, and all three nonzero gate pre-activations remain unclipped."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 1], "data": { "kind": "values", "values": [2.0] } },
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [1.0, -0.5, 0.75] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "constant", "value": 0.0 } },
"b": {
"dtype": "float32",
"shape": [1, 6],
"data": { "kind": "values", "values": [0.2, -0.3, 0.4, 0.1, -0.1, 0.2] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [0.0884304866194725] }
},
"y_h": {
"dtype": "float32",
"shape": [1, 1, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [0.0884304866194725] }
}
}
},
{
"name": "hidden_size_omitted_explicit_clip_zero",
"provenance": {
"source": "ONNX GRU-22 schema, equations, and the limit check in ONNX Runtime's CPU provider",
"notes": "With hidden size inferred as 1, explicit clip=0 clamps every gate pre-activation to zero, yielding exact-zero Y and Y_h from the zero initial state."
},
"attrs": { "layout": 0, "direction": "forward", "linear_before_reset": 0, "clip": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 1], "data": { "kind": "values", "values": [2.0] } },
"w": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "values", "values": [1.0, -0.5, 0.75] } },
"r": { "dtype": "float32", "shape": [1, 3, 1], "data": { "kind": "constant", "value": 0.0 } },
"b": {
"dtype": "float32",
"shape": [1, 6],
"data": { "kind": "values", "values": [0.2, -0.3, 0.4, 0.1, -0.1, 0.2] }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [1, 1, 1, 1], "tolerance": 0, "data": { "kind": "constant", "value": 0.0 } },
"y_h": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0, "data": { "kind": "constant", "value": 0.0 } }
}
},
{
"name": "softplus_candidate_large_preactivation_finite",
"provenance": {
"notes": "Candidate activation Softplus with preactivation 100: finite (100) although log(1 + exp(100)) overflows. Update-gate bias -100 makes z ~ 0 so H = (1 - z) * softplus(Wbh) exposes the candidate directly; the second unit uses softplus(2). Bias layout [Wbz Wbr Wbh Rbz Rbr Rbh]; values pinned from the ONNX GRU equations."
},
"attrs": { "hidden_size": 2, "activations": ["Sigmoid", "Softplus"] },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 1], "data": { "kind": "constant", "value": 0.0 } },
"w": { "dtype": "float32", "shape": [1, 6, 1], "data": { "kind": "constant", "value": 0.0 } },
"r": { "dtype": "float32", "shape": [1, 6, 2], "data": { "kind": "constant", "value": 0.0 } },
"b": {
"dtype": "float32",
"shape": [1, 12],
"data": { "kind": "values", "values": [-100.0, -100.0, 0.0, 0.0, 100.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 2],
"tolerance": 0.00001,
"data": { "kind": "values", "values": [100.0, 2.1269280110429727] }
},
"y_h": {
"dtype": "float32",
"shape": [1, 1, 2],
"tolerance": 0.00001,
"data": { "kind": "values", "values": [100.0, 2.1269280110429727] }
}
}
},
{
"name": "layout1_batch_major_projected_forward_h192",
"provenance": {
"notes": "A batch-major forward GRU large enough for the projected recurrence. The layout changes only how (timestep, batch) maps to a row, so the same recurrence runs with a different stride pair."
},
"attrs": { "layout": 1, "direction": "forward", "linear_before_reset": 0, "hidden_size": 192 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [4, 4, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07 }
},
"w": {
"dtype": "float32",
"shape": [1, 576, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.03, "cosStep": 0.05, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 576, 192],
"data": { "kind": "fillFloat32", "sinStep": 0.02, "cosStep": 0.09, "scale": 0.05 }
},
"b": {
"dtype": "float32",
"shape": [1, 1152],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.17, "scale": 0.02 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [4, 4, 1, 192], "tolerance": 0.00001, "relTolerance": 0.0001 },
"y_h": { "dtype": "float32", "shape": [4, 1, 192], "tolerance": 0.00001, "relTolerance": 0.0001 }
}
},
{
"name": "projection_reverse-h128-in128-b8-seq64-general-scalar",
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 0, "hidden_size": 128 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [64, 8, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 768],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.07, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [64, 1, 8, 128] },
"y_h": { "dtype": "float32", "shape": [1, 8, 128] }
}
},
{
"name": "projection_reverse-neighbor-h126-i128-b8-s64-lbr0",
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 0, "hidden_size": 126 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [64, 8, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 378, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 378, 126],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 756],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.07, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [64, 1, 8, 126] },
"y_h": { "dtype": "float32", "shape": [1, 8, 126] }
}
},
{
"name": "projection_reverse-neighbor-h128-i128-b8-s64-lbr1",
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 1, "hidden_size": 128 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [64, 8, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 768],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.07, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [64, 1, 8, 128] },
"y_h": { "dtype": "float32", "shape": [1, 8, 128] }
}
},
{
"name": "projection_reverse-neighbor-h256-i64-b4-s32-lbr0",
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 0, "hidden_size": 256 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [32, 4, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 768, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 768, 256],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 1536],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.07, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [32, 1, 4, 256] },
"y_h": { "dtype": "float32", "shape": [1, 4, 256] }
}
},
{
"name": "projection_reverse-neighbor-h128-i128-b8-s128-lbr0",
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 0, "hidden_size": 128 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [128, 8, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 768],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.07, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [128, 1, 8, 128] },
"y_h": { "dtype": "float32", "shape": [1, 8, 128] }
}
},
{
"name": "projection_reverse-neighbor-h128-i128-b1-s128-lbr0",
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 0, "hidden_size": 128 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [128, 1, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 768],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.07, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [128, 1, 1, 128] },
"y_h": { "dtype": "float32", "shape": [1, 1, 128] }
}
},
{
"name": "projection_reverse-neighbor-h130-i128-b4-s32-lbr0",
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 0, "hidden_size": 130 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [32, 4, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 390, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 390, 130],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 780],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.07, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [32, 1, 4, 130] },
"y_h": { "dtype": "float32", "shape": [1, 4, 130] }
}
},
{
"name": "projection_reverse-neighbor-h128-i128-b8-s7-lbr0",
"attrs": { "layout": 0, "direction": "reverse", "linear_before_reset": 0, "hidden_size": 128 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [7, 8, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 0.3 }
},
"w": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.05 }
},
"r": {
"dtype": "float32",
"shape": [1, 384, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07, "scale": 0.02 }
},
"b": {
"dtype": "float32",
"shape": [1, 768],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.07, "scale": 0.05 }
}
},
"outputs": {
"y": { "dtype": "float32", "shape": [7, 1, 8, 128] },
"y_h": { "dtype": "float32", "shape": [1, 8, 128] }
}
},
{
"name": "ort_layout1_batch_major_hidden3_no_bias",
"provenance": {
"source": "onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc",
"test": "GRUTest.ForwardDefaultActivationsSimpleWeightsNoBiasLayout1",
"notes": "Upstream passes no bias; this package requires B, so a zero bias of shape [1, 6*hidden] is supplied. X is batch-major [batch, seq, input]."
},
"attrs": { "layout": 1, "direction": "forward", "linear_before_reset": 0, "hidden_size": 3 },
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2, 1], "data": { "kind": "values", "values": [1.0, 10.0, 2.0, 11.0] } },
"w": {
"dtype": "float32",
"shape": [1, 9, 1],
"data": { "kind": "values", "values": [0.1, 0.2, 0.3, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0] }
},
"r": { "dtype": "float32", "shape": [1, 9, 3], "data": { "kind": "constant", "value": 0.1 } },
"b": { "dtype": "float32", "shape": [1, 18], "data": { "kind": "constant", "value": 0.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [2, 2, 1, 3], "tolerance": 0.000001 },
"y_h": { "dtype": "float32", "shape": [2, 1, 3], "tolerance": 0.000001 }
}
}
]
}