Skip to content

Commit

Permalink
Update Multinode Warning (#16091)
Browse files Browse the repository at this point in the history
  • Loading branch information
justusschock committed Dec 16, 2022
1 parent 4c91dec commit 3d509f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lightning_app/components/multi_node/base.py
Expand Up @@ -56,12 +56,12 @@ def run(
"""
super().__init__()
if num_nodes > 1 and not is_running_in_cloud():
num_nodes = 1
warnings.warn(
f"You set {type(self).__name__}(num_nodes={num_nodes}, ...)` but this app is running locally."
" We assume you are debugging and will ignore the `num_nodes` argument."
" To run on multiple nodes in the cloud, launch your app with `--cloud`."
)
num_nodes = 1
self.ws = structures.List(
*[
work_cls(
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_app/components/multi_node/test_base.py
Expand Up @@ -13,7 +13,7 @@ class Work(LightningWork):
def run(self):
pass

with pytest.warns(UserWarning, match=escape("You set MultiNode(num_nodes=1, ...)` but ")):
with pytest.warns(UserWarning, match=escape("You set MultiNode(num_nodes=2, ...)` but ")):
MultiNode(Work, num_nodes=2, cloud_compute=CloudCompute("gpu"))

with no_warning_call(UserWarning, match=escape("You set MultiNode(num_nodes=1, ...)` but ")):
Expand Down

0 comments on commit 3d509f6

Please sign in to comment.