Add a record scope around autograd::engine::evaluate_function (#63619)
authorRohan Varma <rvarm1@fb.com>
Wed, 1 Sep 2021 19:28:23 +0000 (12:28 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 1 Sep 2021 19:32:30 +0000 (12:32 -0700)
commit421d8f86b6def536df18371a5da2f5df4de6e262
tree060b2c6612fad81da1b88aadf86bc857d9558476
parent0b48d968952a6183ae122679d624940e5228567f
Add a record scope around autograd::engine::evaluate_function (#63619)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63619

Adds a RECORD_FUNCTION with the function that is being valuate as part
of backwards execution. This has been useful in picking up some operations
in the backwards pass that otherwise would not show up, for example custom cpp
functions that use custom C++ code.
ghstack-source-id: 137041723

Test Plan:
CI

benchmark:
buck run mode/opt //scripts/rvarm1/ddp:bench

Reviewed By: albanD

Differential Revision: D30439492

fbshipit-source-id: 955917770cdf2a2edb0303223ace710b668ba388
test/test_autograd.py
torch/csrc/autograd/engine.cpp