Skip to content

Question about multiple LoRAs and FSDP #3012

@l1346792580123

Description

@l1346792580123

Hello, I want to train multiple LoRA simultaneously based on a single base model. The base model is too big so I need to use FSDP to save GPU memory. My current implementation as follows

modelA = basemodel
modelB = inject_adapter_in_model(lora_config, basemodel)
modelC = inject_adapter_in_model(lora_config, basemodel)

modelA = FSDP(modelA)
modelB = FSDP(modelB)
modelC = FSDP(modelC)

training_loop

As you can see, the base model is repeated three times. Is there a way to use only one base model and two LoRA adapters to achieve the same functionality ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions