SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.10933 · IJCAI · 2024

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

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

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.10933.json · badge: /api/ran/2404.10933.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
taehokim20/llmem canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
taehokim20/LLMem community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
taehokim20/llmem/real_models/modeling_codegen.py
code served (permissive licence) · get_code("d11e60ed4e63403d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 5, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct valid arguments for apply_rotary_pos_emb
# The function expects:
# - tensor: shape (batch, seq_len, ?, dim) - used with *, rotate_every_two
# - sin: shape (batch, seq_len, dim_half) - repeat_interleave to (batch, seq_len, 1, dim)
# - cos: shape (batch, seq_len, dim_half) - repeat_interleave to (batch, seq_len, 1, dim)

batch_size = 2
seq_len = 3
dim = 4
dim_half = dim // 2

# tensor shape: (batch, seq_len, intermediate, dim)
tensor = torch.randn(batch_size, seq_len, 5, dim)

# sin and cos shapes: (batch, seq_len, dim_half)
sin = torch.randn(batch_size, seq_len, dim_half)
cos = torch.randn(batch_size, seq_len, dim_half)

ARGS = {
    "tensor": tensor,
    "sin": sin,
    "cos": cos,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 3, 5, 4) — shape (2, 3, 5, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
bloom_gelu_forward Ran
ran; our contract draft was wrong, not the code
taehokim20/llmem/real_models/modeling_bloom.py
code served (permissive licence) · get_code("fea555fa29409762")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small input tensor with shape (batch=2, dim=4)
x = torch.randn(2, 4)

ARGS = {
    "x": x,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_alibi_tensor Ran
ran; our contract draft was wrong, not the code
taehokim20/llmem/real_models/modeling_bloom.py
code served (permissive licence) · get_code("4a678475b134e3a3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (16, 1, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# Create a small attention mask tensor
# Shape: (batch_size, seq_length)
batch_size = 2
seq_length = 4
attention_mask = torch.ones(batch_size, seq_length, dtype=torch.long)

# Set num_heads to a value
num_heads = 8

# Set dtype
dtype = torch.float32

ARGS = {
    "attention_mask": attention_mask,
    "num_heads": num_heads,
    "dtype": dtype,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (16, 1, 4) — shape (16, 1, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_sinusoidal_positions Ran
ran, honoured the contract we drafted
taehokim20/llmem/real_models/modeling_codegen.py
code served (permissive licence) · get_code("c2217cd556fe5607")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "num_pos": 2,
    "dim": 4,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
dropout_add Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
taehokim20/llmem/real_models/modeling_bloom.py
code served (permissive licence) · get_code("280bd05460216db0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for input and residual
x = torch.randn(2, 4)
residual = torch.randn(2, 4)

# Dropout probability
prob = 0.5

# Training mode flag
training = True

ARGS = {
    "x": x,
    "residual": residual,
    "prob": prob,
    "training": training,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
masked_softmax Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
taehokim20/llmem/real_models/modeling_gpt_bigcode.py
code served (permissive licence) · get_code("49334501abd461a4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
seq_len = 4

# x: input tensor for softmax computation
x = torch.randn(batch_size, seq_len)

# mask: boolean tensor indicating which positions to keep (True = keep, False = mask)
mask = torch.tensor([
    [True, True, False, False],
    [True, True, True, False]
])

# mask_value: the value to fill in masked positions (typically large negative number for softmax)
mask_value = torch.tensor(float('-inf'))

ARGS = {
    "x": x,
    "mask": mask,
    "mask_value": mask_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
move_to_cuda Ran
ran; our contract draft was wrong, not the code
taehokim20/llmem/dp_real.py
code served (permissive licence) · get_code("87770cda7e05b48c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects a dict where values have a .to() method (tensors)
# and a device parameter to move them to
batch = {
    'input_ids': torch.randn(2, 4),
    'attention_mask': torch.randn(2, 3),
    'labels': torch.randn(2, 5)
}

device = 'cpu'

ARGS = {
    'batch': batch,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
preprocess Ran
ran; our contract draft was wrong, not the code
taehokim20/llmem/dp_real.py
pointer only (licence: MIT); the stored copy get_code serves, from GCYZSL/O3-LLM-UNLEARNING, is pointer only (licence: NONE) · get_code("817d5f759487007d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from GCYZSL/O3-LLM-UNLEARNING, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rotate_every_two Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
taehokim20/llmem/real_models/modeling_codegen.py
code served (permissive licence) · get_code("2e3bec9f0c9b1973")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 4, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function rotate_every_two takes a single tensor argument x
# It expects a 4D tensor based on the indexing: x[:, :, :, ::2] and x[:, :, :, 1::2]
# The last dimension must be even so it can be split into pairs
# Let's create a small tensor with shape (batch=2, dim1=3, dim2=4, dim3=6)
# where dim3=6 is even so it can be split into pairs

x = torch.randn(2, 3, 4, 6)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 3, 4, 6) — shape (2, 3, 4, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
upcast_masked_softmax Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
taehokim20/llmem/real_models/modeling_gpt_bigcode.py
code served (permissive licence) · get_code("38cab2f301010b6d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional

torch.manual_seed(0)

# Create small tensors
batch_size = 2
seq_len = 4
hidden_dim = 3

# x: input tensor (batch_size, seq_len, hidden_dim)
x = torch.randn(batch_size, seq_len, hidden_dim, dtype=torch.float32)

# mask: boolean mask with same shape as x
mask = torch.ones(batch_size, seq_len, hidden_dim, dtype=torch.bool)
# Set some values to False to test masking
mask[0, 0, 0] = False
mask[1, 2, 1] = False

# mask_value: scalar tensor to use where mask is False
mask_value = torch.tensor(float('-inf'), dtype=torch.float32)

# scale: float scaling factor
scale = 0.5

# softmax_dtype: the dtype to use for softmax computation
softmax_dtype = torch.float32

ARGS = {
    "x": x,
    "mask": mask,
    "mask_value": mask_value,
    "scale": scale,
    "softmax_dtype": softmax_dtype,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
upcast_softmax Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
taehokim20/llmem/real_models/modeling_gpt_bigcode.py
code served (permissive licence) · get_code("49527b68e554c71a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small tensor for testing
# Using shape (2, 4) - batch size 2, feature dim 4
x = torch.randn(2, 4, dtype=torch.float32)

# Define scale parameter
scale = 2.0

# Define softmax_dtype parameter
softmax_dtype = torch.float32

ARGS = {
    "x": x,
    "scale": scale,
    "softmax_dtype": softmax_dtype
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SizeEstimator Not yet run
unverified (harvested, no recorded run)
taehokim20/LLMem/size_estimator.py
code served (permissive licence) · get_code("2d6cdec623b61202")
How it ran

no invocation recorded.

preprocess Not yet run
unverified (harvested, no recorded run)
taehokim20/llmem/tp_real.py
code served (permissive licence) · get_code("57ebefbf9f9142ef")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 0 the same month, 1 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
preprocess 23 other papers
14 dated earlier, 7 later, 2 same year, order not determinable
2305.12870 (2023-05)
Lion: Adversarial Distillation of Proprietary Large Language Models
2306.17194 (2023-06)
On the Exploitability of Instruction Tuning
2308.07286 (2023-08)
The Devil is in the Errors: Leveraging Large Language Models for Fine-grained Machine Translation Evaluation
and 20 more not named here
dropout_add 8 other papers
6 dated earlier, 1 same year, order not determinable, 1 undated
2311.04219 (2023-11)
OtterHD: A High-Resolution Multi-modality Model
2311.13230 (2023-11)
Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus
2024.findings-acl.347 (2024 (year only))
Mass-Editing Memory with Attention in Transformers: A cross-lingual exploration of knowledge
and 5 more not named here
create_sinusoidal_positions 4 other papers
4 dated earlier
2203.13474 (2022-03)
CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
2311.13230 (2023-11)
Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus
2403.04945 (2024-03)
MEIT: Multimodal Electrocardiogram Instruction Tuning on Large Language Models for Report Generation
and 1 more not named here
rotate_every_two 4 other papers
4 dated earlier
2203.13474 (2022-03)
CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
2311.13230 (2023-11)
Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus
2403.04945 (2024-03)
MEIT: Multimodal Electrocardiogram Instruction Tuning on Large Language Models for Report Generation
and 1 more not named here
bloom_gelu_forward 3 other papers
2 dated earlier, 1 undated
2402.18815 (2024-02)
How do Large Language Models Handle Multilingualism?
2403.04945 (2024-03)
MEIT: Multimodal Electrocardiogram Instruction Tuning on Large Language Models for Report Generation
openreview_d3RFDLBw01
STLA: Spatiotemporal Lookahead Alignment for Post-Training Quantization
build_alibi_tensor 3 other papers
2 dated earlier, 1 undated
2402.18815 (2024-02)
How do Large Language Models Handle Multilingualism?
2403.04945 (2024-03)
MEIT: Multimodal Electrocardiogram Instruction Tuning on Large Language Models for Report Generation
openreview_d3RFDLBw01
STLA: Spatiotemporal Lookahead Alignment for Post-Training Quantization
apply_rotary_pos_emb 1 other paper
1 dated earlier
2203.13474 (2022-03)
CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
masked_softmax 1 other paper
1 dated earlier
2402.16347 (2024-02)
CodeS: Towards Building Open-source Language Models for Text-to-SQL
upcast_masked_softmax 1 other paper
1 dated earlier
2402.16347 (2024-02)
CodeS: Towards Building Open-source Language Models for Text-to-SQL
upcast_softmax 1 other paper
1 dated earlier
2402.16347 (2024-02)
CodeS: Towards Building Open-source Language Models for Text-to-SQL

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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 outof-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 finetuning 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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.10933")
get_code_for_paper("2404.10933")
have("2404.10933")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.10933.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.10933.svg)](https://syntology.ai/paper/2404.10933)

Connect an agent — have() is free.