You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I follow the install pip install git+https://github.com/huggingface/transformers accelerate and the pip list:
transformers==4.49.0.dev0
tokenizers==0.21.0
accelerate== 0.34.0
flash-attn==2.5.8
apply_rotary_pos_emb_flashatt_fp32 question from training
File ""/mnt/beegfs_lfs3/training/riderapi/al_team/qian.ye/miniconda3/envs/qwen2/lib/python3.10/site-packages/torch/nn/modules/module.py"", line 1844, in _call_impl"
"1739588804.641397953","[rank7]: return inner()"
"1739588804.641407251","[rank7]: File ""/mnt/beegfs_lfs3/training/riderapi/al_team/qian.ye/miniconda3/envs/qwen2/lib/python3.10/site-packages/torch/nn/modules/module.py"", line 1790, in inner"
"1739588804.641416549","[rank7]: result = forward_call(*args, **kwargs)"
"1739588804.641424894","[rank7]: File ""/mnt/beegfs_lfs3/training/riderapi/al_team/qian.ye/miniconda3/envs/qwen2/lib/python3.10/site-packages/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py"", line 201, in forward"
"1739588804.641432762","[rank7]: q, k = apply_rotary_pos_emb_flashatt(q.unsqueeze(0), k.unsqueeze(0), cos, sin)"
"1739588804.641441583","[rank7]: TypeError: apply_rotary_pos_emb_flashatt_fp32() takes 2 positional arguments but 4 were given"
The text was updated successfully, but these errors were encountered:
It's a bit odd, I don't get it how the arguments are passed. I can't reproduce the issue.
Can you show your dataset example and the scripts you are running?
I have solved the question, the lasted transformers have update the cos/sin embeding and the code def apply_rotary_pos_emb_flashatt_fp32(tensor: torch.Tensor, freqs: torch.Tensor) -> torch.Tensor: tensor_ = tensor.float() cos = freqs.cos().float() sin = freqs.sin().float() output = apply_rotary_emb(tensor_, cos, sin).type_as(tensor) return output
need to be replace to be def apply_rotary_pos_emb_flashatt_fp32( q: torch.Tensor, k: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor ) -> Tuple[torch.Tensor, torch.Tensor]: cos = cos.chunk(2, dim=-1)[0].contiguous() sin = sin.chunk(2, dim=-1)[0].contiguous() cos = cos.float() sin = sin.float() q_embed = apply_rotary_emb(q.float(), cos, sin).type_as(q) k_embed = apply_rotary_emb(k.float(), cos, sin).type_as(k) return q_embed, k_embed
for the lasted transformers.
I follow the install
pip install git+https://github.com/huggingface/transformers accelerate
and the pip list:transformers==4.49.0.dev0
tokenizers==0.21.0
accelerate== 0.34.0
flash-attn==2.5.8
apply_rotary_pos_emb_flashatt_fp32 question from training
The text was updated successfully, but these errors were encountered: