Add XPU type for work-around -inf mask causing sdpa NaN issue in modeling files (#35647)

* add xpu for unmask

* change modular for generated matching

* add lastest modeling for helium
This commit is contained in:
Liangliang Ma
2025-02-05 20:28:31 +08:00
committed by GitHub
parent d8080d55c7
commit 315a9f494e
60 changed files with 61 additions and 61 deletions

View File

@@ -639,7 +639,7 @@ class DummyModel(DummyPreTrainedModel):
if (
self.config._attn_implementation == "sdpa"
and attention_mask is not None
and attention_mask.device.type == "cuda"
and attention_mask.device.type in ["cuda", "xpu"]
and not output_attentions
):
# Attend to all tokens in fully masked rows in the causal_mask, for example the relevant first rows when