Skip to content

Commit d012f34

Browse files
authored
add xpu to valid hardware for torch.compile (#42079)
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
1 parent e76364d commit d012f34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/generation/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,7 @@ def _valid_auto_compile_criteria(self, model_kwargs: dict[str, Any], generation_
21702170
return False
21712171

21722172
# Base logic
2173-
valid_hardware = self.device.type == "cuda" or bool(
2173+
valid_hardware = self.device.type in ["cuda", "xpu"] or bool(
21742174
generation_config.compile_config is not None and generation_config.compile_config._compile_all_devices
21752175
)
21762176
using_compilable_cache = (

0 commit comments

Comments
 (0)