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

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

16 Apr 2024arXiv:2404.10933archive 2025-07-28

TaeHo Kim, Yanming Wang, Vatshank Chaturvedi, Lokesh Gupta, Seyeon Kim, Yongin Kwon, Sangtae Ha

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2404.10933")

Code

Syntology Ran 11 of 13 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 11 ran with no contract checked.

By repository: official repository: 13 samples from 1 repository, 11 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

taehokim20/llmem officialmentioned in paperpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

13 samples harvested; 11 ran; 0 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

11ran
2unverified

Licence: 0 of the 13 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from taehokim20/llmem. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

apply_rotary_pos_emb taehokim20/llmem/real_models/modeling_codegen.py official repository ran MIT (permissive) · d11e60ed4e63403d · report
bloom_gelu_forward taehokim20/llmem/real_models/modeling_bloom.py official repository ran fingerprinted MIT (permissive) · fea555fa29409762 · report
build_alibi_tensor taehokim20/llmem/real_models/modeling_bloom.py official repository ran MIT (permissive) · 4a678475b134e3a3 · report
create_sinusoidal_positions taehokim20/llmem/real_models/modeling_codegen.py official repository ran fingerprinted MIT (permissive) · c2217cd556fe5607 · report
dropout_add taehokim20/llmem/real_models/modeling_bloom.py official repository ran MIT (permissive) · 280bd05460216db0 · report
masked_softmax taehokim20/llmem/real_models/modeling_gpt_bigcode.py official repository ran MIT (permissive) · 49334501abd461a4 · report
move_to_cuda taehokim20/llmem/dp_real.py official repository ran MIT (permissive) · 87770cda7e05b48c · report
preprocess taehokim20/llmem/dp_real.py official repository ran MIT (permissive) · 817d5f759487007d · report
rotate_every_two taehokim20/llmem/real_models/modeling_codegen.py official repository ran fingerprinted MIT (permissive) · 2e3bec9f0c9b1973 · report
upcast_masked_softmax taehokim20/llmem/real_models/modeling_gpt_bigcode.py official repository ran MIT (permissive) · 38cab2f301010b6d · report
upcast_softmax taehokim20/llmem/real_models/modeling_gpt_bigcode.py official repository ran MIT (permissive) · 49527b68e554c71a · report
SizeEstimator taehokim20/LLMem/size_estimator.py official repository unverified MIT (permissive) · 2d6cdec623b61202 · report
preprocess taehokim20/llmem/tp_real.py official repository unverified MIT (permissive) · 57ebefbf9f9142ef · report

Tasks

Decoder

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections