Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
32da5e9c
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
32da5e9c
编写于
5月 20, 2019
作者:
T
Tao Luo
提交者:
GitHub
5月 20, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused expected_kernel_cache_pass (#17486)
test=develop
上级
65dd7ec2
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
4 addition
and
92 deletion
+4
-92
paddle/fluid/framework/details/build_strategy.cc
paddle/fluid/framework/details/build_strategy.cc
+0
-6
paddle/fluid/framework/details/build_strategy.h
paddle/fluid/framework/details/build_strategy.h
+0
-1
paddle/fluid/framework/ir/CMakeLists.txt
paddle/fluid/framework/ir/CMakeLists.txt
+0
-1
paddle/fluid/framework/ir/expected_kernel_cache_pass.cc
paddle/fluid/framework/ir/expected_kernel_cache_pass.cc
+0
-37
paddle/fluid/framework/ir/expected_kernel_cache_pass.h
paddle/fluid/framework/ir/expected_kernel_cache_pass.h
+0
-31
paddle/fluid/framework/operator.h
paddle/fluid/framework/operator.h
+0
-6
paddle/fluid/inference/api/analysis_config.cc
paddle/fluid/inference/api/analysis_config.cc
+0
-1
paddle/fluid/inference/api/paddle_pass_builder.cc
paddle/fluid/inference/api/paddle_pass_builder.cc
+3
-5
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+1
-4
未找到文件。
paddle/fluid/framework/details/build_strategy.cc
浏览文件 @
32da5e9c
...
...
@@ -171,11 +171,6 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder {
AppendPass
(
"runtime_context_cache_pass"
);
}
if
(
strategy_
.
cache_expected_kernel_
)
{
VLOG
(
10
)
<<
"Add expected_kernel_cache_pass"
;
AppendPass
(
"expected_kernel_cache_pass"
);
}
AppendMultiDevPass
(
strategy_
);
if
(
strategy_
.
fuse_all_reduce_ops_
)
{
...
...
@@ -371,7 +366,6 @@ USE_PASS(fuse_sgd_op_pass);
USE_PASS
(
fuse_momentum_op_pass
);
USE_PASS
(
fuse_all_reduce_op_pass
);
USE_PASS
(
runtime_context_cache_pass
);
USE_PASS
(
expected_kernel_cache_pass
);
USE_PASS
(
record_skip_memory_opt_vars_pass
);
#ifdef PADDLE_WITH_MKLDNN
USE_PASS
(
mkldnn_placement_pass
);
...
...
paddle/fluid/framework/details/build_strategy.h
浏览文件 @
32da5e9c
...
...
@@ -109,7 +109,6 @@ struct BuildStrategy {
bool
remove_unnecessary_lock_
{
true
};
bool
cache_runtime_context_
{
false
};
bool
cache_expected_kernel_
{
true
};
std
::
unordered_set
<
std
::
string
>
mkldnn_enabled_op_types_
;
// NOTE:
...
...
paddle/fluid/framework/ir/CMakeLists.txt
浏览文件 @
32da5e9c
...
...
@@ -72,7 +72,6 @@ pass_library(transpose_flatten_concat_fuse_pass inference)
pass_library
(
identity_scale_op_clean_pass base
)
pass_library
(
sync_batch_norm_pass base
)
pass_library
(
runtime_context_cache_pass base
)
pass_library
(
expected_kernel_cache_pass base
)
pass_library
(
quant_conv2d_dequant_fuse_pass inference
)
pass_library
(
fillconstant_elementwisemul_fuse inference
)
pass_library
(
shuffle_channel_detect_pass inference
)
...
...
paddle/fluid/framework/ir/expected_kernel_cache_pass.cc
已删除
100644 → 0
浏览文件 @
65dd7ec2
/* 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/framework/ir/expected_kernel_cache_pass.h"
#include <memory>
#include "paddle/fluid/framework/operator.h"
namespace
paddle
{
namespace
framework
{
namespace
ir
{
void
ExpectedKernelCachePass
::
ApplyImpl
(
ir
::
Graph
*
graph
)
const
{
VLOG
(
3
)
<<
"Applies Expected Kernel Cache strategy."
;
for
(
const
Node
*
n
:
graph
->
Nodes
())
{
if
(
n
->
IsOp
()
&&
n
->
Op
())
{
n
->
Op
()
->
SetAttr
(
kEnableCacheExpectedKernel
,
true
);
}
}
}
}
// namespace ir
}
// namespace framework
}
// namespace paddle
REGISTER_PASS
(
expected_kernel_cache_pass
,
paddle
::
framework
::
ir
::
ExpectedKernelCachePass
);
paddle/fluid/framework/ir/expected_kernel_cache_pass.h
已删除
100644 → 0
浏览文件 @
65dd7ec2
/* 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. */
#pragma once
#include <memory>
#include "paddle/fluid/framework/ir/pass.h"
namespace
paddle
{
namespace
framework
{
namespace
ir
{
class
ExpectedKernelCachePass
:
public
Pass
{
protected:
void
ApplyImpl
(
ir
::
Graph
*
graph
)
const
override
;
};
}
// namespace ir
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/operator.h
浏览文件 @
32da5e9c
...
...
@@ -71,12 +71,6 @@ constexpr char kNewGradSuffix[] = "@NEWGRAD@";
/// this Op's execution to save the elapsed time.
constexpr
char
kEnableCacheRuntimeContext
[]
=
"@ENABLE_CACHE_RUNTIME_CONTEXT@"
;
/// If an Op has attribtue kEnableCacheExpectedKernel, it means that in a same
/// name scope and same place, since the expected kerenl of this Op does not
/// change in the execution, it could be recorded only at the first iteration of
/// this Op's execution to save the elapsed time.
constexpr
char
kEnableCacheExpectedKernel
[]
=
"@ENABLE_CACHE_EXPECTED_KERNEL@"
;
/// If an Op has this attribute, all its kernels should calculate output
/// variable's shape in the corresponding Compute() function. And
/// OperatorWithKernel::RunImpl() would skip call this Op's InferShape()
...
...
paddle/fluid/inference/api/analysis_config.cc
浏览文件 @
32da5e9c
...
...
@@ -235,7 +235,6 @@ void AnalysisConfig::Update() {
pass_builder
()
->
InsertPass
(
3
,
"tensorrt_subgraph_pass"
);
}
pass_builder
()
->
DeletePass
(
"runtime_context_cache_pass"
);
pass_builder
()
->
DeletePass
(
"expected_kernel_cache_pass"
);
}
if
(
use_mkldnn_
)
{
...
...
paddle/fluid/inference/api/paddle_pass_builder.cc
浏览文件 @
32da5e9c
...
...
@@ -98,9 +98,8 @@ GpuPassStrategy::GpuPassStrategy() : PassStrategy({}) {
"conv_elementwise_add_fuse_pass"
,
//
#endif //
"transpose_flatten_concat_fuse_pass"
,
// following
two passes should be located in the last, since they
will
// following
pass should be located in the last, since it
will
// work on all fused ops.
"expected_kernel_cache_pass"
,
//
"runtime_context_cache_pass"
});
...
...
@@ -134,9 +133,8 @@ CpuPassStrategy::CpuPassStrategy() : PassStrategy({}) {
"conv_bn_fuse_pass"
,
//
"conv_eltwiseadd_bn_fuse_pass"
,
//
"is_test_pass"
,
//
// following two passes should be located in the last, since
// they will work on all fused ops.
"expected_kernel_cache_pass"
,
//
// following pass should be located in the last, since
// it will work on all fused ops.
"runtime_context_cache_pass"
});
use_gpu_
=
false
;
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
32da5e9c
...
...
@@ -18,6 +18,7 @@ limitations under the License. */
#include <mutex> // NOLINT // for call_once
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
...
...
@@ -1492,10 +1493,6 @@ All parameter, weight, gradient are variables in Paddle.
"cache_runtime_context"
,
[](
const
BuildStrategy
&
self
)
{
return
self
.
cache_runtime_context_
;
},
[](
BuildStrategy
&
self
,
bool
b
)
{
self
.
cache_runtime_context_
=
b
;
})
.
def_property
(
"cache_expected_kernel"
,
[](
const
BuildStrategy
&
self
)
{
return
self
.
cache_expected_kernel_
;
},
[](
BuildStrategy
&
self
,
bool
b
)
{
self
.
cache_expected_kernel_
=
b
;
})
.
def_property
(
"mkldnn_enabled_op_types"
,
[](
const
BuildStrategy
&
self
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录