File size: 6,238 Bytes
e1b1cf9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{
  "op": "ai.onnx.Round",
  "cases": [
    {
      "name": "ties_to_even",
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [8],
          "data": { "kind": "values", "values": [-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 2.1, 2.9] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [8] } }
    },
    {
      "name": "backend_mixed_values",
      "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_round" },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [15],
          "data": {
            "kind": "values",
            "values": [0.1, 0.5, 0.9, 1.2, 1.5, 1.8, 2.3, 2.5, 2.7, -1.1, -1.5, -1.9, -2.2, -2.5, -2.8]
          }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [15], "tolerance": 0 } }
    },
    {
      "name": "f16_ties_to_even",
      "inputs": {
        "x": {
          "dtype": "float16",
          "shape": [10],
          "data": { "kind": "values", "values": [-4.5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 4.5] }
        }
      },
      "outputs": { "y": { "dtype": "float16", "shape": [10], "tolerance": 0 } }
    },
    {
      "name": "f16_nonfinite_and_near_half_values",
      "inputs": {
        "x": {
          "dtype": "float16",
          "shape": [8],
          "data": {
            "kind": "values",
            "values": ["-Infinity", -2.5, -0.499755859375, 0.0, 0.0, 0.499755859375, "Infinity", "NaN"]
          }
        }
      },
      "outputs": { "y": { "dtype": "float16", "shape": [8], "tolerance": 0, "allowNaN": true } }
    },
    {
      "name": "ort_float_fractional_mix",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/round_test.cc",
        "test": "RoundTest.SimpleTestFloat"
      },
      "inputs": {
        "x": { "dtype": "float32", "shape": [5], "data": { "kind": "values", "values": [0.9, 2.5, 2.3, 1.5, -4.5] } }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [5], "tolerance": 0 } }
    },
    {
      "name": "ort_float16_fractional_mix",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/round_test.cc",
        "test": "RoundTest.SimpleTestFloat16"
      },
      "inputs": {
        "x": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [0.9, 2.5, 2.3, 1.5, -4.5] } }
      },
      "outputs": { "y": { "dtype": "float16", "shape": [5], "tolerance": 0 } }
    },
    {
      "name": "rank0_scalar_half_tie_even",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/round_test.cc",
        "test": "RoundTest.SimpleTestFloat",
        "notes": "Additional node-level edge for rank-0 tensors and half-to-even scalar behavior."
      },
      "inputs": { "x": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.5] } } },
      "outputs": {
        "y": { "dtype": "float32", "shape": [], "tolerance": 0, "data": { "kind": "values", "values": [2.0] } }
      }
    },
    {
      "name": "large_exact_half_ties_to_even",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/round_test.cc",
        "test": "RoundTest.SimpleTestFloat",
        "notes": "Half-way values at larger magnitudes remain exactly representable here and must round to the even integer, not away from zero."
      },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [6],
          "data": { "kind": "values", "values": [-1048577.5, -1048576.5, -1024.5, 1024.5, 1048576.5, 1048577.5] }
        }
      },
      "outputs": {
        "y": {
          "dtype": "float32",
          "shape": [6],
          "tolerance": 0,
          "data": { "kind": "values", "values": [-1048578.0, -1048576.0, -1024.0, 1024.0, 1048576.0, 1048578.0] }
        }
      }
    },
    {
      "name": "f16_negative_positive_tie_grid",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/round_test.cc",
        "test": "RoundTest.SimpleTestFloat16",
        "notes": "Extended float16 tie grid across negative and positive odd/even integer neighbors."
      },
      "inputs": {
        "x": {
          "dtype": "float16",
          "shape": [8],
          "data": { "kind": "values", "values": [-7.5, -6.5, -5.5, -4.5, 4.5, 5.5, 6.5, 7.5] }
        }
      },
      "outputs": {
        "y": {
          "dtype": "float16",
          "shape": [8],
          "tolerance": 0,
          "data": { "kind": "values", "values": [-8.0, -6.0, -6.0, -4.0, 4.0, 6.0, 6.0, 8.0] }
        }
      }
    },
    {
      "name": "nonfinite_and_signed_zero",
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [6],
          "data": { "kind": "values", "values": ["-Infinity", 0.0, 0.0, 0.49999997, "Infinity", "NaN"] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [6], "tolerance": 0, "allowNaN": true } }
    },
    {
      "name": "zero_size_noop",
      "inputs": { "x": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } } },
      "outputs": { "y": { "dtype": "float32", "shape": [0], "tolerance": 0 } }
    },
    {
      "name": "f32_large_integral_noop_vec4",
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [8],
          "data": { "kind": "values", "values": [3.5, 4.5, 5.5, 6.5, -3.5, -4.5, -5.5, -6.5] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [8], "tolerance": 0 } },
      "provenance": {
        "notes": "Half-ties at odd/even integer boundaries in vec4 path; tests round-half-to-even vs WGSL builtin round() which rounds away from zero."
      }
    },
    {
      "name": "f32_scalar_tail_4095",
      "provenance": {
        "notes": "Compact sibling for the large scalar-fallback Round benchmark; odd numel forces the non-vec4 elementwise path over a sustained fractional range."
      },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [4095],
          "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 10.0 }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [4095], "tolerance": 0 } }
    }
  ]
}