[c2] [easy] stop gradient when diagnose (#38518)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38518
as title
Test Plan: buck test
Reviewed By: olittle
Differential Revision: D21562570
fbshipit-source-id: 3a2e8dea3d821a2bdb9f30db25816a2bfa6c5dcf