Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 771d5a4

Browse files
authored
Pop kwargs to support LightningCLI (#154)
Closes #151. As discussed in #151, LightningCLI does not support kwargs well, and assume kwargs are all passed into the superclass even though that's not necessarily the case. We do a small workaround here to pop certain values from kwargs to unblock using RayPlugin with LightningCLI until the actual issue is fixed upstream in PTL.
1 parent a927dfa commit 771d5a4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ray_lightning/ray_ddp.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ def __init__(self,
158158
self._global_rank = 0
159159
self._node_rank = 0
160160

161+
# Pop these arguments so LightningCLI doesn't complain about them being
162+
# passed in twice.
163+
# https://github.com/ray-project/ray_lightning/issues/151
164+
# TODO(amogkam): Remove after
165+
# https://github.com/PyTorchLightning/pytorch-lightning/discussions/8561
166+
# is fixed.
167+
ddp_kwargs.pop("parallel_devices", None)
168+
ddp_kwargs.pop("cluster_environment", None)
169+
161170
super().__init__(
162171
parallel_devices=[], cluster_environment=None, **ddp_kwargs)
163172

0 commit comments

Comments
 (0)