Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Better fix: remove all the code
  • Loading branch information
BenjaminBossan committed Jan 13, 2025
commit 7dc36f71c9c56e179c186626f5fffec1f2030a03
9 changes: 0 additions & 9 deletions src/peft/tuners/lora/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,6 @@ def _replace_module(self, parent, child_name, new_module, child):
child = child.base_layer

meta = torch.device("meta")

# handle .state attribute of 8 bit bnb
if (getattr(child, "state", None) is not None) and not any(p.device == meta for p in new_module.parameters()):
if hasattr(new_module, "base_layer"):
new_module.base_layer.state = child.state
else:
new_module.state = child.state
new_module.to(child.weight.device)

# dispatch to correct device
for name, module in new_module.named_modules():
if (self.prefix in name) or ("ranknum" in name):
Expand Down
Loading