Created by: bingyanghuang
Before EIGEN is used for all sequence pooling implementation (MAX/AVE/FIRST/LAST/...). We use memcpy directly for FIRST/LAST which is a little bit more efficient. I ran a benchmark of text classification to show the performance difference with or without modifications.
- command line:
./paddle/fluid/inference/analysis/test_text_classification --infer_model=third_party/inference_demo/text_classification/text-classification-Senta/ --infer_data=third_party/inference_demo/text_classification/data.txt --profiler=1 --repeat=2
- Platform: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz

For sequence pooling op , we got about 13% performance gain.