From 1ea3ad1aeca1ffc1726d8a4fab2e4393a72be56f Mon Sep 17 00:00:00 2001 From: Fanli Lin Date: Fri, 8 Mar 2024 19:21:43 +0800 Subject: [PATCH] [tests] use `torch_device` instead of `auto` for model testing (#29531) * use torch_device * skip for XPU * Update tests/generation/test_utils.py Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com> --------- Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com> --- tests/generation/test_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/generation/test_utils.py b/tests/generation/test_utils.py index 425db5ecd..bd3bbe7c6 100644 --- a/tests/generation/test_utils.py +++ b/tests/generation/test_utils.py @@ -1073,6 +1073,9 @@ class GenerationTesterMixin: @require_torch_multi_accelerator def test_model_parallel_beam_search(self): for model_class in self.all_generative_model_classes: + if "xpu" in torch_device: + return unittest.skip("device_map='auto' does not work with XPU devices") + if model_class._no_split_modules is None: continue