Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-savelyevv committed Nov 1, 2024
1 parent 68a8696 commit b953f0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ def calculate_quantization_params(

if config.group_size == -1:
result_scale = fns.squeeze(result_scale, axis=1)
if zp is not None and config.group_size == -1:
zp = fns.squeeze(zp, axis=1)

return result_scale, zp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ def test_compressed_weighs_range(mode, data):


@pytest.mark.parametrize(
"configuration",
("config", "precompute_scale", "precompute_zero_point", "raises"),
[
(WeightCompressionConfig(CompressWeightsMode.INT8_ASYM), False, False, False),
(WeightCompressionConfig(CompressWeightsMode.INT8_ASYM), True, True, False),
Expand All @@ -1091,8 +1091,7 @@ def test_compressed_weighs_range(mode, data):
(WeightCompressionConfig(CompressWeightsMode.INT4_SYM), False, False, False),
],
)
def test_int_quantization_with_precomputed_parameters(configuration):
config, precompute_scale, precompute_zero_point, raises = configuration
def test_int_quantization_with_precomputed_parameters(config, precompute_scale, precompute_zero_point, raises):
is_asym = config.mode in [CompressWeightsMode.INT4_ASYM, CompressWeightsMode.INT8_ASYM]

precomputed_scale, precomputed_zero_point = None, None
Expand Down

0 comments on commit b953f0c

Please sign in to comment.