TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

Support Loop Translation to TensorRT

Open narendasan opened this issue 5 years ago • 12 comments

In order to fully support RNNs, we want to be able to make recurrent subgraphs to TRT. To do so we must expand the capability of the compiler to recognize these cases and generate a TensorRT Loop.

  • Relevant TRT Documentation:

    • https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#define-loops
    • https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_loop.html
  • Relevant PyTorch Documentation: https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/OVERVIEW.md#loops

narendasan avatar Jun 23 '20 04:06 narendasan

Some more issues we can address with this issue:

  1. Can we expand loop translation when unrolling the loop (see Lowering pass)?

  2. Can we backtrace through the graph and freeze and frozen operators?

abhi-iyer avatar Jul 16 '20 00:07 abhi-iyer

To add on, we want to be able to handle types like int inside the loop block at runtime. This will require probably doing things like mapping functions that operate on identified recurrence objects to a custom namespace tensor instead of int instead of standard aten to engage a converter instead of a evaluator and at conversion time freezing external dependencies in the TRT graph.

narendasan avatar Jul 16 '20 01:07 narendasan

I'm currently receiving this message when converting my model with TRTorch TRTorch currently can only compile loops that are evaluatable at conversion time. What is the current timeline to add loop translation support for dynamic loop bodies? It's the main functionality missing in order for TRTorch to support my model.

evanbro avatar Nov 20 '20 18:11 evanbro

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

github-actions[bot] avatar May 07 '21 00:05 github-actions[bot]

@evanbro We are landing partial compilation in TRTorch, this might help you run your model. Right now there is still no great solution for doing translation of dynamic loops into TensorRT directly.

narendasan avatar May 10 '21 21:05 narendasan

@evanbro We are landing partial compilation in TRTorch, this might help you run your model. Right now there is still no great solution for doing translation of dynamic loops into TensorRT directly.

Can you share more about partial compilation? Is there a PR or issue I can refer to?

evanbro avatar May 20 '21 17:05 evanbro

You can enable it with the "torch_fallback" option. https://github.com/NVIDIA/TRTorch/pull/406

narendasan avatar May 20 '21 20:05 narendasan

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

github-actions[bot] avatar Aug 19 '21 00:08 github-actions[bot]

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

github-actions[bot] avatar Nov 25 '21 00:11 github-actions[bot]

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

github-actions[bot] avatar Feb 28 '22 00:02 github-actions[bot]

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

github-actions[bot] avatar Jun 02 '22 00:06 github-actions[bot]

@inocsin can you please confirm if #617 resolves this issue?

ncomly-nvidia avatar Jun 06 '22 16:06 ncomly-nvidia

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

github-actions[bot] avatar Sep 05 '22 00:09 github-actions[bot]

@inocsin confirmed offline. Closing.

ncomly-nvidia avatar Sep 06 '22 15:09 ncomly-nvidia