From d6428940d57cc40c15d1c3713c5009c469bbdc54 Mon Sep 17 00:00:00 2001 From: tgghzyh <430211065@qq.com> Date: Thu, 12 Nov 2026 01:56:28 +0800 Subject: [PATCH] Avoid copying the full scale table for 4-bit embedding lookups --- bitsandbytes/nn/modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitsandbytes/nn/modules.py b/bitsandbytes/nn/modules.py index ebc0b0943..d691a0f81 100644 --- a/bitsandbytes/nn/modules.py +++ b/bitsandbytes/nn/modules.py @@ -951,7 +951,7 @@ def _forward_with_partial_dequantize(self, input: Tensor): ) assert output_absmax.shape == (input.numel() * blocks_per_emb,) - output_quant_state = copy.deepcopy(self.weight.quant_state) + output_quant_state = copy.copy(self.weight.quant_state) output_quant_state.absmax = output_absmax output_quant_state.shape = torch.Size((*input.shape, self.embedding_dim))