jquesnelle / yarn

YaRN: Efficient Context Window Extension of Large Language Models
MIT License
1.25k stars 110 forks source link

Running Error #44

Open wangyang-stu opened 7 months ago

wangyang-stu commented 7 months ago

When launching finetune. py using the following command: CUDA_VISIBLE_DEVICES=0,1,2,3,4 accelerate launch finetune.py --output-dir output/yarn-7b-64k --model /data/wy/llm_base/Llama-2-7b-hf --dataset /data/wy/LLMScaledData/pg_books-tokenized-bos-eos-chunked-6/data

The following error occurred: Traceback (most recent call last): File "/data/wy/yarn/finetune.py", line 293, in main(args.parse_args()) File "/data/wy/yarn/finetune.py", line 156, in main model.gradient_checkpointing_enable() File "/home/centos/anaconda3/envs/llm_sacled/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1614, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'DistributedDataParallel' object has no attribute 'gradient_checkpointing_enable'

Need to modify 'model.gradient_checkpointing_enable()' to 'model.module.gradient_checkpointing_enable()'

ichsan2895 commented 7 months ago

I got same problem. Did modify model.gradient_checkpointing_enable() to model.module.gradient_checkpointing_enable() solve the problem?

18140663659 commented 2 months ago

model.module.gradient_checkpointing_enable()

same question