Skip to content

Dynamic backend tests on NNPA cause errors #2817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
negiyas opened this issue May 8, 2024 · 3 comments
Closed

Dynamic backend tests on NNPA cause errors #2817

negiyas opened this issue May 8, 2024 · 3 comments

Comments

@negiyas
Copy link
Collaborator

negiyas commented May 8, 2024

Dynamic backend tests on NNPA cause runtime errors. (c.f. This Issue is similar to Issue #2743 "Dynamic backend tests cause errors on CPU," but this issue for errors on NNPA.)

PR #2781 introduces "--dimParams" option for specifying relationships among dimensions of model inputs. It also enables dynamic backend tests on NNPA with the --dimParams option, but some tests cannot be enabled because of runtime errors, and they are temporally disabled by the PR. We need to fix these runtime issues or confirm that they are reasonable.

The following is a list of backend tests on NNPA not causing errors with static shapes, but causing errors with dynamic shapes. Please fix errors or confirm that they are reasonable. Thanks.

[ ] test_averagepool_2d_default_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_precomputed_pads_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_precomputed_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_precomputed_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_batchnorm_epsilon_cpu,zdnn_mul,NO_DYNAMIC_SHAPE_TEST
[ ] test_batchnorm_example_cpu,zdnn_mul,NO_DYNAMIC_SHAPE_TEST
[ ] test_basic_conv_with_padding_cpu,zdnn_conv2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_basic_conv_without_padding_cpu,zdnn_conv2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_conv_with_strides_no_padding_cpu,zdnn_conv2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_conv_with_strides_padding_cpu,zdnn_conv2d,NO_DYNAMIC_SHAPE _TEST
[ ] test_globalaveragepool_cpu,zdnn_meanreduce2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_globalaveragepool_precomputed_cpu,zdnn_meanreduce2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_logsoftmax_example_1_cpu,zdnn_softmax,NO_DYNAMIC_SHAPE_TEST
[ ] test_max_float32_cpu,zdnn_max,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_default_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_precomputed_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_precomputed_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_min_float32_cpu,zdnn_min,NO_DYNAMIC_SHAPE_TEST

@imaihal
Copy link
Collaborator

imaihal commented May 17, 2024

I found that most test cases for avgpool run on CPU because we don't know they meet one of the parameter restriction Input tensor batch_Num and Channel dimensions must always match the output tensor's respective dimensions. in AvgPool2D Parameter Restrictions when input is unknown dimension.

Since we can't check it at compile time, I think we can ignore it in unknown dimension case. (If this doesn't meet at runtime, the execution fails at runtime. ) By fixing the legality check, I confirmed most of the case can run on NNPA.

test_averagepool_2d_precomputed_pads_cpu really can't be run on NNPA because padding type is not calculated in unknown dimension.

[ ] test_averagepool_2d_default_cpu,zdnn_avgpool2d, NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_precomputed_pads_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST # Padding type is not SAME_PADDING or VALID_PADDING
[ ] test_averagepool_2d_precomputed_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_precomputed_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST

maxpool is also same.

@imaihal
Copy link
Collaborator

imaihal commented Jun 12, 2024

Now only test cases with [x] (8 cases) do not support dynamic tests by PR #2831 . The remaining tests with [ ] support dynamic tests. So, NO_DYNAMIC_SHAPE_TEST was removed from them.

[ ] test_averagepool_2d_default_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[x] test_averagepool_2d_precomputed_pads_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_precomputed_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_precomputed_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_averagepool_2d_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_batchnorm_epsilon_cpu,zdnn_mul,NO_DYNAMIC_SHAPE_TEST
[ ] test_batchnorm_example_cpu,zdnn_mul,NO_DYNAMIC_SHAPE_TEST
[x] test_basic_conv_with_padding_cpu,zdnn_conv2d,NO_DYNAMIC_SHAPE_TEST
[x] test_basic_conv_without_padding_cpu,zdnn_conv2d,NO_DYNAMIC_SHAPE_TEST
[x] test_conv_with_strides_no_padding_cpu,zdnn_conv2d,NO_DYNAMIC_SHAPE_TEST
[x] test_conv_with_strides_padding_cpu,zdnn_conv2d,NO_DYNAMIC_SHAPE _TEST
[x] test_globalaveragepool_cpu,zdnn_meanreduce2d,NO_DYNAMIC_SHAPE_TEST
[x] test_globalaveragepool_precomputed_cpu,zdnn_meanreduce2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_logsoftmax_example_1_cpu,zdnn_softmax,NO_DYNAMIC_SHAPE_TEST
[ ] test_max_float32_cpu,zdnn_max,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_default_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[x] test_maxpool_2d_precomputed_pads_cpu,zdnn_maxpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_precomputed_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_precomputed_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_same_upper_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_maxpool_2d_strides_cpu,zdnn_avgpool2d,NO_DYNAMIC_SHAPE_TEST
[ ] test_min_float32_cpu,zdnn_min,NO_DYNAMIC_SHAPE_TEST

@negiyas
Copy link
Collaborator Author

negiyas commented Jul 23, 2024

Closing this issue, since all tests were fixed or confirmed. Thanks.

@negiyas negiyas closed this as completed Jul 23, 2024
@negiyas negiyas changed the title Dynamic backend tests on NNPA cause errors [Reopend] Dynamic backend tests on NNPA cause errors Oct 1, 2024
@negiyas negiyas changed the title [Reopend] Dynamic backend tests on NNPA cause errors Dynamic backend tests on NNPA cause errors Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants