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

[BYOC] Fix build with TensorRT 8 #9047

Merged
merged 2 commits into from
Sep 21, 2021
Merged

[BYOC] Fix build with TensorRT 8 #9047

merged 2 commits into from
Sep 21, 2021

Conversation

masahi
Copy link
Member

@masahi masahi commented Sep 20, 2021

I tried to use TRT BYOC with the latest TensorRT version, but got a build error. The code is using functions that were deprecated in TRT 7 and removed in 8.

These function calls should be redundant, since we are also using config_->setFlag(...) API anyway.

config_->setFlag(nvinfer1::BuilderFlag::kINT8);
config_->setInt8Calibrator(calibrator_);

@trevor-m @comaniac @tiandiao123

@masahi
Copy link
Member Author

masahi commented Sep 20, 2021

Got MyPy lint errors on files that I didn't touch https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/PR-9047/1/pipeline

@honsontran
Copy link

@masahi Question on this. I noticed you deleted the deprecating changes from tensorrt_builder.cc... are you still able to utilize fp16 and int8 functionality for TRT 8 if you removed those flags that were once previously set?

@tiandiao123
Copy link
Contributor

tiandiao123 commented Sep 20, 2021

@masahi Question on this. I noticed you deleted the deprecating changes from tensorrt_builder.cc... are you still able to utilize fp16 and int8 functionality for TRT 8 if you removed those flags that were once previously set?

As long as config_ has set up fp16 or int8 when building engine, we don't need to builder_->setFp16Mode(true) or builder_->setInt16Mode(true), and these two functions are deleted in trt8 api.

@tiandiao123
Copy link
Contributor

tiandiao123 commented Sep 21, 2021

@masahi Question on this. I noticed you deleted the deprecating changes from tensorrt_builder.cc... are you still able to utilize fp16 and int8 functionality for TRT 8 if you removed those flags that were once previously set?

As long as config_ has set up fp16 or int8 when building engine, we don't need to builder_->setFp16Mode(true) or builder_->setInt16Mode(true), and these two functions are deleted in trt8 api.

I think this pr should be no problem @Laurawly @trevor-m @comaniac

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@comaniac
Copy link
Contributor

btw, it would be good if you could also update the TensorRT document (https://tvm.apache.org/docs/deploy/tensorrt.html) about the supported versions.

@honsontran
Copy link

Has anyone seen any performance increases with TRT 8?

@junrushao junrushao merged commit 92ca782 into apache:main Sep 21, 2021
@tiandiao123
Copy link
Contributor

tiandiao123 commented Sep 21, 2021

Has anyone seen any performance increases with TRT 8?

I tested several models such as resnet and super resolution model, and my machine is T4, and they slightly have some performance gain based on my test (probably TRT8 doesn't have too much optimization for vision model? They say they have great performance gain in bert model). However, I didn't test them using large models such as bert, not quite sure whether they have great performance gain in those models, and Nvidia team says bert models have huge performance gain using TRT8. Also, we need to investigate tensorrt 8 supported ops to see what kind of new ops TRT8 has newly-supported, and we can register them into https://github.com/apache/tvm/blob/main/src/runtime/contrib/tensorrt/tensorrt_ops.cc.

ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
* fix compile error missing noexcept in overwridden methods

* remove depricated builder method call
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* fix compile error missing noexcept in overwridden methods

* remove depricated builder method call
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.

6 participants