Skip to content

Commit 692a8e1

Browse files
committed
fix save
Signed-off-by: jiqing-feng <[email protected]>
1 parent 6cec12d commit 692a8e1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

bitsandbytes/functional.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,6 +2214,7 @@ def _convert_weight_packed_for_cpu_inverse(
22142214
recovered_state.absmax = qabsmax
22152215
recovered_state.offset = offset
22162216
recovered_state.state2 = state2
2217+
recovered_state.nested = True
22172218

22182219
recovered_state.dtype = recovered_state.original_dtype
22192220
recovered_state.packing_format_for_cpu = False

bitsandbytes/nn/modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,11 @@ def _save_to_state_dict(self, destination, prefix, keep_vars):
515515
save weight and bias,
516516
then fill state_dict with components of quant_state
517517
"""
518-
super()._save_to_state_dict(destination, prefix, keep_vars) # saving weight and bias
519518
if getattr(self.weight.quant_state, "packing_format_for_cpu", False):
520519
self.weight.data, self.weight.quant_state = _convert_weight_packed_for_cpu_inverse(
521520
self.weight.data, self.weight.quant_state
522521
)
522+
super()._save_to_state_dict(destination, prefix, keep_vars) # saving weight and bias
523523
if getattr(self.weight, "quant_state", None) is not None:
524524
for k, v in self.weight.quant_state.as_dict(packed=True).items():
525525
destination[prefix + "weight." + k] = v if keep_vars else v.detach()

0 commit comments

Comments
 (0)