Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix scale bug in quantized batch_dot (#20735)
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikaJedynak authored Nov 17, 2021
1 parent 36ed5e0 commit 52bc1bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/operator/nn/dnnl/dnnl_batch_dot-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct DNNLDotParam : public dmlc::Parameter<DNNLDotParam> {

dmlc::optional<float> min_calib_range; // min float value calculated from calibration dataset
dmlc::optional<float> max_calib_range; // max float value calculated from calibration dataset
bool enable_float_output; // min float value calculated from calibration dataset
bool enable_float_output;
DMLC_DECLARE_PARAMETER(DNNLDotParam) {
DMLC_DECLARE_FIELD(transpose_a)
.describe("If true then transpose the first input before dot.")
Expand Down
2 changes: 1 addition & 1 deletion src/operator/nn/dnnl/dnnl_batch_dot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ dnnl::primitive_attr GetQuantizationAttributes(const DNNLDotParam& param,
// fused requantize => output is int
out_scale_ = GetQuantizeScale(outputs[DotOut::out].dtype(),
param.min_calib_range.value(),
param.min_calib_range.value()) /
param.max_calib_range.value()) /
lhs_scale_ / rhs_scale_;
attr.set_output_scales(0, {out_scale_});
} else if (param.enable_float_output) {
Expand Down

0 comments on commit 52bc1bf

Please sign in to comment.