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

Fix scale bug in quantized batch_dot #20735

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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