Skip to content
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

Blas optimized elementwise_add forward and backward passes #10913

Merged
merged 8 commits into from
May 25, 2018
Merged

Blas optimized elementwise_add forward and backward passes #10913

merged 8 commits into from
May 25, 2018

Conversation

tpatejko
Copy link

This PR implements optimization of elementwse_add forward and backward passes.
It includes for forward pass:

  • MKL VML-based optimization with v?Add then MKL/MKLDNN are used
  • Blas-based optimization with VCopy and SAXPY operations when MKL is disabled

For backward pass:

  • Blas level 1 VCopy is used for copying dx and dy vectors.

When integral or float16 types, or GPU device are used, the implementation falls back to the default (generic) elementwise_add operation.

@tpatejko
Copy link
Author

This PR implements the following issue #10786.

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM!Thanks for this speedup, I test it on OCR CRNN_CTC model, the total elapsed time (repeat 100 times of model) of elementwise_add op is from 467ms to 428ms.

@luotao1 luotao1 merged commit bab1196 into PaddlePaddle:develop May 25, 2018
@tpatejko
Copy link
Author

@luotao1 Thanks for this information. Does the model converge?

@luotao1
Copy link
Contributor

luotao1 commented May 25, 2018

@tpatejko I only test the inference speed, but in our unit-tests, https://github.com/PaddlePaddle/Paddle/tree/develop/python/paddle/fluid/tests/book will test the model converge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants