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

[LNL Windows][Test by CD Nightly Wheels] hugging face model - DebertaForQuestionAnswering && DebertaV2ForMaskedLM failed with RuntimeError: value cannot be converted to type at::BFloat16 without overflow #1159

Open
libohao1201 opened this issue Dec 11, 2024 · 1 comment
Assignees
Labels
client E2E module: dependency bug Problem is not caused by us, but caused by the library we use ut_triaged
Milestone

Comments

@libohao1201
Copy link

libohao1201 commented Dec 11, 2024

🐛 Describe the bug

Huggingface model DebertaForQuestionAnswering && DebertaV2ForMaskedLM failed with RuntimeError: value cannot be converted to type at::BFloat16 without overflow .

Script: python benchmarks\dynamo\huggingface.py --accuracy -d xpu -n10 --inference --backend=eager --cold-start-latency --amp --amp-dtype float16 --only DebertaForQuestionAnswering

Error Log Info:


xpu eval DebertaForMaskedLM
Traceback (most recent call last):
File "C:\pt26_ww48\pytorch\benchmarks\dynamo\common.py", line 2732, in validate_model
self.model_iter_fn(model, example_inputs)
File "C:\pt26_ww48\pytorch\benchmarks\dynamo\huggingface.py", line 522, in forward_pass
return mod(**inputs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\transformers\models\deberta\modeling_deberta.py", line 990, in forward
outputs = self.deberta(
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\transformers\models\deberta\modeling_deberta.py", line 798, in forward
encoder_outputs = self.encoder(
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\transformers\models\deberta\modeling_deberta.py", line 609, in forward
hidden_states, att_m = layer_module(
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\transformers\models\deberta\modeling_deberta.py", line 526, in forward
attention_output, att_matrix = self.attention(
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\transformers\models\deberta\modeling_deberta.py", line 461, in forward
self_output, att_matrix = self.self(
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\sdp\pt26_ww48_virtual_env\lib\site-packages\transformers\models\deberta\modeling_deberta.py", line 290, in forward
attention_scores = attention_scores.masked_fill(~(attention_mask), torch.finfo(query_layer.dtype).min)
RuntimeError: value cannot be converted to type at::BFloat16 without overflow

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\pt26_ww48\pytorch\benchmarks\dynamo\common.py", line 4856, in run
) = runner.load_model(
File "C:\pt26_ww48\pytorch\benchmarks\dynamo\huggingface.py", line 458, in load_model
self.validate_model(model, example_inputs)
File "C:\pt26_ww48\pytorch\benchmarks\dynamo\common.py", line 2734, in validate_model
raise RuntimeError("Eager run failed") from e
RuntimeError: Eager run failed

eager_fail_to_run


Versions

ENV:

Machine LNL - Win11
stock pytorch https://github.com/pytorch/pytorch/tree/90b7dcf2c5ee13b892701822f2abbc0e64f5584d pip install --pre torch==2.6.0.dev20241202+xpu torchvision==0.20.0.dev20241202+xpu torchaudio==2.5.0.dev20241202+xpu --index-url https://download.pytorch.org/whl/nightly/xpu
torch-xpu-ops Commit: bf4bab1
Driver 32.0.101.6314
Conda python 3.10
@Stonepia
Copy link
Contributor

This is the issue from transformers. See the discussion at huggingface/transformers#35336 .

@Stonepia Stonepia added module: dependency bug Problem is not caused by us, but caused by the library we use ut_triaged labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client E2E module: dependency bug Problem is not caused by us, but caused by the library we use ut_triaged
Projects
None yet
Development

No branches or pull requests

3 participants