N Neurarch Try it See it Changes Bot Pricing API Open app

Models / bert

bge-small-zh-v1.5: GPU memory to fine-tune

Fine-tuning bge-small-zh-v1.5 at batch 1 and 512 tokens takes about 0.49 GB of GPU memory for a full fine-tune (fits one T4 16 GB), and 96 MB with LoRA r=16 on a bf16 base (fits one T4 16 GB). Estimated from the model's structure, not measured. What fits on which card.

Reconstructed from its own config.json with no weights read. 4.9M downloads on Hugging Face.

Our count against the checkpoint

The left number comes from the graph. The right one is the number of scalars in the published weight files. Nothing on this page was tuned to make them agree.

Derived from structure
23.7M
23,685,120 parameters
In the published checkpoint
24.0M
23,954,432 scalars · safetensors.total, read 2023-10-12
Delta
-1.12%

What it costs to run

Cost is a roofline estimate on the priced GPU for 10 epochs at batch 32, 512 tokens over 50,000 samples (assumed; no dataset attached).

Layers
18
Will it forward-pass
Yes
Priced on
A10G (24GB)
Est. one run
$0.30

Memory: what fits on which card

Largest batch per card. Training is sized at 512 tokens per sample, serving at 512 tokens per sequence.

Full fine-tune, batch 1 at 512 tokens
0.49 GB
LoRA r=16, batch 1 at 512 tokens
96 MB
Serve: bf16 weights
47 MB
Serve: KV cache, 512 tokens
4.2 MB
CardFull fine-tuneLoRA r=16Serve bf16, 512 tokens
T4 16 GBbatch 358batch 369batch 3305
L4 24 GBbatch 544batch 554batch 4964
A100 40 GBbatch 915batch 925batch 8281
A100 / H100 80 GBbatch 1842batch 1852batch 16574
H200 141 GBbatch 3256batch 3266batch 29220

Training: 512 tokens per sample (2048, or the model's context when shorter), AdamW with bf16 autocast, SDPA attention (no score matrix stored), 1.15x headroom on every card. Full fine-tune holds weights, gradients and optimizer state (1.2 x 16 bytes per parameter) plus activations. LoRA is r=16 on every linear layer but the head, base frozen in bf16 (2 bytes per parameter), adapters at full AdamW state, same activations. A two-card split is a contiguous layer cut (pipeline parallel), computed only where one card cannot hold batch 1. Serving: bf16 weights plus the KV cache of 512 tokens per sequence; prefill working set, CUDA context and framework reserve not counted.

These are estimates from the graph, not measurements. Against measured runs, held out by architecture, the estimate flagged 113 of the 131 jobs that did not fit their card and said "fits" on the other 18. Every measured run.

Structure

20 nodes. Output shapes are propagated from the input shape, batch dimension excluded, at 512 tokens: the config's maximum context.

LayerTypeOutput shape
1InputInput1 × 512
2EmbeddingEmbedding1 × 512 × 512
3Positional_EmbeddingLearned Pos Embed1 × 512 × 512
4Attention_1Multi-Head Attention1 × 512 × 512
5Add_1Add1 × 512 × 512
6LayerNorm_1_1LayerNorm1 × 512 × 512
7FFN_1Feed Forward1 × 512 × 512
8Attention_2Multi-Head Attention1 × 512 × 512
9Add_2Add1 × 512 × 512
10LayerNorm_2_1LayerNorm1 × 512 × 512
11FFN_2Feed Forward1 × 512 × 512
12Attention_3Multi-Head Attention1 × 512 × 512
13Add_3Add1 × 512 × 512
14LayerNorm_3_1LayerNorm1 × 512 × 512
15FFN_3Feed Forward1 × 512 × 512
16Attention_4Multi-Head Attention1 × 512 × 512
17Add_4Add1 × 512 × 512
18LayerNorm_4_1LayerNorm1 × 512 × 512
19FFN_4Feed Forward1 × 512 × 512
20OutputOutput1 × 512 × 512

What the verifier says

No finding on the reconstructed graph. See the checks.

What changed upstream

The change tracker follows BAAI/bge-small-zh-v1.5: every revision it has read, what changed in the config, tokenizer, chat template or weights between them, and an OSV advisory per change.

Do this to your own model

Same numbers, on a model in your repo, in one command. No account.

pip install neurarch-trace
neurarch-trace BAAI/bge-small-zh-v1.5 --plan --share

Other bert checkpoints

all-MiniLM-L12-v2
33.2M derived · -0.48% against the checkpoint
all-MiniLM-L6-v2
22.6M derived · -0.68% against the checkpoint
bert-base-cased
108M derived · -1.13% against the checkpoint
bert-base-multilingual-uncased
167M derived · -0.78% against the checkpoint