"vscode:/vscode.git/clone" did not exist on "d25398cbc83384b5ca6219c23b905b4b7a38f987"
  • Yanli Zhao's avatar
    [FSDP] Move final backward callback queueing to pre-backward hook of root instance (#753) · ba7df621
    Yanli Zhao authored
    Move final backward callback to pre-backward hook of root FSDP instance
    
    Summary:
    
    Move final backward callback to pre-backward hook of root FSDP instance,
    so that it is always attached to the outer most backward call and fired
    after all backward calls are completed.
    
    Also added flags to check final backward callback is fired when final
    backward callback is required.
    
    If root FSDP is checkpointed and called multiple times in forward,
    check pointer counter is used to make sure final backward callback is queued inside last inner backward
    call as well.
    
    Test Plan: unit tests
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * reformat
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * nits and unit tests
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * address some comments
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * replace m with self
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * reformat
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * nits
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * remove the fired flag
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * assert state on root only
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * comments
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    
    * comments
    
    Summary:
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    ba7df621
test_fsdp.py 31 KB