Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable autograd cache on inductor tests (#140890)
Summary: This turns on AOTAutogradCache for all inductor tests. It clears AOTAutogradCache on each test as well, by virtue of the local cache using the same directory to store cache entries. I've also tested with INDUCTOR_TEST_DISABLE_FRESH_CACHE=1, running all the tests. AOTAutogradCache successfully caches 99% of these. There are a few tests that use view_replay and therefore save functional tensors, which cause AOTAutogradCache to fail to pickle its result. Will look into next steps there, but for now, it seems okay if the cache just misses on those cases where it can't serialize the result. It would be better to check before pickling, though. I've made the following small bugfixes to get this working: - Inductor is sometimes used in a standalone mode without dynamo, which leads to attribute errors in check_can_cache. In general, we should *never* crash in cache checking, only bypass. So I change a try catch to check Exception instead of just a specific exception. - Add extra structured logging for metadata on cache hits X-link: pytorch/pytorch#140890 Approved by: https://github.com/bdhirsh Reviewed By: atalman Differential Revision: D66556085 Pulled By: jamesjwu fbshipit-source-id: d1379a9946afca524e289459217845e29e97e142
- Loading branch information