Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a5c98630
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
提交
a5c98630
编写于
7月 26, 2019
作者:
P
Physher
提交者:
Tao Luo
7月 26, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clarify MKLDNN INT8 Mul Op attributes (#18685)
上级
cff5e2c1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
6 deletion
+18
-6
paddle/fluid/operators/mkldnn/mul_mkldnn_op.cc
paddle/fluid/operators/mkldnn/mul_mkldnn_op.cc
+8
-0
paddle/fluid/operators/mul_op.cc
paddle/fluid/operators/mul_op.cc
+10
-6
未找到文件。
paddle/fluid/operators/mkldnn/mul_mkldnn_op.cc
浏览文件 @
a5c98630
...
@@ -207,6 +207,14 @@ class QuantMulPrimitiveFactory : public MulPrimitiveFactory<XT, YT, OT> {
...
@@ -207,6 +207,14 @@ class QuantMulPrimitiveFactory : public MulPrimitiveFactory<XT, YT, OT> {
int
y_num_col_dims
=
ctx
.
Attr
<
int
>
(
"y_num_col_dims"
);
int
y_num_col_dims
=
ctx
.
Attr
<
int
>
(
"y_num_col_dims"
);
auto
scale_y
=
ctx
.
Attr
<
std
::
vector
<
float
>>
(
"scale_y"
);
auto
scale_y
=
ctx
.
Attr
<
std
::
vector
<
float
>>
(
"scale_y"
);
// TODO(intel-minghui) : Remove the restriction that only supports Input(Y)
// as weights
bool
enforce
=
std
::
is_same
<
YT
,
float
>::
value
;
PADDLE_ENFORCE
(
enforce
==
true
,
"Input(Y) supposed to be fp32 data type since only fp32 data type is "
"supported in the current design of MKLDNN INT8."
);
auto
x_matrix
=
auto
x_matrix
=
this
->
template
UpdateDataFormat
<
XT
>(
x_input
,
x_num_col_dims
,
ctx
);
this
->
template
UpdateDataFormat
<
XT
>(
x_input
,
x_num_col_dims
,
ctx
);
auto
y_matrix
=
auto
y_matrix
=
...
...
paddle/fluid/operators/mul_op.cc
浏览文件 @
a5c98630
...
@@ -144,13 +144,17 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -144,13 +144,17 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
)DOC"
)
)DOC"
)
.
SetDefault
(
1
)
.
SetDefault
(
1
)
.
EqualGreaterThan
(
1
);
.
EqualGreaterThan
(
1
);
AddAttr
<
float
>
(
"scale_x"
,
AddAttr
<
float
>
(
"scale_x to used for int8 input data x."
"scale_x"
,
"Only used with MKL-DNN INT8"
)
"scale_x to be used for int8 mul input data x. scale_x has the"
"same purpose as scale_in in OPs that support quantization."
"Only to be used with MKL-DNN INT8"
)
.
SetDefault
(
1.0
f
);
.
SetDefault
(
1.0
f
);
AddAttr
<
std
::
vector
<
float
>>
(
"scale_y"
,
AddAttr
<
std
::
vector
<
float
>>
(
"scale_y to used for int8 input data y."
"scale_y"
,
"Only used with MKL-DNN INT8"
)
"scale_y to be used for int8 mul input data y. scale_y has the"
"same purpose as scale_weights in OPs that support quantization."
"Only to be used with MKL-DNN INT8"
)
.
SetDefault
({
1.0
f
});
.
SetDefault
({
1.0
f
});
AddAttr
<
float
>
(
"scale_out"
,
AddAttr
<
float
>
(
"scale_out"
,
"scale_out to be used for int8 output data."
"scale_out to be used for int8 output data."
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录