Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TensorRT conversion support for diffusion unet and hovernet #6838

Open
binliunls opened this issue Aug 8, 2023 · 1 comment · May be fixed by #6859
Open

Add TensorRT conversion support for diffusion unet and hovernet #6838

binliunls opened this issue Aug 8, 2023 · 1 comment · May be fixed by #6859

Comments

@binliunls
Copy link
Contributor

Is your feature request related to a problem? Please describe.
MONAI supported the TensorRT model conversion since 1.2. However, when tried to export the diffusion unet and hovernet to the TensorRT engine-based torchscript, there are some issues that some features need to be added to MONAI core to fix.

  1. For the diffusion unet, the forward function needs two inputs, a tensor and an extra time step. While the trt_export API only supports one input shape and one dynamic batchsize now, these two parameters should be extended to support the multiple inputs case.
  2. For the hovernet, the output of the forward function is a dict, which is not supported very well by the torchscript and TensorRT conversion. Therefore, a optional list output with a predefined order would be a good solution. There is a fixed similar issue of the detection network.

Describe the solution you'd like

  1. Support the multiple inputs case by extending the input_shape and dynamic_batchsize parameters from Sequence[int] to Sequence[int] | Sequence[Sequence[int]] type, where each element in these two parameters stands for a shape requirement and a batch size range of one input.
  2. Add a list output support option parameter for the hovernet like this PR and update the MONAI model zoo bundle accordingly.
@binliunls binliunls linked a pull request Aug 12, 2023 that will close this issue
7 tasks
@thalatamsainath
Copy link

Hi, its been a while since the last update on this. Has this been abandoned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants