We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5df48e commit 4595971Copy full SHA for 4595971
torchao/quantization/GPTQ.py
@@ -720,6 +720,8 @@ def _create_quantized_state_dict(
720
self.precision, # dtype for scales_and_zeros
721
)
722
# TODO: just get the device from mod.weight.device?
723
+ w_cpu = w_int4x8.cpu()
724
+ w_int4x8 = (w_cpu[::, ::2] << 4 | w_cpu[::, 1::2]).to(torch.uint8)
725
weight_int4pack = torch.ops.aten._convert_weight_to_int4pack(w_int4x8.to(self.device), self.inner_k_tiles)
726
cur_state_dict[f"{fqn}.weight"] = weight_int4pack.to(self.device)
727
cur_state_dict[f"{fqn}.scales_and_zeros"] = scales_and_zeros.to(self.device)
0 commit comments