From 0caa1d239871c69efc6d71999d2e30bdc22c807d Mon Sep 17 00:00:00 2001 From: Lena Kashtelyan Date: Wed, 3 Apr 2024 09:21:18 -0700 Subject: [PATCH] Clean up too verbose logs pt. 2 (#2298) Summary: Pull Request resolved: https://github.com/facebook/Ax/pull/2298 Reviewed By: saitcakmak Differential Revision: D54885252 --- ax/modelbridge/tests/test_model_spec.py | 2 +- ax/modelbridge/tests/test_torch_modelbridge.py | 2 +- ax/modelbridge/torch.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ax/modelbridge/tests/test_model_spec.py b/ax/modelbridge/tests/test_model_spec.py index 04e464a5d2e..144c011ddce 100644 --- a/ax/modelbridge/tests/test_model_spec.py +++ b/ax/modelbridge/tests/test_model_spec.py @@ -58,7 +58,7 @@ def test_fit(self, wrapped_extract_ssd: Mock) -> None: # This should skip the model fit. with mock.patch("ax.modelbridge.torch.logger") as mock_logger: ms.fit(experiment=self.experiment, data=self.data) - mock_logger.info.assert_called_with( + mock_logger.debug.assert_called_with( "The observations are identical to the last set of observations " "used to fit the model. Skipping model fitting." ) diff --git a/ax/modelbridge/tests/test_torch_modelbridge.py b/ax/modelbridge/tests/test_torch_modelbridge.py index 304e5fc5559..a53f3ceb7ad 100644 --- a/ax/modelbridge/tests/test_torch_modelbridge.py +++ b/ax/modelbridge/tests/test_torch_modelbridge.py @@ -149,7 +149,7 @@ def test_TorchModelBridge( self.assertIsNone(model_fit_args["candidate_metadata"]) self.assertEqual(ma._last_observations, observations) - with mock.patch(f"{TorchModelBridge.__module__}.logger.info") as mock_logger: + with mock.patch(f"{TorchModelBridge.__module__}.logger.debug") as mock_logger: ma._fit( model=model, search_space=search_space, diff --git a/ax/modelbridge/torch.py b/ax/modelbridge/torch.py index 1c466b4999c..b2d964c5a7c 100644 --- a/ax/modelbridge/torch.py +++ b/ax/modelbridge/torch.py @@ -633,7 +633,7 @@ def _fit( **kwargs: Any, ) -> None: if self.model is not None and observations == self._last_observations: - logger.info( + logger.debug( "The observations are identical to the last set of observations " "used to fit the model. Skipping model fitting." )