Skip to content

Commit f5cb0ce

Browse files
committed
up
1 parent 52bf16a commit f5cb0ce

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

torchao/quantization/qat/embedding.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ def _convert_helper(self, module: torch.nn.Module):
235235
# Load weights and qparams into quantized embedding
236236
(qmin, qmax) = _get_qmin_qmax(self.bit_width)
237237
(s, zp) = get_group_qparams_symmetric(
238-
child.weight, self.bit_width, group_size, precision=scale_precision,
238+
child.weight,
239+
self.bit_width,
240+
group_size,
241+
precision=scale_precision,
239242
)
240243
q_weight = _quantized_decomposed_quantize_per_channel_group_wrapper(
241244
child.weight,

torchao/quantization/qat/linear.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ def _convert_qat_linear_8da4w(self, module: torch.nn.Module):
219219
n_bit = 4
220220
(qmin, qmax) = _get_qmin_qmax(n_bit)
221221
(s, zp) = get_group_qparams_symmetric(
222-
child.weight, n_bit, config.group_size, precision=scale_precision,
222+
child.weight,
223+
n_bit,
224+
config.group_size,
225+
precision=config.scale_precision,
223226
)
224227
from torchao._executorch_ops import (
225228
_quantized_decomposed_quantize_per_channel_group_wrapper,

0 commit comments

Comments
 (0)