From 450e8e8abb2c5819451ac577c146ee336f58b5f0 Mon Sep 17 00:00:00 2001 From: Daniel King Date: Mon, 23 Sep 2024 10:21:20 -0700 Subject: [PATCH 1/4] add mosaic logger to registered --- llmfoundry/loggers/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llmfoundry/loggers/__init__.py b/llmfoundry/loggers/__init__.py index cd3f3fdc62..fc156fefbc 100644 --- a/llmfoundry/loggers/__init__.py +++ b/llmfoundry/loggers/__init__.py @@ -6,6 +6,7 @@ MLFlowLogger, TensorboardLogger, WandBLogger, + MosaicMLLogger, ) from llmfoundry.registry import loggers @@ -18,3 +19,4 @@ func=InMemoryLogger, ) # for backwards compatibility loggers.register('mlflow', func=MLFlowLogger) +loggers.register('mosaicml', func=MosaicMLLogger) From 623772d4b00a52d6ac46809481355d5f08ca9cfc Mon Sep 17 00:00:00 2001 From: Daniel King Date: Mon, 23 Sep 2024 13:02:59 -0700 Subject: [PATCH 2/4] add mosaicml logger direct creation support --- llmfoundry/loggers/__init__.py | 2 +- tests/loggers/test_mosaic_ml_logger.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/loggers/test_mosaic_ml_logger.py diff --git a/llmfoundry/loggers/__init__.py b/llmfoundry/loggers/__init__.py index fc156fefbc..c60d9be2cd 100644 --- a/llmfoundry/loggers/__init__.py +++ b/llmfoundry/loggers/__init__.py @@ -4,9 +4,9 @@ from composer.loggers import ( InMemoryLogger, MLFlowLogger, + MosaicMLLogger, TensorboardLogger, WandBLogger, - MosaicMLLogger, ) from llmfoundry.registry import loggers diff --git a/tests/loggers/test_mosaic_ml_logger.py b/tests/loggers/test_mosaic_ml_logger.py new file mode 100644 index 0000000000..42c348029c --- /dev/null +++ b/tests/loggers/test_mosaic_ml_logger.py @@ -0,0 +1,9 @@ +from llmfoundry.utils.builders import build_logger + +from composer.loggers import MosaicMLLogger + +def test_mosaic_ml_logger_constructs(): + mosaic_ml_logger = build_logger('mosaicml', kwargs={'ignore_exceptions': True}) + + assert isinstance(mosaic_ml_logger, MosaicMLLogger) + assert mosaic_ml_logger.ignore_exceptions == True \ No newline at end of file From 82d443bc6e4a158cb59bce2219ddee11327c04fb Mon Sep 17 00:00:00 2001 From: Daniel King Date: Mon, 23 Sep 2024 14:54:51 -0700 Subject: [PATCH 3/4] pc --- tests/loggers/test_mosaic_ml_logger.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/loggers/test_mosaic_ml_logger.py b/tests/loggers/test_mosaic_ml_logger.py index 42c348029c..b4419d6f3a 100644 --- a/tests/loggers/test_mosaic_ml_logger.py +++ b/tests/loggers/test_mosaic_ml_logger.py @@ -1,9 +1,15 @@ -from llmfoundry.utils.builders import build_logger +# Copyright 2024 MosaicML LLM Foundry authors +# SPDX-License-Identifier: Apache-2.0 from composer.loggers import MosaicMLLogger +from llmfoundry.utils.builders import build_logger + + def test_mosaic_ml_logger_constructs(): - mosaic_ml_logger = build_logger('mosaicml', kwargs={'ignore_exceptions': True}) + mosaic_ml_logger = build_logger( + 'mosaicml', kwargs={'ignore_exceptions': True} + ) assert isinstance(mosaic_ml_logger, MosaicMLLogger) - assert mosaic_ml_logger.ignore_exceptions == True \ No newline at end of file + assert mosaic_ml_logger.ignore_exceptions == True From 8537a6cc8bdf0ee7258f0c7a2d323ff1f596f998 Mon Sep 17 00:00:00 2001 From: Daniel King Date: Mon, 23 Sep 2024 15:10:45 -0700 Subject: [PATCH 4/4] pc --- tests/loggers/test_mosaic_ml_logger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/loggers/test_mosaic_ml_logger.py b/tests/loggers/test_mosaic_ml_logger.py index b4419d6f3a..e9c003321b 100644 --- a/tests/loggers/test_mosaic_ml_logger.py +++ b/tests/loggers/test_mosaic_ml_logger.py @@ -8,7 +8,8 @@ def test_mosaic_ml_logger_constructs(): mosaic_ml_logger = build_logger( - 'mosaicml', kwargs={'ignore_exceptions': True} + 'mosaicml', + kwargs={'ignore_exceptions': True}, ) assert isinstance(mosaic_ml_logger, MosaicMLLogger)