Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
2eb6c9a6
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看板
提交
2eb6c9a6
编写于
3月 30, 2020
作者:
M
MRXLT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix gpu serve
上级
092c090a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
198 addition
and
1 deletion
+198
-1
compile_and_upload.sh
compile_and_upload.sh
+197
-0
python/paddle_serving_server_gpu/serve.py
python/paddle_serving_server_gpu/serve.py
+1
-1
未找到文件。
compile_and_upload.sh
0 → 100644
浏览文件 @
2eb6c9a6
set
-e
set
-v
version
=
0.1.4
cd
./python
python change_version.py
$version
cd
..
export
PYTHONROOT
=
/usr/
export
CUDA_CUDART_LIBRARY
=
/usr/local/cuda/lib64/libcudart.so
git fetch upstream
git merge upstream/v0.2.0
git submodule init
git submodule update
function
pack
(){
mkdir
-p
bin_package
cd
bin_package
WITHAVX
=
$1
WITHMKL
=
$2
if
[
$WITHAVX
=
"ON"
-a
$WITHMKL
=
"OFF"
]
;
then
mkdir
-p
serving-cpu-avx-openblas-
$version
cp
../build_server/core/general-server/serving serving-cpu-avx-openblas-
$version
tar
-czvf
serving-cpu-avx-openblas-
$version
.tar.gz serving-cpu-avx-openblas-
$version
/
fi
if
[
$WITHAVX
=
"OFF"
-a
$WITHMKL
=
"OFF"
]
;
then
mkdir
-p
serving-cpu-noavx-openblas-
$version
cp
../build_server/core/general-server/serving serving-cpu-noavx-openblas-
$version
tar
-czvf
serving-cpu-noavx-openblas-
$version
.tar.gz serving-cpu-noavx-openblas-
$version
/
fi
if
[
$WITHAVX
=
"ON"
-a
$WITHMKL
=
"ON"
]
;
then
mkdir
-p
serving-cpu-avx-mkl-
$version
cp
../build_server/output/demo/serving/bin/serving serving-cpu-avx-mkl-
$version
cp
../build_server/third_party/install/Paddle/third_party/install/mklml/lib/
*
serving-cpu-avx-mkl-
$version
cp
../build_server/third_party/install/Paddle/third_party/install/mkldnn/lib/libdnnl.so.1 serving-gpu-
$version
tar
-czvf
serving-cpu-avx-mkl-
$version
.tar.gz serving-cpu-avx-mkl-
$version
/
fi
cd
..
}
function
pack_gpu
(){
mkdir
-p
bin_package
cd
bin_package
mkdir
-p
serving-gpu-
$version
cp
../build_gpu_server/output/demo/serving/bin/serving serving-gpu-
$version
cp
../build_gpu_server/third_party/install/Paddle/third_party/install/mklml/lib/
*
serving-gpu-
$version
cp
../build_gpu_server/third_party/install/Paddle/third_party/install/mkldnn/lib/libdnnl.so.1 serving-gpu-
$version
tar
-czvf
serving-gpu-
$version
.tar.gz serving-gpu-
$version
/
cd
..
}
function
cp_whl
(){
cp
./python/dist/paddle_serving_
*
-
$version
-py
*
../whl_package
}
function
compile_cpu
(){
mkdir
-p
build_server
cd
build_server
WITHAVX
=
$1
WITHMKL
=
$2
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python2.7
-DWITH_AVX
=
$WITHAVX
-DWITH_MKL
=
$WITHMKL
-DSERVER
=
ON ..
>
compile_log
make
-j20
>>
compile_log
make
install
>>
compile_log
cp_whl
cd
..
pack
$WITHAVX
$WITHMKL
}
function
compile_cpu_py3
(){
mkdir
-p
build_server_py3
cd
build_server_py3
WITHAVX
=
$1
WITHMKL
=
$2
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python3.6m/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython3.6m.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python3.6m
-DWITH_AVX
=
$WITHAVX
-DWITH_MKL
=
$WITHMKL
-DSERVER
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
#pack $WITHAVX $WITHMKL
}
function
compile_gpu
(){
mkdir
-p
build_gpu_server
cd
build_gpu_server
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python2.7
-DWITH_GPU
=
ON
-DSERVER
=
ON
-DCUDA_CUDART_LIBRARY
=
$CUDA_CUDART_LIBRARY
..
>
compile_log
make
-j20
>>
compile_log
make
install
>>
compile_log
cp_whl
cd
..
pack_gpu
}
function
compile_gpu_py3
(){
mkdir
-p
build_gpu_server_py3
cd
build_gpu_server_py3
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python3.6m/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython3.6m.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python3.6m
-DWITH_GPU
=
ON
-DSERVER
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
#pack_gpu
}
function
compile_client
(){
mkdir
-p
build_client
cd
build_client
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python2.7
-DCLIENT
=
ON
-DPACK
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
}
function
compile_client_py3
(){
mkdir
-p
build_client_py3
cd
build_client_py3
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python3.6m/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython3.6m.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python3.6m
-DCLIENT
=
ON
-DPACK
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
}
function
compile_app
(){
mkdir
-p
build_app
cd
build_app
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python2.7/
-DPYTHON_LIBRARIES
=
$PYTHONROOT
/lib64/libpython2.7.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python
-DAPP
=
ON ..
>
compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
}
function
compile_app_py3
(){
mkdir
-p
build_app_py3
cd
build_app_py3
cmake
-DPYTHON_INCLUDE_DIR
=
$PYTHONROOT
/include/python3.6m/
-DPYTHON_LIBRARY
=
$PYTHONROOT
/lib64/libpython3.6m.so
-DPYTHON_EXECUTABLE
=
$PYTHONROOT
/bin/python3.6m
-DAPP
=
ON ..> compile_log
make
-j20
>>
compile_log
#make install >> compile_log
cp_whl
cd
..
}
function
upload_bin
(){
cd
bin_package
python ../bos_conf/upload.py serving-cpu-avx-openblas-
$version
.tar.gz
python ../bos_conf/upload.py serving-cpu-avx-mkl-
$version
.tar.gz
python ../bos_conf/upload.py serving-cpu-noavx-openblas-
$version
.tar.gz
python ../bos_conf/upload.py serving-gpu-
$version
.tar.gz
cd
..
}
function
upload_whl
(){
cd
whl_package
#python ../bos_conf/upload_whl.py paddle_serving_client-$version-py2-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_server-$version-py2-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_server_gpu-$version-py2-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_client-$version-py3-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_server-$version-py3-none-any.whl
#python ../bos_conf/upload_whl.py paddle_serving_server_gpu-$version-py3-none-any.whl
cd
..
}
#cpu-avx-openblas $1-avx $2-mkl
#compile_cpu ON OFF
#compile_cpu_py3 ON OFF
#cpu-avx-mkl
#compile_cpu ON ON
#compile_cpu_py3 ON ON
#cpu-noavx-openblas
#compile_cpu OFF OFF
#compile_cpu_py3 OFF OFF
#gpu
#compile_gpu
#compile_gpu_py3
#client
#compile_client
#compile_client_py3
#app
#compile_app
#compile_app_py3
#upload bin
#upload_bin
#upload whl
#upload_whl
python/paddle_serving_server_gpu/serve.py
浏览文件 @
2eb6c9a6
...
...
@@ -71,7 +71,7 @@ def start_multi_card(args): # pylint: disable=doc-string-missing
else
:
gpus
=
args
.
gpu_ids
.
split
(
","
)
if
len
(
gpus
)
<=
0
:
start_gpu_card_model
(
-
1
,
args
)
start_gpu_card_model
(
-
1
,
0
,
args
)
else
:
gpu_processes
=
[]
for
i
,
gpu_id
in
enumerate
(
gpus
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录