Training Loop
PremiumTake apart LightningCLI, PretrainModule, the optimizer, and the scheduler
The previous section organized text samples into input_ids, labels, and attention_mask. Starting from this section, this batch enters the real training loop: model forward, loss computation, backpropagation, optimizer update, learning rate scheduling, logging, and checkpoint saving.
The pretraining loop of cookllm-bento can first be viewed as the following pipeline:
Pretrain Training Loop
How configs become a running Lightning training job.
Training Entrypoint
The pretraining entrypoint file is very thin:
def main():
LightningCLI(PretrainModule, PretrainDataModule, save_config_callback=None)It mainly does three things:
Log in to continue reading
This is premium content. Please log in to access the full article.
CookLLM Docs