Rank 0-only logging (#2608)

Co-authored-by: Wing Lian <wing@axolotl.ai>
This commit is contained in:
salman
2025-05-28 14:57:30 +01:00
committed by GitHub
parent 5fca214108
commit 65c5481120
135 changed files with 454 additions and 378 deletions

View File

@@ -2,8 +2,6 @@
config validation tests for swiglu args
"""
# pylint: disable=duplicate-code
import logging
from typing import Optional
import pytest
@@ -11,6 +9,11 @@ import pytest
from axolotl.utils.config import prepare_plugins, validate_config
from axolotl.utils.dict import DictDefault
# pylint: disable=duplicate-code
from axolotl.utils.logging import get_logger
LOG = get_logger("axolotl.integrations.test_liger")
@pytest.fixture(name="minimal_liger_cfg")
def fixture_cfg():
@@ -41,7 +44,7 @@ class TestValidation:
@pytest.fixture(autouse=True)
def inject_fixtures(self, caplog):
caplog.set_level(logging.WARNING)
caplog.set_level("WARNING")
self._caplog = caplog
def test_deprecated_swiglu(self, minimal_liger_cfg):
@@ -52,9 +55,7 @@ class TestValidation:
| minimal_liger_cfg
)
with self._caplog.at_level(
logging.WARNING, logger="axolotl.integrations.liger.args"
):
with self._caplog.at_level("WARNING", logger="axolotl.integrations.liger.args"):
prepare_plugins(test_cfg)
updated_cfg = validate_config(test_cfg)
# TODO this test is brittle in CI