batchflow
batchflow copied to clipboard
New way of finding optimal batch size
Now optimal batch_size can be found via running _compute_optimal_batch_size function, which does two steps:
-
Compute
batch_size_estimation. Again It can be done in two ways: 1.1. Viacompute_optimal_batch_sizefunction, that solves the system ofmeasured_memory = batch_size * item_size + model_size + epsforitem_sizeandmodel_size. 1.2. Via_run_power_scalingfunction, which multipliesstart_batch_sizewithfactoruntilmax_memoryexceeds or OOM exception. -
Compute precise batch_size using
_run_binary_scaling, based onbatch_size_estimation.