[POT] Fixed non-zero zero point value in symmetric quantized weights (#13013)
* Fixed non-zero zero point val in symmquantized weights * Update references * Add tests
This commit is contained in:
1 parent
43db45a4fb
commit
fcfc5c963b
3 files changed
+7
-4
No files matched your search
@@ -212,7 +212,8 @@ def optimize_model(args):
|
||||
|
||||
# Step 7 (Optional): Compress model weights quantized precision
|
||||
# in order to reduce the size of final .bin file.
|
||||
compress_model_weights(compressed_model)
|
||||
if not args.keep_uncompressed_weights:
|
||||
compress_model_weights(compressed_model)
|
||||
|
||||
return compressed_model, pipeline
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from typing import List, Set
|
||||
|
||||
import numpy as np
|
||||
from openvino.tools.mo.back.ForceStrictPrecision import ForceStrictPrecision
|
||||
from openvino.tools.mo.back.compress_quantized_weights import CompressQuantizeWeights
|
||||
from openvino.tools.mo.back.compress_quantized_weights import CompressQuantizeWeights, ZeroPointOptimizer
|
||||
from openvino.tools.mo.ops.elementwise import Add
|
||||
from openvino.tools.mo.ops.Cast import Cast
|
||||
from openvino.tools.mo.ops.fakequantize import FakeQuantize
|
||||
@@ -1013,6 +1013,8 @@ def compress_weights(model: Graph):
|
||||
add_removed_converts(model)
|
||||
CompressQuantizeWeights().find_and_replace_pattern(model)
|
||||
model.clean_up()
|
||||
ZeroPointOptimizer().find_and_replace_pattern(model)
|
||||
model.clean_up()
|
||||
ForceStrictPrecision().find_and_replace_pattern(model)
|
||||
model.clean_up()
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ TEST_MODELS = [
|
||||
'accuracy@top5': 0.907},
|
||||
{}, 'CPU'),
|
||||
|
||||
('mobilenet-v2-pytorch', 'pytorch', 'DefaultQuantization', 'mixed', 300, {'accuracy@top1': 0.734,
|
||||
('mobilenet-v2-pytorch', 'pytorch', 'DefaultQuantization', 'mixed', 300, {'accuracy@top1': 0.737,
|
||||
'accuracy@top5': 0.91},
|
||||
{}, 'CPU'),
|
||||
|
||||
@@ -173,7 +173,7 @@ SIMPLIFIED_TEST_MODELS = [
|
||||
('mobilenet-v2-pytorch', 'pytorch', 'DefaultQuantization', 'performance',
|
||||
{'accuracy@top1': 0.707, 'accuracy@top5': 0.91}, []),
|
||||
('mobilenet-v2-pytorch', 'pytorch', 'DefaultQuantization', 'performance',
|
||||
{'accuracy@top1': 0.709, 'accuracy@top5': 0.904}, ['--input_shape=[1,3,?,?]'])
|
||||
{'accuracy@top1': 0.706, 'accuracy@top5': 0.904}, ['--input_shape=[1,3,?,?]'])
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user