Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
cc5e118b
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cc5e118b
编写于
10月 20, 2017
作者:
Z
zchen0211
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/Paddle
into develop
上级
b3ab3ce0
ac4f7598
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
41 addition
and
4 deletion
+41
-4
Dockerfile
Dockerfile
+1
-1
paddle/framework/CMakeLists.txt
paddle/framework/CMakeLists.txt
+3
-3
paddle/framework/operator.cc
paddle/framework/operator.cc
+15
-0
paddle/framework/operator.h
paddle/framework/operator.h
+2
-0
paddle/pybind/pybind.cc
paddle/pybind/pybind.cc
+2
-0
paddle/scripts/docker/build.sh
paddle/scripts/docker/build.sh
+7
-0
python/paddle/v2/framework/tests/test_op_support_gpu.py
python/paddle/v2/framework/tests/test_op_support_gpu.py
+11
-0
未找到文件。
Dockerfile
浏览文件 @
cc5e118b
...
...
@@ -22,7 +22,7 @@ COPY ./paddle/scripts/docker/root/ /root/
RUN
apt-get update
&&
\
apt-get
install
-y
\
git python-pip python-dev openssh-server bison
\
git python-pip python-dev openssh-server bison
libnccl-dev
\
wget unzip unrar
tar
xz-utils bzip2
gzip
coreutils ntp
\
curl
sed grep
graphviz libjpeg-dev zlib1g-dev
\
python-matplotlib gcc-4.8 g++-4.8
\
...
...
paddle/framework/CMakeLists.txt
浏览文件 @
cc5e118b
...
...
@@ -19,15 +19,15 @@ cc_test(scope_test SRCS scope_test.cc DEPS scope)
proto_library
(
framework_proto SRCS framework.proto
)
cc_library
(
attribute SRCS attribute.cc DEPS framework_proto
)
cc_library
(
proto_desc SRCS var_desc.cc op_desc.cc block_desc.cc program_desc.cc DEPS attribute ddim op_info
)
cc_test
(
program_desc_test SRCS program_desc_test.cc DEPS proto_desc
)
cc_library
(
op_proto_maker SRCS op_proto_maker.cc DEPS framework_proto attribute
)
cc_test
(
op_proto_maker_test SRCS op_proto_maker_test.cc DEPS op_proto_maker
)
cc_library
(
op_info SRCS op_info.cc DEPS attribute framework_proto
)
cc_library
(
operator SRCS operator.cc DEPS op_info device_context tensor scope
proto_desc
glog
)
cc_library
(
operator SRCS operator.cc DEPS op_info device_context tensor scope glog
)
cc_test
(
operator_test SRCS operator_test.cc DEPS operator op_registry
)
cc_library
(
proto_desc SRCS var_desc.cc op_desc.cc block_desc.cc program_desc.cc DEPS attribute ddim op_info operator
)
cc_library
(
op_registry SRCS op_registry.cc DEPS op_proto_maker op_info operator glog
)
cc_library
(
op_registry SRCS op_registry.cc DEPS op_proto_maker op_info operator glog
proto_desc
)
cc_test
(
op_registry_test SRCS op_registry_test.cc DEPS op_registry
)
py_proto_compile
(
framework_py_proto SRCS framework.proto
)
...
...
paddle/framework/operator.cc
浏览文件 @
cc5e118b
...
...
@@ -252,5 +252,20 @@ std::ostream& operator<<(std::ostream& os,
return
os
;
}
bool
OpSupportGPU
(
const
std
::
string
&
op_type
)
{
auto
&
all_kernels
=
OperatorWithKernel
::
AllOpKernels
();
auto
it
=
all_kernels
.
find
(
op_type
);
if
(
it
==
all_kernels
.
end
())
{
// All control operator must support GPU
return
true
;
}
for
(
auto
&
kern_pair
:
it
->
second
)
{
if
(
platform
::
is_gpu_place
(
kern_pair
.
first
.
place_
))
{
return
true
;
}
}
return
false
;
}
}
// namespace framework
}
// namespace paddle
paddle/framework/operator.h
浏览文件 @
cc5e118b
...
...
@@ -649,5 +649,7 @@ class OperatorWithKernel : public OperatorBase {
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
OperatorWithKernel
::
OpKernelKey
&
kernel_key
);
extern
bool
OpSupportGPU
(
const
std
::
string
&
op_type
);
}
// namespace framework
}
// namespace paddle
paddle/pybind/pybind.cc
浏览文件 @
cc5e118b
...
...
@@ -466,6 +466,8 @@ All parameter, weight, gradient are variables in Paddle.
BindVarDsec
(
m
);
BindOpDesc
(
m
);
m
.
def
(
"op_support_gpu"
,
OpSupportGPU
);
return
m
.
ptr
();
}
}
// namespace pybind
...
...
paddle/scripts/docker/build.sh
浏览文件 @
cc5e118b
...
...
@@ -141,10 +141,17 @@ RUN sed -i '${APT_MIRROR}' /etc/apt/sources.list
EOF
fi
if
[[
${
WITH_GPU
}
==
"ON"
]]
;
then
NCCL_DEPS
=
"apt-get install -y libnccl-dev &&"
else
NCCL_DEPS
=
""
fi
cat
>>
/paddle/build/Dockerfile
<<
EOF
ADD python/dist/*.whl /
# run paddle version to install python packages first
RUN apt-get update &&
\
${
NCCL_DEPS
}
\
apt-get install -y wget python-pip && pip install -U pip &&
\
pip install /*.whl; apt-get install -f -y &&
\
apt-get clean -y &&
\
...
...
python/paddle/v2/framework/tests/test_op_support_gpu.py
0 → 100644
浏览文件 @
cc5e118b
import
unittest
import
paddle.v2.framework.core
as
core
class
TestOpSupportGPU
(
unittest
.
TestCase
):
def
test_case
(
self
):
self
.
assertEqual
(
core
.
is_compile_gpu
(),
core
.
op_support_gpu
(
"sum"
))
if
__name__
==
'__main__'
:
unittest
.
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录