Skip to content

Commit

Permalink
Fix (examples/llm): padding for packed 3/5/6b (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
volcacius authored Sep 4, 2023
1 parent 96d5733 commit 2b203c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/brevitas_examples/llm/llm_quant/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def pack_int_weights(self, bit_width, int_weights):
f"Weight tensor does not divide by {bit_width}, zero-padding columns by {padding}."
)
packed_int_weights = torch.zeros(
(int_weights.shape[0], int_weights.shape[1] * bit_width // 8 + padding),
(int_weights.shape[0], (int_weights.shape[1] * bit_width + padding) // 8),
device=int_weights.device,
dtype=int_weights.dtype)

Expand Down

0 comments on commit 2b203c9

Please sign in to comment.