Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
0d47f387
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
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看板
未验证
提交
0d47f387
编写于
8月 24, 2023
作者:
Z
zhangbo9674
提交者:
GitHub
8月 24, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[IR] Auto gen fused op (#56585)
* add code * fix bug * fix bug
上级
773ee87c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
11 deletion
+19
-11
paddle/fluid/ir/dialect/op_generator/op_gen.py
paddle/fluid/ir/dialect/op_generator/op_gen.py
+1
-0
paddle/fluid/ir/dialect/paddle_dialect/ir/CMakeLists.txt
paddle/fluid/ir/dialect/paddle_dialect/ir/CMakeLists.txt
+7
-1
paddle/phi/api/yaml/fused_ops.yaml
paddle/phi/api/yaml/fused_ops.yaml
+1
-0
paddle/phi/infermeta/fusion.cc
paddle/phi/infermeta/fusion.cc
+5
-5
paddle/phi/infermeta/fusion.h
paddle/phi/infermeta/fusion.h
+5
-5
未找到文件。
paddle/fluid/ir/dialect/op_generator/op_gen.py
浏览文件 @
0d47f387
...
@@ -112,6 +112,7 @@ CC_FILE_TEMPLATE = """// This file is generated by "paddle/fluid/ir/dialect/op_g
...
@@ -112,6 +112,7 @@ CC_FILE_TEMPLATE = """// This file is generated by "paddle/fluid/ir/dialect/op_g
#include "paddle/phi/infermeta/unary.h"
#include "paddle/phi/infermeta/unary.h"
#include "paddle/phi/infermeta/ternary.h"
#include "paddle/phi/infermeta/ternary.h"
#include "paddle/phi/infermeta/backward.h"
#include "paddle/phi/infermeta/backward.h"
#include "paddle/phi/infermeta/fusion.h"
#include "paddle/phi/api/lib/utils/allocator.h"
#include "paddle/phi/api/lib/utils/allocator.h"
#include "paddle/fluid/primitive/rule/vjp/vjp.h"
#include "paddle/fluid/primitive/rule/vjp/vjp.h"
{def_primitive}
{def_primitive}
...
...
paddle/fluid/ir/dialect/paddle_dialect/ir/CMakeLists.txt
浏览文件 @
0d47f387
...
@@ -17,11 +17,17 @@ set(op_backward_yaml_file1
...
@@ -17,11 +17,17 @@ set(op_backward_yaml_file1
set
(
op_backward_yaml_file2
set
(
op_backward_yaml_file2
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/operators/generator/parsed_ops/legacy_backward_ops.parsed.yaml
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/operators/generator/parsed_ops/legacy_backward_ops.parsed.yaml
)
)
set
(
fused_op_forward_yaml_file
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/operators/generator/parsed_ops/fused_ops.parsed.yaml
)
set
(
fused_op_backward_yaml_file
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/operators/generator/parsed_ops/fused_backward.parsed.yaml
)
set
(
op_yaml_file3
set
(
op_yaml_file3
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/ir/dialect/paddle_dialect/ir/pd_op.yaml
)
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/ir/dialect/paddle_dialect/ir/pd_op.yaml
)
set
(
op_yaml_files
set
(
op_yaml_files
${
op_forward_yaml_file1
}
,
${
op_forward_yaml_file2
}
,
${
op_backward_yaml_file1
}
,
${
op_backward_yaml_file2
}
,
${
op_yaml_file3
}
${
op_forward_yaml_file1
}
,
${
op_forward_yaml_file2
}
,
${
op_backward_yaml_file1
}
,
${
op_backward_yaml_file2
}
,
${
fused_op_forward_yaml_file
}
,
${
fused_op_backward_yaml_file
}
,
${
op_yaml_file3
}
)
)
set
(
op_namespace paddle,dialect
)
set
(
op_namespace paddle,dialect
)
set
(
dialect_name pd
)
set
(
dialect_name pd
)
...
...
paddle/phi/api/yaml/fused_ops.yaml
浏览文件 @
0d47f387
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
output
:
Tensor(out), Tensor(seq_lod), Tensor(max_seq_len)
output
:
Tensor(out), Tensor(seq_lod), Tensor(max_seq_len)
infer_meta
:
infer_meta
:
func
:
EmbeddingWithEltwiseAddXPUInferMeta
func
:
EmbeddingWithEltwiseAddXPUInferMeta
param
:
[
ids
,
tables
,
mask
]
kernel
:
kernel
:
func
:
embedding_with_eltwise_add_xpu
func
:
embedding_with_eltwise_add_xpu
data_type
:
tables
data_type
:
tables
...
...
paddle/phi/infermeta/fusion.cc
浏览文件 @
0d47f387
...
@@ -466,11 +466,11 @@ void FusedMultiTransformerXpuInferMeta(
...
@@ -466,11 +466,11 @@ void FusedMultiTransformerXpuInferMeta(
const
std
::
vector
<
const
MetaTensor
*>&
ffn2_bias
,
const
std
::
vector
<
const
MetaTensor
*>&
ffn2_bias
,
const
std
::
vector
<
const
MetaTensor
*>&
cache_kv
,
const
std
::
vector
<
const
MetaTensor
*>&
cache_kv
,
const
std
::
vector
<
const
MetaTensor
*>&
pre_caches
,
const
std
::
vector
<
const
MetaTensor
*>&
pre_caches
,
const
std
::
vector
<
const
MetaTensor
*>
&
rotary_pos_emb
,
const
MetaTensor
&
rotary_pos_emb
,
const
std
::
vector
<
const
MetaTensor
*>
&
time_step
,
const
MetaTensor
&
time_step
,
const
std
::
vector
<
const
MetaTensor
*>
&
seq_lengths
,
const
MetaTensor
&
seq_lengths
,
const
std
::
vector
<
const
MetaTensor
*>
&
src_mask
,
const
MetaTensor
&
src_mask
,
const
std
::
vector
<
const
MetaTensor
*>
&
gather_index
,
const
MetaTensor
&
gather_index
,
bool
pre_layer_norm
,
bool
pre_layer_norm
,
int
rotary_emb_dims
,
int
rotary_emb_dims
,
float
epsilon
,
float
epsilon
,
...
...
paddle/phi/infermeta/fusion.h
浏览文件 @
0d47f387
...
@@ -143,11 +143,11 @@ void FusedMultiTransformerXpuInferMeta(
...
@@ -143,11 +143,11 @@ void FusedMultiTransformerXpuInferMeta(
const
std
::
vector
<
const
MetaTensor
*>&
ffn2_bias
,
const
std
::
vector
<
const
MetaTensor
*>&
ffn2_bias
,
const
std
::
vector
<
const
MetaTensor
*>&
cache_kv
,
const
std
::
vector
<
const
MetaTensor
*>&
cache_kv
,
const
std
::
vector
<
const
MetaTensor
*>&
pre_caches
,
const
std
::
vector
<
const
MetaTensor
*>&
pre_caches
,
const
std
::
vector
<
const
MetaTensor
*>
&
rotary_pos_emb
,
const
MetaTensor
&
rotary_pos_emb
,
const
std
::
vector
<
const
MetaTensor
*>
&
time_step
,
const
MetaTensor
&
time_step
,
const
std
::
vector
<
const
MetaTensor
*>
&
seq_lengths
,
const
MetaTensor
&
seq_lengths
,
const
std
::
vector
<
const
MetaTensor
*>
&
src_mask
,
const
MetaTensor
&
src_mask
,
const
std
::
vector
<
const
MetaTensor
*>
&
gather_index
,
const
MetaTensor
&
gather_index
,
bool
pre_layer_norm
,
bool
pre_layer_norm
,
int
rotary_emb_dims
,
int
rotary_emb_dims
,
float
epsilon
,
float
epsilon
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录