diff --git a/composer/cli/launcher.py b/composer/cli/launcher.py index c72e1b01db..c25772621a 100755 --- a/composer/cli/launcher.py +++ b/composer/cli/launcher.py @@ -22,7 +22,8 @@ import torch import composer -from composer.loggers.mosaicml_logger import MOSAICML_LOG_DIR_ENV_VAR, MOSAICML_PLATFORM_ENV_VAR +from composer.loggers.mosaicml_logger import (MOSAICML_GPU_LOG_FILE_PREFIX_ENV_VAR, MOSAICML_LOG_DIR_ENV_VAR, + MOSAICML_PLATFORM_ENV_VAR) from composer.utils import get_free_tcp_port CLEANUP_TIMEOUT = datetime.timedelta(seconds=30) @@ -485,7 +486,7 @@ def main(): MOSAICML_PLATFORM_ENV_VAR, 'false').lower() == 'true' and str(os.environ.get(MOSAICML_LOG_DIR_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)}/gpu_{{rank}}.txt' + 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: warnings.warn( 'Logging to Mosaic Platform. Ignoring provided stdout and stderr args. To use provided stdout and stderr, set MOSAICML_LOG_DIR=false.' diff --git a/composer/loggers/mosaicml_logger.py b/composer/loggers/mosaicml_logger.py index cab710a4c3..fa317d6f8c 100644 --- a/composer/loggers/mosaicml_logger.py +++ b/composer/loggers/mosaicml_logger.py @@ -37,6 +37,7 @@ MOSAICML_PLATFORM_ENV_VAR = 'MOSAICML_PLATFORM' MOSAICML_ACCESS_TOKEN_ENV_VAR = 'MOSAICML_ACCESS_TOKEN_FILE' MOSAICML_LOG_DIR_ENV_VAR = 'MOSAICML_LOG_DIR' +MOSAICML_GPU_LOG_FILE_PREFIX_ENV_VAR = 'MOSAICML_GPU_LOG_FILE_PREFIX' class MosaicMLLogger(LoggerDestination):