Skip to content

Commit

Permalink
[runner/launch] propagate the error (#854)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff Rasley <jerasley@microsoft.com>
  • Loading branch information
stas00 and jeffra committed Mar 16, 2021
1 parent a75d971 commit 24335d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deepspeed/launcher/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@ def main(args=None):
result = subprocess.Popen(cmd, env=env)
result.wait()

# In case of failure must propagate the error-condition back to the caller (usually shell). The
# actual error and traceback should have been printed in the subprocess, so in order to avoid
# unnecessary noise we just quietly exit here with the same code as the subprocess
if result.returncode > 0:
sys.exit(result.returncode)


if __name__ == "__main__":
main()

0 comments on commit 24335d4

Please sign in to comment.