Repository: PaddlePaddle/Paddle

Issue #11742: Optimize bipartite_match_op in large scale input
Created: 2018-06-26T12:09:36Z
Now bipartite_match_op can well handle small size input. But when input size is large, this op become extremely slow

Duplicate issue #11744: Speed  bipartite_match_op for large scale input.
Created: 2018-06-26T12:13:44Z
Now the bipartite_match_op in face detection model is not unstable. For input with large shape, it is more time-consuming. For example:
Sometimes:
------------------------->     Profiling Report     <-------------------------

Place: All
Time unit: ms
Sorted by total time in descending order in the same thread

Event                                       Calls       Total       Min.        Max.        Ave.
thread0::conv2d_grad                        910         6673.74     0.114688    109.962     7.33378
thread0::conv2d                             910         2508.75     0.038912    77.8394     2.75687
thread0::depthwise_conv2d_transpose_grad    30          610.87      1.34861     49.5985     20.3623
thread0::relu_grad                          610         603.051     0.009216    8.3927      0.988608
thread0::sum                                270         534.452     0.022528    18.0644     1.97945
thread0::elementwise_add                    2880        494.677     0.008192    8.30874     0.171763
thread0::elementwise_add_grad               760         437.225     0.01024     7.29702     0.575297
thread0::mine_hard_examples                 20          435.2       20.8599     23.1741     21.76
thread0::relu                               610         430.992     0.008192    6.05082     0.706545
thread0::batch_norm_grad                    240         259.25      0.018432    7.7015      1.08021
thread0::norm_grad                          30          177.194     0.815104    13.6868     5.90647
thread0::batch_norm                         240         175.673     0.031744    5.08518     0.731972
thread0::pool2d_grad                        50          148.305     0.292864    7.65542     2.9661
thread0::momentum                           2120        132.703     0.022528    0.825344    0.0625959
thread0::elementwise_mul                    840         114.2       0.013312    3.04435     0.135952
thread0::bipartite_match                    20          113.835     5.52346     5.91974     5.69175

Sometimes:
------------------------->     Profiling Report     <-------------------------

Place: All
Time unit: ms
Sorted by total time in descending order in the same thread

Event                                       Calls       Total       Min.        Max.        Ave.
thread0::bipartite_match                    20          303299      14632.6     17169.2     15165
thread0::conv2d_grad                        910         6767.8      0.115712    111.08      7.43715
thread0::conv2d                             910         2489.88     0.039936    77.0724     2.73613
thread0::depthwise_conv2d_transpose_grad    30          612.314     1.36294     49.7981     20.4105
thread0::relu_grad                          610         603.089     0.009216    8.35584     0.98867
thread0::sum                                270         536.14      0.022528    18.1832     1.9857
thread0::mine_hard_examples                 20          509.812     25.0388     26.0997     25.4906
thread0::elementwise_add                    2880        497.335     0.008192    8.23296     0.172686
thread0::elementwise_add_grad               760         439.64      0.01024     7.3513      0.578474
thread0::relu                               610         431.84      0.008192    6.0375      0.707935
thread0::batch_norm_grad                    240         259.976     0.018432    7.72813     1.08323

Closing comment (2018-06-26T12:14:44Z): related to #11742