Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
larryliu0820 committed Jul 5, 2024
1 parent df3b18a commit f3c320a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torchao/quantization/GPTQ.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ def __init__(
self.groupsize: int = groupsize
self.padding_allowed: bool = padding_allowed
self.device: torch.device = device
# precision and dtype are being used interchangeably here
self.precision: torch.dtype = precision

@torch.no_grad()
Expand Down Expand Up @@ -652,7 +653,7 @@ def _create_quantized_state_dict(
weight,
4, # n_bit
self.groupsize,
self.precision, # precision for scales_and_zeros
self.precision, # dtype for scales_and_zeros
)
weight_int4pack = torch.ops.aten._convert_weight_to_int4pack(w_int4x8.to(self.device), self.inner_k_tiles)
cur_state_dict[f"{fqn}.weight"] = weight_int4pack.to(self.device)
Expand Down

0 comments on commit f3c320a

Please sign in to comment.