Skip to content

Commit

Permalink
moved gsutil copy to condtional to avoid breakages
Browse files Browse the repository at this point in the history
  • Loading branch information
kocchop committed Sep 23, 2024
1 parent 1e136a7 commit 6700187
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 6700187

Please sign in to comment.