Project-MONAI / Project-MONAI/MONAI
Make Dints TensorRT Convertable
@dongyang0122 is already working on this.
Since Feb 28, 2023.
- Dominant language
- Python
- Stars
- 8.7k
- Forks
- 1.6k
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 20
Description
Is your feature request related to a problem? Please describe.
TensorRT is a SDK for high-performance deep learning inference. For the trained pytorch models, Torch-TensorRT is the most convenient way to apply the TensorRT acceleration. Therefore, we are trying to accelerate DiNTS trought this way.
However, currently the DiNTS net structure in MONAI cannot be converted through Torch-TensorRT. After having a discussion with the Torch-TensorRT team, this failed convert is caused by the torch.nn.ModuleDict module in the network like this one, which is not supported by Torch-TensorRT.
Describe the solution you'd like
As the Torch-TensorRT team suggest, there are two ways that are worth to try:
- unpack
torch.nn.ModuleDictand lay out the modules in a flat manner during inference phase. - replace it with a Python level dictionary
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.