Skip to content

Commit 2d7d6c3

Browse files
vidhyavfacebook-github-bot
authored andcommitted
Add missing exit() when shutting down
Summary: We weren't exiting the device mesh properly when invoking the local mesh. (I may have to remove exit() in the testing code will wait for the unit tests to run). Reviewed By: andrewjcg, moonli Differential Revision: D75143906 fbshipit-source-id: 2ebca9055e59d696d8b7243bcc80698c439bca3e
1 parent d2d8595 commit 2d7d6c3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

python/monarch/rust_local_mesh.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,15 @@ def local_meshes(
12791279
system_factory=system_factory,
12801280
)
12811281
with bootstrap:
1282-
yield dms
1282+
maybe_error = None
1283+
try:
1284+
yield dms
1285+
except Exception as e:
1286+
maybe_error = e
1287+
raise
1288+
finally:
1289+
for dm in dms:
1290+
dm.exit(maybe_error)
12831291

12841292

12851293
def local_meshes_and_bootstraps(

0 commit comments

Comments
 (0)