Unverified Commit 6dc64865 authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[LoRA] fix adapter movement when using DoRA. (#9411)

fix adapter movement when using DoRA.
parent 1e8cf276
...@@ -699,6 +699,7 @@ class LoraBaseMixin: ...@@ -699,6 +699,7 @@ class LoraBaseMixin:
module.lora_B[adapter_name].to(device) module.lora_B[adapter_name].to(device)
# this is a param, not a module, so device placement is not in-place -> re-assign # this is a param, not a module, so device placement is not in-place -> re-assign
if hasattr(module, "lora_magnitude_vector") and module.lora_magnitude_vector is not None: if hasattr(module, "lora_magnitude_vector") and module.lora_magnitude_vector is not None:
if adapter_name in module.lora_magnitude_vector:
module.lora_magnitude_vector[adapter_name] = module.lora_magnitude_vector[ module.lora_magnitude_vector[adapter_name] = module.lora_magnitude_vector[
adapter_name adapter_name
].to(device) ].to(device)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment