Skip to content

Commit 4558548

Browse files
【lora】delete nouse llm target_modules (#3125)
1 parent d5f4730 commit 4558548

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

paddleformers/peft/lora/lora_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,12 +951,12 @@ def get_lora_model(self, model: Union[PretrainedModel, nn.Layer], lora_config: L
951951
return model
952952
if isinstance(lora_config.target_modules, str):
953953
lora_config.target_modules = [lora_config.target_modules]
954-
955-
for target_module in lora_config.target_modules:
956-
for i in model.named_sublayers():
957-
module_name = i[0]
954+
for i in model.named_sublayers():
955+
module_name = i[0]
956+
for target_module in lora_config.target_modules:
958957
if re.fullmatch(target_module, module_name):
959958
self._find_and_replace_module(model, module_name, lora_config)
959+
break
960960
return model
961961

962962
def restore_original_model(self):

scripts/regression/test_dpo_tiny-random-glm4moe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
DPO_FULL_RESUME_EXCEPTED_LOSS = 0.69372
3636
DPO_FULL_EXCEPTED_RESULT = [[51172, 37927, 96130, 27654, 133362, 95331, 27654, 133362, 115845, 115845]]
3737

38-
DPO_LORA_EXCEPTED_LOSS = 0.692349
39-
DPO_LORA_RESUME_EXCEPTED_LOSS = 0.691924
38+
DPO_LORA_EXCEPTED_LOSS = 0.692831
39+
DPO_LORA_RESUME_EXCEPTED_LOSS = 0.693171
4040
DPO_LORA_EXCEPTED_RESULT = [[51172, 37927, 96130, 27654, 133362, 95331, 27654, 133362, 115845, 115845]]
4141

4242
DPO_FULL_TP_PP_EXCEPTED_LOSS = 0.693105

scripts/regression/test_pt_tiny-random-glm4moe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
PT_FULL_RESUME_EXCEPTED_LOSS = 12.750999
3636
PT_FULL_EXCEPTED_RESULT = [[51172, 37927, 96130, 27654, 133362, 95331, 27654, 133362, 115845, 115845]]
3737

38-
PT_LORA_EXCEPTED_LOSS = 12.746654
39-
PT_LORA_RESUME_EXCEPTED_LOSS = 12.752742
38+
PT_LORA_EXCEPTED_LOSS = 12.746094
39+
PT_LORA_RESUME_EXCEPTED_LOSS = 12.751206
4040
PT_LORA_EXCEPTED_RESULT = [[51172, 37927, 96130, 27654, 133362, 95331, 133362, 30625, 95331, 4198]]
4141

4242
PT_FULL_TP_PP_EXCEPTED_LOSS = 11.932426

scripts/regression/test_sft_tiny-random-glm4moe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
SFT_FULL_RESUME_EXCEPTED_LOSS = 13.080153
3636
SFT_FULL_EXCEPTED_RESULT = [[51172, 37927, 96130, 27654, 133362, 95331, 27654, 133362, 115845, 115845]]
3737

38-
SFT_LORA_EXCEPTED_LOSS = 13.092133
39-
SFT_LORA_RESUME_EXCEPTED_LOSS = 13.081255
38+
SFT_LORA_EXCEPTED_LOSS = 13.092138
39+
SFT_LORA_RESUME_EXCEPTED_LOSS = 13.081409
4040
SFT_LORA_EXCEPTED_RESULT = [[51172, 37927, 96130, 27654, 133362, 95331, 27654, 133362, 115845, 115845]]
4141

4242
SFT_FULL_TP_PP_EXCEPTED_LOSS = 11.92912

0 commit comments

Comments
 (0)