@@ -178,8 +178,6 @@ static void RunQDQResizeOpTest(const TestInputDef<float>& input_def,
178
178
// CPU tests:
179
179
//
180
180
181
- // TODO: Enable QnnCPU tests that use "nearest" mode.
182
- //
183
181
// Our non-quantized implementation of Resize uses QNN's ResizeNearestNeighbor operator,
184
182
// which is __not__ equivalent to ONNX's Resize operator with a single specific "nearest_mode".
185
183
// The following disabled unit tests would pass if we removed the check in QNN EP that expects the
@@ -197,61 +195,68 @@ TEST_F(QnnCPUBackendTests, DISABLED_ResizeUpsampleNearestHalfPixel_rpf) {
197
195
ExpectedEPNodeAssignment::All);
198
196
}
199
197
198
+ // QNN v2.13 Failed for Linux
199
+ #if defined(_WIN32)
200
200
// Upsample that uses "round_prefer_ceil" as the "nearest_mode".
201
201
// coordinate_transformation_mode: "half_pixel"
202
- TEST_F (QnnCPUBackendTests, DISABLED_ResizeUpsampleNearestHalfPixel_rpc ) {
202
+ TEST_F (QnnCPUBackendTests, ResizeUpsampleNearestHalfPixel_rpc ) {
203
203
RunCPUResizeOpTest (TestInputDef<float >({1 , 1 , 2 , 4 }, false , -10 .0f , 10 .0f ),
204
204
{1 , 1 , 7 , 5 }, " nearest" , " half_pixel" , " round_prefer_ceil" ,
205
205
ExpectedEPNodeAssignment::All);
206
206
}
207
207
208
208
// Downsample that uses "round_prefer_ceil" as the "nearest_mode".
209
209
// coordinate_transformation_mode: "half_pixel"
210
- TEST_F (QnnCPUBackendTests, DISABLED_ResizeDownsampleNearestHalfPixel_rpc ) {
210
+ TEST_F (QnnCPUBackendTests, ResizeDownsampleNearestHalfPixel_rpc ) {
211
211
RunCPUResizeOpTest (TestInputDef<float >({1 , 1 , 2 , 4 }, false , -10 .0f , 10 .0f ),
212
212
{1 , 1 , 1 , 3 }, " nearest" , " half_pixel" , " round_prefer_ceil" ,
213
213
ExpectedEPNodeAssignment::All);
214
214
}
215
215
216
216
// Downsample that uses "round_prefer_floor" as the "nearest_mode".
217
217
// coordinate_transformation_mode: "half_pixel"
218
- TEST_F (QnnCPUBackendTests, DISABLED_ResizeDownsampleNearestHalfPixel_rpf ) {
218
+ TEST_F (QnnCPUBackendTests, ResizeDownsampleNearestHalfPixel_rpf ) {
219
219
RunCPUResizeOpTest (TestInputDef<float >({1 , 1 , 2 , 4 }, false , -10 .0f , 10 .0f ),
220
220
{1 , 1 , 1 , 2 }, " nearest" , " half_pixel" , " round_prefer_ceil" ,
221
221
ExpectedEPNodeAssignment::All);
222
222
}
223
+ #endif
223
224
224
225
// Upsample that uses "round_prefer_floor" as the "nearest_mode".
225
226
// coordinate_transformation_mode: "align_corners"
227
+ // QNN v2.13: index #50 don't match, which is 4.67152 from -1.93515
226
228
TEST_F (QnnCPUBackendTests, DISABLED_ResizeUpsampleNearestAlignCorners_rpf) {
227
229
RunCPUResizeOpTest (TestInputDef<float >({1 , 2 , 7 , 5 }, false , -10 .0f , 10 .0f ),
228
230
{1 , 2 , 21 , 10 }, " nearest" , " align_corners" , " round_prefer_floor" ,
229
231
ExpectedEPNodeAssignment::All);
230
232
}
231
233
234
+ // QNN v2.13 Failed for Linux
235
+ #if defined(_WIN32)
232
236
// Upsample that uses "round_prefer_ceil" as the "nearest_mode".
233
237
// coordinate_transformation_mode: "align_corners"
234
- TEST_F (QnnCPUBackendTests, DISABLED_ResizeUpsampleNearestAlignCorners_rpc ) {
238
+ TEST_F (QnnCPUBackendTests, ResizeUpsampleNearestAlignCorners_rpc ) {
235
239
RunCPUResizeOpTest (TestInputDef<float >({1 , 1 , 2 , 4 }, false , -10 .0f , 10 .0f ),
236
240
{1 , 1 , 7 , 5 }, " nearest" , " align_corners" , " round_prefer_ceil" ,
237
241
ExpectedEPNodeAssignment::All);
238
242
}
239
243
240
244
// Downsample that uses "round_prefer_ceil" as the "nearest_mode".
241
245
// coordinate_transformation_mode: "align_corners"
242
- TEST_F (QnnCPUBackendTests, DISABLED_ResizeDownsampleNearestAlignCorners_rpc ) {
246
+ TEST_F (QnnCPUBackendTests, ResizeDownsampleNearestAlignCorners_rpc ) {
243
247
RunCPUResizeOpTest (TestInputDef<float >({1 , 1 , 2 , 4 }, false , -10 .0f , 10 .0f ),
244
248
{1 , 1 , 1 , 3 }, " nearest" , " align_corners" , " round_prefer_ceil" ,
245
249
ExpectedEPNodeAssignment::All);
246
250
}
247
251
248
252
// Downsample that uses "round_prefer_floor" as the "nearest_mode".
249
253
// coordinate_transformation_mode: "align_corners"
250
- TEST_F (QnnCPUBackendTests, DISABLED_ResizeDownsampleNearestAlignCorners_rpf ) {
254
+ TEST_F (QnnCPUBackendTests, ResizeDownsampleNearestAlignCorners_rpf ) {
251
255
RunCPUResizeOpTest (TestInputDef<float >({1 , 1 , 2 , 4 }, false , -10 .0f , 10 .0f ),
252
256
{1 , 1 , 1 , 2 }, " nearest" , " align_corners" , " round_prefer_floor" ,
253
257
ExpectedEPNodeAssignment::All);
254
258
}
259
+ #endif
255
260
256
261
//
257
262
// Cpu tests that use the "linear" mode.
@@ -309,10 +314,11 @@ TEST_F(QnnHTPBackendTests, ResizeU8_2xNearestAsymmetricFloor) {
309
314
// QNN's own Resize operator (instead of ResizeNearestNeighbor), but it doesn't support the "asymmetric" coordinate
310
315
// transform mode.
311
316
//
312
- // Expected: contains 192 values, where each value and its corresponding value in 16-byte object
313
- // <C0-00 00-00 00-00 00-00 40-05 D6-27 BB-01 00-00> are an almost-equal pair
314
- // Actual : 16 - byte object<C0 - 00 00 - 00 00 - 00 00 - 00 40 - 04 E9 - 1B BB - 01 00 - 00>,
315
- // where the value pair(0.15, 0.501) at index #1 don't match, which is 0.351 from 0.15
317
+ // QNN v2.13: Inaccuracy detected for output 'output', element 189.
318
+ // Output quant params: scale=0.078431375324726105, zero_point=127.
319
+ // Expected val: -2.663428783416748
320
+ // QNN QDQ val: 7.4509806632995605 (err 10.114409446716309)
321
+ // CPU QDQ val: -2.6666667461395264 (err 0.0032379627227783203)
316
322
TEST_F (QnnHTPBackendTests, DISABLED_ResizeU8_2xNearestAsymmetricCeil) {
317
323
RunQDQResizeOpTest<uint8_t >(TestInputDef<float >({1 , 3 , 4 , 4 }, false , -10 .0f , 10 .0f ),
318
324
{1 , 3 , 8 , 8 }, " nearest" , " asymmetric" , " ceil" ,
0 commit comments