Skip to content

Commit

Permalink
Allow duplicate executors (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
apaz-cli authored Apr 18, 2024
1 parent 649c3d7 commit 6cd19c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions thunder/extend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
4 changes: 0 additions & 4 deletions thunder/tests/test_extend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

0 comments on commit 6cd19c4

Please sign in to comment.