Skip to content

Commit 4328b41

Browse files
author
George
authored
[Forward Call] fake quant fix (#145)
* fake quant fix * fix * comment * commetn
1 parent 0435986 commit 4328b41

File tree

1 file changed

+10
-1
lines changed
  • src/compressed_tensors/quantization/lifecycle

1 file changed

+10
-1
lines changed

src/compressed_tensors/quantization/lifecycle/forward.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,16 @@ def maybe_calibrate_or_quantize(
348348
update_parameter_data(module, updated_scale, f"{base_name}_scale")
349349
update_parameter_data(module, updated_zero_point, f"{base_name}_zero_point")
350350

351-
return fake_quantize(value, scale, zero_point, args, g_idx=g_idx)
351+
scale = updated_scale
352+
zero_point = updated_zero_point
353+
354+
return fake_quantize(
355+
x=value,
356+
scale=scale,
357+
zero_point=zero_point,
358+
args=args,
359+
g_idx=g_idx,
360+
)
352361

353362

354363
@torch.no_grad()

0 commit comments

Comments
 (0)