From 6cd19c4d7f23b635513cbc029c7eea6652708f65 Mon Sep 17 00:00:00 2001 From: apaz Date: Thu, 18 Apr 2024 14:38:48 -0500 Subject: [PATCH] Allow duplicate executors (#232) --- thunder/extend/__init__.py | 3 --- thunder/tests/test_extend.py | 4 ---- 2 files changed, 7 deletions(-) diff --git a/thunder/extend/__init__.py b/thunder/extend/__init__.py index e68303e939..66c8e5b39d 100644 --- a/thunder/extend/__init__.py +++ b/thunder/extend/__init__.py @@ -470,9 +470,6 @@ def resolve_executors(executors: None | Sequence[Executor | str]) -> tuple[Execu + f"Registered executors: {get_all_executors()}" ) - if duplicates := {x for x in resolved_executors if resolved_executors.count(x) > 1}: - raise ValueError(f"Duplicate executors in the list of executors. Duplicates: {duplicates}") - return tuple(resolved_executors) diff --git a/thunder/tests/test_extend.py b/thunder/tests/test_extend.py index 26c5f23642..0a29637b90 100644 --- a/thunder/tests/test_extend.py +++ b/thunder/tests/test_extend.py @@ -263,7 +263,3 @@ def test_validate_executors(): assert thunder.resolve_executors(("python", pytorch_executor)) == (pythonex, pytorch_executor) with pytest.raises(ValueError, match=re.compile("Expected an Executor or the name of a registered Executor")): assert thunder.resolve_executors(("python", "foo", pytorch_executor, "bar")) - with pytest.raises( - ValueError, match=re.compile("Duplicate executors in the list of executors. Duplicates: {python}") - ): - assert thunder.resolve_executors(("python", "python", "torch"))