Code Monkey home page Code Monkey logo

Comments (2)

we1k avatar we1k commented on August 28, 2024

I have encountered the same problem, however, it seem more like a problem with FSDP a peft wrapped model. When i run run_fsdp work fine for me, but when i try to add a lora config, which lead to the same error. @pacman100 could you please look at this problem?

from llm-workshop.

we1k avatar we1k commented on August 28, 2024

found out this is caused by module_wrap_policy function in the FSDP(trainer.model).
image

Peft wrapped model passed a None as the module class variable.
image

After I mannually filter out the None module_class , another error occurs:

 File "train.py", line 197, in main
    trainer.model = trainer.model_wrapped = FSDP(trainer.model, **kwargs)
  File "/home/lzw/miniconda3/envs/Bert/lib/python3.8/site-packages/torch/distributed/fsdp/fully_sharded_data_parallel.py", line 487, in __init__
    _init_param_handle_from_module(
  File "/home/lzw/miniconda3/envs/Bert/lib/python3.8/site-packages/torch/distributed/fsdp/_init_utils.py", line 519, in _init_param_handle_from_module
    _init_param_handle_from_params(state, managed_params, fully_sharded_module)
  File "/home/lzw/miniconda3/envs/Bert/lib/python3.8/site-packages/torch/distributed/fsdp/_init_utils.py", line 531, in _init_param_handle_from_params
    handle = FlatParamHandle(
  File "/home/lzw/miniconda3/envs/Bert/lib/python3.8/site-packages/torch/distributed/fsdp/flat_param.py", line 537, in __init__
    self._init_flat_param_and_metadata(
  File "/home/lzw/miniconda3/envs/Bert/lib/python3.8/site-packages/torch/distributed/fsdp/flat_param.py", line 585, in _init_flat_param_and_metadata
    ) = self._validate_tensors_to_flatten(params)
  File "/home/lzw/miniconda3/envs/Bert/lib/python3.8/site-packages/torch/distributed/fsdp/flat_param.py", line 731, in _validate_tensors_to_flatten
    raise ValueError(
ValueError: Must flatten tensors with uniform `requires_grad` when `use_orig_params=False`

I'm not familar with FSDP, so still dont know how to figure it out.

from llm-workshop.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.