Skip to content

Commit c81c8ab

Browse files
mikekgfbmalfet
authored andcommitted
packed as default (#350)
1 parent 9f7a329 commit c81c8ab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

quantize.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,17 +552,16 @@ def __init__(
552552
*,
553553
bitwidth: int = 8,
554554
groupsize: Optional[int] = None,
555-
packed=False,
555+
packed=True,
556556
):
557+
# when quantization dictionary comes from JSON, packed is a string
557558
if isinstance(packed, str):
558-
packed = packed == "True"
559+
packed = packed.lower() != "false"
559560
self.model_ = model
560561
self.device = device
561562
self.groupsize = groupsize
562563
self.bitwidth = bitwidth
563564
self.packed = packed
564-
if (bitwidth != 4) and packed:
565-
raise RuntimeError("pack only works with bitsize 4")
566565

567566
@torch.no_grad()
568567
def create_quantized_state_dict(self, packed=False) -> Dict:

0 commit comments

Comments
 (0)