File tree Expand file tree Collapse file tree 3 files changed +1
-16
lines changed
lightning_lite/strategies/launchers
pytorch_lightning/strategies/launchers
tests/tests_lite/strategies/launchers Expand file tree Collapse file tree 3 files changed +1
-16
lines changed Original file line number Diff line number Diff line change 14
14
import os
15
15
import subprocess
16
16
import sys
17
- from time import sleep
18
17
from typing import Any , Callable , Sequence
19
18
20
- import numpy as np
21
19
from lightning_utilities .core .imports import RequirementCache
22
20
23
21
from lightning_lite .plugins .environments .cluster_environment import ClusterEnvironment
@@ -126,11 +124,6 @@ def _call_children_scripts(self) -> None:
126
124
command = _basic_subprocess_cmd ()
127
125
subprocess .Popen (command , env = env_copy )
128
126
129
- # starting all processes at once can cause issues
130
- # with dataloaders delay between 1-10 seconds
131
- delay = np .random .uniform (1 , 5 , 1 )[0 ]
132
- sleep (delay )
133
-
134
127
def _check_can_spawn_children (self ) -> None :
135
128
if self .cluster_environment .local_rank () != 0 :
136
129
raise RuntimeError (
Original file line number Diff line number Diff line change 13
13
# limitations under the License.
14
14
import os
15
15
import subprocess
16
- from time import sleep
17
16
from typing import Any , Callable , Optional
18
17
19
- import numpy as np
20
18
from lightning_utilities .core .imports import RequirementCache
21
19
22
20
import pytorch_lightning as pl
@@ -123,11 +121,6 @@ def _call_children_scripts(self) -> None:
123
121
124
122
subprocess .Popen (command , env = env_copy )
125
123
126
- # starting all processes at once can cause issues
127
- # with dataloaders delay between 1-10 seconds
128
- delay = np .random .uniform (1 , 5 , 1 )[0 ]
129
- sleep (delay )
130
-
131
124
def _check_can_spawn_children (self ) -> None :
132
125
if self .cluster_environment .local_rank () != 0 :
133
126
raise RuntimeError (
Original file line number Diff line number Diff line change @@ -47,9 +47,8 @@ def test_subprocess_script_launcher_external_processes(popen_mock):
47
47
popen_mock .assert_not_called ()
48
48
49
49
50
- @mock .patch ("lightning_lite.strategies.launchers.subprocess_script.sleep" )
51
50
@mock .patch ("lightning_lite.strategies.launchers.subprocess_script.subprocess.Popen" )
52
- def test_subprocess_script_launcher_launch_processes (popen_mock , _ ):
51
+ def test_subprocess_script_launcher_launch_processes (popen_mock ):
53
52
cluster_env = Mock ()
54
53
cluster_env .creates_processes_externally = False
55
54
cluster_env .local_rank .return_value = 0
You can’t perform that action at this time.
0 commit comments