[GNA] Reverted internal overload correction (#16962)

* reverted overload correction

* added comment

* Enabled tests

* Revert merge error

This reverts commit daed290452.
This commit is contained in:
Mikhail Ryzhov 2023-04-17 19:39:58 +02:00 committed by GitHub
parent 930441b223
commit 14f38bfde8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -1313,9 +1313,13 @@ bool ScaleFactorCalculator::ScaleFactorPerLayerWeightable(InferenceEngine::Weigh
} }
} }
if (calculateWeightsReducerFromDstStats(quant->_dst_quant) > initial_weights_reducer_val) { auto weightsReducer = calculateWeightsReducerFromDstStats(quant->_dst_quant);
// This correction should be done by POT, but we observed issues with int8 quantization
if (weightsReducer > initial_weights_reducer_val) {
log::warning() << "Potential overload correction issue at layer " << wl->name; log::warning() << "Potential overload correction issue at layer " << wl->name;
quant->_weights_quant.SetScale(quant->_weights_quant.GetScale() / weightsReducer);
} }
quant->_dst_quant.SetScale(quant->_weights_quant.GetScale() * quant->_src_quant.GetScale());
} }
return true; return true;

View File

@ -141,6 +141,7 @@ TEST_P(MatMulOverloadCorrectionNegTest, CompareWithRefImpl) {
EXPECT_THAT(what.str(), ::testing::HasSubstr(expected)); EXPECT_THAT(what.str(), ::testing::HasSubstr(expected));
std::cout.rdbuf(sbuf); std::cout.rdbuf(sbuf);
std::cerr.rdbuf(ebuf); std::cerr.rdbuf(ebuf);
Run();
}; };
const std::vector<InferenceEngine::Precision> netPrecisions = {InferenceEngine::Precision::FP32, const std::vector<InferenceEngine::Precision> netPrecisions = {InferenceEngine::Precision::FP32,