From 330ebd7d6b2408688e2c7b408d36a43d25585c69 Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:29:39 -0400 Subject: [PATCH] Fix regression in 8bit parameter device movement --- bitsandbytes/nn/modules.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bitsandbytes/nn/modules.py b/bitsandbytes/nn/modules.py index 69d39277b..c36fb68a6 100644 --- a/bitsandbytes/nn/modules.py +++ b/bitsandbytes/nn/modules.py @@ -694,11 +694,10 @@ def to(self, *args, **kwargs): ) # If we had already quantized, move the statistics appropriately. - if is_quantized and device is not None: - if self.CB is not None: - new_param.CB = new_param.data + if is_quantized: + new_param.CB = new_param.data - if self.SCB is not None: + if self.SCB is not None and device is not None: new_param.SCB = self.SCB.to(device) return new_param