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

2.0.4之后的版本的显存使用问题 #922

Open
kratorado opened this issue May 13, 2024 · 5 comments
Open

2.0.4之后的版本的显存使用问题 #922

kratorado opened this issue May 13, 2024 · 5 comments

Comments

@kratorado
Copy link

kratorado commented May 13, 2024

Describe the bug
自从支持lisa以后,8个v100可以全参数微调32b了
我一直是用main分支源码安装使用swift的,最近几天发现同样入参的微调命令,以前可以运行,现在会报显存不足的问题

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 NPROC_PER_NODE=1  \
swift sft --sft_type full  \
  --model_type qwen1half-32b-chat   \
  --dataset ms-bench \
  --train_dataset_sample 5000 \
  --self_cognition_sample 1000     \
  --logging_steps 5     \
  --max_length 2048     \
  --learning_rate 5e-5     \
  --warmup_ratio 0.4     \
  --output_dir output   \
  --num_train_epochs 1         \
  --eval_steps 100        \
  --save_steps 100 \
  --lisa_activated_layers=2 \
  --model_name 小黄 'Xiao Huang' \
  --model_author 魔搭 ModelScope 

换到main分支后,运行命令改了,主要是训练数据集的那几条命令格式改成了 --dataset ms-bench#5000 这种
就再也跑不起来了,

其余参数都是用默认的,想知道具体问题大概会出在哪里

Your hardware and system info
Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等)

Additional context
Add any other context about the problem here(在这里补充其他信息)

@tastelikefeet
Copy link
Collaborator

不加#5000也可以兼容原来的运行方式,最近的代码更新应该不涉及显存才对

@kratorado
Copy link
Author

我也觉得应该不涉及,但是确实就是有这个现象。我来对比一下是不是依赖的哪个库更新了

@kratorado
Copy link
Author

不加#5000也可以兼容原来的运行方式,最近的代码更新应该不涉及显存才对

经过二分查找,2.0.4可以运行的,到2.0.5就不可以了,更新的依赖是 peft 从 0.10.0 升级到了 0.11.1 ,估计问题出在这。

@kratorado
Copy link
Author

手动降级peft版本后,再相应地调整swift里面几个文件(主要是有boft和vera的额代码),再运行,也还是会OOM。是不是2.0.5调整了加载训练数据的逻辑呢

@kratorado
Copy link
Author

7e288e7

这个commit,

lisa_callback.switch_active_layers() # Make trainable parameters printing a correct value

这一句多使用的那一点显存,刚好用爆了。请问,这句的作用真的只是像注释说的这样,只是为了 printing a correct value 吗?

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

No branches or pull requests

2 participants