Skip to content

Commit

Permalink
fix per token initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
kylesayrs committed Nov 19, 2024
1 parent 82235b3 commit 0b0d8b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/compressed_tensors/quantization/lifecycle/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ def _initialize_scale_zero_point(
device = "cpu" if has_offloaded_params(module) else params_device

# infer expected scale/zero point shape
expected_shape = 1 # per tensor
if quantization_args.strategy == QuantizationStrategy.TOKEN:
expected_shape = (1, 1)
else:
expected_shape = 1

if base_name == "weight" and weight_shape is not None:
if quantization_args.strategy == QuantizationStrategy.CHANNEL:
Expand Down
2 changes: 0 additions & 2 deletions src/compressed_tensors/utils/offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ def update_offload_data(
prefix = module._hf_hook.weights_map.prefix
key = f"{prefix}{name}"

breakpoint()

offload_device = (
dataset[key].device
if key in dataset
Expand Down

0 comments on commit 0b0d8b6

Please sign in to comment.