Skip to content

Commit 61d6393

Browse files
Michael Gschwindfacebook-github-bot
authored andcommitted
Fix groupwise quantization when group size divides channel size (#2264)
Summary: Pull Request resolved: #2264 Fix groupwise quantization when group size divides channel size Reviewed By: manuelcandales Differential Revision: D54549436 fbshipit-source-id: 859a419b43be0c120795396c7d34641ed311a34d
1 parent 80f3b1b commit 61d6393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/models/llama2/quantize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def dynamically_quantize_per_channel(
7676

7777
if group_size is None or group_size == 0:
7878
items = x_shape_1
79-
elif not enable_non_multiple_groups:
79+
elif ((x_shape_1 % group_size) == 0) or not enable_non_multiple_groups:
8080
assert group_size > 0, "group size must be positive"
8181
assert (
8282
x_shape_1 % group_size

0 commit comments

Comments
 (0)