File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,9 @@ def main(**kwargs):
6363 # TODO: may have to init qccl backend, next try run with torchrun command
6464 torch_device = torch .device (device )
6565 assert torch_device .type != "cpu" , "Host doesn't support single-node DDP"
66- assert (
67- torch_device . index is None
68- ), f"DDP requires specification of device type only, however provided device index as well: { torch_device } "
66+ assert torch_device . index is None , (
67+ f"DDP requires specification of device type only, however provided device index as well: { torch_device } "
68+ )
6969 dist .init_process_group (backend = train_config .dist_backend )
7070 # from here onward "qaic/cuda" will automatically map to "qaic:i/cuda:i", where i = process rank
7171 getattr (torch , torch_device .type ).set_device (dist .get_rank ())
@@ -126,7 +126,6 @@ def main(**kwargs):
126126 model = get_peft_model (model , peft_config )
127127 model .print_trainable_parameters ()
128128
129-
130129 # Get the dataset utils
131130 dataset_config = generate_dataset_config (train_config , kwargs )
132131 dataset_processer = tokenizer
Original file line number Diff line number Diff line change @@ -211,7 +211,6 @@ def train(
211211 train_step_loss .append (loss .detach ().float ().item ())
212212 train_step_perplexity .append (float (torch .exp (loss .detach ().float ())))
213213
214-
215214 if train_config .grad_scaler :
216215 scaler .scale (loss ).backward () # backward pass
217216 else :
You can’t perform that action at this time.
0 commit comments