How should I manually get branches within the model to inference in parallel for trt8.5?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Description
Same question as https://github.com/NVIDIA/TensorRT/issues/3133 and https://github.com/NVIDIA/TensorRT/issues/2828 .
As shown in the figure below, my model has three separate and similar branches starting from a certain point and converging at one point.
I truncated the model from the Conv point to the Concat point on the figure as a three branch model. I also truncated out a SeparateHead as one branch model. Then I use trtexec to inference. Latency and GPU compute time show that three branch models take three times as long as one branch model. It looks like TensorRT chose to Inference serially.
I read the answer to a previous issue that TensorRT 8.6 can support parallel inference using trtexec --maxAuxStreams=.
But due to hardware limitations, I can't use TensorRT 8.6. I would like to know how TensorRT 8.5 and lower versions could manually make these three branches parallel. Is there a sample somewhere that I can refer to?
I tried trtexec --streams=3 and trtexec --threads=3, but they didn't work.
Environment
TensorRT Version: 8.5.2.2
NVIDIA GPU: Orin
Operating System:
Python Version (if applicable): 3.8
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.
Research direction
Read linked issues 3133 and 2828 first, then reproduce the three-branch and single-branch comparisons with TensorRT 8.5.2.2 on Orin using trtexec. Compare the reported --streams=3 and --threads=3 attempts; done means identifying a supported method for parallel branch execution or clearly establishing that it is unavailable in this version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100