@@ -630,7 +630,7 @@ def main():
630630 with torch .no_grad ():
631631 lora_output = lora_merged_model (test_input_lora )
632632 print ("✓ LoRA merged model can perform forward pass" )
633- # del lora_merged_model
633+ del lora_merged_model
634634 gc .collect ()
635635
636636 # Adapter-only (PEFT) export assertions
@@ -652,12 +652,6 @@ def main():
652652 "✓ PEFT adapter directory has expected files (adapter_config.json + weights)"
653653 )
654654
655- # Forward pass using the already-merged model from Step 7c.
656- test_input_peft = torch .randint (0 , 1000 , (1 , 10 ))
657- with torch .no_grad ():
658- lora_merged_model (test_input_peft )
659- print ("✓ LoRA merged model can perform a forward pass" )
660-
661655 # Verify the adapter-only export produces the same merged weights as Step 7c
662656 # by calling merge_lora_to_hf again with the same Megatron adapter. This
663657 # avoids tied-weight complications from PeftModel.merge_and_unload().
@@ -682,7 +676,7 @@ def main():
682676 )
683677 print ("✓ adapter-only merge via merge_lora_to_hf matches Step 7c" )
684678
685- del adapter_only_merged_model , lora_merged_model
679+ del adapter_only_merged_model
686680 gc .collect ()
687681
688682 # Verify that both converted models have the expected structure
@@ -713,7 +707,7 @@ def main():
713707 megatron_output = megatron_converted_model (test_input )
714708
715709 print (
716- "✓ Dtensor V1 and Dtensor V2 DCP, Megatron, and LoRA models can perform forward passes"
710+ "✓ Dtensor V1 and Dtensor V2 DCP, Megatron, and LoRA merged models can perform forward passes"
717711 )
718712
719713 print ("\n " + "=" * 80 )
0 commit comments