Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
cc2f9462
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
cc2f9462
编写于
12月 30, 2020
作者:
W
wawltor
提交者:
GitHub
12月 30, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add the support the op version check for matmul, test=op_version (#30011)
* add the support the op version check for matmul, test=op_version
上级
b33aaea8
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
20 addition
and
8 deletion
+20
-8
paddle/fluid/framework/ir/map_matmul_to_mul_pass.cc
paddle/fluid/framework/ir/map_matmul_to_mul_pass.cc
+3
-3
paddle/fluid/framework/ir/mkldnn/matmul_transpose_reshape_fuse_pass.cc
...framework/ir/mkldnn/matmul_transpose_reshape_fuse_pass.cc
+1
-1
paddle/fluid/framework/ir/mkldnn/scale_matmul_fuse_pass.cc
paddle/fluid/framework/ir/mkldnn/scale_matmul_fuse_pass.cc
+1
-1
paddle/fluid/framework/ir/multihead_matmul_fuse_pass.cc
paddle/fluid/framework/ir/multihead_matmul_fuse_pass.cc
+1
-1
paddle/fluid/framework/ir/squared_mat_sub_fuse_pass.cc
paddle/fluid/framework/ir/squared_mat_sub_fuse_pass.cc
+1
-1
paddle/fluid/inference/analysis/ir_passes/tensorrt_subgraph_pass.cc
...id/inference/analysis/ir_passes/tensorrt_subgraph_pass.cc
+1
-1
paddle/fluid/operators/matmul_op.cc
paddle/fluid/operators/matmul_op.cc
+12
-0
未找到文件。
paddle/fluid/framework/ir/map_matmul_to_mul_pass.cc
浏览文件 @
cc2f9462
...
@@ -227,7 +227,7 @@ REGISTER_PASS(map_matmul_to_mul_pass, paddle::framework::ir::MapMatmul2MulPass);
...
@@ -227,7 +227,7 @@ REGISTER_PASS(map_matmul_to_mul_pass, paddle::framework::ir::MapMatmul2MulPass);
REGISTER_PASS_CAPABILITY
(
map_matmul_to_mul_pass
)
REGISTER_PASS_CAPABILITY
(
map_matmul_to_mul_pass
)
.
AddCombination
(
.
AddCombination
(
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
.
EQ
(
"matmul"
,
0
)
.
LE
(
"matmul"
,
1
)
.
EQ
(
"mul"
,
0
));
.
EQ
(
"mul"
,
0
));
REGISTER_PASS
(
squeeze2_matmul_fuse_pass
,
REGISTER_PASS
(
squeeze2_matmul_fuse_pass
,
...
@@ -235,7 +235,7 @@ REGISTER_PASS(squeeze2_matmul_fuse_pass,
...
@@ -235,7 +235,7 @@ REGISTER_PASS(squeeze2_matmul_fuse_pass,
REGISTER_PASS_CAPABILITY
(
squeeze2_matmul_fuse_pass
)
REGISTER_PASS_CAPABILITY
(
squeeze2_matmul_fuse_pass
)
.
AddCombination
(
.
AddCombination
(
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
.
EQ
(
"matmul"
,
0
)
.
LE
(
"matmul"
,
1
)
.
EQ
(
"squeeze2"
,
0
)
.
EQ
(
"squeeze2"
,
0
)
.
EQ
(
"mul"
,
0
));
.
EQ
(
"mul"
,
0
));
...
@@ -244,6 +244,6 @@ REGISTER_PASS(reshape2_matmul_fuse_pass,
...
@@ -244,6 +244,6 @@ REGISTER_PASS(reshape2_matmul_fuse_pass,
REGISTER_PASS_CAPABILITY
(
reshape2_matmul_fuse_pass
)
REGISTER_PASS_CAPABILITY
(
reshape2_matmul_fuse_pass
)
.
AddCombination
(
.
AddCombination
(
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
.
EQ
(
"matmul"
,
0
)
.
LE
(
"matmul"
,
1
)
.
EQ
(
"reshape2"
,
0
)
.
EQ
(
"reshape2"
,
0
)
.
EQ
(
"mul"
,
0
));
.
EQ
(
"mul"
,
0
));
paddle/fluid/framework/ir/mkldnn/matmul_transpose_reshape_fuse_pass.cc
浏览文件 @
cc2f9462
...
@@ -103,6 +103,6 @@ REGISTER_PASS(matmul_transpose_reshape_fuse_pass,
...
@@ -103,6 +103,6 @@ REGISTER_PASS(matmul_transpose_reshape_fuse_pass,
REGISTER_PASS_CAPABILITY
(
matmul_transpose_reshape_fuse_pass
)
REGISTER_PASS_CAPABILITY
(
matmul_transpose_reshape_fuse_pass
)
.
AddCombination
(
.
AddCombination
(
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
.
EQ
(
"matmul"
,
0
)
.
LE
(
"matmul"
,
1
)
.
EQ
(
"transpose"
,
0
)
.
EQ
(
"transpose"
,
0
)
.
EQ
(
"reshape"
,
0
));
.
EQ
(
"reshape"
,
0
));
paddle/fluid/framework/ir/mkldnn/scale_matmul_fuse_pass.cc
浏览文件 @
cc2f9462
...
@@ -96,4 +96,4 @@ REGISTER_PASS_CAPABILITY(scale_matmul_fuse_pass)
...
@@ -96,4 +96,4 @@ REGISTER_PASS_CAPABILITY(scale_matmul_fuse_pass)
.
AddCombination
(
.
AddCombination
(
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
.
EQ
(
"scale"
,
0
)
.
EQ
(
"scale"
,
0
)
.
EQ
(
"matmul"
,
0
));
.
LE
(
"matmul"
,
1
));
paddle/fluid/framework/ir/multihead_matmul_fuse_pass.cc
浏览文件 @
cc2f9462
...
@@ -720,5 +720,5 @@ REGISTER_PASS_CAPABILITY(multihead_matmul_fuse_pass_v2)
...
@@ -720,5 +720,5 @@ REGISTER_PASS_CAPABILITY(multihead_matmul_fuse_pass_v2)
.
EQ
(
"reshape2"
,
0
)
.
EQ
(
"reshape2"
,
0
)
.
EQ
(
"transpose2"
,
0
)
.
EQ
(
"transpose2"
,
0
)
.
EQ
(
"scale"
,
0
)
.
EQ
(
"scale"
,
0
)
.
EQ
(
"matmul"
,
0
)
.
LE
(
"matmul"
,
1
)
.
EQ
(
"softmax"
,
0
));
.
EQ
(
"softmax"
,
0
));
paddle/fluid/framework/ir/squared_mat_sub_fuse_pass.cc
浏览文件 @
cc2f9462
...
@@ -389,7 +389,7 @@ REGISTER_PASS(squared_mat_sub_fuse_pass,
...
@@ -389,7 +389,7 @@ REGISTER_PASS(squared_mat_sub_fuse_pass,
REGISTER_PASS_CAPABILITY
(
squared_mat_sub_fuse_pass
)
REGISTER_PASS_CAPABILITY
(
squared_mat_sub_fuse_pass
)
.
AddCombination
(
.
AddCombination
(
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
paddle
::
framework
::
compatible
::
OpVersionComparatorCombination
()
.
EQ
(
"matmul"
,
0
)
.
LE
(
"matmul"
,
1
)
.
EQ
(
"matmul_v2"
,
0
)
.
EQ
(
"matmul_v2"
,
0
)
.
EQ
(
"square"
,
0
)
.
EQ
(
"square"
,
0
)
.
LE
(
"elementwise_mul"
,
1
)
.
LE
(
"elementwise_mul"
,
1
)
...
...
paddle/fluid/inference/analysis/ir_passes/tensorrt_subgraph_pass.cc
浏览文件 @
cc2f9462
...
@@ -396,4 +396,4 @@ REGISTER_PASS_CAPABILITY(tensorrt_subgraph_pass)
...
@@ -396,4 +396,4 @@ REGISTER_PASS_CAPABILITY(tensorrt_subgraph_pass)
.
EQ
(
"gelu"
,
0
)
.
EQ
(
"gelu"
,
0
)
.
EQ
(
"layer_norm"
,
0
)
.
EQ
(
"layer_norm"
,
0
)
.
EQ
(
"scale"
,
0
)
.
EQ
(
"scale"
,
0
)
.
EQ
(
"matmul"
,
0
));
.
LE
(
"matmul"
,
1
));
paddle/fluid/operators/matmul_op.cc
浏览文件 @
cc2f9462
...
@@ -16,6 +16,7 @@ limitations under the License. */
...
@@ -16,6 +16,7 @@ limitations under the License. */
#include <utility>
#include <utility>
#include <vector>
#include <vector>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/op_version_registry.h"
#include "paddle/fluid/operators/math/blas.h"
#include "paddle/fluid/operators/math/blas.h"
#ifdef PADDLE_WITH_MKLDNN
#ifdef PADDLE_WITH_MKLDNN
#include "paddle/fluid/platform/mkldnn_helper.h"
#include "paddle/fluid/platform/mkldnn_helper.h"
...
@@ -932,3 +933,14 @@ REGISTER_OP_CUDA_KERNEL(
...
@@ -932,3 +933,14 @@ REGISTER_OP_CUDA_KERNEL(
ops
::
MatMulDoubleGradKernel
<
paddle
::
platform
::
CUDADeviceContext
,
float
>
,
ops
::
MatMulDoubleGradKernel
<
paddle
::
platform
::
CUDADeviceContext
,
float
>
,
ops
::
MatMulDoubleGradKernel
<
paddle
::
platform
::
CUDADeviceContext
,
double
>
);
ops
::
MatMulDoubleGradKernel
<
paddle
::
platform
::
CUDADeviceContext
,
double
>
);
#endif
#endif
REGISTER_OP_VERSION
(
matmul
)
.
AddCheckpoint
(
R"ROC(Register matmul for adding the attribute of
fused_reshape_Y)ROC"
,
paddle
::
framework
::
compatible
::
OpVersionDesc
().
NewAttr
(
"fused_reshape_Y"
,
"In order to support the function of fused the input Y "
" and input X into the input X when "
"using the operator of matmul, and get raw shape of input Y."
,
std
::
vector
<
int
>
{}));
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录