Skip to content

Added TanhGrad.#9507

Merged
satyajandhyala merged 3 commits intomasterfrom
sajandhy/add_tanh_grad
Oct 26, 2021
Merged

Added TanhGrad.#9507
satyajandhyala merged 3 commits intomasterfrom
sajandhy/add_tanh_grad

Conversation

@satyajandhyala
Copy link
Contributor

Description: Added Tanh gradient schema and kernel

Motivation and Context

  • Why is this change required? What problem does it solve?
  • If it fixes an open issue, please link to the issue here.

@satyajandhyala satyajandhyala added component:ortmodule training issues related to ONNX Runtime training; typically submitted using template labels Oct 23, 2021
@satyajandhyala satyajandhyala force-pushed the sajandhy/add_tanh_grad branch 2 times, most recently from 6e4615e to 215aad6 Compare October 25, 2021 00:57
@satyajandhyala satyajandhyala changed the title [WIP] Added TanhGrad. Added TanhGrad. Oct 25, 2021
SherlockNoMad
SherlockNoMad previously approved these changes Oct 25, 2021
Copy link
Contributor

@SherlockNoMad SherlockNoMad left a comment

Choose a reason for hiding this comment

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

LGTM with nit comments.

@satyajandhyala
Copy link
Contributor Author

satyajandhyala commented Oct 25, 2021

image
Profiled test_tanh_grad with and without the TanhGrad changes using the following command

nvprof python -m pytest -sv orttraining_test_ortmodule_api.py -k test_tanh_grad

Using the new TanhGrad operator reduced the gradient computation from (36.5+21.5) 58 microseconds to 21 microseconds. The perf improvement is about 30%.

@satyajandhyala satyajandhyala merged commit f29057c into master Oct 26, 2021
@satyajandhyala satyajandhyala deleted the sajandhy/add_tanh_grad branch October 26, 2021 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

training issues related to ONNX Runtime training; typically submitted using template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants