Skip to content

Commit

Permalink
cleaner (vllm-project#168)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle Sayers <kyle@neuralmagic.com>
  • Loading branch information
kylesayrs and Kyle Sayers authored Oct 2, 2024
1 parent 9c36ff0 commit 710bc53
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/compressed_tensors/quantization/lifecycle/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ def set_module_for_calibration(module: Module, quantize_weights_upfront: bool =
observer = module.weight_observer
g_idx = getattr(module, "weight_g_idx", None)

offloaded = False
if is_module_offloaded(module):
offloaded = is_module_offloaded(module)
if offloaded:
module._hf_hook.pre_forward(module)
offloaded = True

scale, zero_point = observer(module.weight, g_idx=g_idx)
update_parameter_data(module, scale, "weight_scale")
Expand Down

0 comments on commit 710bc53

Please sign in to comment.