Skip to content

Commit

Permalink
set num_groups to 1 if if < 1
Browse files Browse the repository at this point in the history
  • Loading branch information
dsikka committed Oct 3, 2024
1 parent 710bc53 commit a02bb2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compressed_tensors/quantization/lifecycle/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ def _initialize_scale_zero_point_observer(
# (output_channels, 1)
expected_shape = (weight_shape[0], 1)
elif quantization_args.strategy == QuantizationStrategy.GROUP:
num_groups = weight_shape[1] // quantization_args.group_size
expected_shape = (
weight_shape[0],
weight_shape[1] // quantization_args.group_size,
1 if num_groups < 1 else num_groups
)

scale_dtype = module.weight.dtype
Expand Down

0 comments on commit a02bb2b

Please sign in to comment.