Skip to content

VRAM Optimization Guide

Important Parameters to Consider

ParameterPurposeRecommended Adjustment
--per_device_train_batch_sizeTraining batch size per deviceFor low VRAM: 1-2, for high VRAM: 4 or higher
--per_device_eval_batch_sizeEvaluation batch size per deviceSame as above
--gradient_accumulation_stepsGradient accumulation stepsLow VRAM: 4-16, high VRAM: reduce accordingly