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

[Eager Hook] Support GradientHook and ReduceHook, expose related interface to python #39893

Merged
merged 2 commits into from
Feb 26, 2022

Conversation

veyron95
Copy link
Contributor

@veyron95 veyron95 commented Feb 24, 2022

PR types

New features

PR changes

APIs

Describe

  1. Support GradientHook in Eager
  2. Support ReduceHook in Eager
  3. Expose 3 related Hook interface to python
    1. _register_grad_hook —— (GradientHook)
    2. _remove_grad_hook —— (Remove GradientHook)
    3. _register_backward_hook —— (ReduceHook)
  4. There is a DoubleGrad-related unit test left in the test_tensor_register_hook.py, which will be tested after the DoubleGrad supported in Eager.

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

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

check name

virtual void operator()() = 0;
};

class CppTensorHook : public TensorHook {
Copy link
Contributor

Choose a reason for hiding this comment

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

check name

Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

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

LGTM

@veyron95 veyron95 merged commit a456dda into PaddlePaddle:develop Feb 26, 2022
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.

3 participants