Cache compilation of free functions (#30503)
Summary:
We don't have to recompile free functions if we've already compiled them.
Improved compilation of resnet18 by 27%.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30503
Differential Revision: D18796501
Pulled By: eellison
fbshipit-source-id: 2dee0fc5fcf9adc5b92213f8cb813730d71b376f