Skip to content

Commit

Permalink
Merge pull request #909 from kocchop:faysal/move-gsutil-cp-2-conditional
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 678406771
  • Loading branch information
maxtext authors committed Sep 24, 2024
2 parents a300501 + 6700187 commit 9a0cfd4
Showing 1 changed file with 5 additions and 1 deletion.
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()

0 comments on commit 9a0cfd4

Please sign in to comment.