Skip to content

Commit

Permalink
Fix: Also set group_size if we're doing groupwise quantization
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfraser committed Feb 15, 2024
1 parent 2369645 commit a9fedcb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/brevitas_examples/common/generative/quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@ def quantize_model(
**{
'bit_width': weight_bit_width,
'narrow_range': False,
'group_size': weight_group_size,
'quantize_zero_point': quantize_weight_zero_point},
**weight_float_format)

# Set the group_size is we're doing groupwise quantization
if weight_quant_granularity == 'per_group':
weight_quant = weight_quant.let(
**{'group_size': weight_group_size})
# weight scale is converted to a standalone parameter
# This is done already by default in the per_group quantizer
if weight_quant_granularity != 'per_group':
Expand Down

0 comments on commit a9fedcb

Please sign in to comment.