Skip to content

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

Merged
ksivaman merged 1 commit intoNVIDIA:mainfrom
ksivaman:fix_hang_for_non_cg_path
Apr 15, 2024
Merged

[PyTorch] Don't use autograd hook for bwd reduction#781
ksivaman merged 1 commit intoNVIDIA:mainfrom
ksivaman:fix_hang_for_non_cg_path

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 <ksivamani@nvidia.com>
@ksivaman ksivaman requested review from cyanguwa and timmoon10 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
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 <ksivamani@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
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