LLMem: Estimating GPU Memory Usage for Fine-Tuning Pre-Trained LLMs

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Kim, Taeho, Wang, Yanming, Chaturvedi, Vatshank, Gupta, Lokesh, Kim, Seyeon, Kwon, Yongin, Ha, Sangtae
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866910413073940480
author Kim, Taeho
Wang, Yanming
Chaturvedi, Vatshank
Gupta, Lokesh
Kim, Seyeon
Kwon, Yongin
Ha, Sangtae
author_facet Kim, Taeho
Wang, Yanming
Chaturvedi, Vatshank
Gupta, Lokesh
Kim, Seyeon
Kwon, Yongin
Ha, Sangtae
contents Fine-tuning pre-trained large language models (LLMs) with limited hardware presents challenges due to GPU memory constraints. Various distributed fine-tuning methods have been proposed to alleviate memory constraints on GPU. However, determining the most effective method for achieving rapid fine-tuning while preventing GPU out-of-memory issues in a given environment remains unclear. To address this challenge, we introduce LLMem, a solution that estimates the GPU memory consumption when applying distributed fine-tuning methods across multiple GPUs and identifies the optimal method. We conduct GPU memory usage estimation prior to fine-tuning, leveraging the fundamental structure of transformer-based decoder models and the memory usage distribution of each method. Experimental results show that LLMem accurately estimates peak GPU memory usage on a single GPU, with error rates of up to 1.6%. Additionally, it shows an average error rate of 3.0% when applying distributed fine-tuning methods to LLMs with more than a billion parameters on multi-GPU setups.
format Preprint
id arxiv_https___arxiv_org_abs_2404_10933
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LLMem: Estimating GPU Memory Usage for Fine-Tuning Pre-Trained LLMs
Kim, Taeho
Wang, Yanming
Chaturvedi, Vatshank
Gupta, Lokesh
Kim, Seyeon
Kwon, Yongin
Ha, Sangtae
Artificial Intelligence
Computation and Language
Machine Learning
Fine-tuning pre-trained large language models (LLMs) with limited hardware presents challenges due to GPU memory constraints. Various distributed fine-tuning methods have been proposed to alleviate memory constraints on GPU. However, determining the most effective method for achieving rapid fine-tuning while preventing GPU out-of-memory issues in a given environment remains unclear. To address this challenge, we introduce LLMem, a solution that estimates the GPU memory consumption when applying distributed fine-tuning methods across multiple GPUs and identifies the optimal method. We conduct GPU memory usage estimation prior to fine-tuning, leveraging the fundamental structure of transformer-based decoder models and the memory usage distribution of each method. Experimental results show that LLMem accurately estimates peak GPU memory usage on a single GPU, with error rates of up to 1.6%. Additionally, it shows an average error rate of 3.0% when applying distributed fine-tuning methods to LLMs with more than a billion parameters on multi-GPU setups.
title LLMem: Estimating GPU Memory Usage for Fine-Tuning Pre-Trained LLMs
topic Artificial Intelligence
Computation and Language
Machine Learning
url https://arxiv.org/abs/2404.10933