Skip to content

Commit fe8ac14

Browse files
committed
change horovod tests on root gpu index
1 parent 67835f4 commit fe8ac14

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tests/models/data/horovod/train_default_model.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import os
2121
import sys
2222

23-
import pytest
2423
import torch
2524

2625
# this is needed because Conda does not use `PYTHONPATH` env var while pip and virtualenv do
@@ -102,13 +101,8 @@ def training_epoch_end(self, outputs) -> None:
102101

103102
if on_gpu:
104103
trainer = Trainer(gpus=1, strategy="horovod", max_epochs=1)
105-
# Test the root_gpu property
106-
with pytest.deprecated_call(
107-
match="`Trainer.root_gpu` is deprecated in v1.6 and will be removed in v1.8. Please use "
108-
r"`Trainer.strategy.root_device.index if isinstance\(Trainer.accelerator, GPUAccelerator\) else None`"
109-
" instead."
110-
):
111-
assert trainer.root_gpu == hvd.local_rank()
104+
# test root gpu index
105+
assert trainer.strategy.root_device.index == hvd.local_rank()
112106

113107

114108
if __name__ == "__main__":

0 commit comments

Comments
 (0)