From 602e9685b2b5584b8242384783bda053e450d8d0 Mon Sep 17 00:00:00 2001 From: John Mulhausen Date: Fri, 17 Jul 2026 13:16:29 -0400 Subject: [PATCH] Update torchtune component paths from utils to training torchtune relocated several APIs out of torchtune.utils, so the notebook's generated config crashed with: AttributeError: module 'torchtune.utils' has no attribute 'metric_logging' Updated component paths (verified against torchtune 0.6.1): - torchtune.utils.metric_logging.WandBLogger -> torchtune.training.metric_logging.WandBLogger - torchtune.utils.FullModelHFCheckpointer -> torchtune.training.FullModelHFCheckpointer - torchtune.utils.profiler -> torchtune.training.setup_torch_profiler - torchtune.modules.get_cosine_schedule_with_warmup -> torchtune.training.lr_schedulers.get_cosine_schedule_with_warmup Fixes #579 Co-Authored-By: Claude Fable 5 --- colabs/torchtune/torchtune_and_wandb.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/colabs/torchtune/torchtune_and_wandb.ipynb b/colabs/torchtune/torchtune_and_wandb.ipynb index cad9c0e3..bd0b6e37 100644 --- a/colabs/torchtune/torchtune_and_wandb.ipynb +++ b/colabs/torchtune/torchtune_and_wandb.ipynb @@ -112,7 +112,7 @@ "```yaml\n", "# Logging\n", "metric_logger:\n", - " _component_: torchtune.utils.metric_logging.WandBLogger # <---You only need this to enable W&B\n", + " _component_: torchtune.training.metric_logging.WandBLogger # <---You only need this to enable W&B\n", " project: mistral_lora # <--- The W&B project to save our logs to\n", "log_every_n_steps: 1\n", "\n", @@ -154,7 +154,7 @@ " lora_alpha: 16\n", "\n", "checkpointer:\n", - " _component_: torchtune.utils.FullModelHFCheckpointer\n", + " _component_: torchtune.training.FullModelHFCheckpointer\n", " checkpoint_dir: /tmp/Mistral-7B-v0.1\n", " checkpoint_files: [\n", " pytorch_model-00001-of-00002.bin,\n", @@ -170,7 +170,7 @@ " lr: 2e-5\n", "\n", "lr_scheduler:\n", - " _component_: torchtune.modules.get_cosine_schedule_with_warmup\n", + " _component_: torchtune.training.lr_schedulers.get_cosine_schedule_with_warmup\n", " num_warmup_steps: 100\n", "\n", "loss:\n", @@ -195,7 +195,7 @@ "################################################################################\n", "# Logging\n", "metric_logger:\n", - " _component_: torchtune.utils.metric_logging.WandBLogger # <---You only need this to enable W&B\n", + " _component_: torchtune.training.metric_logging.WandBLogger # <---You only need this to enable W&B\n", " project: mistral_lora # <--- The W&B project to save our logs to\n", "log_every_n_steps: 1\n", "################################################################################\n", @@ -205,7 +205,7 @@ "\n", "# Profiler (disabled)\n", "profiler:\n", - " _component_: torchtune.utils.profiler\n", + " _component_: torchtune.training.setup_torch_profiler\n", " enabled: False" ] },