Project-MONAI / Project-MONAI/MONAI

Make Dints TensorRT Convertable

Open
#6,079 5 comments 0 reactions 1 assignee View on GitHub

@dongyang0122 is already working on this.

Since Feb 28, 2023.

Feature request
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:

  1. unpack torch.nn.ModuleDict and lay out the modules in a flat manner during inference phase.
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.