TensorRT
TensorRT copied to clipboard
Add trt_executed_modules & default_torch_execution interface
Signed-off-by: Cheng Hang [email protected]
Description
According to the current design, every module is by default compiled to TensorRT execpt those modules included in torch_executed_modules.
However, in some cases, for example, a multi-modal model where ResNet and BERT are present, BERT is optimized by custom op implementation (FasterTransformer). Developers may only want to compile ResNet, and leave everything in BERT (embedding, custom op, FC) run in torch. Although it is fine to explicitly assign values for torch_executed_modules, it will be much more convenient to have an interface like trt_executed_modules, and a switch-mode interface like default_torch_execution.
When the switch is turned on, every module would by default run in Torch, and only modules explicitly included in trt_executed_modules would be compiled.
Fixes # ()
Type of change
Please delete options that are not relevant and/or add your own.
- New feature (non-breaking change which adds functionality)
- This change requires a documentation update
Checklist:
- [x] My code follows the style guidelines of this project (You can use the linters)
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas and hacks
- [x] I have made corresponding changes to the documentation
- [x] I have added tests to verify my fix or my feature
- [x] New and existing unit tests pass locally with my changes
- [x] I have added the relevant labels to my PR in so that relevant reviewers are notified
Notes left on the design in the RFC #1119. This PR should be WIP until the design is finalized
This PR has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days