[static runtime] Split out graph preparation from runtime (#44131)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/44131
Test Plan: Imported from OSS
Reviewed By: hlu1
Differential Revision: D23604305
Pulled By: bwasti
fbshipit-source-id: 7b47da4961d99074199417ef1407a788c7d80ee6