We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 648ea70 commit 52d38d8Copy full SHA for 52d38d8
quantllm/utils/benchmark.py
@@ -64,9 +64,11 @@ def benchmark_quantizer(
64
"percdamp": 0.01,
65
"block_size": 128,
66
})
67
+ # Create a deep copy of the model using state dict
68
+ model_clone = type(self.model)(self.model.config)
69
+ model_clone.load_state_dict(self.model.state_dict())
70
- # Initialize quantizer with model on CPU
- model_clone = self.model.clone()
71
+ # Initialize quantizer with model copy on CPU
72
quantizer = quantizer_class(model=model_clone, **mem_efficient_args)
73
74
# Move to device for quantization
0 commit comments