From 31c904b0d940640389b47bfcb352ec5178720ca2 Mon Sep 17 00:00:00 2001 From: JackZ-db Date: Fri, 7 Jun 2024 10:28:47 -0700 Subject: [PATCH] added unit testing for building system_metrics_monitor --- tests/callbacks/test_system_metrics_monitor.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/callbacks/test_system_metrics_monitor.py diff --git a/tests/callbacks/test_system_metrics_monitor.py b/tests/callbacks/test_system_metrics_monitor.py new file mode 100644 index 0000000000..4a7459b0d5 --- /dev/null +++ b/tests/callbacks/test_system_metrics_monitor.py @@ -0,0 +1,16 @@ +# Copyright 2024 MosaicML LLM Foundry authors +# SPDX-License-Identifier: Apache-2.0 + +from composer.callbacks import SystemMetricsMonitor +from llmfoundry.utils.builders import build_callback + + +def test_system_metrics_monitor_callback_builds(): + kwargs = {'log_all_data': True} + callback = build_callback( + 'system_metrics_monitor', + kwargs=kwargs, + train_config={'train_loader': {}}, + ) + assert isinstance(callback, SystemMetricsMonitor) + assert getattr(callback, 'log_all_data', None) is True