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,9 +699,10 @@ class LoraBaseMixin:
module.lora_B[adapter_name].to(device)
# 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:
module.lora_magnitude_vector[adapter_name] = module.lora_magnitude_vector[
adapter_name
].to(device)
if adapter_name in module.lora_magnitude_vector:
module.lora_magnitude_vector[adapter_name] = module.lora_magnitude_vector[
adapter_name
].to(device)
@staticmethod
def pack_weights(layers, prefix):
......
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