test_elementwise_sub_ngraph_op fails
Created by: danleifeng
In order to enhance elementwise broadcast function, we edit the get_mid_dims function in elementwise_funtion_op.h and add unit test case for all elementwise operations(add/sub/mul/pow, etc.). But we noticed that in test_elementwise_sub_ngraph_op.py, it calls
from test_elementwise_sub_op import *
which may cause unit test fail.
148/165 Test #654: test_elementwise_sub_ngraph_op ..............................***Failed 8.02 sec
[21:19:58] W0829 21:19:54.470252 104659 executor.cc:67] FLAGS_use_ngraph=True, garbage collection strategy is disabled in Executor
[21:19:58] I0829 21:19:54.624999 104659 parallel_executor.cc:384] The number of CPUPlace, which is used in ParallelExecutor, is 1. And the Program will be copied 1 copies
[21:19:58] I0829 21:19:54.625885 104659 build_strategy.cc:308] SeqOnlyAllReduceOps:0, num_trainers:1
[21:19:58] I0829 21:19:54.626368 104659 parallel_executor.cc:331] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0
[21:19:58] I0829 21:19:54.634658 104659 parallel_executor.cc:384] The number of CPUPlace, which is used in ParallelExecutor, is 1. And the Program will be copied 1 copies
[21:19:58] I0829 21:19:54.635313 104659 build_strategy.cc:308] SeqOnlyAllReduceOps:0, num_trainers:1
[21:19:58] I0829 21:19:54.636294 104659 parallel_executor.cc:331] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0
[21:19:58] I0829 21:19:54.671506 104659 parallel_executor.cc:384] The number of CPUPlace, which is used in ParallelExecutor, is 1. And the Program will be copied 1 copies
[21:19:58] I0829 21:19:54.672159 104659 build_strategy.cc:308] SeqOnlyAllReduceOps:0, num_trainers:1
[21:19:58] I0829 21:19:54.672794 104659 parallel_executor.cc:331] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0
[21:19:58] I0829 21:19:54.678957 104659 parallel_executor.cc:384] The number of CPUPlace, which is used in ParallelExecutor, is 1. And the Program will be copied 1 copies
[21:19:58] I0829 21:19:54.679168 104659 build_strategy.cc:308] SeqOnlyAllReduceOps:0, num_trainers:1
[21:19:58] I0829 21:19:54.679443 104659 parallel_executor.cc:331] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0
[21:19:58] I0829 21:19:54.868353 104659 parallel_executor.cc:384] The number of CPUPlace, which is used in ParallelExecutor, is 1. And the Program will be copied 1 copies
[21:19:58] I0829 21:19:54.868847 104659 build_strategy.cc:308] SeqOnlyAllReduceOps:0, num_trainers:1
[21:19:58] I0829 21:19:54.869259 104659 parallel_executor.cc:331] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0
[21:19:58] I0829 21:19:54.878319 104659 parallel_executor.cc:384] The number of CPUPlace, which is used in ParallelExecutor, is 1. And the Program will be copied 1 copies
...
[21:19:58] An exception was thrown!
[21:19:58] Enforce failed. Expected x_shape[i + axis] == y_shape[i], but received x_shape[i + axis]:4 != y_shape[i]:1.
[21:19:58] Broadcast dimension mismatch. at [/paddle/paddle/fluid/platform/ngraph_helper.h:160]
[21:19:58] PaddlePaddle Call Stacks:
[21:19:58] 0 0x7f71a7cfef5fp void paddle::platform::EnforceNotMet::Init<std::string>(std::string, char const*, int) + 255
[21:19:58] 1 0x7f71a7cff4abp paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const*, int) + 139
[21:19:58] 2 0x7f71aa6c31c4p paddle::platform::GetMidDims(ngraph::Shape const&, ngraph::Shape const&, int, int*, int*, int*) + 548
[21:19:58] 3 0x7f71aa688ec6p paddle::operators::ngraphs::ElementwiseBinaryNodePrepare(std::shared_ptr<paddle::framework::OperatorBase> const&, std::shared_ptr<std::unordered_map<std::string, std::shared_ptr<ngraph::Node>, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::shared_ptr<ngraph::Node> > > > >) + 1318
unit tests fail including: test_elementwise_sub_ngraph_op test_elementwise_pow_ngraph_op test_elementwise_min_ngraph_op test_elementwise_max_ngraph_op
our pull request: https://github.com/PaddlePaddle/Paddle/pull/19536