From 128cf09b4070ce6ea9e651debbdd23a646d1e541 Mon Sep 17 00:00:00 2001 From: hamptonm1 <79232909+hamptonm1@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:24:39 -0400 Subject: [PATCH] Re-enable ReduceMax/Min backend tests (#2977) * Re-enable ReduceMax/Min backend tests * Fix format * Small fixes --------- Co-authored-by: Megan Hampton --- docs/SupportedONNXOps-cpu.md | 6 +++--- test/backend/inference_backend.py | 30 +++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/docs/SupportedONNXOps-cpu.md b/docs/SupportedONNXOps-cpu.md index 2aea8be068..172c9ed7ca 100644 --- a/docs/SupportedONNXOps-cpu.md +++ b/docs/SupportedONNXOps-cpu.md @@ -158,9 +158,9 @@ Onnx-mlir currently supports ONNX operations targeting up to opset 21. Limitatio | **ReduceL2** |13 - * |do_not_keep_dim not supported. | | | **ReduceLogSum** |13 - * |do_not_keep_dim not supported. | | | **ReduceLogSumExp** |13 - * |do_not_keep_dim not supported. | | -| **ReduceMax** |6 - * |do_not_keep_dim not supported. | | -| **ReduceMean** |6 - * |do_not_keep_dim not supported. | | -| **ReduceMin** |6 - * |do_not_keep_dim not supported. | | +| **ReduceMax** |6 - * |do_not_keep_dims not supported. | | +| **ReduceMean** |6 - * |do_not_keep_dims not supported. | | +| **ReduceMin** |6 - * |do_not_keep_dims not supported. | | | **ReduceProd** |13 - * |do_not_keep_dim not supported. | | | **ReduceSum** |6 - * |Default axis and do_not_keep_dim not supported. |Default axis and do_not_keep_dim temporarily removed due to changes in onnx 1.8.1. | | **ReduceSumSquare** |13 - * |Default axis and do_not_keep_dim not supported. | | diff --git a/test/backend/inference_backend.py b/test/backend/inference_backend.py index 4e963e3bff..b13f25f177 100644 --- a/test/backend/inference_backend.py +++ b/test/backend/inference_backend.py @@ -2451,9 +2451,17 @@ def get_test_models(): }, # ==OP== ReduceMax # ==MIN== 1 - # ==LIM== do_not_keep_dim not supported. - # "test_reduce_max_default_axes_keepdim_example_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, - # "test_reduce_max_default_axes_keepdims_random_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, + # ==LIM== do_not_keep_dims not supported. + "test_reduce_max_default_axes_keepdim_example_cpu": { + STATIC_SHAPE: {}, + DYNAMIC_SHAPE: {-1: {-1}}, + CONSTANT_INPUT: {-1}, + }, + "test_reduce_max_default_axes_keepdims_random_cpu": { + STATIC_SHAPE: {}, + DYNAMIC_SHAPE: {-1: {-1}}, + CONSTANT_INPUT: {-1}, + }, # "test_reduce_max_do_not_keepdims_example_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, # "test_reduce_max_do_not_keepdims_random_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, "test_reduce_max_keepdims_example_cpu": { @@ -2478,7 +2486,7 @@ def get_test_models(): }, # ==OP== ReduceMean # ==MIN== 1 - # ==LIM== do_not_keep_dim not supported. + # ==LIM== do_not_keep_dims not supported. # "test_reduce_mean_default_axes_keepdims_example_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, # "test_reduce_mean_default_axes_keepdims_random_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, # "test_reduce_mean_do_not_keepdims_example_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, @@ -2505,9 +2513,17 @@ def get_test_models(): }, # ==OP== ReduceMin # ==MIN== 1 - # ==LIM== do_not_keep_dim not supported. - # "test_reduce_min_default_axes_keepdims_example_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, - # "test_reduce_min_default_axes_keepdims_random_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, + # ==LIM== do_not_keep_dims not supported. + "test_reduce_min_default_axes_keepdims_example_cpu": { + STATIC_SHAPE: {}, + DYNAMIC_SHAPE: {-1: {-1}}, + CONSTANT_INPUT: {-1}, + }, + "test_reduce_min_default_axes_keepdims_random_cpu": { + STATIC_SHAPE: {}, + DYNAMIC_SHAPE: {-1: {-1}}, + CONSTANT_INPUT: {-1}, + }, # "test_reduce_min_do_not_keepdims_example_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, # "test_reduce_min_do_not_keepdims_random_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}}, "test_reduce_min_keepdims_example_cpu": {