Factor the core lowering component into a pass function (#777)
Summary:
Pull Request resolved: https://github.com/pytorch/benchmark/pull/777
The core lowering component is taking a fx.GraphModule, and turning it into a lowered, `nn.Module` (generally speaking). Or more specifically,
turning it into a `TRTModule` in the case of fx2trt.
```
[nn.Module, PassContext] -> [nn.Module, PassContext]
```
As a matter of fact, the above signature is just a general module transformation pass function we should have consolidated and used across our stack.
Today this involves two steps:
1. Run TRTInterpreter
2. Turn the TRTInterpreterResult into a TRTModule
We wrap it into the above pass function.
Why? This is one step towards making it possible to swap in a different fx -> trt implementation, e.g., torch-tensorrt. (see [discussion](https://fb.workplace.com/groups/890926038157430/posts/1058116424771723/)
Reviewed By: xuzhao9
Differential Revision: D34540677
fbshipit-source-id: 3c332767dcde0496df3096a66c5be9ddffd1bd7f