Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
d66a52f1
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 2 年 前同步成功
通知
187
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看板
未验证
提交
d66a52f1
编写于
2月 02, 2021
作者:
J
Jiawei Wang
提交者:
GitHub
2月 02, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1013 from wangjiawei04/v0.4.1
cherry-pick 1008 1010
上级
8da76211
092e4b5c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
57 addition
and
80 deletion
+57
-80
cmake/paddlepaddle.cmake
cmake/paddlepaddle.cmake
+17
-13
core/cube/cube-builder/CMakeLists.txt
core/cube/cube-builder/CMakeLists.txt
+1
-1
python/pipeline/operator.py
python/pipeline/operator.py
+38
-8
tools/Dockerfile.ci
tools/Dockerfile.ci
+1
-58
未找到文件。
cmake/paddlepaddle.cmake
浏览文件 @
d66a52f1
...
@@ -32,19 +32,23 @@ message( "WITH_GPU = ${WITH_GPU}")
...
@@ -32,19 +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
)
if
(
WITH_GPU
)
set
(
CUDA_SUFFIX
"cuda11-cudnn8-avx-mkl"
)
if
(
CUDA_VERSION EQUAL 11.0
)
set
(
WITH_TRT ON
)
set
(
CUDA_SUFFIX
"cuda11-cudnn8-avx-mkl"
)
elseif
(
CUDA_VERSION EQUAL 10.2
)
set
(
WITH_TRT ON
)
set
(
CUDA_SUFFIX
"cuda10.2-cudnn8-avx-mkl"
)
elseif
(
CUDA_VERSION EQUAL 10.2
)
set
(
WITH_TRT ON
)
set
(
CUDA_SUFFIX
"cuda10.2-cudnn8-avx-mkl"
)
elseif
(
CUDA_VERSION EQUAL 10.1
)
set
(
WITH_TRT ON
)
set
(
CUDA_SUFFIX
"cuda10.1-cudnn7-avx-mkl"
)
elseif
(
CUDA_VERSION EQUAL 10.1
)
set
(
WITH_TRT ON
)
set
(
CUDA_SUFFIX
"cuda10.1-cudnn7-avx-mkl"
)
elseif
(
CUDA_VERSION EQUAL 10.0
)
set
(
WITH_TRT ON
)
set
(
CUDA_SUFFIX
"cuda10-cudnn7-avx-mkl"
)
elseif
(
CUDA_VERSION EQUAL 10.0
)
elseif
(
CUDA_VERSION EQUAL 9.0
)
set
(
CUDA_SUFFIX
"cuda10-cudnn7-avx-mkl"
)
set
(
CUDA_SUFFIX
"cuda9-cudnn7-avx-mkl"
)
elseif
(
CUDA_VERSION EQUAL 9.0
)
set
(
CUDA_SUFFIX
"cuda9-cudnn7-avx-mkl"
)
endif
()
else
()
set
(
WITH_TRT OFF
)
endif
()
endif
()
if
(
WITH_GPU
)
if
(
WITH_GPU
)
...
...
core/cube/cube-builder/CMakeLists.txt
浏览文件 @
d66a52f1
...
@@ -22,7 +22,7 @@ include_directories(SYSTEM ${CMAKE_CURRENT_BINARY_DIR}/../)
...
@@ -22,7 +22,7 @@ include_directories(SYSTEM ${CMAKE_CURRENT_BINARY_DIR}/../)
add_executable
(
cube-builder src/main.cpp include/cube-builder/util.h src/util.cpp src/builder_job.cpp include/cube-builder/builder_job.h include/cube-builder/define.h src/seqfile_reader.cpp include/cube-builder/seqfile_reader.h include/cube-builder/raw_reader.h include/cube-builder/vtext.h src/crovl_builder_increment.cpp include/cube-builder/crovl_builder_increment.h src/curl_simple.cpp include/cube-builder/curl_simple.h
)
add_executable
(
cube-builder src/main.cpp include/cube-builder/util.h src/util.cpp src/builder_job.cpp include/cube-builder/builder_job.h include/cube-builder/define.h src/seqfile_reader.cpp include/cube-builder/seqfile_reader.h include/cube-builder/raw_reader.h include/cube-builder/vtext.h src/crovl_builder_increment.cpp include/cube-builder/crovl_builder_increment.h src/curl_simple.cpp include/cube-builder/curl_simple.h
)
add_dependencies
(
cube-builder jsoncpp
)
add_dependencies
(
cube-builder jsoncpp
boost
)
set
(
DYNAMIC_LIB
set
(
DYNAMIC_LIB
gflags
gflags
...
...
python/pipeline/operator.py
浏览文件 @
d66a52f1
...
@@ -709,11 +709,39 @@ class Op(object):
...
@@ -709,11 +709,39 @@ class Op(object):
# combine samples to batch
# combine samples to batch
one_input
=
preped_data_dict
[
data_ids
[
0
]]
one_input
=
preped_data_dict
[
data_ids
[
0
]]
feed_batch
=
[]
feed_batch
=
[]
feed_dict
=
{}
input_offset
=
None
input_offset
=
None
cur_offset
=
0
input_offset_dict
=
{}
if
isinstance
(
one_input
,
dict
):
if
isinstance
(
one_input
,
dict
):
# sample input
# sample input
feed_batch
=
[
preped_data_dict
[
data_id
]
for
data_id
in
data_ids
]
if
len
(
data_ids
)
==
1
:
input_offset
=
list
(
range
(
len
(
data_ids
)
+
1
))
feed_batch
=
[
preped_data_dict
[
data_id
]
for
data_id
in
data_ids
]
else
:
for
data_id
in
data_ids
:
for
key
,
val
in
preped_data_dict
[
data_id
].
items
():
has_val
=
feed_dict
.
get
(
key
)
if
has_val
is
None
:
feed_dict
[
key
]
=
val
continue
# merge 2 np.arrray
if
isinstance
(
val
,
np
.
ndarray
):
feed_dict
[
key
]
=
np
.
append
(
feed_dict
[
key
],
val
,
axis
=
0
)
feed_batch
.
append
(
feed_dict
)
for
data_id
in
data_ids
:
start
=
cur_offset
for
key
,
val
in
preped_data_dict
[
data_id
].
items
():
if
isinstance
(
val
,
(
list
,
np
.
ndarray
)):
cur_offset
+=
len
(
val
)
else
:
cur_offset
+=
1
break
input_offset_dict
[
data_id
]
=
[
start
,
cur_offset
]
elif
isinstance
(
one_input
,
list
):
elif
isinstance
(
one_input
,
list
):
# batch input
# batch input
input_offset
=
[
0
]
input_offset
=
[
0
]
...
@@ -796,8 +824,10 @@ class Op(object):
...
@@ -796,8 +824,10 @@ class Op(object):
for
name
in
var_names
:
for
name
in
var_names
:
lod_offset_name
=
"{}.lod"
.
format
(
name
)
lod_offset_name
=
"{}.lod"
.
format
(
name
)
if
lod_offset_name
in
var_names
:
if
lod_offset_name
in
var_names
:
_LOGGER
.
debug
(
"(log_id={}) {} {} is LodTensor"
.
format
(
_LOGGER
.
debug
(
typical_logid
,
op_info_prefix
,
name
))
"(log_id={}) {} {} is LodTensor. lod_offset_name:{}"
.
format
(
typical_logid
,
op_info_prefix
,
name
,
lod_offset_name
))
lod_var_names
.
add
(
name
)
lod_var_names
.
add
(
name
)
lod_offset_names
.
add
(
lod_offset_name
)
lod_offset_names
.
add
(
lod_offset_name
)
...
@@ -812,8 +842,8 @@ class Op(object):
...
@@ -812,8 +842,8 @@ class Op(object):
lod_offset_name
=
"{}.lod"
.
format
(
name
)
lod_offset_name
=
"{}.lod"
.
format
(
name
)
lod_offset
=
midped_batch
[
lod_offset_name
]
lod_offset
=
midped_batch
[
lod_offset_name
]
for
idx
,
data_id
in
enumerate
(
data_ids
):
for
idx
,
data_id
in
enumerate
(
data_ids
):
data_offset_left
=
input_offset
[
idx
]
data_offset_left
=
input_offset
_dict
[
data_id
][
0
]
data_offset_right
=
input_offset
[
idx
+
1
]
data_offset_right
=
input_offset
_dict
[
data_id
][
1
]
lod_offset_left
=
lod_offset
[
data_offset_left
]
lod_offset_left
=
lod_offset
[
data_offset_left
]
lod_offset_right
=
lod_offset
[
data_offset_right
]
lod_offset_right
=
lod_offset
[
data_offset_right
]
midped_data_dict
[
data_id
][
name
]
=
value
[
midped_data_dict
[
data_id
][
name
]
=
value
[
...
@@ -823,8 +853,8 @@ class Op(object):
...
@@ -823,8 +853,8 @@ class Op(object):
else
:
else
:
# normal tensor
# normal tensor
for
idx
,
data_id
in
enumerate
(
data_ids
):
for
idx
,
data_id
in
enumerate
(
data_ids
):
left
=
input_offset
[
idx
]
left
=
input_offset
_dict
[
data_id
][
0
]
right
=
input_offset
[
idx
+
1
]
right
=
input_offset
_dict
[
data_id
][
1
]
midped_data_dict
[
data_id
][
name
]
=
value
[
left
:
right
]
midped_data_dict
[
data_id
][
name
]
=
value
[
left
:
right
]
else
:
else
:
midped_data_dict
=
preped_data_dict
midped_data_dict
=
preped_data_dict
...
...
tools/Dockerfile.ci
浏览文件 @
d66a52f1
FROM
centos:7.3.1611
FROM
hub.baidubce.com/paddlepaddle/serving:latest-cuda10.2-cudnn8-devel
RUN yum -y install wget >/dev/null \
&& yum -y install gcc gcc-c++ make glibc-static which >/dev/null \
&& yum -y install git openssl-devel curl-devel bzip2-devel python-devel >/dev/null \
&& yum -y install libSM-1.2.2-2.el7.x86_64 --setopt=protected_multilib=false \
&& yum -y install libXrender-0.9.10-1.el7.x86_64 --setopt=protected_multilib=false \
&& yum -y install libXext-1.3.3-3.el7.x86_64 --setopt=protected_multilib=false
RUN wget https://cmake.org/files/v3.2/cmake-3.2.0-Linux-x86_64.tar.gz >/dev/null \
&& tar xzf cmake-3.2.0-Linux-x86_64.tar.gz \
&& mv cmake-3.2.0-Linux-x86_64 /usr/local/cmake3.2.0 \
&& echo 'export PATH=/usr/local/cmake3.2.0/bin:$PATH' >> /root/.bashrc \
&& rm cmake-3.2.0-Linux-x86_64.tar.gz
RUN wget https://dl.google.com/go/go1.14.linux-amd64.tar.gz >/dev/null \
&& tar xzf go1.14.linux-amd64.tar.gz \
&& mv go /usr/local/go \
&& echo 'export GOROOT=/usr/local/go' >> /root/.bashrc \
&& echo 'export PATH=/usr/local/go/bin:$PATH' >> /root/.bashrc \
&& rm go1.14.linux-amd64.tar.gz
RUN yum -y install python-devel sqlite-devel >/dev/null \
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py >/dev/null \
&& python get-pip.py >/dev/null \
&& rm get-pip.py \
&& pip install requests
RUN wget http://nixos.org/releases/patchelf/patchelf-0.10/patchelf-0.10.tar.bz2 \
&& yum -y install bzip2 >/dev/null \
&& tar -jxf patchelf-0.10.tar.bz2 \
&& cd patchelf-0.10 \
&& ./configure --prefix=/usr \
&& make >/dev/null && make install >/dev/null \
&& cd .. \
&& rm -rf patchelf-0.10*
RUN yum install -y python3 python3-devel \
&& pip3 install requests
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protobuf-all-3.11.2.tar.gz && \
tar zxf protobuf-all-3.11.2.tar.gz && \
cd protobuf-3.11.2 && \
./configure && make -j4 && make install && \
make clean && \
cd .. && rm -rf protobuf-*
RUN yum -y update >/dev/null \
&& yum -y install dnf >/dev/null \
&& yum -y install dnf-plugins-core >/dev/null \
&& dnf copr enable alonid/llvm-3.8.0 -y \
&& dnf install llvm-3.8.0 clang-3.8.0 compiler-rt-3.8.0 -y \
&& echo 'export PATH=/opt/llvm-3.8.0/bin:$PATH' >> /root/.bashrc
RUN yum install -y java \
&& wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo \
&& yum install -y apache-maven
RUN yum install -y lsof
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录