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
Mixtral 8x7B SFT 问题 #533
Comments
提供更多信息: [ 上面的文件是运行xtuner check-custom-data产生的。 可以看到,在dataset after adding template后,'input'键中出现了两次[INST][/INST], 格式为[INST]+我想要的system+[/INST]+[INST]+我想要的input+[/INST]。 然后就是'output'键, 然后又来了个'system'键,如下: 会不会是这里的template导致的问题呢?还是说这就是xtuner要求的格式 |
@aiyinyuedejustin 另外,训练开头打印数据那个地方,是 |
问题1: 谢谢 |
xtuner/xtuner/dataset/huggingface.py Lines 182 to 184 in 0b5708c
单卡训练,在这几行的后面打个断点,检查一下 input 中的这个初始的[INST]是否正常吧 |
您好,正在尝试微调mixtral 8x7b,但是训练一段时间后loss不再下降,输出也有些问题
使用的config如下:
训练使用8x 40G A100, Lora训练,显存没有爆。
在训练过程中,1000/5838 steps后loss就一直在1附近徘徊:
问题1:有什么参数可以更改吗?是不是我的lr太小了?或者batch size太小了?或许还有其他参数能更改吗
问题2: 如下图,mixtral的模板是不是错了呢,导致输出略奇怪,没有follow instruciton?
参考:
xtuner/xtuner/utils/templates.py
Line 123 in 0b5708c
我的训练数据是自定义单轮,如下:
我发现训练开始前train example只是 "SOS" 开头,并没有加一个 [INST] , system结束后跟了一个[/INST]。 然后input也是用[INST]开头,然后[/INST]结尾, 然后直接就加上了output,最后以 EOS结尾, 如下:
然而训练中eval的时候是 "SOS" +[INST] + system message+[/INST] +[INST]+input+[/INST]+eval_output 的形式:
会不会是模板错了, 不然训练开始前的train example 出现了两遍 [INST][/INST]这正常吗?且eval output的时候,理论上不应该重复input吧,应该直接输出我想要的output才对,但他还是重复了 special token和input,然后才开始output。
根据hugging face :
https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1
https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1/discussions/98
看起来需要如下格式?
并且貌似我们的system和input是否应该合并起来作为一个总的"instruction"?而不是分开?比如应该 SOS+ [INST] system+input+[/INST] +output +EOS ?
The text was updated successfully, but these errors were encountered: