Download build/webgpu/test.json from webgpu-kernels/ai.onnx.TopK: direct link, hf CLI and curl.
- Browser
- Download file 110 kB
-
https://huggingface.co/kernels/webgpu-kernels/ai.onnx.TopK/resolve/v1/build/webgpu/test.json
- Command line
-
hf download hf://webgpu-kernels/ai.onnx.TopK@v1/build/webgpu/test.json
-
curl -L -o test.json https://huggingface.co/kernels/webgpu-kernels/ai.onnx.TopK/resolve/v1/build/webgpu/test.json
110 kB
| { | |
| "fixtureArrays": { | |
| "topk_small_rows_rank3_cycle33": [0.015625, 0.03125, 0.046875, 0.0625, 0.078125, 0.09375, 0.109375, 0.125, 0.140625, 0.15625, 0.171875, 0.1875, 0.203125, 0.21875, 0.234375, 0.25, 0.265625, 0.28125, 0.296875, 0.3125, 0.328125, 0.34375, 0.359375, 0.375, 0.390625, 0.40625, 0.421875, 0.4375, 0.453125, 0.46875, 0.484375, 0.5, 0.515625], | |
| "order_key_extremes": ["-Infinity", -65504, -2, 0, 0, 2, 65504, "Infinity", 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0] | |
| }, | |
| "cases": [ | |
| { | |
| "name": "onnx_default_last_axis_omitted", | |
| "provenance": { | |
| "source": "https://onnx.ai/onnx/operators/onnx__TopK.html", | |
| "test": "TopK axis default", | |
| "notes": "Omitting axis must select the last dimension (ONNX default -1), not axis 1. Rank 3 makes those axes distinct, and both output values and indices are pinned. Representable ONNX int64 indices are stored in uint32 slots." | |
| }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 2, 3], | |
| "data": { "kind": "values", "values": [1.0, 9.0, 3.0, 4.0, 2.0, 8.0, 7.0, 0.0, 6.0, 5.0, 11.0, 10.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "float32", | |
| "shape": [2, 2, 1], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [9.0, 8.0, 7.0, 11.0] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [2, 2, 1], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 2, 0, 1] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "f32_largest_positive_subnormal_beats_zero", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top1DefaultAxisLargestElements", | |
| "notes": "A positive subnormal is strictly greater than zero; TopK should return its index rather than tie-breaking on a flushed zero." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [-1e-40, 0.0, 1e-40] } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 1], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "f32_largest_positive_subnormal_beats_zero_axis0", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top1DefaultAxisLargestElements", | |
| "notes": "On axis 0, a positive subnormal is strictly greater than zero; TopK must return its index rather than tie-break against a flushed zero." | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [-1e-40, 0.0, 1e-40] } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 1], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "f32_smallest_negative_subnormal_beats_zero", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top2DefaultAxisSmallestElements", | |
| "notes": "A negative subnormal is strictly less than zero; smallest TopK should return its index rather than tie-breaking on flushed zeros." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [1e-40, 0.0, -1e-40] } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 1], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 1], "tolerance": 0, "data": { "kind": "values", "values": [2] } } | |
| } | |
| }, | |
| { | |
| "name": "f32_smallest_negative_subnormal_beats_zero_axis0", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3ExplicitAxisSmallestElements", | |
| "notes": "On axis 0, a negative subnormal is strictly less than zero; smallest TopK must return its index." | |
| }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [1e-40, 0.0, -1e-40] } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 1], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 1], "tolerance": 0, "data": { "kind": "values", "values": [2] } } | |
| } | |
| }, | |
| { | |
| "name": "axis1_largest_sorted", | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 5], | |
| "data": { "kind": "values", "values": [1.5, 2.0, 2.0, -1.0, 0.5, 0.1, 2.5, 3.0, 3.0, -2.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top1_default_axis_largest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top1DefaultAxisLargestElements" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.3, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top2_default_axis_largest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top2DefaultAxisLargestElements" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.4, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top3_default_axis_largest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3DefaultAxisLargestElements" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.4, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top_all_default_axis_largest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopAllDefaultAxisLargestElements" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.3, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top2_default_axis_smallest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top2DefaultAxisSmallestElements" | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.4, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top3_axis0_smallest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3ExplicitAxisSmallestElements" | |
| }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.3, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top1_rank3_axis1_largest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top1ExplicitAxisMultiDInputLargestElements" | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 2, 2], | |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top1_rank3_axis1_smallest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top1ExplicitAxisMultiDInputSmallestElements" | |
| }, | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 2, 2], | |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top2_axis0_largest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top2ExplicitAxisLargestElements" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4], | |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 11.0, 8.0, 5.0, 6.0, 7.0, 4.0, 9.0, 10.0, 3.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top_all_axis0_largest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopAllExplicitAxisLargestElements" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.3, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [4, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [4, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "tie_breaks_lower_index", | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 6], | |
| "data": { "kind": "values", "values": [5.0, 5.0, 4.0, 5.0, 3.0, 5.0, 1.0, 2.0, 2.0, 2.0, -1.0, -1.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "smallest_tie_breaks_lower_index", | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 6], | |
| "data": { "kind": "values", "values": [-5.0, -5.0, -4.0, -5.0, 3.0, -5.0, 1.0, -2.0, -2.0, -2.0, -1.0, -1.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "axis0_largest_sorted", | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4], | |
| "data": { "kind": "values", "values": [1.0, 5.0, 3.0, 4.0, 2.0, 5.0, 7.0, 1.0, 3.0, 4.0, 7.0, 9.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "axis0_smallest_sorted", | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4], | |
| "data": { "kind": "values", "values": [1.0, 5.0, 3.0, 4.0, 2.0, 5.0, -7.0, 1.0, 3.0, 4.0, -7.0, 9.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "axis_minus_one_largest_sorted", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 5], | |
| "data": { "kind": "values", "values": [0.5, 4.0, 4.0, -1.0, 2.0, 7.0, 1.0, 7.0, 3.0, 7.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "axis1_largest_unsorted_attr", | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 0 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 5], | |
| "data": { "kind": "values", "values": [1.0, 5.0, 3.0, 4.0, 2.0, 2.0, 7.0, 8.0, 6.0, 1.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "axis_minus_two_largest_sorted", | |
| "attrs": { "axis": -2, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4], | |
| "data": { "kind": "values", "values": [1.0, 5.0, 3.0, 4.0, 2.0, 5.0, 7.0, 1.0, 3.0, 4.0, 7.0, 9.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_last_axis_largest_sorted_ties", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 2, 5], | |
| "data": { | |
| "kind": "values", | |
| "values": [1.0, 4.0, 4.0, -2.0, 3.0, 0.0, -1.0, -1.0, 5.0, 5.0, 9.0, 8.0, 9.0, 7.0, 6.0, -3.0, -3.0, -4.0, -2.0, -2.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_rank3_last_axis_largest_nan_rows", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top2DefaultAxisLargestElements", | |
| "notes": "NaN extension of ORT's largest sorted TopK coverage. Includes an all-NaN row and a finite-tie row where a NaN sentinel appears after finite values." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1, 2, 4], | |
| "data": { "kind": "values", "values": ["NaN", "NaN", "NaN", "NaN", 1.0, "NaN", 1.0, 0.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0, "allowNaN": true }, | |
| "indices": { "dtype": "uint32", "shape": [1, 2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_last_axis_smallest_sorted_ties", | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 2, 5], | |
| "data": { | |
| "kind": "values", | |
| "values": [1.0, -4.0, -4.0, 2.0, -3.0, 0.0, -1.0, -1.0, -5.0, -5.0, -9.0, -8.0, -9.0, -7.0, -6.0, 3.0, 3.0, 4.0, 2.0, 2.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_largest_sorted_ties", | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4, 3], | |
| "data": { | |
| "kind": "values", | |
| "values": [1.0, 5.0, 2.0, 3.0, 5.0, 4.0, 3.0, -1.0, 6.0, 0.0, 7.0, 6.0, -2.0, 10.0, 0.0, -2.0, 8.0, 0.0, 4.0, 8.0, -1.0, 4.0, 9.0, -1.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_smallest_sorted_ties", | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4, 3], | |
| "data": { | |
| "kind": "values", | |
| "values": [-1.0, 5.0, -2.0, -3.0, 5.0, -4.0, -3.0, -1.0, -6.0, 0.0, 7.0, -6.0, 2.0, -10.0, 0.0, 2.0, -8.0, 0.0, -4.0, -8.0, 1.0, -4.0, -9.0, 1.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis0_largest_sorted_ties", | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2, 3], | |
| "data": { | |
| "kind": "values", | |
| "values": [1.0, 9.0, 3.0, 4.0, 5.0, 6.0, 2.0, 9.0, 7.0, 4.0, 8.0, 6.0, 3.0, 1.0, 7.0, 2.0, 8.0, 0.0, 3.0, 9.0, -1.0, 4.0, 0.0, 6.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis0_smallest_sorted_ties", | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2, 3], | |
| "data": { | |
| "kind": "values", | |
| "values": [-1.0, -9.0, 3.0, 4.0, -5.0, -6.0, -2.0, -9.0, -7.0, 4.0, -8.0, -6.0, -3.0, -1.0, -7.0, 2.0, -8.0, 0.0, -3.0, -9.0, -1.0, 4.0, 0.0, -6.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank4_last_axis_largest_sorted_ties", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1, 2, 2, 4], | |
| "data": { | |
| "kind": "values", | |
| "values": [1.0, 4.0, 4.0, 2.0, 0.0, 5.0, 5.0, 3.0, 7.0, 6.0, 7.0, 1.0, -2.0, -2.0, -3.0, -1.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 2, 2, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 2, 2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank4_last_axis_smallest_sorted_ties", | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1, 2, 2, 4], | |
| "data": { | |
| "kind": "values", | |
| "values": [-1.0, -4.0, -4.0, -2.0, 0.0, -5.0, -5.0, -3.0, -7.0, -6.0, -7.0, -1.0, 2.0, 2.0, 3.0, 1.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 2, 2, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 2, 2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "top0_default_axis_largest_empty_outputs", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top0DefaultAxisLargestElements" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 0 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.3, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 0], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 0], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "top0_axis0_empty_outputs", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top0DefaultAxisLargestElements" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 0 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2], | |
| "data": { "kind": "values", "values": [0.1, 0.3, 0.2, 0.4, 0.1, 0.3, 0.3, 0.2] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [0, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [0, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank1_top_all_largest_ort", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopAllExplicitAxis1DInputLargestElements" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 13 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [13], | |
| "data": { | |
| "kind": "values", | |
| "values": [93.0, 695.0, 971.0, 978.0, 483.0, 247.0, 242.0, 983.0, 531.0, 723.0, 285.0, 527.0, 862.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [13], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [13], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank1_top2_repeated_maxima_lower_index", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopAllExplicitAxis1DLargeInputLargestElements" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [16], | |
| "data": { | |
| "kind": "values", | |
| "values": [93.0, 695.0, 971.0, 978.0, 483.0, 247.0, 242.0, 983.0, 531.0, 723.0, 93.0, 695.0, 971.0, 983.0, 483.0, 247.0] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "f16_rank1_nth_element_negative_values", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.NthElementHalf_NegtiveVals" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [6], | |
| "data": { "kind": "values", "values": [10.0, -8.0, -7.0, -4.0, -5.0, -6.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [4], "tolerance": 0.00098 }, | |
| "indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "smallest_non_power_of_two_positive_infinity_padding", | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [1.0, 2.0, "Infinity"] } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "largest_non_power_of_two_negative_infinity_padding", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [-1.0, -2.0, "-Infinity"] } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "top3_all_same_smallest_lower_indices", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3AllSame" | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_axis0_all_positive_infinity_largest_ties", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3ExplicitAxisInfinity" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": ["Infinity", "Infinity", "Infinity", "Infinity", "Infinity", "Infinity", "Infinity", "Infinity"] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_axis0_all_negative_infinity_largest_ties", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3ExplicitAxisInfinity" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": ["-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity"] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_rank1_one_merge_all_ties_largest", | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 8 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [4097], "data": { "kind": "constant", "value": 0.25 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [8], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [8], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_axis1_one_merge_all_ties_smallest", | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 7 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [2, 4099], "data": { "kind": "constant", "value": -0.5 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 7], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 7], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_axis1_two_merge_vocab_top100_ties", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 100 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [1, 43009], "data": { "kind": "constant", "value": 1.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 100], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 100], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_axis1_two_merge_smallest_ties", | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 100 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [1, 43009], "data": { "kind": "constant", "value": -1.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 100], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 100], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_f16_one_merge_generated_logits", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 6 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [1, 3000], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.029, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [1, 6], "tolerance": 0.00098 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 6], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_top0_last_axis_empty_outputs", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 0 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [2, 4097], "data": { "kind": "constant", "value": 0.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 0], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 0], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_top1_last_axis_all_ties_lower_index", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 0 }, | |
| "args": { "k": 1 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [1, 4097], "data": { "kind": "constant", "value": 3.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 1], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_top1_last_axis_smallest_generated", | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 3001], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.031, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "last_axis_top1_smallest_generated", | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 129], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.043, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 1], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank1_axis0_smallest_sorted_tie_lower_index", | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [7], | |
| "data": { "kind": "values", "values": [3.0, -1.5, 2.0, -1.5, 0.0, 5.0, -4.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "f16_axis0_non_last_all_ties", | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { "x": { "dtype": "float16", "shape": [6, 4], "data": { "kind": "constant", "value": 2.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [2, 4], "tolerance": 0.00098 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_unsorted_top1_smallest", | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 0 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 5, 3], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.07, "scale": 1.5 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_axis0_top3_positive_infinity_smallest", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3ExplicitAxisInfinity" | |
| }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": ["Infinity", "Infinity", "Infinity", "Infinity", "Infinity", "Infinity", "Infinity", "Infinity"] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_axis0_top3_negative_infinity_smallest", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3ExplicitAxisInfinity" | |
| }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": ["-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity"] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_rank1_nth_element_k4_f32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.NthElement" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [6], | |
| "data": { "kind": "values", "values": [10.0, 8.0, 7.0, 4.0, 5.0, 6.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [4], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_rank1_nth_element_k4_negative_values", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.NthElementHalf_NegtiveVals" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [6], | |
| "data": { "kind": "values", "values": [10.0, -8.0, -7.0, -4.0, -5.0, -6.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [4], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_rank1_nth_element_k4_f16", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.NthElementHalf" | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [6], | |
| "data": { "kind": "values", "values": [10.0, 8.0, 7.0, 4.0, 5.0, 6.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [4], "tolerance": 0.00098 }, | |
| "indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank1_axis0_largest_k100_merge", | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 100 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1024], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.031, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [100], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [100], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_top3_all_same_smallest_tie_lower_index", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3AllSame" | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [2, 4], "data": { "kind": "constant", "value": 0.1 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "onnx_backend_top_k", | |
| "attrs": { "axis": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 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] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 3] }, | |
| "indices": { "dtype": "uint32", "shape": [3, 3] } | |
| }, | |
| "provenance": { | |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_top_k", | |
| "notes": "The fixture represents the scalar TopK `K` input as argument `k`. This WebGPU package stores representable ONNX int64 values and indices in int32 or uint32 slots." | |
| } | |
| }, | |
| { | |
| "name": "onnx_backend_top_k_negative_axis", | |
| "attrs": { "axis": -1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 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] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 3] }, | |
| "indices": { "dtype": "uint32", "shape": [3, 3] } | |
| }, | |
| "provenance": { | |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_top_k_negative_axis", | |
| "notes": "The fixture represents the scalar TopK `K` input as argument `k`. This WebGPU package stores representable ONNX int64 values and indices in int32 or uint32 slots." | |
| } | |
| }, | |
| { | |
| "name": "onnx_backend_top_k_smallest", | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4], | |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 11.0, 10.0, 9.0, 8.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 3] }, | |
| "indices": { "dtype": "uint32", "shape": [3, 3] } | |
| }, | |
| "provenance": { | |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_top_k_smallest", | |
| "notes": "The fixture represents the scalar TopK `K` input as argument `k`. This WebGPU package stores representable ONNX int64 values and indices in int32 or uint32 slots." | |
| } | |
| }, | |
| { | |
| "name": "onnx_backend_top_k_same_values_2d", | |
| "provenance": { | |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_top_k_same_values_2d", | |
| "notes": "Official value tensor is int64; adapted to float32 because this TopK manifest supports floating values and uint32 indices." | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4], | |
| "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 1.0, 1.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "onnx_backend_top_k_same_values_largest", | |
| "provenance": { | |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_top_k_same_values_largest", | |
| "notes": "The official int64 value tensor is represented as supported float32 values with uint32 indices and an explicit `largest=1` request." | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_int8_largest_sorted_tie_indices", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopK_Int8" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int8", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [10, 30, 20, 40, 10, 30, 40, 20] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int8", "shape": [2, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_int8_negative_largest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopK_Int8_Negative" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int8", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [-10, -30, -20, -40, -10, -30, -40, -20] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int8", "shape": [2, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_int8_smallest_sorted", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopK_Int8_Smallest" | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int8", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [10, 30, 20, 40, 10, 30, 40, 20] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int8", "shape": [2, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_int16_largest_sorted_tie_indices", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopK_Int16" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int16", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [100, 300, 200, 400, 100, 300, 400, 200] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int16", "shape": [2, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_uint8_largest_sorted_tie_indices", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopK_Uint8" | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint8", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [10, 30, 20, 40, 10, 30, 40, 20] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "uint8", "shape": [2, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "int32_largest_sorted_tie_indices", | |
| "provenance": { | |
| "source": "https://github.com/onnx/onnx/blob/main/docs/Operators.md#TopK", | |
| "notes": "ONNX TopK permits int32 value tensors." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [10, 30, 20, 40, 40, 30, 40, 20] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int32", "shape": [2, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "int32_largest_exact_above_float24", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top1ExplicitAxisMultiDInputLargestElements", | |
| "notes": "Distinct int32 values 16777216 and 16777217 must remain ordered by integer value, not by their rounded f32 representation." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [16777216, 16777217, 5, -3, 123456788, 123456789, 0, -7] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [2, 1], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [16777217, 123456789] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [2, 1], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 1] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "int32_smallest_exact_below_negative_float24", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3ExplicitAxisSmallestElements", | |
| "notes": "Distinct int32 values -16777216 and -16777217 must remain ordered by integer value, not by their rounded f32 representation." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [-16777216, -16777217, 5, -3, -123456788, -123456789, 0, -7] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [2, 1], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [-16777217, -123456789] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [2, 1], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 1] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "axis0_int32_largest_exact_above_float24", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top1ExplicitAxisLargestElements", | |
| "notes": "An axis-0 TopK must compare and emit exact int32 values without routing them through f32." | |
| }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 2], | |
| "data": { "kind": "values", "values": [16777216, 123456789, 16777217, 123456788] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [1, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [16777217, 123456789] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [1, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 0] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "axis0_int32_smallest_exact_below_negative_float24", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top3ExplicitAxisSmallestElements", | |
| "notes": "An axis-0 smallest TopK must preserve exact int32 ordering below -2^24; an f32 round trip collapses the chosen sentinel values." | |
| }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 2], | |
| "data": { "kind": "values", "values": [-16777216, -123456789, -16777217, -123456788] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [1, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [-16777217, -123456789] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [1, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 0] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "int32_largest_top2_exact_above_float24", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top2ExplicitAxisMultiDInputLargestElements", | |
| "notes": "Sorted k=2 must order exact int32 values before applying tie-breaking; an f32 comparison would see 16777216 and 16777217 as equal." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [16777216, 16777217, 5, -3, 123456788, 123456789, 0, -7] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [2, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [16777217, 16777216, 123456789, 123456788] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [2, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 0, 1, 0] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "int32_smallest_top2_exact_below_negative_float24", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.Top2ExplicitAxisMultiDInputSmallestElements", | |
| "notes": "Sorted smallest TopK with k=2 must preserve exact int32 ordering below -2^24." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 4], | |
| "data": { "kind": "values", "values": [-16777216, -16777217, 5, -3, -123456788, -123456789, 0, -7] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [2, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [-16777217, -16777216, -123456789, -123456788] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [2, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 0, 1, 0] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_int32_largest_exact_above_float24", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopK_Int32_ExplicitAxis", | |
| "notes": "Middle-axis TopK must use exact int32 ordering; this covers the rank-3 axis-1 path as well as the last-axis and axis-0 paths." | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [1, 2, 2], | |
| "data": { "kind": "values", "values": [16777216, 123456789, 16777217, 123456788] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [1, 1, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [16777217, 123456789] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [1, 1, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 0] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_int32_smallest_exact_below_negative_float24", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopK_Int32_ExplicitAxis", | |
| "notes": "A rank-3 middle-axis smallest TopK must preserve exact int32 ordering below -2^24." | |
| }, | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [1, 2, 2], | |
| "data": { "kind": "values", "values": [-16777216, -123456789, -16777217, -123456788] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [1, 1, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [-16777217, -123456789] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [1, 1, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 0] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "ort_int8_explicit_axis_middle", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.TopK_Int8_ExplicitAxis" | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "int8", "shape": [2, 2, 2], "data": { "kind": "values", "values": [1, 2, 3, 4, 5, 6, 7, 8] } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int8", "shape": [2, 1, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "dispatch_cliff_rows_65537", | |
| "provenance": { | |
| "notes": "With 65,537 rows, TopK uses a two-row workgroup dispatch. An 11-value cycle shifts every eight-element row and avoids ties, making folded row-index errors observable." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [65537, 8], | |
| "data": { "kind": "cycle", "values": [0.1, 0.5, 0.9, 0.3, 0.7, 0.2, 0.6, 0.4, 0.8, 0.05, 0.95] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [65537, 4], "tolerance": 0.00001 }, | |
| "indices": { "dtype": "uint32", "shape": [65537, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "dispatch_cliff_rank3_axis1_cols_65537", | |
| "provenance": { | |
| "notes": "A rank-3 axis-1 TopK with trailing extent 65,537 uses a two-row workgroup dispatch while the z dimension carries the batch. Distinct column values make folded column-index errors observable." | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 2, 65537], | |
| "data": { "kind": "cycle", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1, 65537], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1, 65537], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "f16_vocab_top1_large_block_argmax", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [1, 4096], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.011, "cosStep": 0.027, "scale": 3.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [1, 1], "tolerance": 0.001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "axis0_largest_k8_rows4096_tournament", | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 8 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4096, 8], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.037, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [8, 8], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [8, 8], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "axis1_empty_row_dim_largest", | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [0, 6], "data": { "kind": "constant", "value": 1.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [0, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [0, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "axis1_k_equals_cols_minus_one_pad_vs_real_zero", | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2046 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 2047], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023, "scale": 0.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 2046], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 2046], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_merge_last_axis_pos_inf_ties_lower_index", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 5 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 4100], | |
| "data": { | |
| "kind": "cycle", | |
| "values": ["Infinity", 1.0, 2.0, "Infinity", 3.0, "Infinity", 0.5, 4.0, "Infinity", 2.5] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 5], "tolerance": 0, "allowNaN": true }, | |
| "indices": { "dtype": "uint32", "shape": [2, 5], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "small_row_batched_boundary_4097x8_k4", | |
| "provenance": { | |
| "notes": "The 4,097th eight-element row checks the final partial row group; an 11-value cycle exercises row-dependent ordering and ties." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4097, 8], | |
| "data": { "kind": "cycle", "values": [0.1, 0.5, 0.9, 0.3, 0.7, 0.2, 0.6, 0.4, 0.8, 0.05, 0.95] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [4097, 4], "tolerance": 0.00001 }, | |
| "indices": { "dtype": "uint32", "shape": [4097, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rows_smallk_boundary_1025x128_k4", | |
| "provenance": { | |
| "notes": "The 1,025th row checks partial-row handling, stable ties and the first-index ordering for k=4." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1025, 128], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.5, "srqStep": 0.02 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1025, 4], "tolerance": 0.00001 }, | |
| "indices": { "dtype": "uint32", "shape": [1025, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "small_row_batched_smallest_ties_4096x8_k4", | |
| "provenance": { | |
| "notes": "For 4,096 equal eight-element rows with largest=0, sorted output must retain the lower input indices in ascending order." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [4096, 8], "data": { "kind": "constant", "value": -1.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [4096, 4], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [4096, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_smallk_tournament_16x2048x16_k8", | |
| "provenance": { | |
| "notes": "A 2048-element axis across 256 independent rows checks sorted top-eight values and indices." | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 8 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [16, 2048, 16], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.037, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [16, 8, 16], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [16, 8, 16], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_k9_256x2048x1_tournament_boundary", | |
| "provenance": { | |
| "notes": "A [256, 2048, 1] float32 tensor holds a deterministic sinusoidal fill; TopK keeps the 9 largest values (largest=1, sorted=1) along axis 1 independently for each of the 256 rows." | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 9 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [256, 2048, 1], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.031, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [256, 9, 1], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [256, 9, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_2049x_k8_tournament_coverage", | |
| "provenance": { | |
| "notes": "A non-last axis of length 2,049 gives each tournament lane nine local candidates and avoids the generic bitonic implementation." | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 8 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [256, 2049, 1], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.029, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [256, 8, 1], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [256, 8, 1], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_int32_top1_preserves_exact_order", | |
| "provenance": { | |
| "notes": "Large-axis integer top-1 must use the native direct reducer: f32 split scratch would collapse 16777216 and 16777217 to the same value." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "int32", "shape": [1, 2049], "data": { "kind": "cycle", "values": [16777216, 16777217] } } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [1, 1], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [16777217] } | |
| }, | |
| "indices": { "dtype": "uint32", "shape": [1, 1], "tolerance": 0, "data": { "kind": "values", "values": [1] } } | |
| } | |
| }, | |
| { | |
| "name": "rank5_last_axis_generic_geometry", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 1, 2, 3, 4], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.29, "scale": 2.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 1, 2, 3, 2], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 1, 2, 3, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "int32_large_axis_merge_top2_above_float24", | |
| "provenance": { | |
| "source": "onnxruntime/core/providers/webgpu/math/top_k.cc", | |
| "test": "float-typed kernel registration", | |
| "notes": "Large-axis merge scratch must preserve exact int32 values above 2^24 rather than store candidates as f32." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [3, 2100], | |
| "data": { "kind": "cycle", "values": [16777217, -16777217, 5, 16777216, -3, 0, 7, 16777215] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [3, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [16777217, 16777217, 16777217, 16777217, 16777217, 16777217] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [3, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [0, 8, 4, 12, 0, 8] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "int32_large_axis_merge_smallest_below_negative_float24", | |
| "provenance": { | |
| "source": "onnxruntime/core/providers/webgpu/math/top_k.cc", | |
| "test": "float-typed kernel registration", | |
| "notes": "Large-axis merge scratch must preserve exact negative int32 values below -2^24 rather than store candidates as f32." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 2100], | |
| "data": { "kind": "cycle", "values": [-16777217, 16777217, -16777216, 4, -1] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [2, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [-16777217, -16777217, -16777217, -16777217] } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [2, 2], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [0, 5, 0, 5] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "uint32_large_axis_merge_top3_above_2pow31", | |
| "provenance": { | |
| "source": "onnxruntime/core/providers/webgpu/math/top_k.cc", | |
| "test": "float-typed kernel registration", | |
| "notes": "Large-axis merge scratch must preserve exact uint32 values above 2^31 rather than store candidates as f32." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [2, 2100], | |
| "data": { "kind": "cycle", "values": [4294967295, 2147483648, 4294967294, 7, 0] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "uint32", | |
| "shape": [2, 3], | |
| "tolerance": 0, | |
| "data": { | |
| "kind": "values", | |
| "values": [4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295] | |
| } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [2, 3], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [0, 5, 10, 0, 5, 10] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "int32_large_axis_two_merge_k64_above_float24", | |
| "provenance": { | |
| "source": "onnxruntime/core/providers/webgpu/math/top_k.cc", | |
| "test": "float-typed kernel registration", | |
| "notes": "Two merge stages must preserve exact int32 values above 2^24 rather than store candidates as f32." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 64 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [1, 20480], | |
| "data": { | |
| "kind": "cycle", | |
| "values": [16777217, 16777219, -16777217, 16777216, 3, 16777221, -5, 16777215, 0, 16777223] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { | |
| "dtype": "int32", | |
| "shape": [1, 64], | |
| "tolerance": 0, | |
| "data": { | |
| "kind": "values", | |
| "values": [16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223, 16777223] | |
| } | |
| }, | |
| "indices": { | |
| "dtype": "uint32", | |
| "shape": [1, 64], | |
| "tolerance": 0, | |
| "data": { | |
| "kind": "values", | |
| "values": [9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 109, 119, 129, 139, 149, 159, 169, 179, 189, 199, 209, 219, 229, 239, 249, 259, 269, 279, 289, 299, 309, 319, 329, 339, 349, 359, 369, 379, 389, 399, 409, 419, 429, 439, 449, 459, 469, 479, 489, 499, 509, 519, 529, 539, 549, 559, 569, 579, 589, 599, 609, 619, 629, 639] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "large_vocab_three_merge_k100_262144", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 100 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1, 262144], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0137, "cosStep": 0.0071, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 100], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 100], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "large_vocab_three_merge_k200_262144", | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 200 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1, 262144], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0113, "cosStep": 0.0059, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 200], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 200], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_large_axis8192_k8", | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 8 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 8192, 4], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0173, "cosStep": 0.0091, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [4, 8, 4], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [4, 8, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_large_k32_6144", | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 32 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 6144, 8], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0157, "cosStep": 0.0083, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 32, 8], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 32, 8], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_large_smallest_axis8192_k8", | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 8 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4, 8192, 4], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0173, "cosStep": 0.0091, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [4, 8, 4], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [4, 8, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "two_merge_distinct_values_vocab_k16_262144", | |
| "provenance": { | |
| "notes": "Distinct values over 262,144 candidates require two merge stages. The final stage must read the immediately preceding candidate buffer; otherwise the returned top 16 values and indices change." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 16 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1, 262144], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0137, "cosStep": 0.0071, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 16], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 16], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "two_merge_monotonic_ramp_k128_8704", | |
| "provenance": { | |
| "notes": "For a monotonic ramp, the true top 128 values occupy the final 128 indices, making stale candidate-buffer reads observable at every merge stage." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 128 }, | |
| "inputs": { | |
| "x": { "dtype": "float32", "shape": [1, 8704], "data": { "kind": "linspace", "start": 0.0, "end": 1.0 } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 128], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 128], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "rank3_axis1_two_merge_k128_8704", | |
| "provenance": { | |
| "notes": "Non-last-axis strided merge with firstCandidates 17*128=2176 past the one-merge chunk, so the two-level strided pipeline runs." | |
| }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 128 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1, 8704, 4], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0157, "cosStep": 0.0083, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 128, 4], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 128, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "int32_vocab_three_merge_k100_262144", | |
| "provenance": { | |
| "notes": "Distinct int32 ramp through the three-level merge (512 blocks -> 25 -> 2 chunks); exact order keys keep values above float24 precision honest." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 100 }, | |
| "inputs": { | |
| "x": { "dtype": "int32", "shape": [1, 262144], "data": { "kind": "linspace", "start": -131072, "end": 131071 } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int32", "shape": [1, 100], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 100], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "dsa_index_topk_2048_decode_16k", | |
| "requires": { "limits": { "maxComputeWorkgroupStorageSize": 32768 } }, | |
| "provenance": { | |
| "notes": "Selecting k=2048 from 16,384 candidates requires merge chunks larger than k; a chunk no larger than k does not reduce the candidate count. A 4,096-element chunk halves the candidates per stage and requires 32 KiB of workgroup storage." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2048 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [1, 16384], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0131, "cosStep": 0.0237, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 2048], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 2048], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "dsa_index_topk_2048_prefill_rows", | |
| "requires": { "limits": { "maxComputeWorkgroupStorageSize": 32768 } }, | |
| "provenance": { | |
| "notes": "Several query rows each retain 2,048 of 4,096 candidate keys; the expected top-k values and indices must be correct across every row." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 2048 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [8, 4096], | |
| "data": { "kind": "fillFloat32", "sinStep": 0.0131, "cosStep": 0.0237, "scale": 4.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [8, 2048], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [8, 2048], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "small_rows_batched_4096x32_k4_f16", | |
| "provenance": { | |
| "notes": "A float16 tensor with 4,096 rows, axis length 32, and k=4 uses a 33-value cycle of exact multiples of 1/64, leaving unambiguous top-four indices in every row." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [4096, 32], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/topk_small_rows_rank3_cycle33" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [4096, 4], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [4096, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "portable_rows_smallk_1025x128_k4_f16", | |
| "provenance": { | |
| "notes": "A float16 tensor with 1,025 rows, axis length 128, and k=4 exercises the portable small-k row specialization. A 129-value cycle rotates distinct, exactly representable values through each row." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [1025, 128], | |
| "data": { | |
| "kind": "cycle", | |
| "values": [0.00390625, 0.0078125, 0.01171875, 0.015625, 0.01953125, 0.0234375, 0.02734375, 0.03125, 0.03515625, 0.0390625, 0.04296875, 0.046875, 0.05078125, 0.0546875, 0.05859375, 0.0625, 0.06640625, 0.0703125, 0.07421875, 0.078125, 0.08203125, 0.0859375, 0.08984375, 0.09375, 0.09765625, 0.1015625, 0.10546875, 0.109375, 0.11328125, 0.1171875, 0.12109375, 0.125, 0.12890625, 0.1328125, 0.13671875, 0.140625, 0.14453125, 0.1484375, 0.15234375, 0.15625, 0.16015625, 0.1640625, 0.16796875, 0.171875, 0.17578125, 0.1796875, 0.18359375, 0.1875, 0.19140625, 0.1953125, 0.19921875, 0.203125, 0.20703125, 0.2109375, 0.21484375, 0.21875, 0.22265625, 0.2265625, 0.23046875, 0.234375, 0.23828125, 0.2421875, 0.24609375, 0.25, 0.25390625, 0.2578125, 0.26171875, 0.265625, 0.26953125, 0.2734375, 0.27734375, 0.28125, 0.28515625, 0.2890625, 0.29296875, 0.296875, 0.30078125, 0.3046875, 0.30859375, 0.3125, 0.31640625, 0.3203125, 0.32421875, 0.328125, 0.33203125, 0.3359375, 0.33984375, 0.34375, 0.34765625, 0.3515625, 0.35546875, 0.359375, 0.36328125, 0.3671875, 0.37109375, 0.375, 0.37890625, 0.3828125, 0.38671875, 0.390625, 0.39453125, 0.3984375, 0.40234375, 0.40625, 0.41015625, 0.4140625, 0.41796875, 0.421875, 0.42578125, 0.4296875, 0.43359375, 0.4375, 0.44140625, 0.4453125, 0.44921875, 0.453125, 0.45703125, 0.4609375, 0.46484375, 0.46875, 0.47265625, 0.4765625, 0.48046875, 0.484375, 0.48828125, 0.4921875, 0.49609375, 0.5, 0.50390625] | |
| } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [1025, 4], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1025, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "unsorted_small_rows_4096x8_k2_batched_route", | |
| "provenance": { | |
| "notes": "Exactly 4,096 eight-element rows with k=2 and unspecified output order use a nine-value cycle that leaves the top-two set unambiguous." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 0 }, | |
| "args": { "k": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4096, 8], | |
| "data": { "kind": "cycle", "values": [0.1, 0.5, 0.9, 0.3, 0.7, 0.2, 0.6, 0.4, 0.8] } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [4096, 2], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [4096, 2], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "small_rows_batched_rank3_4096rows_32axis_k4", | |
| "provenance": { | |
| "notes": "A rank-three tensor flattens to 4,096 rows of 32 values with k=4. A 33-value cycle leaves distinct top-four indices in every row." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [128, 32, 32], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/topk_small_rows_rank3_cycle33" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [128, 32, 4], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [128, 32, 4] } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_float32_axis256_k17_largest0", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 256], | |
| "data": { "kind": "linspace", "start": 16777200.0, "end": 16777600.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_float32_axis256_k17_largest1", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 256], | |
| "data": { "kind": "linspace", "start": 16777200.0, "end": 16777600.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_float32_axis257_k17_largest0", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 257], | |
| "data": { "kind": "linspace", "start": 16777200.0, "end": 16777600.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_float32_axis257_k17_largest1", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 257], | |
| "data": { "kind": "linspace", "start": 16777200.0, "end": 16777600.0 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_float16_axis256_k17_largest0", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { "dtype": "float16", "shape": [2, 256], "data": { "kind": "linspace", "start": 1000.0, "end": 1200.0 } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_float16_axis256_k17_largest1", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { "dtype": "float16", "shape": [2, 256], "data": { "kind": "linspace", "start": 1000.0, "end": 1200.0 } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_float16_axis257_k17_largest0", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { "dtype": "float16", "shape": [2, 257], "data": { "kind": "linspace", "start": 1000.0, "end": 1200.0 } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_float16_axis257_k17_largest1", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { "dtype": "float16", "shape": [2, 257], "data": { "kind": "linspace", "start": 1000.0, "end": 1200.0 } } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_int32_axis256_k17_largest0", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 256], | |
| "data": { "kind": "linspace", "start": -16777473, "end": -16777216 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_int32_axis256_k17_largest1", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 256], | |
| "data": { "kind": "linspace", "start": -16777473, "end": -16777216 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_int32_axis257_k17_largest0", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 257], | |
| "data": { "kind": "linspace", "start": -16777473, "end": -16777216 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_int32_axis257_k17_largest1", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 257], | |
| "data": { "kind": "linspace", "start": -16777473, "end": -16777216 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "int32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_uint32_axis256_k17_largest0", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [2, 256], | |
| "data": { "kind": "linspace", "start": 4294967040, "end": 4294967295 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_uint32_axis256_k17_largest1", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [2, 256], | |
| "data": { "kind": "linspace", "start": 4294967040, "end": 4294967295 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_uint32_axis257_k17_largest0", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [2, 257], | |
| "data": { "kind": "linspace", "start": 4294967040, "end": 4294967295 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "bitonic_prefix_boundary_uint32_axis257_k17_largest1", | |
| "provenance": { | |
| "notes": "Covers both sides of the default workgroup-width pruning boundary and a non-power-of-two retained prefix. Rounded adjacent ties retain stable index ordering while selected values vary across positions; integer cases preserve exact ordering beyond float32 integer precision." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1 }, | |
| "args": { "k": 17 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [2, 257], | |
| "data": { "kind": "linspace", "start": 4294967040, "end": 4294967295 } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float32_n257_axis0_largest0", | |
| "args": { "k": 17 }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [257, 3], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [17, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [17, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float32_n257_axis0_largest1", | |
| "args": { "k": 17 }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [257, 3], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [17, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [17, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float32_n257_axis1_largest0", | |
| "args": { "k": 17 }, | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 257], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float32_n257_axis1_largest1", | |
| "args": { "k": 17 }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 257], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float32_n4099_axis0_largest0", | |
| "args": { "k": 70 }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4099, 3], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [70, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [70, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float32_n4099_axis0_largest1", | |
| "args": { "k": 70 }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4099, 3], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [70, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [70, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float32_n4099_axis1_largest0", | |
| "args": { "k": 70 }, | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4099], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 70], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 70], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float32_n4099_axis1_largest1", | |
| "args": { "k": 70 }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4099], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [3, 70], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 70], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float16_n257_axis0_largest0", | |
| "args": { "k": 17 }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [257, 3], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [17, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [17, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float16_n257_axis0_largest1", | |
| "args": { "k": 17 }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [257, 3], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [17, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [17, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float16_n257_axis1_largest0", | |
| "args": { "k": 17 }, | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [3, 257], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [3, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float16_n257_axis1_largest1", | |
| "args": { "k": 17 }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [3, 257], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [3, 17], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 17], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float16_n4099_axis0_largest0", | |
| "args": { "k": 70 }, | |
| "attrs": { "axis": 0, "largest": 0, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [4099, 3], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [70, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [70, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float16_n4099_axis0_largest1", | |
| "args": { "k": 70 }, | |
| "attrs": { "axis": 0, "largest": 1, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [4099, 3], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [70, 3], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [70, 3], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float16_n4099_axis1_largest0", | |
| "args": { "k": 70 }, | |
| "attrs": { "axis": 1, "largest": 0, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [3, 4099], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [3, 70], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 70], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "order_keys_float16_n4099_axis1_largest1", | |
| "args": { "k": 70 }, | |
| "attrs": { "axis": 1, "largest": 1, "sorted": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [3, 4099], | |
| "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/order_key_extremes" } } | |
| } | |
| }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [3, 70], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [3, 70], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_signed_zero_all_ties_large_axis_k8", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.StableHybridSignedZero", | |
| "notes": "Upstream (StableHybridSignedZero) fills the first 2k lanes of an 8192-wide row with alternating -0.0/+0.0 and asserts the top-k is indices 0..k-1 with the sign bits preserved. Alternating signed zeros across the WHOLE row is the stronger form: IEEE regards -0.0 and +0.0 as equal, so every lane ties and the first k indices must win. The ordering key must treat both signed zeros as equal while preserving the selected sign bits." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 8 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [1, 8192], "data": { "kind": "cycle", "values": [-0.0, 0.0] } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 8], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 8], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_signed_zero_all_ties_smallest_k16", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.StableSmallKSignedZero", | |
| "notes": "largest=0 form of the signed-zero tie contract (upstream RunStableSignedZeroTopKCase(5000, 16, 0))." | |
| }, | |
| "attrs": { "axis": -1, "largest": 0, "sorted": 1 }, | |
| "args": { "k": 16 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [1, 5000], "data": { "kind": "cycle", "values": [-0.0, 0.0] } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 16], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 16], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_signed_zero_ties_small_rows_batched", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.StableHybridSignedZero", | |
| "notes": "A compact signed-zero tie case checks the top-k values and indices within a short row." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 4 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [2, 32], "data": { "kind": "cycle", "values": [-0.0, 0.0] } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [2, 4], "tolerance": 0 }, | |
| "indices": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_all_ties_500000_k256", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.StableHybridLargeLastAxis", | |
| "notes": "Upstream StableHybridLargeLastAxis sweeps (dimension, k) pairs of all-equal values up to {500000, 256} and requires indices 0..k-1. The widest all-ties row pinned here is 43009 at k=100." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 256 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [1, 500000], "data": { "kind": "constant", "value": 1.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float32", "shape": [1, 256], "tolerance": 0.000001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 256], "tolerance": 0 } | |
| } | |
| }, | |
| { | |
| "name": "ort_f16_all_ties_248320_k65", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/math/topk_op_test.cc", | |
| "test": "TopKOperator.StableHybridHalfLargeLastAxis", | |
| "notes": "f16 form of StableHybridHalfLargeLastAxis ({248320, 65}); all values equal so indices 0..64 are required." | |
| }, | |
| "attrs": { "axis": -1, "largest": 1, "sorted": 1 }, | |
| "args": { "k": 65 }, | |
| "inputs": { "x": { "dtype": "float16", "shape": [1, 248320], "data": { "kind": "constant", "value": 1.0 } } }, | |
| "outputs": { | |
| "values": { "dtype": "float16", "shape": [1, 65], "tolerance": 0.001 }, | |
| "indices": { "dtype": "uint32", "shape": [1, 65], "tolerance": 0 } | |
| } | |
| } | |
| ] | |
| } | |