Skip to content

Commit

Permalink
[Bug fix] Do not quantize weights Y when matmul X and Y both other op…
Browse files Browse the repository at this point in the history
…s outputs (#43297)

* fix some matmul that X and Y both other ops outputs, do not dequantize the Y.

* fix CI format

* fix according to review
  • Loading branch information
lidanqing-intel authored Jun 9, 2022
1 parent 6678def commit 06d999f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions paddle/fluid/framework/ir/mkldnn/quant_dequant_mkldnn_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,9 @@ bool QuantDequantMkldnnPass::IsInt8Weight(
auto* op_desc = op_node->Op();
auto var_name = op_desc->Input(weight_name)[0];
auto* var = scope->FindVar(var_name);
PADDLE_ENFORCE_NOT_NULL(
var, platform::errors::NotFound(
"The input persistable [%s] var of [%s] op is not found.",
var_name, op_desc->Type()));
if (var == nullptr) {
return false;
}
auto* weight_tensor = var->GetMutable<LoDTensor>();
auto* weight_data = weight_tensor->data<float>();
bool is_int8 = true;
Expand Down

0 comments on commit 06d999f

Please sign in to comment.