Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c054adf2
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c054adf2
编写于
10月 16, 2019
作者:
Z
Zeng Jinle
提交者:
GitHub
10月 16, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make_conv_workspace_size_configurable, test=release/1.6 (#20664)
上级
06e35ae4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
45 addition
and
6 deletion
+45
-6
paddle/fluid/operators/conv_op.cc
paddle/fluid/operators/conv_op.cc
+2
-2
paddle/fluid/operators/conv_transpose_op.cc
paddle/fluid/operators/conv_transpose_op.cc
+2
-2
paddle/fluid/operators/fused/fusion_conv_inception_op.cc
paddle/fluid/operators/fused/fusion_conv_inception_op.cc
+1
-1
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+3
-1
paddle/fluid/platform/cudnn_workspace_helper.cc
paddle/fluid/platform/cudnn_workspace_helper.cc
+35
-0
paddle/fluid/platform/cudnn_workspace_helper.h
paddle/fluid/platform/cudnn_workspace_helper.h
+2
-0
未找到文件。
paddle/fluid/operators/conv_op.cc
浏览文件 @
c054adf2
...
@@ -318,7 +318,7 @@ void Conv2DOpMaker::Make() {
...
@@ -318,7 +318,7 @@ void Conv2DOpMaker::Make() {
"allocated/freed each time the operator runs, larger "
"allocated/freed each time the operator runs, larger "
"workspace size can increase performance but also requires "
"workspace size can increase performance but also requires "
"better hardware. This size should be chosen carefully."
)
"better hardware. This size should be chosen carefully."
)
.
SetDefault
(
platform
::
kDefaultConvWorkspaceSizeLimitMB
);
.
SetDefault
(
platform
::
GetDefaultConvWorkspaceSizeLimitMB
()
);
AddAttr
<
bool
>
(
"exhaustive_search"
,
AddAttr
<
bool
>
(
"exhaustive_search"
,
"(bool, default false) cuDNN has many algorithm to calculation "
"(bool, default false) cuDNN has many algorithm to calculation "
"convolution, whether enable exhaustive search "
"convolution, whether enable exhaustive search "
...
@@ -455,7 +455,7 @@ void Conv3DOpMaker::Make() {
...
@@ -455,7 +455,7 @@ void Conv3DOpMaker::Make() {
"allocated/freed each time the operator runs, larger "
"allocated/freed each time the operator runs, larger "
"workspace size can increase performance but also requires "
"workspace size can increase performance but also requires "
"better hardware. This size should be chosen carefully."
)
"better hardware. This size should be chosen carefully."
)
.
SetDefault
(
platform
::
kDefaultConvWorkspaceSizeLimitMB
);
.
SetDefault
(
platform
::
GetDefaultConvWorkspaceSizeLimitMB
()
);
AddAttr
<
bool
>
(
"exhaustive_search"
,
AddAttr
<
bool
>
(
"exhaustive_search"
,
"(bool, default false) cuDNN has many algorithm to calculation "
"(bool, default false) cuDNN has many algorithm to calculation "
"convolution, whether enable exhaustive search "
"convolution, whether enable exhaustive search "
...
...
paddle/fluid/operators/conv_transpose_op.cc
浏览文件 @
c054adf2
...
@@ -222,7 +222,7 @@ void Conv2DTransposeOpMaker::Make() {
...
@@ -222,7 +222,7 @@ void Conv2DTransposeOpMaker::Make() {
"allocated/freed each time the operator runs, larger "
"allocated/freed each time the operator runs, larger "
"workspace size can increase performance but also requires "
"workspace size can increase performance but also requires "
"better hardward. This size should be carefully setted."
)
"better hardward. This size should be carefully setted."
)
.
SetDefault
(
platform
::
kDefaultConvWorkspaceSizeLimitMB
);
.
SetDefault
(
platform
::
GetDefaultConvWorkspaceSizeLimitMB
()
);
AddComment
(
R"DOC(
AddComment
(
R"DOC(
Convolution2D Transpose Operator.
Convolution2D Transpose Operator.
...
@@ -323,7 +323,7 @@ void Conv3DTransposeOpMaker::Make() {
...
@@ -323,7 +323,7 @@ void Conv3DTransposeOpMaker::Make() {
"allocated/freed each time the operator runs, larger "
"allocated/freed each time the operator runs, larger "
"workspace size can increase performance but also requires "
"workspace size can increase performance but also requires "
"better hardward. This size should be carefully setted."
)
"better hardward. This size should be carefully setted."
)
.
SetDefault
(
platform
::
kDefaultConvWorkspaceSizeLimitMB
);
.
SetDefault
(
platform
::
GetDefaultConvWorkspaceSizeLimitMB
()
);
AddComment
(
R"DOC(
AddComment
(
R"DOC(
Convolution3D Transpose Operator.
Convolution3D Transpose Operator.
...
...
paddle/fluid/operators/fused/fusion_conv_inception_op.cc
浏览文件 @
c054adf2
...
@@ -96,7 +96,7 @@ class ConvInceptionFusionOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -96,7 +96,7 @@ class ConvInceptionFusionOpMaker : public framework::OpProtoAndCheckerMaker {
"allocated/freed each time the operator runs, larger "
"allocated/freed each time the operator runs, larger "
"workspace size can increase performance but also requires "
"workspace size can increase performance but also requires "
"better hardware. This size should be chosen carefully."
)
"better hardware. This size should be chosen carefully."
)
.
SetDefault
(
platform
::
kDefaultConvWorkspaceSizeLimitMB
);
.
SetDefault
(
platform
::
GetDefaultConvWorkspaceSizeLimitMB
()
);
AddComment
(
R"DOC(
AddComment
(
R"DOC(
)DOC"
);
)DOC"
);
}
}
...
...
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
c054adf2
...
@@ -68,11 +68,13 @@ ELSE()
...
@@ -68,11 +68,13 @@ ELSE()
set
(
STREAM_CALLBACK_DEPS
)
set
(
STREAM_CALLBACK_DEPS
)
ENDIF
()
ENDIF
()
cc_library
(
cudnn_workspace_helper SRCS cudnn_workspace_helper.cc DEPS boost
)
# memcpy depends on device_context, here add deps individually for
# memcpy depends on device_context, here add deps individually for
# avoiding cycle dependencies
# avoiding cycle dependencies
cc_library
(
device_context SRCS device_context.cc init.cc DEPS simple_threadpool malloc xxhash
${
STREAM_CALLBACK_DEPS
}
cc_library
(
device_context SRCS device_context.cc init.cc DEPS simple_threadpool malloc xxhash
${
STREAM_CALLBACK_DEPS
}
place eigen3 stringpiece cpu_helper cpu_info framework_proto
${
GPU_CTX_DEPS
}
${
MKLDNN_CTX_DEPS
}
place eigen3 stringpiece cpu_helper cpu_info framework_proto
${
GPU_CTX_DEPS
}
${
MKLDNN_CTX_DEPS
}
${
dgc_deps
}
dlpack
)
${
dgc_deps
}
dlpack
cudnn_workspace_helper
)
if
(
WITH_DISTRIBUTE
)
if
(
WITH_DISTRIBUTE
)
cc_library
(
collective_helper SRCS collective_helper.cc DEPS framework_proto device_context enforce
)
cc_library
(
collective_helper SRCS collective_helper.cc DEPS framework_proto device_context enforce
)
...
...
paddle/fluid/platform/cudnn_workspace_helper.cc
0 → 100644
浏览文件 @
c054adf2
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/fluid/platform/cudnn_workspace_helper.h"
#include <cstdlib>
#include <string>
#include "boost/lexical_cast.hpp"
namespace
paddle
{
namespace
platform
{
static
int
GetDefaultConvWorkspaceSizeLimitMBImpl
()
{
const
char
*
env_str
=
std
::
getenv
(
"FLAGS_conv_workspace_size_limit"
);
return
env_str
?
boost
::
lexical_cast
<
int
>
(
std
::
string
(
env_str
))
:
kDefaultConvWorkspaceSizeLimitMB
;
}
int
GetDefaultConvWorkspaceSizeLimitMB
()
{
static
auto
workspace_size
=
GetDefaultConvWorkspaceSizeLimitMBImpl
();
return
workspace_size
;
}
}
// namespace platform
}
// namespace paddle
paddle/fluid/platform/cudnn_workspace_helper.h
浏览文件 @
c054adf2
...
@@ -19,5 +19,7 @@ namespace platform {
...
@@ -19,5 +19,7 @@ namespace platform {
static
constexpr
int
kDefaultConvWorkspaceSizeLimitMB
=
512
;
static
constexpr
int
kDefaultConvWorkspaceSizeLimitMB
=
512
;
int
GetDefaultConvWorkspaceSizeLimitMB
();
}
// namespace platform
}
// namespace platform
}
// namespace paddle
}
// namespace paddle
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录