Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夏有凉风,冬有雪
Paddle
提交
5e62605c
P
Paddle
项目概览
夏有凉风,冬有雪
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5e62605c
编写于
8月 15, 2017
作者:
Q
qijun
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'baidu/develop' into implement_EigenCudaStreamDevice
上级
95fe318e
d605560e
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
77 addition
and
31 deletion
+77
-31
CMakeLists.txt
CMakeLists.txt
+2
-2
cmake/external/openblas.cmake
cmake/external/openblas.cmake
+9
-1
paddle/operators/math/CMakeLists.txt
paddle/operators/math/CMakeLists.txt
+2
-7
paddle/scripts/docker/build.sh
paddle/scripts/docker/build.sh
+6
-10
paddle/scripts/submit_local.sh.in
paddle/scripts/submit_local.sh.in
+2
-0
python/CMakeLists.txt
python/CMakeLists.txt
+13
-1
python/paddle/v2/reader/creator.py
python/paddle/v2/reader/creator.py
+8
-4
python/paddle/v2/reader/tests/creator_test.py
python/paddle/v2/reader/tests/creator_test.py
+22
-0
python/paddle/v2/reader/tests/test_reader_recordio.dat
python/paddle/v2/reader/tests/test_reader_recordio.dat
+0
-0
python/requirements.txt
python/requirements.txt
+1
-1
python/setup.py.in
python/setup.py.in
+12
-5
未找到文件。
CMakeLists.txt
浏览文件 @
5e62605c
...
...
@@ -36,8 +36,8 @@ include(simd)
################################ Configurations #######################################
option
(
WITH_GPU
"Compile PaddlePaddle with NVIDIA GPU"
${
CUDA_FOUND
}
)
option
(
WITH_AVX
"Compile PaddlePaddle with AVX intrinsics"
${
AVX_FOUND
}
)
option
(
WITH_MKLDNN
"Compile PaddlePaddle with mkl-dnn support."
OFF
)
option
(
WITH_MKLML
"Compile PaddlePaddle with mklml package."
OFF
)
option
(
WITH_MKLDNN
"Compile PaddlePaddle with mkl-dnn support."
${
AVX_FOUND
}
)
option
(
WITH_MKLML
"Compile PaddlePaddle with mklml package."
${
AVX_FOUND
}
)
option
(
WITH_DSO
"Compile PaddlePaddle with dynamic linked CUDA"
ON
)
option
(
WITH_TESTING
"Compile PaddlePaddle with unit testing"
ON
)
option
(
WITH_SWIG_PY
"Compile PaddlePaddle with inference api"
ON
)
...
...
cmake/external/openblas.cmake
浏览文件 @
5e62605c
...
...
@@ -73,10 +73,18 @@ INCLUDE_DIRECTORIES(${CBLAS_INC_DIR})
# linear algebra libraries for cc_library(xxx SRCS xxx.c DEPS cblas)
SET
(
dummyfile
${
CMAKE_CURRENT_BINARY_DIR
}
/cblas_dummy.c
)
FILE
(
WRITE
${
dummyfile
}
"const char * dummy =
\"
${
dummyfile
}
\"
;"
)
ADD_LIBRARY
(
cblas STATIC
${
dummyfile
}
)
IF
(
${
CBLAS_PROVIDER
}
MATCHES MKL
)
ADD_LIBRARY
(
cblas SHARED
${
dummyfile
}
)
ELSE
()
ADD_LIBRARY
(
cblas STATIC
${
dummyfile
}
)
ENDIF
()
TARGET_LINK_LIBRARIES
(
cblas
${
CBLAS_LIBRARIES
}
)
IF
(
NOT
${
CBLAS_FOUND
}
)
ADD_DEPENDENCIES
(
cblas extern_openblas
)
LIST
(
APPEND external_project_dependencies cblas
)
ELSE
()
IF
(
"
${
CBLAS_PROVIDER
}
"
STREQUAL
"MKLML"
)
ADD_DEPENDENCIES
(
cblas mklml
)
ENDIF
()
ENDIF
(
NOT
${
CBLAS_FOUND
}
)
paddle/operators/math/CMakeLists.txt
浏览文件 @
5e62605c
if
(
WITH_MKLML
)
set
(
BLAS_LIB mklml
)
else
()
set
(
BLAS_LIB cblas
)
endif
()
if
(
WITH_GPU
)
nv_library
(
math_function SRCS math_function.cc math_function.cu DEPS
${
BLAS_LIB
}
device_context
)
nv_library
(
math_function SRCS math_function.cc math_function.cu DEPS
cblas
device_context
)
else
()
cc_library
(
math_function SRCS math_function.cc DEPS
${
BLAS_LIB
}
device_context
)
cc_library
(
math_function SRCS math_function.cc DEPS
cblas
device_context
)
endif
()
nv_test
(
math_function_test SRCS math_function_test.cc DEPS math_function tensor
)
paddle/scripts/docker/build.sh
浏览文件 @
5e62605c
...
...
@@ -82,10 +82,6 @@ EOF
fi
# To build documentation, we need to run cmake again after installing
# PaddlePaddle. This awkwardness is due to
# https://github.com/PaddlePaddle/Paddle/issues/1854. It also
# describes a solution.
if
[[
${
WITH_DOC
:-
OFF
}
==
"ON"
]]
;
then
cat
<<
EOF
========================================
...
...
@@ -93,11 +89,6 @@ Building documentation ...
In /paddle/build_doc
========================================
EOF
# build documentation need install Paddle before
make
install
-j
`
nproc
`
pip
install
/usr/local/opt/paddle/share/wheels/
*
.whl
paddle version
mkdir
-p
/paddle/build_doc
pushd
/paddle/build_doc
cmake ..
\
...
...
@@ -106,7 +97,8 @@ EOF
-DWITH_AVX
=
${
WITH_AVX
:-
ON
}
\
-DWITH_SWIG_PY
=
ON
\
-DWITH_STYLE_CHECK
=
OFF
make paddle_docs paddle_docs_cn
make
-j
`
nproc
`
gen_proto_py
make
-j
`
nproc
`
paddle_docs paddle_docs_cn
popd
fi
...
...
@@ -182,3 +174,7 @@ ADD go/cmd/master/master /usr/bin/
# default command shows the paddle version and exit
CMD ["paddle", "version"]
EOF
set
+xe
printf
"If you need to install PaddlePaddle in develop docker image,"
printf
"please make install or pip install build/python/dist/*.whl.
\n
"
paddle/scripts/submit_local.sh.in
浏览文件 @
5e62605c
...
...
@@ -18,6 +18,8 @@ function version(){
echo
"PaddlePaddle @PADDLE_VERSION@, compiled with"
echo
" with_avx: @WITH_AVX@"
echo
" with_gpu: @WITH_GPU@"
echo
" with_mkldnn: @WITH_MKLDNN"
echo
" with_mklml: @WITH_MKLML@"
echo
" with_double: @WITH_DOUBLE@"
echo
" with_python: @WITH_PYTHON@"
echo
" with_rdma: @WITH_RDMA@"
...
...
python/CMakeLists.txt
浏览文件 @
5e62605c
...
...
@@ -21,6 +21,18 @@ if(WITH_GOLANG)
add_dependencies
(
copy_paddle_master paddle_master
)
endif
(
WITH_GOLANG
)
set
(
MKL_SHARED_LIBS
""
)
set
(
MKL_DEPENDS
""
)
if
(
WITH_MKLML
)
list
(
APPEND MKL_SHARED_LIBS
${
MKLML_LIB
}
${
MKLML_IOMP_LIB
}
)
list
(
APPEND MKL_DEPENDS mklml
)
endif
()
if
(
WITH_MKLDNN
)
list
(
APPEND MKL_SHARED_LIBS
"
${
MKLDNN_LIB
}
"
"
${
MKLDNN_LIB
}
.0"
)
list
(
APPEND MKL_DEPENDS mkldnn
)
endif
()
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/setup.py.in
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py
)
...
...
@@ -39,7 +51,7 @@ add_custom_command(OUTPUT ${PADDLE_PYTHON_BUILD_DIR}/.timestamp
DEPENDS gen_proto_py copy_paddle_pybind framework_py_proto
${
PY_FILES
}
${
external_project_dependencies
}
${
COPY_PADDLE_MASTER
}
)
add_custom_target
(
paddle_python ALL DEPENDS
${
PADDLE_PYTHON_BUILD_DIR
}
/.timestamp paddle_pserver_main paddle_trainer paddle_merge_model python_api_wheel
)
${
PADDLE_PYTHON_BUILD_DIR
}
/.timestamp paddle_pserver_main paddle_trainer paddle_merge_model python_api_wheel
${
MKL_DEPENDS
}
)
set
(
PADDLE_PYTHON_PACKAGE_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
/dist/
)
...
...
python/paddle/v2/reader/creator.py
浏览文件 @
5e62605c
...
...
@@ -57,7 +57,7 @@ def text_file(path):
return
reader
def
recordio
_local
(
paths
,
buf_size
=
100
):
def
recordio
(
paths
,
buf_size
=
100
):
"""
Creates a data reader from given RecordIO file paths separated by ",",
glob pattern is supported.
...
...
@@ -67,15 +67,19 @@ def recordio_local(paths, buf_size=100):
import
recordio
as
rec
import
paddle.v2.reader.decorator
as
dec
import
cPickle
as
pickle
def
reader
():
a
=
','
.
join
(
paths
)
f
=
rec
.
reader
(
a
)
if
isinstance
(
paths
,
basestring
):
path
=
paths
else
:
path
=
","
.
join
(
paths
)
f
=
rec
.
reader
(
path
)
while
True
:
r
=
f
.
read
()
if
r
is
None
:
break
yield
r
yield
pickle
.
loads
(
r
)
f
.
close
()
return
dec
.
buffered
(
reader
,
buf_size
)
...
...
python/paddle/v2/reader/tests/creator_test.py
浏览文件 @
5e62605c
...
...
@@ -34,5 +34,27 @@ class TestTextFile(unittest.TestCase):
self
.
assertEqual
(
e
,
str
(
idx
*
2
)
+
" "
+
str
(
idx
*
2
+
1
))
class
TestRecordIO
(
unittest
.
TestCase
):
def
do_test
(
self
,
path
):
reader
=
paddle
.
v2
.
reader
.
creator
.
recordio
(
path
)
idx
=
0
for
e
in
reader
():
if
idx
==
0
:
self
.
assertEqual
(
e
,
(
1
,
2
,
3
))
elif
idx
==
1
:
self
.
assertEqual
(
e
,
(
4
,
5
,
6
))
idx
+=
1
self
.
assertEqual
(
idx
,
2
)
def
test_recordIO
(
self
):
self
.
do_test
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"test_reader_recordio.dat"
))
self
.
do_test
([
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"test_reader_recordio.dat"
)
])
if
__name__
==
'__main__'
:
unittest
.
main
()
python/paddle/v2/reader/tests/test_reader_recordio.dat
0 → 100644
浏览文件 @
5e62605c
文件已添加
python/requirements.txt
浏览文件 @
5e62605c
requests==2.9.2
numpy>=1.12
protobuf==3.1
recordio
recordio
>=0.1.0
matplotlib
rarfile
scipy>=0.19.0
...
...
python/setup.py.in
浏览文件 @
5e62605c
...
...
@@ -23,6 +23,16 @@ with open('@PADDLE_SOURCE_DIR@/python/requirements.txt') as f:
if '${CMAKE_SYSTEM_PROCESSOR}' not in ['arm', 'armv7-a', 'aarch64']:
setup_requires+=["opencv-python"]
# the prefix is sys.prefix which should always be usr
paddle_bin_dir = 'local/opt/paddle/bin'
paddle_bins = ['${PADDLE_BINARY_DIR}/paddle/scripts/paddle_usage',
'${PADDLE_BINARY_DIR}/paddle/trainer/paddle_trainer',
'${PADDLE_BINARY_DIR}/paddle/trainer/paddle_merge_model',
'${PADDLE_BINARY_DIR}/paddle/pserver/paddle_pserver_main']
paddle_rt_lib_dir = 'local/lib'
paddle_rt_libs = [] if '${MKL_SHARED_LIBS}'== '' else '${MKL_SHARED_LIBS}'.split(';')
setup(name='paddlepaddle',
version='${PADDLE_VERSION}',
description='Parallel Distributed Deep Learning',
...
...
@@ -42,9 +52,6 @@ setup(name='paddlepaddle',
},
scripts=['${PADDLE_BINARY_DIR}/paddle/scripts/paddle'],
distclass=BinaryDistribution,
data_files=[('/usr/local/opt/paddle/bin',
['${PADDLE_BINARY_DIR}/paddle/scripts/paddle_usage',
'${PADDLE_BINARY_DIR}/paddle/trainer/paddle_trainer',
'${PADDLE_BINARY_DIR}/paddle/trainer/paddle_merge_model',
'${PADDLE_BINARY_DIR}/paddle/pserver/paddle_pserver_main'])]
data_files=[(paddle_bin_dir, paddle_bins),
(paddle_rt_lib_dir, paddle_rt_libs)]
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录