Skip to content

Commit 8e20394

Browse files
author
Joe Cummings
committed
Merge remote-tracking branch 'upstream/main' into multi-node-support
2 parents a3aaeb4 + d4465c8 commit 8e20394

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

recipes/configs/code_llama2/evaluation.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# To launch, run the following command:
44
# tune run eleuther_eval --config code_llama2/evaluation
55

6+
output_dir: ./ # Not needed
7+
68
# Model arguments
79
model:
810
_component_: torchtune.models.code_llama2.code_llama2_7b

recipes/configs/llama3_2/evaluation.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# To launch, run the following command:
44
# tune run eleuther_eval --config llama3_2/evaluation
55

6+
output_dir: ./ # Not needed
7+
68
# Model Arguments
79
model:
810
_component_: torchtune.models.llama3_2.llama3_2_3b

recipes/configs/llama3_2_vision/11B_lora_multi_dataset.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
# Config for multi-device LoRA finetuning in lora_finetune_distributed_td.py
1+
# Config for multi-device LoRA finetuning in lora_finetune_distributed_multi_dataset.py
22
# using a Llama3.2 11B Vision Instruct model
33
#
44
# This config assumes that you've run the following command before launching:
55
# tune download meta-llama/Llama-3.2-11B-Vision-Instruct --output-dir /tmp/Llama-3.2-11B-Vision-Instruct --ignore-patterns "original/consolidated*"
66
#
77
# To launch on 2 devices, run the following command from root:
8-
# tune run --nproc_per_node 2 lora_finetune_distributed_td --config llama3_2_vision/11B_lora_td
8+
# tune run --nproc_per_node 2 lora_finetune_distributed_multi_dataset --config llama3_2_vision/11B_lora_multi_dataset
99
#
1010
# You can add specific overrides through the command line. For example
1111
# to override the checkpointer directory while launching training:
12-
# tune run --nproc_per_node 2 lora_finetune_distributed_td --config llama3_2_vision/11B_lora_td checkpointer.checkpoint_dir=<YOUR_CHECKPOINT_DIR>
12+
# tune run --nproc_per_node 2 lora_finetune_distributed_multi_dataset --config llama3_2_vision/11B_lora_multi_dataset checkpointer.checkpoint_dir=<YOUR_CHECKPOINT_DIR>
1313
#
1414
# This config works best when the model is being fine-tuned on 2+ GPUs.
1515
# For single device LoRA finetuning please use 11B_lora_single_device.yaml
1616
# or 11B_qlora_single_device.yaml
1717

18+
output_dir: /tmp/torchtune/llama3_2_vision_11B/lora_multi_dataset # /tmp may be deleted by your system. Change it to your preference.
19+
1820
# Model arguments
1921
model:
2022
_component_: torchtune.models.llama3_2_vision.lora_llama3_2_vision_11b
@@ -44,7 +46,7 @@ checkpointer:
4446
filename_format: model-{}-of-{}.safetensors
4547
max_filename: "00005"
4648
recipe_checkpoint: null
47-
output_dir: /tmp/Llama-3.2-11B-Vision-Instruct/
49+
output_dir: ${output_dir}
4850
model_type: LLAMA3_VISION
4951
resume_from_checkpoint: False
5052
save_adapter_weights_only: False # PeFT formatting not available yet. This will save it in torchtune format only.
@@ -117,6 +119,6 @@ dtype: bf16
117119
output_dir: /tmp/lora-llama3.2-vision-finetune
118120
metric_logger:
119121
_component_: torchtune.training.metric_logging.DiskLogger
120-
log_dir: /tmp/Llama-3.2-11B-Vision-Instruct/logs
122+
log_dir: ${output_dir}/logs
121123
log_every_n_steps: 1
122124
log_peak_memory_stats: True

torchtune/utils/_logging.py

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def deprecated(msg: str = "") -> Callable[[T], T]:
6767

6868
@lru_cache(maxsize=1)
6969
def warn(obj):
70+
rank = dist.get_rank() if dist.is_available() and dist.is_initialized() else 0
71+
if rank != 0:
72+
return
7073
warnings.warn(
7174
f"{obj.__name__} is deprecated and will be removed in future versions. "
7275
+ msg,

0 commit comments

Comments
 (0)