Skip to content

Commit

Permalink
set default for log dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jjanezhang committed Feb 2, 2024
1 parent c84790b commit 398d6e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions composer/cli/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,13 @@ def main():

# If running on the Mosaic platform, log all gpu ranks' stderr and stdout to Mosaic platform
if os.environ.get(MOSAICML_PLATFORM_ENV_VAR,
'false').lower() == 'true' and os.environ.get(MOSAICML_LOG_DIR_ENV_VAR, '') != '':
'false').lower() == 'true' and os.environ.get(MOSAICML_LOG_DIR_ENV_VAR, '/') != '/':
log.info('Logging all GPU ranks to Mosaic Platform.')
log_file_format = f'{os.environ.get(MOSAICML_LOG_DIR_ENV_VAR)}/gpu_{{rank}}.txt'
if args.stderr is not None or args.stdout is not None:
warnings.warn(
'Logging to Mosaic Platform. Ignoring provided stdout and stderr args. Set env var MOSAICML_LOG_DIR='
' to use provided stdout and stderr args.')
'Logging to Mosaic Platform. Ignoring provided stdout and stderr args. Set MOSAICML_LOG_DIR="/" to use provided stdout and stderr args.'
)
args.stdout = log_file_format
args.stderr = None

Expand Down

0 comments on commit 398d6e0

Please sign in to comment.