Skip to content

Commit 6517a30

Browse files
authored
Always initialize dist (#864)
* fix dev * lint * remove gpu
1 parent 936e3a1 commit 6517a30

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

tests/a_scripts/eval/test_eval.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def test_icl_eval(eval_cfg: Union[om.ListConfig, om.DictConfig], capfd: Any,
7171
assert expected_results in out
7272

7373

74-
@pytest.mark.gpu
7574
def test_loader_eval(capfd: Any, mock_saved_model_path: Any,
7675
tmp_path: pathlib.Path):
7776

tests/fixtures/autouse.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@
1717
@pytest.fixture(autouse=True)
1818
def initialize_dist(request: pytest.FixtureRequest):
1919
"""Initialize the default PyTorch distributed process group for tests."""
20-
# should we just always initialize dist like in train.py?
21-
_default = pytest.mark.world_size(1).mark
22-
world_size = request.node.get_closest_marker('world_size', _default).args[0]
2320
gpu = request.node.get_closest_marker('gpu')
24-
if world_size > 1:
25-
dist.initialize_dist(get_device('gpu' if gpu is not None else 'cpu'))
21+
dist.initialize_dist(get_device('gpu' if gpu is not None else 'cpu'))
2622

2723

2824
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)