Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
343bff7b
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
343bff7b
编写于
1月 04, 2023
作者:
A
Aurelius84
提交者:
GitHub
1月 04, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[D2SCinn]Add build_cinn_pass in BuildStrategy (#49496)
上级
257e6c99
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
30 addition
and
1 deletion
+30
-1
paddle/fluid/framework/details/build_strategy.cc
paddle/fluid/framework/details/build_strategy.cc
+1
-1
paddle/fluid/framework/details/build_strategy.h
paddle/fluid/framework/details/build_strategy.h
+3
-0
paddle/fluid/pybind/parallel_executor.cc
paddle/fluid/pybind/parallel_executor.cc
+26
-0
未找到文件。
paddle/fluid/framework/details/build_strategy.cc
浏览文件 @
343bff7b
...
@@ -56,7 +56,7 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder {
...
@@ -56,7 +56,7 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder {
AppendPrintGraphPass
(
"graph_viz_pass"
,
"_original_graph"
);
AppendPrintGraphPass
(
"graph_viz_pass"
,
"_original_graph"
);
#ifdef PADDLE_WITH_CINN
#ifdef PADDLE_WITH_CINN
if
(
FLAGS_use_cinn
)
{
if
(
FLAGS_use_cinn
||
strategy
.
build_cinn_pass_
)
{
// Note: This pass is used to enable cinn.
// Note: This pass is used to enable cinn.
AppendPass
(
"build_cinn_pass"
);
AppendPass
(
"build_cinn_pass"
);
AppendPrintGraphPass
(
"graph_viz_pass"
,
"_build_cinn_graph"
);
AppendPrintGraphPass
(
"graph_viz_pass"
,
"_build_cinn_graph"
);
...
...
paddle/fluid/framework/details/build_strategy.h
浏览文件 @
343bff7b
...
@@ -103,6 +103,9 @@ struct BuildStrategy {
...
@@ -103,6 +103,9 @@ struct BuildStrategy {
// Fix the op run order.
// Fix the op run order.
bool
fix_op_run_order_
{
false
};
bool
fix_op_run_order_
{
false
};
// Lowering sub-graph into cinn ops.
bool
build_cinn_pass_
{
false
};
// Operator fusion
// Operator fusion
// TODO(dev-paddle): fuse_elewise_add_act_ops may cause some models have
// TODO(dev-paddle): fuse_elewise_add_act_ops may cause some models have
// cycle.
// cycle.
...
...
paddle/fluid/pybind/parallel_executor.cc
浏览文件 @
343bff7b
...
@@ -633,7 +633,33 @@ void BindParallelExecutor(pybind11::module &m) { // NOLINT
...
@@ -633,7 +633,33 @@ void BindParallelExecutor(pybind11::module &m) { // NOLINT
[](
BuildStrategy
&
self
,
int
nranks
)
{
[](
BuildStrategy
&
self
,
int
nranks
)
{
self
.
hierarchical_allreduce_inter_nranks_
=
nranks
;
self
.
hierarchical_allreduce_inter_nranks_
=
nranks
;
})
})
.
def_property
(
"build_cinn_pass"
,
[](
const
BuildStrategy
&
self
)
{
return
self
.
build_cinn_pass_
;
},
[](
BuildStrategy
&
self
,
bool
b
)
{
PADDLE_ENFORCE_NE
(
self
.
IsFinalized
(),
true
,
platform
::
errors
::
PreconditionNotMet
(
"BuildStrategy has been finlaized, "
"cannot be configured again."
));
self
.
build_cinn_pass_
=
b
;
},
R"DOC((bool, optional): build_cinn_pass indicates whether
to lowering some operators in graph into cinn ops
to execute, which will speed up the process of execution.
Default False.
Examples:
.. code-block:: python
import paddle
import paddle.static as static
paddle.enable_static()
build_strategy = static.BuildStrategy()
build_strategy.build_cinn_pass = True
)DOC"
)
.
def_property
(
.
def_property
(
"fuse_elewise_add_act_ops"
,
"fuse_elewise_add_act_ops"
,
[](
const
BuildStrategy
&
self
)
{
[](
const
BuildStrategy
&
self
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录