Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LORA + FSDP: ValueError: FlatParameter requires uniform requires_grad #414

Closed
minionKP opened this issue Jul 2, 2023 · 4 comments · Fixed by #886
Closed

LORA + FSDP: ValueError: FlatParameter requires uniform requires_grad #414

minionKP opened this issue Jul 2, 2023 · 4 comments · Fixed by #886
Labels
enhancement New feature or request

Comments

@minionKP
Copy link

minionKP commented Jul 2, 2023

Environment

To reproduce

Steps to reproduce the behavior:

  1. add lora configs to llm-foundry/scripts/train/finetune_example/mpt-7b-arc-easy--gpu.yaml
lora:
  args:
    r: 16
    lora_alpha: 32
    lora_dropout: 0.05
    target_modules: ['Wqkv']
  1. run composer train.py finetune_example/mpt-7b-arc-easy--gpu.yaml

Expected behavior

FSDP + LORA fine-tuning

Config file

No other changes to example config file

@minionKP minionKP added the bug Something isn't working label Jul 2, 2023
@codestar12
Copy link
Contributor

Hi @minionKP. We do not yet have LoRA working with FSDP. To use LoRA use DDP. We expect to add support eventually, but do not have a solid timeline.

@minionKP
Copy link
Author

minionKP commented Jul 3, 2023

Want to do LORA on MPT-30B model. From another issue #413 looks like QLORA or doing prepare_model_for_int8_training from PEFT does not work. Thanks for communicating the priority.

@hanlint hanlint added enhancement New feature or request and removed bug Something isn't working labels Jul 24, 2023
@floschne
Copy link

floschne commented Feb 2, 2024

I think this issues not only arises with LoRA but with any mixed setup of frozen and unfrozen parameters. Is there any solution in sight? I know one could write a custom auto-wrap policy when using lightning or pure PyTorch but that seems to be complicated especially because it creates un-uniformly sized FSDPUnits :-/

@dakinggg
Copy link
Collaborator

dakinggg commented Feb 2, 2024

Hi @floschne, LoRA + FSDP support is almost merged! You can follow along here if you like: #886. That PR does currently work if you install composer from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants