Xenova's picture
Xenova HF Staff
sync 2e7068faf55e
ea99ad0 verified
Raw
History Blame
15.9 kB
{
"op": "ai.onnx.ReverseSequence",
"cases": [
{
"name": "vec4_inner8_partial_reverse",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [2, 5, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 5] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 5, 8], "tolerance": 0 } }
},
{
"name": "vec4_empty_time_dim_inner4",
"provenance": {
"notes": "An empty tensor that still reaches the vec4 route. The existing empty_zero_dim cases have an innermost dimension of 1, so they fail the `dim(input, rank-1) % 4 == 0` gate and take the scalar fallback -- 0 satisfies that gate, but only the innermost dimension is tested by it. With the zero on the TIME axis and a four-aligned innermost dimension the outer stride is a product containing that zero, which is the case the `stride.value if stride.value > 0 else 1` guards in the coordinate decode and the source recomposition exist for; nothing rendered them before."
},
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": { "dtype": "float32", "shape": [2, 0, 4], "data": { "kind": "values", "values": [] } },
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 0, 4], "tolerance": 0 } }
},
{
"name": "vec4_f16_inner4_partial_reverse",
"provenance": {
"notes": "The f16 half of the vec4 route. float16_default_axes has an innermost dimension of 1 and so takes the scalar fallback, leaving `enable f16` and the f16 element types unrendered on this shader even though the type constraints admit float16."
},
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "float16",
"shape": [2, 3, 4],
"data": { "kind": "cycle", "values": [0.5, -1.25, 2.0, -0.75, 3.5, -2.5] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } }
},
"outputs": { "y": { "dtype": "float16", "shape": [2, 3, 4], "tolerance": 0 } }
},
{
"name": "dispatch_cliff_rankn_f32",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [1, 16777216],
"data": { "kind": "cycle", "values": [-1.0, 0.0, 1.0, 2.0] }
},
"sequence_lens": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [1] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 16777216], "tolerance": 0 } }
},
{
"name": "batch_major_int32",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"test": "ReverseSequenceTest.BatchMajor",
"notes": "Adapted from int64 to supported int32 data and lengths."
},
"inputs": {
"input": {
"dtype": "int32",
"shape": [2, 4, 1],
"data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5, 6, 7] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [4, 3] } }
},
"outputs": { "y": { "dtype": "int32", "shape": [2, 4, 1] } }
},
{
"name": "time_major_int32",
"attrs": { "batch_axis": 1, "time_axis": 0 },
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"test": "ReverseSequenceTest.TimeMajor",
"notes": "Adapted from int64 to supported int32 data and lengths."
},
"inputs": {
"input": {
"dtype": "int32",
"shape": [4, 2, 1],
"data": { "kind": "values", "values": [0, 4, 1, 5, 2, 6, 3, 7] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [4, 3] } }
},
"outputs": { "y": { "dtype": "int32", "shape": [4, 2, 1] } }
},
{
"name": "larger_trailing_dim",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"test": "ReverseSequenceTest.LargerDim2"
},
"inputs": {
"input": {
"dtype": "float32",
"shape": [2, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2] } }
},
{
"name": "zero_sequence_length",
"attrs": { "batch_axis": 1, "time_axis": 0 },
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"test": "ReverseSequenceTest.ZeroSequenceLength"
},
"inputs": {
"input": {
"dtype": "float32",
"shape": [5, 3, 1],
"data": {
"kind": "values",
"values": [10.0, 20.0, 30.0, 11.0, 21.0, 31.0, 12.0, 22.0, 32.0, 13.0, 23.0, 33.0, 14.0, 24.0, 34.0]
}
},
"sequence_lens": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [4, 0, 2] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [5, 3, 1] } }
},
{
"name": "float16_default_axes",
"inputs": {
"input": {
"dtype": "float16",
"shape": [3, 2, 1],
"data": { "kind": "values", "values": [1.0, 10.0, 2.0, 11.0, 3.0, 12.0] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 1] } }
},
"outputs": { "y": { "dtype": "float16", "shape": [3, 2, 1], "tolerance": 0.001 } }
},
{
"name": "onnx_backend_rank2_time_axis0",
"attrs": { "time_axis": 0, "batch_axis": 1 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [4, 4],
"data": {
"kind": "values",
"values": [0.0, 4.0, 8.0, 12.0, 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0]
}
},
"sequence_lens": { "dtype": "uint32", "shape": [4], "data": { "kind": "values", "values": [4, 3, 2, 1] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [4, 4] } },
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_reversesequence_time",
"notes": "Official fixture sequence_lens is int64; this framework stores lengths as int32."
}
},
{
"name": "onnx_backend_rank2_time_axis1",
"attrs": { "time_axis": 1, "batch_axis": 0 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [4, 4],
"data": {
"kind": "values",
"values": [0.0, 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]
}
},
"sequence_lens": { "dtype": "uint32", "shape": [4], "data": { "kind": "values", "values": [1, 2, 3, 4] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [4, 4] } },
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_reversesequence_batch",
"notes": "Official fixture sequence_lens is int64; this framework stores lengths as int32."
}
},
{
"name": "uint8_batch_major_edge_values",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"test": "ReverseSequenceTest.BatchMajor",
"notes": "Additional valid type edge: logical uint8 data is reversed using the same batch-major addressing as ORT's BatchMajor case."
},
"inputs": {
"input": {
"dtype": "uint8",
"shape": [2, 4, 1],
"data": { "kind": "values", "values": [250, 1, 2, 3, 4, 5, 6, 255] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [4, 2] } }
},
"outputs": { "y": { "dtype": "uint8", "shape": [2, 4, 1], "tolerance": 0 } }
},
{
"name": "int8_time_major_negative_values",
"attrs": { "batch_axis": 1, "time_axis": 0 },
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"test": "ReverseSequenceTest.TimeMajor",
"notes": "Additional valid type edge: logical int8 data, including -128 and 127, follows ORT's TimeMajor addressing."
},
"inputs": {
"input": {
"dtype": "int8",
"shape": [4, 2, 1],
"data": { "kind": "values", "values": [-128, 10, -2, 20, 0, 30, 127, 40] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 1] } }
},
"outputs": { "y": { "dtype": "int8", "shape": [4, 2, 1], "tolerance": 0 } }
},
{
"name": "ort_bool_batch_major",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"test": "ReverseSequenceTest.BatchMajor",
"notes": "ONNX ReverseSequence permits bool payload tensors, which this fixture exercises batch-major."
},
"inputs": {
"input": {
"dtype": "bool",
"shape": [2, 4, 1],
"data": { "kind": "values", "values": [1, 0, 1, 0, 0, 1, 0, 1] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 2] } }
},
"outputs": { "y": { "dtype": "bool", "shape": [2, 4, 1], "tolerance": 0 } }
},
{
"name": "ort_int16_time_major",
"attrs": { "batch_axis": 1, "time_axis": 0 },
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"test": "ReverseSequenceTest.TimeMajor",
"notes": "ONNX ReverseSequence int16 coverage with min/max sentinels on the time-major axis."
},
"inputs": {
"input": {
"dtype": "int16",
"shape": [4, 2, 1],
"data": { "kind": "values", "values": [-32768, 10, -2, 20, 0, 30, 32767, 40] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [4, 2] } }
},
"outputs": { "y": { "dtype": "int16", "shape": [4, 2, 1], "tolerance": 0 } }
},
{
"name": "uint32_batch_major_extreme_payloads",
"provenance": {
"source": "onnx/onnx/docs/Operators.md#ReverseSequence-10",
"notes": "Covers standard uint32 data with UINT32_MAX and values across the signed boundary while using the existing runtime index projection."
},
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "uint32",
"shape": [2, 3, 1],
"data": { "kind": "values", "values": [0, 4294967295, 2147483648, 1, 16777217, 4000000000] }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 2] } }
},
"outputs": { "y": { "dtype": "uint32", "shape": [2, 3, 1], "tolerance": 0 } }
},
{
"name": "rank6_default_axes",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/reverse_sequence_test.cc",
"notes": "Additional rank edge inside this framework's supported rank range; uses ONNX defaults batch_axis=1,time_axis=0."
},
"inputs": {
"input": {
"dtype": "float32",
"shape": [3, 2, 1, 2, 1, 2],
"data": {
"kind": "values",
"values": [0.0, 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, 19.0, 20.0, 21.0, 22.0, 23.0]
}
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 2, 1, 2, 1, 2], "tolerance": 0 } }
},
{
"name": "empty_zero_dim",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": { "dtype": "int32", "shape": [2, 0, 1], "data": { "kind": "values", "values": [] } },
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } }
},
"outputs": { "y": { "dtype": "int32", "shape": [2, 0, 1], "tolerance": 0 } }
},
{
"name": "empty_zero_dim_f32",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": { "dtype": "float32", "shape": [2, 0, 1], "data": { "kind": "values", "values": [] } },
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 0, 1], "tolerance": 0 } }
},
{
"name": "scalar_fallback_inner_not_mul4_partial_reverse",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [2, 4, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 4] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 4, 5], "tolerance": 0 } }
},
{
"name": "scalar_fallback_rank2_time_is_inner_axis",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [3, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19 }
},
"sequence_lens": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [6, 4, 2] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 6], "tolerance": 0 } }
},
{
"name": "vec4_len_exceeds_timedim_clamp",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [2, 5, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [99, 100] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 5, 8], "tolerance": 0 } }
},
{
"name": "rank7_batch_major",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [2, 3, 1, 1, 1, 1, 2],
"data": { "kind": "linspace", "start": 0.0, "end": 11.0 }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 3, 1, 1, 1, 1, 2], "tolerance": 0 } }
},
{
"name": "rank8_batch_major",
"attrs": { "batch_axis": 0, "time_axis": 1 },
"inputs": {
"input": {
"dtype": "float32",
"shape": [2, 3, 1, 1, 1, 1, 2, 2],
"data": { "kind": "linspace", "start": 1.0, "end": 24.0 }
},
"sequence_lens": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 2] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 3, 1, 1, 1, 1, 2, 2], "tolerance": 0 } }
}
]
}