Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move gsutil copy to condtional to avoid breakages #909

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion MaxText/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ctypes import cdll
import os
import subprocess
import shutil

import max_logging

Expand Down Expand Up @@ -61,6 +62,9 @@ def deactivate(self):
max_logging.log("WARNING: library for nsys was not loaded \n" "profiler has no effect")
return
# Popen() instead of run() for non-blocking behavior
subprocess.Popen(["gsutil", "cp", "*nsys-rep", self.output_path]) # pylint: disable=consider-using-with
if shutil.which('gsutil') is not None:
subprocess.Popen(["gsutil", "cp", "*nsys-rep", self.output_path]) # pylint: disable=consider-using-with
else:
max_logging.log("WARNING: gsutil is not installed or not found in the system's PATH. Skipping upload...")
elif self.mode == "xplane":
jax.profiler.stop_trace()
Loading