add tensorrt#9891
Merged
Merged
Conversation
dependency has been installed in docker image.
b7cd337 to
0e8e85f
Compare
Superjomn
commented
Apr 15, 2018
| option(WITH_AMD_GPU "Compile PaddlePaddle with AMD GPU" OFF) | ||
| option(WITH_AVX "Compile PaddlePaddle with AVX intrinsics" ${AVX_FOUND}) | ||
| option(WITH_MKL "Compile PaddlePaddle with MKL support." ${AVX_FOUND}) | ||
| option(WITH_TENSORRT "Compile PaddlePaddle with TensorRT support." ON) |
Contributor
Author
There was a problem hiding this comment.
Will turn off this latter. Changing TeamCity config should more cautious.
luotao1
reviewed
Apr 16, 2018
| RUN curl -s -q https://glide.sh/get | sh | ||
|
|
||
| # Install TensorRT | ||
| RUN wget -qO- http://paddlepaddledeps.bj.bcebos.com/TensorRT-4.0.0.3.Ubuntu-16.04.4.x86_64-gnu.cuda-8.0.cudnn7.0.tar.gz | \ |
Contributor
There was a problem hiding this comment.
- 这里的tar.gz和官网下载的有所不同,只包含了include和lib包,目的是为了让包减少2/3的大小,从而节省下载时间。需要加comment说明一下。
- 根据这个包下载的,里面还有targets目录,该目录可以在打包的时候去掉。
TensorRT
├── include
├── lib
└── targets
- 这里使用的
NvInfer.h,是对原来的版本做了一点修改的,不然会报错。可以写一个issue说明下报错情况,然后在这里加一个comment。
| # version(1.7.1 for now), which causes building documentation failed. | ||
| RUN pip install --upgrade pip && \ | ||
| pip install -U wheel && \ | ||
| RUN pip install -U wheel && \ |
| cc_library(dynamic_loader SRCS dynamic_loader.cc DEPS glog gflags enforce) | ||
|
|
||
| list(APPEND CUDA_SRCS cublas.cc cudnn.cc curand.cc nccl.cc) | ||
| list(APPEND CUDA_SRCS cublas.cc cudnn.cc curand.cc nccl.cc tensorrt.cc) |
Contributor
There was a problem hiding this comment.
这里需要加编译选项来选择是否添加tensorrt.cc
|
|
||
| // Fix the dynload issue, the following two API are implemented in TensorRT's | ||
| // header file, cannot load from the dynamic library. So create our own | ||
| // implementation and directly trigger the method from the dynamic library. |
Contributor
There was a problem hiding this comment.
58-60的注释需要更新下:
- fix the dynload issue: 请问issue在哪儿?
- API-》APIs
- but can not loaded from
|
|
||
| if(WITH_GPU) | ||
| include(cuda) | ||
| set(WITH_TENSORRT ON) |
| RUN wget -qO- http://paddlepaddledeps.bj.bcebos.com/TensorRT-4.0.0.3.Ubuntu-16.04.4.x86_64-gnu.cuda-8.0.cudnn7.0.tar.gz | \ | ||
| tar -xz -C /usr/local && \ | ||
| cp -rf /usr/local/TensorRT/include /usr/local && \ | ||
| cp -rf /usr/local/TensorRT/lib /usr/local |
Contributor
Contributor
Author
There was a problem hiding this comment.
现在直接复制到 /usr下了,可以后续pr改下
Contributor
|
编译成功,运行单测存在: 将 |
0b5ce6c to
5132a2b
Compare
d6d030b to
1fe9f63
Compare
luotao1
reviewed
Apr 16, 2018
| @@ -58,3 +58,11 @@ void GetWarpCTCDsoHandle(void** dso_handle); | |||
| * | |||
| */ | |||
| void GetLapackDsoHandle(void** dso_handle); | |||
Contributor
There was a problem hiding this comment.
DynamicLoader.h 可以不用修改,是老paddle用的。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

fixs: #9921
This is a naive test for TensorRT library integration with Paddle.