Skip to content

How save Lora Weight into normal format #2190

Description

@hanguangmic

I used https://github.com/NVIDIA-NeMo/RL/blob/main/examples/configs/recipes/llm/grpo-nanov3-30BA3B-2n8g-megatron-lora.yaml here to train the model and got the dist torch lora weight. but how to make it works for the inference?
The following is my peft config

{'target': 'megatron.bridge.peft.lora.LoRA',
'a2a_experimental': False,
'alpha': 64,
'canonical_mapping': {},
'dim': 32,
'dropout': 0.0,
'dropout_position': 'post',
'exclude_modules': ['out_proj'],
'lora_A_init_method': 'xavier',
'lora_B_init_method': 'zero',
'lora_dtype': 'None',
'params_to_save': {'decoder.layers.0.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.0.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.1.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.1.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.1.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.1.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.10.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.10.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.10.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.10.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.11.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.11.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.12.self_attention.linear_proj.adapter.linear_in.weight',
'decoder.layers.12.self_attention.linear_proj.adapter.linear_out.weight',
'decoder.layers.12.self_attention.linear_qkv.adapter.linear_in.weight',
'decoder.layers.12.self_attention.linear_qkv.adapter.linear_out.weight',
'decoder.layers.13.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.13.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.13.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.13.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.14.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.14.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.15.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.15.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.15.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.15.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.16.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.16.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.17.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.17.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.17.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.17.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.18.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.18.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.19.self_attention.linear_proj.adapter.linear_in.weight',
'decoder.layers.19.self_attention.linear_proj.adapter.linear_out.weight',
'decoder.layers.19.self_attention.linear_qkv.adapter.linear_in.weight',
'decoder.layers.19.self_attention.linear_qkv.adapter.linear_out.weight',
'decoder.layers.2.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.2.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.20.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.20.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.20.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.20.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.21.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.21.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.22.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.22.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.22.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.22.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.23.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.23.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.24.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.24.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.24.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.24.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.25.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.25.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.26.self_attention.linear_proj.adapter.linear_in.weight',
'decoder.layers.26.self_attention.linear_proj.adapter.linear_out.weight',
'decoder.layers.26.self_attention.linear_qkv.adapter.linear_in.weight',
'decoder.layers.26.self_attention.linear_qkv.adapter.linear_out.weight',
'decoder.layers.27.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.27.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.27.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.27.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.28.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.28.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.29.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.29.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.29.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.29.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.3.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.3.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.3.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.3.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.30.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.30.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.31.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.31.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.31.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.31.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.32.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.32.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.33.self_attention.linear_proj.adapter.linear_in.weight',
'decoder.layers.33.self_attention.linear_proj.adapter.linear_out.weight',
'decoder.layers.33.self_attention.linear_qkv.adapter.linear_in.weight',
'decoder.layers.33.self_attention.linear_qkv.adapter.linear_out.weight',
'decoder.layers.34.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.34.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.34.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.34.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.35.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.35.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.36.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.36.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.36.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.36.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.37.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.37.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.38.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.38.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.38.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.38.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.39.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.39.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.4.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.4.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.40.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.40.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.40.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.40.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.41.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.41.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.42.self_attention.linear_proj.adapter.linear_in.weight',
'decoder.layers.42.self_attention.linear_proj.adapter.linear_out.weight',
'decoder.layers.42.self_attention.linear_qkv.adapter.linear_in.weight',
'decoder.layers.42.self_attention.linear_qkv.adapter.linear_out.weight',
'decoder.layers.43.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.43.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.43.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.43.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.44.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.44.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.45.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.45.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.45.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.45.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.46.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.46.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.47.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.47.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.47.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.47.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.48.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.48.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.49.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.49.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.49.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.49.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.5.self_attention.linear_proj.adapter.linear_in.weight',
'decoder.layers.5.self_attention.linear_proj.adapter.linear_out.weight',
'decoder.layers.5.self_attention.linear_qkv.adapter.linear_in.weight',
'decoder.layers.5.self_attention.linear_qkv.adapter.linear_out.weight',
'decoder.layers.50.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.50.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.51.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.51.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.51.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.51.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.6.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.6.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.6.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.6.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.7.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.7.mixer.in_proj.adapter.linear_out.weight',
'decoder.layers.8.mlp.shared_experts.linear_fc1.adapter.linear_in.weight',
'decoder.layers.8.mlp.shared_experts.linear_fc1.adapter.linear_out.weight',
'decoder.layers.8.mlp.shared_experts.linear_fc2.adapter.linear_in.weight',
'decoder.layers.8.mlp.shared_experts.linear_fc2.adapter.linear_out.weight',
'decoder.layers.9.mixer.in_proj.adapter.linear_in.weight',
'decoder.layers.9.mixer.in_proj.adapter.linear_out.weight',
'output_layer.adapter.linear_in.weight',
'output_layer.adapter.linear_out.weight'},
'target_modules': []}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcommunity-requestqa_rcca_donewhen RCCA finished for the issue, the qa will mark with this label .

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions