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

Register Ops based on TRT version. #324

Closed

Conversation

SrivastavaKshitij
Copy link
Contributor

@SrivastavaKshitij SrivastavaKshitij commented May 26, 2020

Hey @jaybdub :

This PR helps registering ops based on TRT version. This PR supersedes #249 , #157 and #307

I have been working on making sure that TRT5 , TRT6 and TRT7 are compatible.

I have used three Pytorch NGC containers for experiments

NGC Container TRT version Pytorch version
Pytorch 19.07 5.1.5 PyTorch 1.2.0a0
Pytorch 19.12 6.0.1 PyTorch 1.4.0a0+a5b4d78
Pytorch 20.03 7.0.0 1.5.0a0+8f84ded

With my current implementation, I had no trouble with TRT 5 and TRT 6. Unit Tests work well.

However, I could not build torch2trt with TRT7 as I got the error:

You need C++14 to compile PyTorch

So I modified my current implementation by taking your PR #307 and building my PR on top of it. Thats why commits from #307 are present in this PR

Now, TRT6 and TRT7 works and unit tests are working absolutely fine. However, TRT5 is breaking during build time as #307 works with Pytorch 1.3+

Right now , we have two issues.

  1. Registering ops for appropriate TRT version. This PR fixes the issue
  2. Building Torch2trt with appropriate TRT version. Problem needs to be solved.

[UPDATE]: It works for TRT 5 as well.
Will have to deprecate support for older Pytorch versions

Torch version Torchvision version TRT version Status
1.5 0.6 5.1 ✔️
1.4 0.5 5.1 ✔️

I created a custom docker image:

FROM nvcr.io/nvidia/tensorrt:19.07-py3
RUN apt-get update
RUN pip install torch torchvision 

RUN git clone --recursive https://github.com/NVIDIA-AI-IOT/torch2trt.git /sw/torch2trt && \
    cd /sw/torch2trt && \
    git fetch origin pull/324/head:PR324 && \
    git checkout PR324 && \
    python setup.py build_ext --inplace

RUN pip install termcolor graphviz

Unit tests work fine.

@jaybdub
Copy link
Contributor

jaybdub commented May 27, 2020

SrivastavaKshitij,

Thanks for the PR, this is great! It's awesome to see it tested against so many different configurations.

I'm going to quickly verify this against my machine configurations as well.

Hope to get back shortly.

Best,
John

@jaybdub
Copy link
Contributor

jaybdub commented May 27, 2020

Is the primary reason for deprecating older versions of PyTorch because of #307 ?

I noticed the build error on my machine using PT1.2. Perhaps there is a way to modify #307 maintain backwards compatibility.

@SrivastavaKshitij
Copy link
Contributor Author

SrivastavaKshitij commented May 27, 2020

Yes, #307 is the reason because I couldn't get older versions to build

@SrivastavaKshitij
Copy link
Contributor Author

@jaybdub : #328 caused merge conflicts for this PR. fixed that

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

Successfully merging this pull request may close these issues.

None yet

3 participants