Why Your Fine-Tuning Takes Longer Than FLOPs Suggest

Why Your Fine-Tuning Takes Longer Than FLOPs Suggest
3 min read

Dharma-AI has presented a method for predicting the total duration of fine-tuning language models on shared GPU clusters. Tested on 272 supervised fine-tuning (SFT, training a model on annotated examples) tasks run on production H200 GPUs, it achieves an R² coefficient of 0.98, with a median error of 0.51 hours. The most widespread estimation, based on the number of computational operations, explains only a small fraction of the observed durations.

GPUs are among the most expensive and scarce resources in artificial intelligence. Every day, teams sharing a cluster must decide which tasks use which GPUs, and in what order. This scheduling depends directly on the quality of the duration estimate for each task: a task finishing ahead of schedule leaves GPUs idle, while a delayed task pushes back everything that follows.

To assess this margin of error, Dharma-AI compared analytical estimates with predictors learned from past data. The corpus includes 272 SFT tasks, representing about 7,382 GPU hours, and covers several model families up to 15 billion parameters, in both LoRA and full fine-tuning.

An estimate based solely on computation

The most commonly used estimate relies on a formula: for a dense Transformer, training costs approximately 6·P·D floating-point operations, where P is the number of parameters and D is the number of training tokens. Dividing this total by the power the GPUs can deliver yields a theoretical duration. In practice, tasks never reach the advertised peak power. The FLOP utilization rate (MFU) typically ranges between 30% and 60%, and its exact value is not known in advance.

Above all, a task is not limited to its optimization loop. One must account for environment preparation, model download and loading, tokenization, periodic evaluations, sending checkpoints, and final storage, all competing with other tasks for network and storage bandwidth. These overheads depend on the configuration and do not scale neatly with workload: two tasks with identical nominal computation can therefore finish hours apart.

The results are clear. The FLOP-based method achieves an R² of 0.31 and a mean absolute error of 12.41 hours, regardless of the MFU chosen between 0.25 and 0.65. Calculon, an analytical performance model presented at the SC ’23 conference, does no better: according to Dharma-AI, its estimates correspond to a median of only 11% of the actually observed duration.

The selected predictor is a CatBoost model with 24 variables, trained solely on information available before task launch. It achieves a mean absolute error of 1.71 hours, measured by five-fold cross-validation. Linear models improve the estimation but remain limited, while XGBoost and CatBoost are close on every metric.

Limitations and next steps

According to the analysis of the most influential variables, the total number of samples processed during evaluation ranks first, ahead of the number of trainable parameters. The frequency of evaluations, the size of the evaluation set, and the number of checkpoints therefore weigh as much as the scale of the model and data. Dharma-AI clarifies, however, that this is not a causal link.

Accuracy decreases for very long tasks. Beyond 60 hours, the median error reaches 5.19 hours, on only 13 tasks, which the company attributes to a lack of data. The study also only covers SFT, without RLHF, DPO, or RLVR, and only H200 GPUs: the model should not be transposed as-is to other hardware generations.

Dharma-AI indicates that the full paper, detailing the formulas and hyperparameters, will be published soon on arXiv. Its future work will focus on hardware descriptors, validation on other GPU types, transfer learning for rarely observed configurations, other training objectives, and more data on long-running tasks.

S’abonner
Notification pour
guest

0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
0
Nous aimerions avoir votre avis, veuillez laisser un commentaire.x