Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
096eb801
P
Paddle
项目概览
PaddlePaddle
/
Paddle
8 个月 前同步成功
通知
2281
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
096eb801
编写于
6月 23, 2022
作者:
L
lidanqing
提交者:
GitHub
6月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove slowing down pass (#43750)
上级
9d12e70c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
2 deletion
+17
-2
paddle/fluid/inference/api/paddle_pass_builder.cc
paddle/fluid/inference/api/paddle_pass_builder.cc
+12
-1
paddle/fluid/inference/api/paddle_pass_builder.h
paddle/fluid/inference/api/paddle_pass_builder.h
+4
-0
python/paddle/fluid/contrib/slim/quantization/quant2_int8_mkldnn_pass.py
...luid/contrib/slim/quantization/quant2_int8_mkldnn_pass.py
+1
-1
未找到文件。
paddle/fluid/inference/api/paddle_pass_builder.cc
浏览文件 @
096eb801
...
...
@@ -20,6 +20,7 @@
#include <miopen/miopen.h>
#endif
#include <glog/logging.h>
#include <algorithm>
#include <sstream>
namespace
paddle
{
...
...
@@ -60,6 +61,12 @@ void PaddlePassBuilder::DeletePass(const std::string &pass_type) {
}
}
size_t
PaddlePassBuilder
::
GetPassIndex
(
const
std
::
string
&
pass_type
)
{
auto
iter
=
std
::
find
(
std
::
begin
(
passes_
),
std
::
end
(
passes_
),
pass_type
);
if
(
iter
==
std
::
end
(
passes_
))
return
-
1
;
return
std
::
distance
(
std
::
begin
(
passes_
),
iter
);
}
void
PaddlePassBuilder
::
InsertPass
(
size_t
idx
,
const
std
::
string
&
pass_type
)
{
passes_
.
insert
(
std
::
begin
(
passes_
)
+
idx
,
pass_type
);
}
...
...
@@ -268,7 +275,11 @@ void CpuPassStrategy::EnableMKLDNN() {
#ifdef PADDLE_WITH_MKLDNN
if
(
!
use_mkldnn_
)
{
passes_
.
insert
(
passes_
.
begin
(),
"mkldnn_placement_pass"
);
int
id
=
GetPassIndex
(
"gpu_cpu_reshape2_matmul_fuse_pass"
);
// this pass slows down FC mkldnn int8 operator
if
(
id
!=
-
1
)
{
passes_
.
erase
(
passes_
.
begin
()
+
id
);
}
for
(
auto
&
pass
:
std
::
vector
<
std
::
string
>
({
"depthwise_conv_mkldnn_pass"
,
//
"conv_bn_fuse_pass"
,
// Execute BN passes again to
...
...
paddle/fluid/inference/api/paddle_pass_builder.h
浏览文件 @
096eb801
...
...
@@ -75,6 +75,10 @@ class PD_INFER_DECL PaddlePassBuilder {
/// \param[in] pass_type the certain pass type to be deleted.
void
DeletePass
(
const
std
::
string
&
pass_type
);
/// \brief Get the certain position of a pass.
// \param[in] pass_type the type of insert pass.
size_t
GetPassIndex
(
const
std
::
string
&
pass_type
);
/// \brief Delete all the passes.
void
ClearPasses
();
...
...
python/paddle/fluid/contrib/slim/quantization/quant2_int8_mkldnn_pass.py
浏览文件 @
096eb801
...
...
@@ -411,7 +411,7 @@ class Quant2Int8MkldnnPass(object):
graph
=
self
.
_apply_pass
(
graph
,
'multi_gru_seq_fuse_pass'
)
graph
=
self
.
_apply_pass
(
graph
,
'seq_concat_fc_fuse_pass'
)
graph
=
self
.
_apply_pass
(
graph
,
'gpu_cpu_squeeze2_matmul_fuse_pass'
)
graph
=
self
.
_apply_pass
(
graph
,
'gpu_cpu_reshape2_matmul_fuse_pass'
)
#
graph = self._apply_pass(graph, 'gpu_cpu_reshape2_matmul_fuse_pass')
graph
=
self
.
_apply_pass
(
graph
,
'gpu_cpu_flatten2_matmul_fuse_pass'
)
graph
=
self
.
_apply_pass
(
graph
,
'matmul_v2_scale_fuse_pass'
)
graph
=
self
.
_apply_pass
(
graph
,
'squared_mat_sub_fuse_pass'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录