ymcui / Chinese-LLaMA-Alpaca-3

中文羊驼大模型三期项目 (Chinese Llama-3 LLMs) developed from Meta Llama 3
Apache License 2.0
1.7k stars 146 forks source link

chinese-llama-2-13b-hf可否直接用bf16继续预训练? #85

Closed NLP-Learning closed 3 months ago

NLP-Learning commented 4 months ago

提交前必须检查以下项目

问题类型

模型训练与精调

基础模型

Others

操作系统

Linux

详细描述问题

老师您好,我基于chinese-llama-2-13b-hf作为基座模型,继续扩充了词表,并使用fp16继续预训练,但是一段时间后会遇到loss突刺,loss变得特别大且无法再收敛。

我随后换了bf16,目前还在训练中,没有再loss突刺,但我突然想到chinese-llama-2-13b-hf是使用fp16精度训练的,我直接使用bf16基于chinese-llama-2-13b-hf继续预训练合理吗?最后保存的时候是不是也会把原来fp16的权重变成了bf16的权重,会不会造成模型推理的错乱或者精度降低?

恳请老师解惑,感谢!

依赖情况(代码类问题务必提供)

# 请在此处粘贴依赖情况(请粘贴在本代码块里)

运行日志或截图

# 请在此处粘贴运行日志(请粘贴在本代码块里)
github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your consideration.

github-actions[bot] commented 3 months ago

Closing the issue, since no updates observed. Feel free to re-open if you need any further assistance.

ymcui commented 3 months ago

可以用bf16,相对会稳定一些。