-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fc_mkldnn format issue #38890
Fix fc_mkldnn format issue #38890
Conversation
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @Aganlengzi could you please review? |
op->Op()->GetAttrIfExists<int>("in_num_col_dims") == 2) { | ||
q_desc.SetAttr("output_format", Has("data_layout") | ||
? Get<std::string>("data_layout") | ||
: "NCHW"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AddAttr<int>("in_num_col_dims",
"(int, default 1), The fc op can take tensors with more than "
"two dimensions as its inputs.")
.SetDefault(1)
Hi, does it support "in_num_col_dims") == 1 too, cause in_num_col_dims by default is 1. Sorry I did not review clearly last time.
like this ? Any issue?
if (op->Op()->Type() == "fc" &&
op->Op()->GetAttrIfExists<int>("in_num_col_dims") <= 2) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no issues for fc and in_num_col_dims == 1
. The problem is seen only in that narrow cased mentioned in description. For example test_analyzer_int8_resnet50
, which has fc passes enabled and fc op is quantized has no issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry to inform you that 2dd308f's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
@baoachun Could you please review this PR so that we can ask @Aganlengzi to merge it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ae9e22d
2dd308f
to
ae9e22d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Since Baoachun already reviewed this PR and left LGTM hence I just merged this PR |
PR types
Bug fixes
PR changes
OPs
Describe
Adding fc mldnn passes in ernie int8 model caused format error, so the fix is to change NHWC to NCHW in this narrow case. It is a workaround to error "DNNL FC only supports in_num_col_dims equal to 2 when input format is equal to ncw."