-
Notifications
You must be signed in to change notification settings - Fork 238
Expand file tree
/
Copy pathllama3_3_nemotron_super_49B_squad.yaml
More file actions
132 lines (112 loc) · 3.59 KB
/
Copy pathllama3_3_nemotron_super_49B_squad.yaml
File metadata and controls
132 lines (112 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# To run this recipe, please use the following command:
# torchrun --nproc-per-node=8 examples/llm_finetune/finetune.py --config examples/llm_finetune/nemotron/llama3_3_nemotron_super_49B_squad.yaml
# This recipe is validated on 2 8xH100 nodes.
recipe: TrainFinetuneRecipeForNextTokenPrediction
step_scheduler:
global_batch_size: 16
local_batch_size: 2
ckpt_every_steps: 100
val_every_steps: 100 # will run every x number of gradient steps
max_steps: 100
dist_env:
backend: nccl
timeout_minutes: 20
rng:
_target_: nemo_automodel.components.training.rng.StatefulRNG
seed: 1111
ranked: true
model:
_target_: nemo_automodel.NeMoAutoModelForCausalLM.from_pretrained
pretrained_model_name_or_path: nvidia/Llama-3_3-Nemotron-Super-49B-v1_5
trust_remote_code: true
attn_implementation: flash_attention_2
# torch.compile configuration
compile:
enabled: false
mode: "default" # Options: "default", "reduce-overhead", "max-autotune"
fullgraph: false
dynamic: true # Set to false for better performance with fixed shapes
backend: null # Use default backend (inductor)
distributed:
strategy: fsdp2
dp_size: none
tp_size: 4
tp_plan: llama_nemotron_super_tp_plan # registered DeciLM/nemotron-nas TP plan; custom-code arch has no default plan
cp_size: 1
ep_size: 1
pipeline:
pp_microbatch_size: 1
pp_schedule: interleaved1f1b
scale_grads_in_schedule: false
pp_size: 2
sequence_parallel: false
checkpoint:
enabled: true
checkpoint_dir: checkpoints/
model_save_format: safetensors
save_consolidated: final
loss_fn:
_target_: nemo_automodel.components.loss.masked_ce.MaskedCrossEntropy
dataset:
_target_: nemo_automodel.components.datasets.llm.squad.make_squad_dataset
dataset_name: rajpurkar/squad
split: train
seq_length: 1024
padding: max_length
truncation: true
packed_sequence:
packed_sequence_size: 0
dataloader:
_target_: torchdata.stateful_dataloader.StatefulDataLoader
collate_fn: nemo_automodel.components.datasets.utils.default_collater
shuffle: True
drop_last: True
validation_dataset:
_target_: nemo_automodel.components.datasets.llm.squad.make_squad_dataset
dataset_name: rajpurkar/squad
split: validation
limit_dataset_samples: 64
seq_length: 1024
padding: max_length
truncation: true
validation_dataloader:
_target_: torchdata.stateful_dataloader.StatefulDataLoader
collate_fn: nemo_automodel.components.datasets.utils.default_collater
shuffle: True
drop_last: True
optimizer:
_target_: torch.optim.Adam
betas: [0.9, 0.999]
eps: 1e-8
lr: 1.0e-5
weight_decay: 0
lr_scheduler:
lr_decay_style: cosine
min_lr: 1.0e-6
ci:
recipe_owner: akoumpa
nodes: 2
time: "00:45:00"
vllm_deploy: true
checkpoint_robustness:
hf_kl_threshold: 5e-3
resume_loss_threshold: 5e-2
distributed.tp_size: 8
tokenizer_name: nvidia/Llama-3_3-Nemotron-Super-49B-v1_5
hf_device_map_auto: true
trust_remote_code: true
dataset.limit_dataset_samples: 500
validation_dataset.limit_dataset_samples: 500