File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1538, in _call_impl
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1538, in _call_impl
loss = self.module(*inputs, **kwargs)
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1538, in _call_impl
result = forward_call(*args, **kwargs)
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/transformers/models/llama/modeling_llama.py", line 912, in forward
result = forward_call(*args, **kwargs)
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/transformers/models/llama/modeling_llama.py", line 912, in forward
causal_mask = self._update_causal_mask(
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/transformers/models/llama/modeling_llama.py", line 1036, in _update_causal_mask
causal_mask = self._update_causal_mask(
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/transformers/models/llama/modeling_llama.py", line 1036, in _update_causal_mask
result = forward_call(*args, **kwargs)
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/peft/peft_model.py", line 918, in forward
causal_mask = torch.triu(causal_mask, diagonal=1)
RuntimeError: "triu_tril_cuda_template" not implemented for 'BFloat16'
causal_mask = torch.triu(causal_mask, diagonal=1)
RuntimeError: "triu_tril_cuda_template" not implemented for 'BFloat16'
return self.base_model(
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1538, in _call_impl
result = forward_call(*args, **kwargs)
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/peft/tuners/tuners_utils.py", line 94, in forward
return self.model.forward(*args, **kwargs)
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/transformers/models/llama/modeling_llama.py", line 1139, in forward
outputs = self.model(
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1538, in _call_impl
result = forward_call(*args, **kwargs)
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/transformers/models/llama/modeling_llama.py", line 912, in forward
causal_mask = self._update_causal_mask(
File "/home/miniconda3/envs/llama3/lib/python3.8/site-packages/transformers/models/llama/modeling_llama.py", line 1036, in _update_causal_mask
causal_mask = torch.triu(causal_mask, diagonal=1)
RuntimeError: "triu_tril_cuda_template" not implemented for 'BFloat16'
你好,我有尝试使用 提供的 finetune_qlora_llama3_8B_chat.sh去finetune 从huggingface下载的官方的3.1-8B-Instruct 模型。
运行的时候,模型可以正常的load,但是在训练的时候有 报以下错误:
我所安装的环境是这些 (和README中提供的版本一样):
在网上查了一下好像是 因为torch==2.0.1 并不支持 BFloat16: https://github.com/meta-llama/llama3/issues/80; https://github.com/meta-llama/llama3/issues/110
训练脚本是这个:
我有尝试把pytorch版本更新到2.1.0,但是好像flash-attn又不支持。
如果把finetune_qlora_llama3_8B_chat.sh 里面的
--bf16 True
拿掉就会解决这个问题。请问一下,如果还想使用
--bf16 True
的情况下,这个问题RuntimeError: "triu_tril_cuda_template" not implemented for 'BFloat16'
有什么解决办法吗?