From 1d91d905c9e8960fe7f453e1529a0577f64042b3 Mon Sep 17 00:00:00 2001 From: Dan Saunders Date: Tue, 3 Jun 2025 16:04:15 -0500 Subject: [PATCH] remove deprecated wandb env var (#2751) * remove deprecated wandb env var * remove os.environ wandb setting; unused loggers * remove os.environ wandb setting; unused loggers --- src/axolotl/utils/wandb_.py | 3 --- tests/e2e/multigpu/patched/test_sp.py | 3 --- tests/e2e/multigpu/solo/test_flex.py | 5 ----- tests/e2e/multigpu/test_eval.py | 5 ----- tests/e2e/multigpu/test_gemma3.py | 5 ----- tests/e2e/multigpu/test_llama.py | 5 ----- tests/e2e/multigpu/test_qwen2.py | 5 ----- tests/e2e/multigpu/test_ray.py | 5 ----- tests/e2e/patched/test_4d_multipack_llama.py | 5 ----- tests/e2e/patched/test_fa_xentropy.py | 6 ------ tests/e2e/patched/test_falcon_samplepack.py | 5 ----- tests/e2e/patched/test_fused_llama.py | 5 ----- tests/e2e/patched/test_llama_s2_attention.py | 5 ----- tests/e2e/patched/test_lora_llama_multipack.py | 5 ----- tests/e2e/patched/test_mistral_samplepack.py | 5 ----- tests/e2e/patched/test_mixtral_samplepack.py | 5 ----- tests/e2e/patched/test_phi_multipack.py | 5 ----- tests/e2e/patched/test_resume.py | 5 ----- tests/e2e/patched/test_unsloth_qlora.py | 6 ------ tests/e2e/solo/test_flex.py | 5 ----- tests/e2e/solo/test_relora_llama.py | 5 ----- tests/e2e/test_deepseekv3.py | 5 ----- tests/e2e/test_dpo.py | 5 ----- tests/e2e/test_embeddings_lr.py | 5 ----- tests/e2e/test_evaluate.py | 3 --- tests/e2e/test_falcon.py | 5 ----- tests/e2e/test_gemma2.py | 5 ----- tests/e2e/test_gemma3_text.py | 5 ----- tests/e2e/test_llama.py | 6 ------ tests/e2e/test_llama_pretrain.py | 6 ------ tests/e2e/test_llama_vision.py | 5 ----- tests/e2e/test_lora_llama.py | 5 ----- tests/e2e/test_mamba.py | 5 ----- tests/e2e/test_mistral.py | 5 ----- tests/e2e/test_mixtral.py | 5 ----- tests/e2e/test_optimizers.py | 5 ----- tests/e2e/test_packing_loss.py | 5 ----- tests/e2e/test_phi.py | 5 ----- tests/e2e/test_process_reward_model_smollm2.py | 5 ----- tests/e2e/test_qwen.py | 5 ----- tests/e2e/test_reward_model_smollm2.py | 5 ----- tests/e2e/test_schedulers.py | 5 ----- tests/integrations/test_liger.py | 6 +----- tests/patched/test_validation.py | 15 ++------------- .../test_chat_templates_thinking.py | 3 --- tests/test_prompt_tokenizers.py | 3 --- 46 files changed, 3 insertions(+), 232 deletions(-) diff --git a/src/axolotl/utils/wandb_.py b/src/axolotl/utils/wandb_.py index 327dd9b63..6484d435a 100644 --- a/src/axolotl/utils/wandb_.py +++ b/src/axolotl/utils/wandb_.py @@ -16,6 +16,3 @@ def setup_wandb_env_vars(cfg: DictDefault): # Enable wandb if project name is present if cfg.wandb_project and len(cfg.wandb_project) > 0: cfg.use_wandb = True - os.environ.pop("WANDB_DISABLED", None) # Remove if present - else: - os.environ["WANDB_DISABLED"] = "true" diff --git a/tests/e2e/multigpu/patched/test_sp.py b/tests/e2e/multigpu/patched/test_sp.py index 1170f5eee..e90def2b7 100644 --- a/tests/e2e/multigpu/patched/test_sp.py +++ b/tests/e2e/multigpu/patched/test_sp.py @@ -1,6 +1,5 @@ """E2E tests for sequence parallelism""" -import os from pathlib import Path import pytest @@ -12,8 +11,6 @@ from axolotl.utils.dict import DictDefault from ...utils import check_tensorboard -os.environ["WANDB_DISABLED"] = "true" - class TestSequenceParallelism: """Test case for training with sequence parallelism enabled""" diff --git a/tests/e2e/multigpu/solo/test_flex.py b/tests/e2e/multigpu/solo/test_flex.py index 080ea4c97..42c3c00c8 100644 --- a/tests/e2e/multigpu/solo/test_flex.py +++ b/tests/e2e/multigpu/solo/test_flex.py @@ -2,7 +2,6 @@ E2E tests for multigpu lora tinyllama """ -import os from pathlib import Path import pytest @@ -13,13 +12,9 @@ from transformers.testing_utils import get_torch_dist_unique_port from transformers.utils import is_torch_bf16_gpu_available from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from tests.e2e.utils import check_tensorboard, require_torch_2_6_0 -LOG = get_logger("axolotl.tests.e2e.multigpu") -os.environ["WANDB_DISABLED"] = "true" - AXOLOTL_ROOT = Path(__file__).parent.parent.parent.parent diff --git a/tests/e2e/multigpu/test_eval.py b/tests/e2e/multigpu/test_eval.py index 45a961b7a..379562e40 100644 --- a/tests/e2e/multigpu/test_eval.py +++ b/tests/e2e/multigpu/test_eval.py @@ -2,7 +2,6 @@ E2E tests for multigpu eval """ -import os from pathlib import Path import yaml @@ -10,13 +9,9 @@ from accelerate.test_utils import execute_subprocess_async from transformers.testing_utils import get_torch_dist_unique_port from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_tensorboard -LOG = get_logger("axolotl.tests.e2e.multigpu") -os.environ["WANDB_DISABLED"] = "true" - AXOLOTL_ROOT = Path(__file__).parent.parent.parent.parent diff --git a/tests/e2e/multigpu/test_gemma3.py b/tests/e2e/multigpu/test_gemma3.py index 8540ec91f..9bff25f40 100644 --- a/tests/e2e/multigpu/test_gemma3.py +++ b/tests/e2e/multigpu/test_gemma3.py @@ -2,7 +2,6 @@ E2E tests for multigpu lora tinyllama """ -import os from pathlib import Path import pytest @@ -12,13 +11,9 @@ from huggingface_hub import snapshot_download from transformers.testing_utils import get_torch_dist_unique_port from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from tests.e2e.utils import check_tensorboard -LOG = get_logger("axolotl.tests.e2e.multigpu") -os.environ["WANDB_DISABLED"] = "true" - AXOLOTL_ROOT = Path(__file__).parent.parent.parent.parent diff --git a/tests/e2e/multigpu/test_llama.py b/tests/e2e/multigpu/test_llama.py index e383c5441..9c4bf5054 100644 --- a/tests/e2e/multigpu/test_llama.py +++ b/tests/e2e/multigpu/test_llama.py @@ -2,7 +2,6 @@ E2E tests for multigpu lora tinyllama """ -import os from pathlib import Path import pytest @@ -14,13 +13,9 @@ from packaging import version from transformers.testing_utils import get_torch_dist_unique_port from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from tests.e2e.utils import check_tensorboard, require_torch_2_6_0 -LOG = get_logger("axolotl.tests.e2e.multigpu") -os.environ["WANDB_DISABLED"] = "true" - AXOLOTL_ROOT = Path(__file__).parent.parent.parent.parent diff --git a/tests/e2e/multigpu/test_qwen2.py b/tests/e2e/multigpu/test_qwen2.py index 23650b10d..fa4efa32b 100644 --- a/tests/e2e/multigpu/test_qwen2.py +++ b/tests/e2e/multigpu/test_qwen2.py @@ -2,7 +2,6 @@ E2E tests for multigpu qwen2 """ -import os from pathlib import Path import pytest @@ -11,10 +10,6 @@ from accelerate.test_utils import execute_subprocess_async from transformers.testing_utils import get_torch_dist_unique_port from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger - -LOG = get_logger("axolotl.tests.e2e.multigpu") -os.environ["WANDB_DISABLED"] = "true" class TestMultiGPUQwen2: diff --git a/tests/e2e/multigpu/test_ray.py b/tests/e2e/multigpu/test_ray.py index 64c2d501f..f2c812eb5 100644 --- a/tests/e2e/multigpu/test_ray.py +++ b/tests/e2e/multigpu/test_ray.py @@ -2,7 +2,6 @@ E2E tests for multigpu post-training use Ray Train """ -import os from pathlib import Path import pytest @@ -10,13 +9,9 @@ import yaml from accelerate.test_utils import execute_subprocess_async from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from tests.e2e.utils import check_tensorboard, require_torch_lt_2_6_0 -LOG = get_logger(__name__) -os.environ["WANDB_DISABLED"] = "true" - AXOLOTL_ROOT = Path(__file__).parent.parent.parent.parent diff --git a/tests/e2e/patched/test_4d_multipack_llama.py b/tests/e2e/patched/test_4d_multipack_llama.py index 27b2b2ca0..490ce77fb 100644 --- a/tests/e2e/patched/test_4d_multipack_llama.py +++ b/tests/e2e/patched/test_4d_multipack_llama.py @@ -2,7 +2,6 @@ E2E tests for multipack fft llama using 4d attention masks """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class Test4dMultipackLlama(unittest.TestCase): """ diff --git a/tests/e2e/patched/test_fa_xentropy.py b/tests/e2e/patched/test_fa_xentropy.py index 2581d39a6..e66b67e6d 100644 --- a/tests/e2e/patched/test_fa_xentropy.py +++ b/tests/e2e/patched/test_fa_xentropy.py @@ -2,8 +2,6 @@ E2E tests for lora llama """ -import os - import pytest from transformers.utils import is_torch_bf16_gpu_available @@ -12,13 +10,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, check_tensorboard -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestFAXentropyLlama: """ diff --git a/tests/e2e/patched/test_falcon_samplepack.py b/tests/e2e/patched/test_falcon_samplepack.py index 61689ca1f..bd80221ce 100644 --- a/tests/e2e/patched/test_falcon_samplepack.py +++ b/tests/e2e/patched/test_falcon_samplepack.py @@ -2,7 +2,6 @@ E2E tests for falcon """ -import os import unittest import pytest @@ -12,13 +11,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestFalconPatched(unittest.TestCase): """ diff --git a/tests/e2e/patched/test_fused_llama.py b/tests/e2e/patched/test_fused_llama.py index 20fd2acb5..49478f10c 100644 --- a/tests/e2e/patched/test_fused_llama.py +++ b/tests/e2e/patched/test_fused_llama.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest import pytest @@ -13,13 +12,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - @pytest.mark.skip("FIXME, mostly underused functionality") class TestFusedLlama(unittest.TestCase): diff --git a/tests/e2e/patched/test_llama_s2_attention.py b/tests/e2e/patched/test_llama_s2_attention.py index 3c81a274a..327bb13f8 100644 --- a/tests/e2e/patched/test_llama_s2_attention.py +++ b/tests/e2e/patched/test_llama_s2_attention.py @@ -2,7 +2,6 @@ E2E tests for llama w/ S2 attn """ -import os import unittest import pytest @@ -12,13 +11,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - @pytest.mark.skip(reason="FIXME?") class TestLlamaShiftedSparseAttention(unittest.TestCase): diff --git a/tests/e2e/patched/test_lora_llama_multipack.py b/tests/e2e/patched/test_lora_llama_multipack.py index 894742a7e..1bad677b9 100644 --- a/tests/e2e/patched/test_lora_llama_multipack.py +++ b/tests/e2e/patched/test_lora_llama_multipack.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest import pytest @@ -13,13 +12,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestLoraLlama(unittest.TestCase): """ diff --git a/tests/e2e/patched/test_mistral_samplepack.py b/tests/e2e/patched/test_mistral_samplepack.py index 5ae5a6dc5..994b9dfca 100644 --- a/tests/e2e/patched/test_mistral_samplepack.py +++ b/tests/e2e/patched/test_mistral_samplepack.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestMistral(unittest.TestCase): """ diff --git a/tests/e2e/patched/test_mixtral_samplepack.py b/tests/e2e/patched/test_mixtral_samplepack.py index 38a5d6b65..6a84069ef 100644 --- a/tests/e2e/patched/test_mixtral_samplepack.py +++ b/tests/e2e/patched/test_mixtral_samplepack.py @@ -2,7 +2,6 @@ E2E tests for mixtral """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestMixtral(unittest.TestCase): """ diff --git a/tests/e2e/patched/test_phi_multipack.py b/tests/e2e/patched/test_phi_multipack.py index 54cac15dc..ee2a3ffb4 100644 --- a/tests/e2e/patched/test_phi_multipack.py +++ b/tests/e2e/patched/test_phi_multipack.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestPhiMultipack(unittest.TestCase): """ diff --git a/tests/e2e/patched/test_resume.py b/tests/e2e/patched/test_resume.py index 8ba6b7c54..cc1f3ddee 100644 --- a/tests/e2e/patched/test_resume.py +++ b/tests/e2e/patched/test_resume.py @@ -2,7 +2,6 @@ E2E tests for resuming training """ -import os import re import subprocess @@ -13,13 +12,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, most_recent_subdir, require_torch_2_6_0 -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestResumeLlama: """ diff --git a/tests/e2e/patched/test_unsloth_qlora.py b/tests/e2e/patched/test_unsloth_qlora.py index 3b429279f..46f5b6614 100644 --- a/tests/e2e/patched/test_unsloth_qlora.py +++ b/tests/e2e/patched/test_unsloth_qlora.py @@ -2,8 +2,6 @@ e2e tests for unsloth qlora """ -import os - import pytest from axolotl.cli.args import TrainerCliArgs @@ -11,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, check_tensorboard -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - # pylint: disable=duplicate-code @pytest.mark.skip( diff --git a/tests/e2e/solo/test_flex.py b/tests/e2e/solo/test_flex.py index 431afd55b..b33869b1c 100644 --- a/tests/e2e/solo/test_flex.py +++ b/tests/e2e/solo/test_flex.py @@ -2,7 +2,6 @@ E2E tests for packed training w/ flex attention """ -import os import unittest from transformers.utils import is_torch_bf16_gpu_available @@ -12,13 +11,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_tensorboard, require_torch_2_6_0, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestPackedFlex(unittest.TestCase): """ diff --git a/tests/e2e/solo/test_relora_llama.py b/tests/e2e/solo/test_relora_llama.py index 6e9f403d0..cff8313f3 100644 --- a/tests/e2e/solo/test_relora_llama.py +++ b/tests/e2e/solo/test_relora_llama.py @@ -2,7 +2,6 @@ E2E tests for relora llama """ -import os import unittest from pathlib import Path @@ -11,13 +10,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from ..utils import check_model_output_exists, check_tensorboard, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestReLoraLlama(unittest.TestCase): """ diff --git a/tests/e2e/test_deepseekv3.py b/tests/e2e/test_deepseekv3.py index 0a228aa05..d882286cc 100644 --- a/tests/e2e/test_deepseekv3.py +++ b/tests/e2e/test_deepseekv3.py @@ -2,7 +2,6 @@ E2E tests for deepseekv3 """ -import os from pathlib import Path import pytest @@ -12,13 +11,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from tests.hf_offline_utils import enable_hf_offline -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestDeepseekV3: """ diff --git a/tests/e2e/test_dpo.py b/tests/e2e/test_dpo.py index b03989384..e9f70758b 100644 --- a/tests/e2e/test_dpo.py +++ b/tests/e2e/test_dpo.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest from pathlib import Path @@ -13,13 +12,9 @@ from axolotl.common.datasets import load_preference_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestDPOLlamaLora(unittest.TestCase): """ diff --git a/tests/e2e/test_embeddings_lr.py b/tests/e2e/test_embeddings_lr.py index fe6a50744..f1297fcf3 100644 --- a/tests/e2e/test_embeddings_lr.py +++ b/tests/e2e/test_embeddings_lr.py @@ -2,7 +2,6 @@ E2E tests for llama pretrain """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, check_tensorboard, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestEmbeddingsLrScale(unittest.TestCase): """ diff --git a/tests/e2e/test_evaluate.py b/tests/e2e/test_evaluate.py index 0278113b7..6271bba28 100644 --- a/tests/e2e/test_evaluate.py +++ b/tests/e2e/test_evaluate.py @@ -1,6 +1,5 @@ """E2E smoke test for evaluate CLI command""" -import os from pathlib import Path import yaml @@ -9,8 +8,6 @@ from transformers.testing_utils import get_torch_dist_unique_port from axolotl.utils.dict import DictDefault -os.environ["WANDB_DISABLED"] = "true" - class TestE2eEvaluate: """Test cases for evaluate CLI""" diff --git a/tests/e2e/test_falcon.py b/tests/e2e/test_falcon.py index 4f15867ca..7ea7e30f4 100644 --- a/tests/e2e/test_falcon.py +++ b/tests/e2e/test_falcon.py @@ -2,7 +2,6 @@ E2E tests for falcon """ -import os import unittest import pytest @@ -12,13 +11,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestFalcon(unittest.TestCase): """ diff --git a/tests/e2e/test_gemma2.py b/tests/e2e/test_gemma2.py index 8b9b0d11d..65732a737 100644 --- a/tests/e2e/test_gemma2.py +++ b/tests/e2e/test_gemma2.py @@ -2,7 +2,6 @@ E2E tests for gemma2 """ -import os from pathlib import Path import pytest @@ -12,10 +11,6 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger - -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" class TestGemma2: diff --git a/tests/e2e/test_gemma3_text.py b/tests/e2e/test_gemma3_text.py index 9873de627..d790fa156 100644 --- a/tests/e2e/test_gemma3_text.py +++ b/tests/e2e/test_gemma3_text.py @@ -2,7 +2,6 @@ E2E tests for gemma3_text """ -import os from pathlib import Path import pytest @@ -12,10 +11,6 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger - -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" class TestGemma3Text: diff --git a/tests/e2e/test_llama.py b/tests/e2e/test_llama.py index 352372e1e..455e17532 100644 --- a/tests/e2e/test_llama.py +++ b/tests/e2e/test_llama.py @@ -2,20 +2,14 @@ E2E tests for llama """ -import os - from axolotl.cli.args import TrainerCliArgs from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from tests.e2e.utils import check_model_output_exists -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestLlama: """ diff --git a/tests/e2e/test_llama_pretrain.py b/tests/e2e/test_llama_pretrain.py index 9d0e4d7a6..ec1e164a4 100644 --- a/tests/e2e/test_llama_pretrain.py +++ b/tests/e2e/test_llama_pretrain.py @@ -2,8 +2,6 @@ E2E tests for llama pretrain """ -import os - import pytest from axolotl.cli.args import TrainerCliArgs @@ -11,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, check_tensorboard -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestPretrainLlama: """ diff --git a/tests/e2e/test_llama_vision.py b/tests/e2e/test_llama_vision.py index 890f27569..b93947f0d 100644 --- a/tests/e2e/test_llama_vision.py +++ b/tests/e2e/test_llama_vision.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestLlamaVision(unittest.TestCase): """ diff --git a/tests/e2e/test_lora_llama.py b/tests/e2e/test_lora_llama.py index 02d2868da..999625070 100644 --- a/tests/e2e/test_lora_llama.py +++ b/tests/e2e/test_lora_llama.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestLoraLlama(unittest.TestCase): """ diff --git a/tests/e2e/test_mamba.py b/tests/e2e/test_mamba.py index 92397ab88..efffb4547 100644 --- a/tests/e2e/test_mamba.py +++ b/tests/e2e/test_mamba.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest import pytest @@ -12,13 +11,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - @pytest.mark.skip(reason="skipping until upstreamed into transformers") class TestMamba(unittest.TestCase): diff --git a/tests/e2e/test_mistral.py b/tests/e2e/test_mistral.py index ac5784843..98a82a5f0 100644 --- a/tests/e2e/test_mistral.py +++ b/tests/e2e/test_mistral.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest from transformers.utils import is_torch_bf16_gpu_available @@ -12,13 +11,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestMistral(unittest.TestCase): """ diff --git a/tests/e2e/test_mixtral.py b/tests/e2e/test_mixtral.py index 329428473..b551e431a 100644 --- a/tests/e2e/test_mixtral.py +++ b/tests/e2e/test_mixtral.py @@ -2,7 +2,6 @@ E2E tests for mixtral """ -import os import unittest import torch @@ -13,13 +12,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestMixtral(unittest.TestCase): """ diff --git a/tests/e2e/test_optimizers.py b/tests/e2e/test_optimizers.py index 291ed3d6a..d0837f191 100644 --- a/tests/e2e/test_optimizers.py +++ b/tests/e2e/test_optimizers.py @@ -2,7 +2,6 @@ E2E tests for custom optimizers using Llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, require_torch_2_5_1, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestCustomOptimizers(unittest.TestCase): """ diff --git a/tests/e2e/test_packing_loss.py b/tests/e2e/test_packing_loss.py index 52e27a2c1..12e272888 100644 --- a/tests/e2e/test_packing_loss.py +++ b/tests/e2e/test_packing_loss.py @@ -2,7 +2,6 @@ E2E tests for packed training """ -import os import unittest from transformers.utils import is_torch_bf16_gpu_available @@ -12,13 +11,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_tensorboard, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestPackedLlama(unittest.TestCase): """ diff --git a/tests/e2e/test_phi.py b/tests/e2e/test_phi.py index 349ae9efb..f8b43ad32 100644 --- a/tests/e2e/test_phi.py +++ b/tests/e2e/test_phi.py @@ -2,7 +2,6 @@ E2E tests for lora llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestPhi(unittest.TestCase): """ diff --git a/tests/e2e/test_process_reward_model_smollm2.py b/tests/e2e/test_process_reward_model_smollm2.py index 0673409ab..eb81959a2 100644 --- a/tests/e2e/test_process_reward_model_smollm2.py +++ b/tests/e2e/test_process_reward_model_smollm2.py @@ -2,7 +2,6 @@ E2E tests for process reward model w/ lora llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, check_tensorboard, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestProcessRewardSmolLM2(unittest.TestCase): """ diff --git a/tests/e2e/test_qwen.py b/tests/e2e/test_qwen.py index 1f57c6ae1..aa8b9f6c0 100644 --- a/tests/e2e/test_qwen.py +++ b/tests/e2e/test_qwen.py @@ -2,7 +2,6 @@ E2E tests for qwen """ -import os from pathlib import Path import pytest @@ -11,10 +10,6 @@ from accelerate.test_utils import execute_subprocess_async from transformers.testing_utils import get_torch_dist_unique_port from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger - -LOG = get_logger("axolotl.tests.qwen") -os.environ["WANDB_DISABLED"] = "true" class TestE2eQwen: diff --git a/tests/e2e/test_reward_model_smollm2.py b/tests/e2e/test_reward_model_smollm2.py index 31938ea58..55405d58c 100644 --- a/tests/e2e/test_reward_model_smollm2.py +++ b/tests/e2e/test_reward_model_smollm2.py @@ -2,7 +2,6 @@ E2E tests for reward model lora llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, check_tensorboard, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestRewardModelLoraSmolLM2(unittest.TestCase): """ diff --git a/tests/e2e/test_schedulers.py b/tests/e2e/test_schedulers.py index 12783cfb7..e468081b1 100644 --- a/tests/e2e/test_schedulers.py +++ b/tests/e2e/test_schedulers.py @@ -2,7 +2,6 @@ E2E tests for custom schedulers using Llama """ -import os import unittest from axolotl.cli.args import TrainerCliArgs @@ -10,13 +9,9 @@ from axolotl.common.datasets import load_datasets from axolotl.train import train from axolotl.utils.config import normalize_config, validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from .utils import check_model_output_exists, with_temp_dir -LOG = get_logger("axolotl.tests.e2e") -os.environ["WANDB_DISABLED"] = "true" - class TestCustomSchedulers(unittest.TestCase): """ diff --git a/tests/integrations/test_liger.py b/tests/integrations/test_liger.py index 2d6abe311..5c4bd1028 100644 --- a/tests/integrations/test_liger.py +++ b/tests/integrations/test_liger.py @@ -9,12 +9,8 @@ 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(): return DictDefault( diff --git a/tests/patched/test_validation.py b/tests/patched/test_validation.py index 93347e2a4..2c28a71ea 100644 --- a/tests/patched/test_validation.py +++ b/tests/patched/test_validation.py @@ -12,15 +12,12 @@ from axolotl.loaders.utils import check_model_config from axolotl.utils import is_comet_available from axolotl.utils.config import validate_config from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from axolotl.utils.mlflow_ import setup_mlflow_env_vars from axolotl.utils.schemas.config import AxolotlConfigWCapabilities from axolotl.utils.wandb_ import setup_wandb_env_vars warnings.filterwarnings("error") -LOG = get_logger(__name__) - @pytest.fixture(name="minimal_cfg") def fixture_cfg(): @@ -1507,7 +1504,6 @@ class TestValidationWandb(BaseValidation): assert os.environ.get("WANDB_MODE", "") == "online" assert os.environ.get("WANDB_WATCH", "") == "false" assert os.environ.get("WANDB_LOG_MODEL", "") == "checkpoint" - assert os.environ.get("WANDB_DISABLED", "") != "true" os.environ.pop("WANDB_PROJECT", None) os.environ.pop("WANDB_NAME", None) @@ -1516,16 +1512,12 @@ class TestValidationWandb(BaseValidation): os.environ.pop("WANDB_MODE", None) os.environ.pop("WANDB_WATCH", None) os.environ.pop("WANDB_LOG_MODEL", None) - os.environ.pop("WANDB_DISABLED", None) def test_wandb_set_disabled(self, minimal_cfg): cfg = DictDefault({}) | minimal_cfg - new_cfg = validate_config(cfg) - setup_wandb_env_vars(new_cfg) - - assert os.environ.get("WANDB_DISABLED", "") == "true" + assert new_cfg.use_wandb is None cfg = ( DictDefault( @@ -1537,13 +1529,10 @@ class TestValidationWandb(BaseValidation): ) new_cfg = validate_config(cfg) - setup_wandb_env_vars(new_cfg) - - assert os.environ.get("WANDB_DISABLED", "") != "true" + assert new_cfg.use_wandb is True os.environ.pop("WANDB_PROJECT", None) - os.environ.pop("WANDB_DISABLED", None) @pytest.mark.skipif(is_comet_available() is False, reason="comet_ml is not installed") diff --git a/tests/prompt_strategies/test_chat_templates_thinking.py b/tests/prompt_strategies/test_chat_templates_thinking.py index 21d8c4d5e..79429b731 100644 --- a/tests/prompt_strategies/test_chat_templates_thinking.py +++ b/tests/prompt_strategies/test_chat_templates_thinking.py @@ -10,12 +10,9 @@ from axolotl.prompt_strategies.chat_template import ( load, ) from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from tests.hf_offline_utils import enable_hf_offline -LOG = get_logger(__name__) - @pytest.fixture(name="messages_w_reasoning") def messages_w_reasoning_fixture(): diff --git a/tests/test_prompt_tokenizers.py b/tests/test_prompt_tokenizers.py index d34b774b3..5e5de4ff8 100644 --- a/tests/test_prompt_tokenizers.py +++ b/tests/test_prompt_tokenizers.py @@ -16,12 +16,9 @@ from axolotl.prompt_strategies.orpo.chat_template import load from axolotl.prompt_tokenizers import AlpacaPromptTokenizingStrategy from axolotl.prompters import AlpacaPrompter, PromptStyle from axolotl.utils.dict import DictDefault -from axolotl.utils.logging import get_logger from tests.hf_offline_utils import enable_hf_offline -LOG = get_logger(__name__) - test_data = { "multi_turn_sys": { "conversations": [