Skip to content

Commit

Permalink
Fall back to normal logging when gpu prefix is not present (#3020)
Browse files Browse the repository at this point in the history
* added new condition

* removed a comma

* Update composer/cli/launcher.py

Co-authored-by: Mihir Patel <[email protected]>

---------

Co-authored-by: Mihir Patel <[email protected]>
  • Loading branch information
jjanezhang and mvpatel2000 committed Feb 16, 2024
1 parent 6e28c88 commit 6096f65
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,9 +482,9 @@ def main():
args.stderr = f'{log_tmpdir.name}/rank{{rank}}.stderr.txt'

# 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 str(os.environ.get(MOSAICML_LOG_DIR_ENV_VAR, 'false')).lower() != 'false':
if os.environ.get(MOSAICML_PLATFORM_ENV_VAR, 'false').lower() == 'true' and str(
os.environ.get(MOSAICML_LOG_DIR_ENV_VAR, 'false')).lower() != 'false' and os.environ.get(
MOSAICML_GPU_LOG_FILE_PREFIX_ENV_VAR, 'false').lower() != 'false':
log.info('Logging all GPU ranks to Mosaic Platform.')
log_file_format = f'{os.environ.get(MOSAICML_LOG_DIR_ENV_VAR)}/{os.environ.get(MOSAICML_GPU_LOG_FILE_PREFIX_ENV_VAR)}{{local_rank}}.txt'
if args.stderr is not None or args.stdout is not None:
Expand Down

0 comments on commit 6096f65

Please sign in to comment.