Skip to content

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 tpatejko requested review from luotao1 and tensor-tang May 24, 2018 13:18
@tpatejko tpatejko added the Intel label May 24, 2018
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants