Skip to content

refine infershape of sequence_enumerate, hash and fuse_emb_seq_pool#15959

Merged
luotao1 merged 1 commit intoPaddlePaddle:developfrom
luotao1:infershape_refine
Feb 27, 2019
Merged

refine infershape of sequence_enumerate, hash and fuse_emb_seq_pool#15959
luotao1 merged 1 commit intoPaddlePaddle:developfrom
luotao1:infershape_refine

Conversation

@luotao1
Copy link
Contributor

@luotao1 luotao1 commented Feb 27, 2019

  • move SetOutputDim and ShareLoD of Infershape's Runtime into Compute function.
  • test PyramidDnn inference:
    • command: ./paddle/fluid/inference/tests/api/test_analyzer_pyramid_dnn --infer_model=third_party/inference_demo/pyramid_dnn/model/ --infer_data=third_party/inference_demo/pyramid_dnn/data.txt --gtest_filter=Analyzer_Pyramid_DNN.profile -repeat=1000
    • machine: 2620 v3

Speedup: 0.272498ms->0.222548ms, 18%.

  • before:
Event                                Calls       Total       Min.        Max.        Ave.        Ratio.
thread0::fused_embedding_seq_pool    16000       83.6798     0.004181    0.066233    0.00522999  0.287419
thread0::hash                        12000       83.5048     0.005935    0.21865     0.00695873  0.286818
thread0::sequence_enumerate          12000       44.1801     0.003242    0.358377    0.00368168  0.151748
thread0::fc                          2000        37.0386     0.01693     0.202705    0.0185193   0.127218
...
  • after
Event                                Calls       Total       Min.        Max.        Ave.        Ratio.
thread0::hash                        12000       72.19       0.004968    0.07149     0.00601583  0.289498
thread0::fused_embedding_seq_pool    16000       64.7578     0.002993    0.34768     0.00404736  0.259694
thread0::fc                          2000        37.7587     0.017463    0.130483    0.0188793   0.151421
thread0::sequence_enumerate          12000       31.06       0.002213    0.105502    0.00258833  0.124558
...

@luotao1 luotao1 requested a review from tensor-tang February 27, 2019 13:12
Copy link
Contributor

@tensor-tang tensor-tang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}
}
}
out->set_lod(in->lod());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lod如果这个op没用,感觉可以尽量早点set比较好

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,会在下一个PR修改。

@luotao1 luotao1 merged commit e6bab55 into PaddlePaddle:develop Feb 27, 2019
@luotao1 luotao1 deleted the infershape_refine branch February 27, 2019 14:43
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

Successfully merging this pull request may close these issues.

2 participants