Weird interaction with p.grad in dynamo #117184
Labels
dynamo-must-fix
These bugs affect TorchDynamo reliability.
module: dynamo
oncall: pt2
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃悰 Describe the bug
I encountered this while trying to enable dynamo on unit tests. Not mentioning requires_grad and then setting the grad of a parameter within a compiled region when the parameter lives outside of that region causes internal dynamo to think that the grad is None.
In my repro below, to_sparse() could be replaced with any function (like .add will produce the same error).
Error logs
Minified repro
Versions
on main
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @zou3519 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng
The text was updated successfully, but these errors were encountered: