benchmark
b9e088a5 - cudagraphs: fix backward hooks & fsdp interaction (#126914)

Commit
1 year ago
cudagraphs: fix backward hooks & fsdp interaction (#126914) Summary: Fixes > ERROR: expected to be in states [<TrainingState.FORWARD_BACKWARD: 2>] but current state is TrainingState.IDLE Error that would occur when composing pt2 fsdp and cudagraphs. Cudagraphs caches output tensor impls in the fast path, so we were inadvertently accumulating multiple hooks on what should have been fresh allocations. from code comment: ``` # this output represents a fresh allocated tensor. # We return the same TensorImpl from run to run to avoid overhead. # autograd.Function will reset the Autograd meta of output tensors # as part of aot_autograd, but _backward_hooks are stored on tensors separately, # so we need to manually reset hooks. `` X-link: https://github.com/pytorch/pytorch/pull/126914 Approved by: https://github.com/awgu, https://github.com/xmfan Reviewed By: PaliC Differential Revision: D57894638 Pulled By: eellison fbshipit-source-id: e588943f3d83d99edbf78aa38d374f66ce2d2b6f
Author
Parents
Loading