TorchTrainer connects Ray’s distributed execution engine to a PyTorch training loop, coordinating worker resources, workload distribution, and failure recovery across nodes or GPUs. section 8.2
A train_func defines the training lifecycle: loading metrics and models, obtaining dataset shards, batching data, configuring training, and evaluating results. TorchTrainer supplies scaling, datasets, and checkpoint policies around that function. section 8.2
Configure and run distributed training
Instantiate TorchTrainer with train_func, ScalingConfig, Ray datasets, and RunConfig. Set num_workers and use_gpu to select resources, then retain the checkpoint with the lowest eval_loss.
