Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
cdd51e2e
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cdd51e2e
编写于
10月 21, 2020
作者:
M
MRXLT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update doc
上级
fc75aea3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
83 addition
and
27 deletion
+83
-27
doc/COMPILE.md
doc/COMPILE.md
+36
-13
doc/COMPILE_CN.md
doc/COMPILE_CN.md
+44
-11
paddle_inference/inferencer-fluid-gpu/include/fluid_gpu_engine.h
...inference/inferencer-fluid-gpu/include/fluid_gpu_engine.h
+3
-3
未找到文件。
doc/COMPILE.md
浏览文件 @
cdd51e2e
...
...
@@ -77,10 +77,10 @@ export PATH=$PATH:$GOPATH/bin
```
shell
go
env
-w
GO111MODULE
=
on
go
env
-w
GOPROXY
=
https://goproxy.cn,direct
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get
-u
github.com/golang/protobuf/protoc-gen-go
go get
-u
google.golang.org/grpc
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
@v1.15.2
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
@v1.15.2
go get
-u
github.com/golang/protobuf/protoc-gen-go
@v1.4.3
go get
-u
google.golang.org/grpc
@v1.33.0
```
...
...
@@ -91,9 +91,9 @@ go get -u google.golang.org/grpc
```
shell
mkdir
server-build-cpu
&&
cd
server-build-cpu
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
\
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DSERVER
=
ON ..
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DSERVER
=
ON ..
make
-j10
```
...
...
@@ -104,10 +104,28 @@ you can execute `make install` to put targets under directory `./output`, you ne
```
shell
mkdir
server-build-gpu
&&
cd
server-build-gpu
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
\
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DSERVER
=
ON
\
-DWITH_GPU
=
ON ..
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DCUDA_TOOLKIT_ROOT_DIR
=
${
CUDA_PATH
}
\
-DCUDNN_LIBRARY
=
${
CUDNN_LIBRARY
}
\
-DSERVER
=
ON
\
-DWITH_GPU
=
ON ..
make
-j10
```
### Integrated TRT version paddle inference library
```
mkdir server-build-trt && cd server-build-trt
cmake -DPYTHON_INCLUDE_DIR=$PYTHONROOT/include/python2.7/ \
-DPYTHON_LIBRARIES=$PYTHONROOT/lib/libpython2.7.so \
-DPYTHON_EXECUTABLE=$PYTHONROOT/bin/python \
-DTENSORRT_ROOT=${TENSORRT_LIBRARY_PATH} \
-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_PATH} \
-DCUDNN_LIBRARY=${CUDNN_LIBRARY} \
-DSERVER=ON \
-DWITH_GPU=ON \
-DWITH_TRT=ON ..
make -j10
```
...
...
@@ -136,7 +154,10 @@ execute `make install` to put targets under directory `./output`
```
bash
mkdir
app-build
&&
cd
app-build
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
-DAPP
=
ON ..
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
\
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DAPP
=
ON ..
make
```
...
...
@@ -167,7 +188,9 @@ Please use the example under `python/examples` to verify.
| WITH_AVX | Compile Paddle Serving with AVX intrinsics | OFF |
| WITH_MKL | Compile Paddle Serving with MKL support | OFF |
| WITH_GPU | Compile Paddle Serving with NVIDIA GPU | OFF |
| CUDNN_ROOT | Define CuDNN library and header path | |
| CUDNN_LIBRARY | Define CuDNN library and header path | |
| CUDA_TOOLKIT_ROOT_DIR | Define CUDA PATH | |
| TENSORRT_ROOT | Define TensorRT PATH | |
| CLIENT | Compile Paddle Serving Client | OFF |
| SERVER | Compile Paddle Serving Server | OFF |
| APP | Compile Paddle Serving App package | OFF |
...
...
doc/COMPILE_CN.md
浏览文件 @
cdd51e2e
...
...
@@ -74,10 +74,10 @@ export PATH=$PATH:$GOPATH/bin
```
shell
go
env
-w
GO111MODULE
=
on
go
env
-w
GOPROXY
=
https://goproxy.cn,direct
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get
-u
github.com/golang/protobuf/protoc-gen-go
go get
-u
google.golang.org/grpc
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
@v1.15.2
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
@v1.15.2
go get
-u
github.com/golang/protobuf/protoc-gen-go
@v1.4.3
go get
-u
google.golang.org/grpc
@v1.33.0
```
...
...
@@ -87,7 +87,10 @@ go get -u google.golang.org/grpc
```
shell
mkdir
server-build-cpu
&&
cd
server-build-cpu
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
-DSERVER
=
ON ..
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
\
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DSERVER
=
ON ..
make
-j10
```
...
...
@@ -97,21 +100,44 @@ make -j10
```
shell
mkdir
server-build-gpu
&&
cd
server-build-gpu
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
-DSERVER
=
ON
-DWITH_GPU
=
ON ..
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
\
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DCUDA_TOOLKIT_ROOT_DIR
=
${
CUDA_PATH
}
\
-DCUDNN_LIBRARY
=
${
CUDNN_LIBRARY
}
\
-DSERVER
=
ON
\
-DWITH_GPU
=
ON ..
make
-j10
```
执行
`make install`
可以把目标产出放在
`./output`
目录下。
### 集成TensorRT版本Paddle Inference Library
**注意:**
编译成功后,需要设置
`SERVING_BIN`
路径,详见后面的
[
注意事项
](
https://github.com/PaddlePaddle/Serving/blob/develop/doc/COMPILE_CN.md#注意事项
)
。
```
mkdir server-build-trt && cd server-build-trt
cmake -DPYTHON_INCLUDE_DIR=$PYTHONROOT/include/python2.7/ \
-DPYTHON_LIBRARIES=$PYTHONROOT/lib/libpython2.7.so \
-DPYTHON_EXECUTABLE=$PYTHONROOT/bin/python \
-DTENSORRT_ROOT=${TENSORRT_LIBRARY_PATH} \
-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_PATH} \
-DCUDNN_LIBRARY=${CUDNN_LIBRARY} \
-DSERVER=ON \
-DWITH_GPU=ON \
-DWITH_TRT=ON ..
make -j10
```
执行
`make install`
可以把目标产出放在
`./output`
目录下。
**注意:**
编译成功后,需要设置
`SERVING_BIN`
路径,详见后面的
[
注意事项
](
https://github.com/PaddlePaddle/Serving/blob/develop/doc/COMPILE_CN.md#注意事项
)
。
## 编译Client部分
```
shell
mkdir
client-build
&&
cd
client-build
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
-DCLIENT
=
ON ..
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
\
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DCLIENT
=
ON ..
make
-j10
```
...
...
@@ -123,7 +149,11 @@ make -j10
```
bash
mkdir
app-build
&&
cd
app-build
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
-DCMAKE_INSTALL_PREFIX
=
./output
-DAPP
=
ON ..
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
\
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib/libpython2.7.so
\
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
\
-DCMAKE_INSTALL_PREFIX
=
./output
\
-DAPP
=
ON ..
make
```
...
...
@@ -154,7 +184,10 @@ make
| WITH_AVX | Compile Paddle Serving with AVX intrinsics | OFF |
| WITH_MKL | Compile Paddle Serving with MKL support | OFF |
| WITH_GPU | Compile Paddle Serving with NVIDIA GPU | OFF |
| CUDNN_ROOT | Define CuDNN library and header path | |
| WITH_TRT | Compile Paddle Serving with TensorRT | OFF |
| CUDNN_LIBRARY | Define CuDNN library and header path | |
| CUDA_TOOLKIT_ROOT_DIR | Define CUDA PATH | |
| TENSORRT_ROOT | Define TensorRT PATH | |
| CLIENT | Compile Paddle Serving Client | OFF |
| SERVER | Compile Paddle Serving Server | OFF |
| APP | Compile Paddle Serving App package | OFF |
...
...
paddle_inference/inferencer-fluid-gpu/include/fluid_gpu_engine.h
浏览文件 @
cdd51e2e
...
...
@@ -238,12 +238,12 @@ class FluidGpuAnalysisDirCore : public FluidFamilyCore {
analysis_config.SetTRTDynamicShapeInfo(
min_input_shape, max_input_shape, opt_input_shape);
#endif
int
batch
=
8
;
int
max_batch
=
256
;
int
min_subgraph_size
=
3
;
if
(
params
.
use_trt
())
{
analysis_config
.
EnableTensorRtEngine
(
1
<<
3
0
,
batch
,
1
<<
2
0
,
max_
batch
,
min_subgraph_size
,
paddle
::
AnalysisConfig
::
Precision
::
kFloat32
,
true
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录