Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
9c46c8fa
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看板
未验证
提交
9c46c8fa
编写于
1月 31, 2021
作者:
T
TeslaZhao
提交者:
GitHub
1月 31, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18 from PaddlePaddle/develop
Develop
上级
c9a2d9d9
c8ad0719
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
27 addition
and
9 deletion
+27
-9
cmake/paddlepaddle.cmake
cmake/paddlepaddle.cmake
+17
-6
core/general-server/CMakeLists.txt
core/general-server/CMakeLists.txt
+2
-1
python/examples/encryption/README.md
python/examples/encryption/README.md
+1
-0
python/examples/encryption/README_CN.md
python/examples/encryption/README_CN.md
+1
-1
python/examples/pipeline/imagenet/README_CN.md
python/examples/pipeline/imagenet/README_CN.md
+1
-1
python/paddle_serving_server/serve.py
python/paddle_serving_server/serve.py
+1
-0
python/paddle_serving_server_gpu/__init__.py
python/paddle_serving_server_gpu/__init__.py
+3
-0
python/paddle_serving_server_gpu/serve.py
python/paddle_serving_server_gpu/serve.py
+1
-0
未找到文件。
cmake/paddlepaddle.cmake
浏览文件 @
9c46c8fa
...
@@ -32,13 +32,23 @@ message( "WITH_GPU = ${WITH_GPU}")
...
@@ -32,13 +32,23 @@ message( "WITH_GPU = ${WITH_GPU}")
# latest: latest develop build
# latest: latest develop build
# version number like 1.5.2
# version number like 1.5.2
SET
(
PADDLE_VERSION
"2.0.0"
)
SET
(
PADDLE_VERSION
"2.0.0"
)
if
(
CUDA_VERSION EQUAL 11.0
)
set
(
CUDA_SUFFIX
"cuda11-cudnn8-avx-mkl"
)
set
(
WITH_TRT ON
)
elseif
(
CUDA_VERSION EQUAL 10.2
)
set
(
CUDA_SUFFIX
"cuda10.2-cudnn8-avx-mkl"
)
set
(
WITH_TRT ON
)
elseif
(
CUDA_VERSION EQUAL 10.1
)
set
(
CUDA_SUFFIX
"cuda10.1-cudnn7-avx-mkl"
)
set
(
WITH_TRT ON
)
elseif
(
CUDA_VERSION EQUAL 10.0
)
set
(
CUDA_SUFFIX
"cuda10-cudnn7-avx-mkl"
)
elseif
(
CUDA_VERSION EQUAL 9.0
)
set
(
CUDA_SUFFIX
"cuda9-cudnn7-avx-mkl"
)
endif
()
if
(
WITH_GPU
)
if
(
WITH_GPU
)
if
(
WITH_TRT
)
SET
(
PADDLE_LIB_VERSION
"
${
PADDLE_VERSION
}
-gpu-
${
CUDA_SUFFIX
}
"
)
SET
(
PADDLE_LIB_VERSION
"
${
PADDLE_VERSION
}
-gpu-cuda10.1-cudnn7-avx-mkl-trt6"
)
else
()
SET
(
PADDLE_LIB_VERSION
"
${
PADDLE_VERSION
}
-gpu-cuda10-cudnn7-avx-mkl"
)
endif
()
elseif
(
WITH_LITE
)
elseif
(
WITH_LITE
)
if
(
WITH_XPU
)
if
(
WITH_XPU
)
SET
(
PADDLE_LIB_VERSION
"
${
PADDLE_VERSION
}
-arm-xpu"
)
SET
(
PADDLE_LIB_VERSION
"
${
PADDLE_VERSION
}
-arm-xpu"
)
...
@@ -78,7 +88,8 @@ if (WITH_GPU OR WITH_MKLML)
...
@@ -78,7 +88,8 @@ if (WITH_GPU OR WITH_MKLML)
INSTALL_COMMAND
INSTALL_COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE_DOWNLOAD_DIR
}
/paddle/include
${
PADDLE_INSTALL_DIR
}
/include &&
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE_DOWNLOAD_DIR
}
/paddle/include
${
PADDLE_INSTALL_DIR
}
/include &&
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE_DOWNLOAD_DIR
}
/paddle/lib
${
PADDLE_INSTALL_DIR
}
/lib &&
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE_DOWNLOAD_DIR
}
/paddle/lib
${
PADDLE_INSTALL_DIR
}
/lib &&
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE_DOWNLOAD_DIR
}
/third_party
${
PADDLE_INSTALL_DIR
}
/third_party
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE_DOWNLOAD_DIR
}
/third_party
${
PADDLE_INSTALL_DIR
}
/third_party &&
${
CMAKE_COMMAND
}
-E copy
${
PADDLE_INSTALL_DIR
}
/third_party/install/mkldnn/lib/libdnnl.so.1
${
PADDLE_INSTALL_DIR
}
/third_party/install/mkldnn/lib/libdnnl.so
)
)
else
()
else
()
ExternalProject_Add
(
ExternalProject_Add
(
...
...
core/general-server/CMakeLists.txt
浏览文件 @
9c46c8fa
...
@@ -41,7 +41,7 @@ endif()
...
@@ -41,7 +41,7 @@ endif()
if
(
WITH_MKL OR WITH_GPU
)
if
(
WITH_MKL OR WITH_GPU
)
if
(
WITH_TRT
)
if
(
WITH_TRT
)
target_link_libraries
(
serving -liomp5 -lmklml_intel -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2
)
target_link_libraries
(
serving -liomp5 -lmklml_intel -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2
-ldnnl
)
else
()
else
()
target_link_libraries
(
serving -liomp5 -lmklml_intel -lmkldnn -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2
)
target_link_libraries
(
serving -liomp5 -lmklml_intel -lmkldnn -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2
)
endif
()
endif
()
...
@@ -62,6 +62,7 @@ install(FILES
...
@@ -62,6 +62,7 @@ install(FILES
${
CMAKE_BINARY_DIR
}
/third_party/install/Paddle/third_party/install/mklml/lib/libmklml_intel.so
${
CMAKE_BINARY_DIR
}
/third_party/install/Paddle/third_party/install/mklml/lib/libmklml_intel.so
${
CMAKE_BINARY_DIR
}
/third_party/install/Paddle/third_party/install/mklml/lib/libiomp5.so
${
CMAKE_BINARY_DIR
}
/third_party/install/Paddle/third_party/install/mklml/lib/libiomp5.so
${
CMAKE_BINARY_DIR
}
/third_party/install/Paddle/third_party/install/mkldnn/lib/libmkldnn.so.0
${
CMAKE_BINARY_DIR
}
/third_party/install/Paddle/third_party/install/mkldnn/lib/libmkldnn.so.0
${
CMAKE_BINARY_DIR
}
/third_party/install/Paddle/third_party/install/mkldnn/lib/libdnnl.so.1
DESTINATION
DESTINATION
${
PADDLE_SERVING_INSTALL_DIR
}
/demo/serving/bin
)
${
PADDLE_SERVING_INSTALL_DIR
}
/demo/serving/bin
)
endif
()
endif
()
python/examples/encryption/README.md
浏览文件 @
9c46c8fa
...
@@ -12,6 +12,7 @@ sh get_data.sh
...
@@ -12,6 +12,7 @@ sh get_data.sh
## Encrypt Model
## Encrypt Model
The
`paddlepaddle`
package is used in this example, you may need to download the corresponding package(
`pip install paddlepaddle`
).
```
```
python encrypt.py
python encrypt.py
```
```
...
...
python/examples/encryption/README_CN.md
浏览文件 @
9c46c8fa
...
@@ -11,7 +11,7 @@ sh get_data.sh
...
@@ -11,7 +11,7 @@ sh get_data.sh
```
```
## 模型加密
## 模型加密
本示例中使用了
`paddlepaddle`
包中的模块,需要进行下载(
`pip install paddlepaddle`
)。
```
```
python encrypt.py
python encrypt.py
```
```
...
...
python/examples/pipeline/imagenet/README_CN.md
浏览文件 @
9c46c8fa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
## 获取模型
## 获取模型
```
```
sh get_
data
.sh
sh get_
model
.sh
```
```
## 启动服务
## 启动服务
...
...
python/paddle_serving_server/serve.py
浏览文件 @
9c46c8fa
...
@@ -25,6 +25,7 @@ import time
...
@@ -25,6 +25,7 @@ import time
from
multiprocessing
import
Process
from
multiprocessing
import
Process
from
.web_service
import
WebService
,
port_is_available
from
.web_service
import
WebService
,
port_is_available
from
flask
import
Flask
,
request
from
flask
import
Flask
,
request
import
sys
if
sys
.
version_info
.
major
==
2
:
if
sys
.
version_info
.
major
==
2
:
from
BaseHTTPServer
import
BaseHTTPRequestHandler
,
HTTPServer
from
BaseHTTPServer
import
BaseHTTPRequestHandler
,
HTTPServer
elif
sys
.
version_info
.
major
==
3
:
elif
sys
.
version_info
.
major
==
3
:
...
...
python/paddle_serving_server_gpu/__init__.py
浏览文件 @
9c46c8fa
...
@@ -771,6 +771,9 @@ class MultiLangServer(object):
...
@@ -771,6 +771,9 @@ class MultiLangServer(object):
self
.
concurrency_
=
concurrency
self
.
concurrency_
=
concurrency
self
.
bserver_
.
set_max_concurrency
(
concurrency
)
self
.
bserver_
.
set_max_concurrency
(
concurrency
)
def
set_device
(
self
,
device
=
"cpu"
):
self
.
device
=
device
def
set_num_threads
(
self
,
threads
):
def
set_num_threads
(
self
,
threads
):
self
.
worker_num_
=
threads
self
.
worker_num_
=
threads
self
.
bserver_
.
set_num_threads
(
threads
)
self
.
bserver_
.
set_num_threads
(
threads
)
...
...
python/paddle_serving_server_gpu/serve.py
浏览文件 @
9c46c8fa
...
@@ -25,6 +25,7 @@ import time
...
@@ -25,6 +25,7 @@ import time
from
multiprocessing
import
Pool
,
Process
from
multiprocessing
import
Pool
,
Process
from
paddle_serving_server_gpu
import
serve_args
from
paddle_serving_server_gpu
import
serve_args
from
flask
import
Flask
,
request
from
flask
import
Flask
,
request
import
sys
if
sys
.
version_info
.
major
==
2
:
if
sys
.
version_info
.
major
==
2
:
from
BaseHTTPServer
import
BaseHTTPRequestHandler
,
HTTPServer
from
BaseHTTPServer
import
BaseHTTPRequestHandler
,
HTTPServer
elif
sys
.
version_info
.
major
==
3
:
elif
sys
.
version_info
.
major
==
3
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录