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

[PyTorch] Don't use autograd hook for bwd reduction #781

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

ksivaman
Copy link
Member

Introduced in #575; using torch.autograd.graph.register_multi_grad_hook is the suspected reason for hangs in certain workloads. This PR uses a different design to achieve the reduction of amaxes for gradient tensors by directly calling it from the backward pass of the modules if needed.

Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
@ksivaman ksivaman requested review from timmoon10 and cyanguwa April 15, 2024 19:16
Copy link
Collaborator

@cyanguwa cyanguwa left a comment

Choose a reason for hiding this comment

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

LGTM

@ksivaman
Copy link
Member Author

/te-ci pytorch

@ksivaman ksivaman merged commit f69e45b into NVIDIA:main Apr 15, 2024
9 of 10 checks passed
pggPL pushed a commit to pggPL/TransformerEngine that referenced this pull request May 9, 2024
Don't use autograd hook for bwd reduction

Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
pggPL pushed a commit to pggPL/TransformerEngine that referenced this pull request May 15, 2024
Don't use autograd hook for bwd reduction

Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Pawel Gadzinski <[email protected]>
pggPL pushed a commit to pggPL/TransformerEngine that referenced this pull request May 16, 2024
Don't use autograd hook for bwd reduction

Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Pawel Gadzinski <[email protected]>
pggPL pushed a commit to pggPL/TransformerEngine that referenced this pull request May 23, 2024
Don't use autograd hook for bwd reduction

Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Pawel Gadzinski <[email protected]>
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.

2 participants