Models / nemotron_h
NVIDIA-Nemotron-Nano-9B-v2: GPU memory to fine-tune
Fine-tuning NVIDIA-Nemotron-Nano-9B-v2 at batch 1 and 2048 tokens takes about 183 GB of GPU memory for a full fine-tune (2 x H200 141 GB, split by layer), and 30.5 GB with LoRA r=16 on a bf16 base (borderline on one A100 40 GB). Estimated from the model's structure, reading the config under transformers semantics, not measured. What fits on which card.
Reconstructed from its own config.json
with no weights read. 429K 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.
custom-code This repository ships its own modeling code (`auto_map`, e.g. `configuration_nemotron_h.py`), so `config.json` names a class in the repo rather than an architecture `transformers` defines. The graph below is what those config keys mean under `transformers` semantics, which is not necessarily what the repo's own file builds. A gap here is a statement about what we read, not about the checkpoint.
What it costs to run
Cost is a roofline estimate on the priced GPU for 10 epochs at batch 32, 2048 tokens over 50,000 samples (assumed; no dataset attached).
Memory: what fits on which card
Largest batch per card. Training is sized at 2048 tokens per sample, serving at 4096 tokens per sequence.
| Card | Full fine-tune | LoRA r=16 | Serve bf16, 4096 tokens |
|---|---|---|---|
| T4 16 GB | does not fit at batch 1 | does not fit at batch 1 | does not fit at batch 1 |
| L4 24 GB | does not fit at batch 1 | does not fit at batch 1 | batch 22 |
| A100 40 GB | does not fit at batch 1 | batch 1, borderline | batch 121 |
| A100 / H100 80 GB | does not fit at batch 1 | batch 4 | batch 370 |
| H200 141 GB | 2 cards at batch 1 (119 + 52 layers) | batch 8 | batch 749 |
Training: 2048 tokens per sample (2048, or the model's context when shorter; the structure table is at the config's maximum, 131072), 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. "Borderline" means the card holds batch 1 on the estimate but not on the conservative peak (the estimate x 1.43, at or above the measured peak on 95% of held-out runs): measure one step before reserving it. Serving: bf16 weights plus the KV cache of 4096 tokens per sequence plus the fixed recurrent state of the SSM / linear-attention layers; 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
173 nodes. Output shapes are propagated from the input shape, batch dimension excluded, at 131072 tokens: the config's maximum context, not the 2048 the memory above is sized at.
| Layer | Type | Output shape | |
|---|---|---|---|
| 1 | Input | Input | 1 × 131072 |
| 2 | Embedding | Embedding | 1 × 131072 × 4480 |
| 3 | RMSNorm_1_1 | RMSNorm | 1 × 131072 × 4480 |
| 4 | Mamba_1 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 5 | Add_1_attn | Add | 1 × 131072 × 4480 |
| 6 | RMSNorm_2_2 | RMSNorm | 1 × 131072 × 4480 |
| 7 | FFN_2 | Feed Forward | 1 × 131072 × 4480 |
| 8 | Add_2_ffn | Add | 1 × 131072 × 4480 |
| 9 | RMSNorm_3_1 | RMSNorm | 1 × 131072 × 4480 |
| 10 | Mamba_3 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 11 | Add_3_attn | Add | 1 × 131072 × 4480 |
| 12 | RMSNorm_4_2 | RMSNorm | 1 × 131072 × 4480 |
| 13 | FFN_4 | Feed Forward | 1 × 131072 × 4480 |
| 14 | Add_4_ffn | Add | 1 × 131072 × 4480 |
| 15 | RMSNorm_5_1 | RMSNorm | 1 × 131072 × 4480 |
| 16 | Mamba_5 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 17 | Add_5_attn | Add | 1 × 131072 × 4480 |
| 18 | RMSNorm_6_2 | RMSNorm | 1 × 131072 × 4480 |
| 19 | FFN_6 | Feed Forward | 1 × 131072 × 4480 |
| 20 | Add_6_ffn | Add | 1 × 131072 × 4480 |
| 21 | RMSNorm_7_1 | RMSNorm | 1 × 131072 × 4480 |
| 22 | Mamba_7 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 23 | Add_7_attn | Add | 1 × 131072 × 4480 |
| 24 | RMSNorm_8_1 | RMSNorm | 1 × 131072 × 4480 |
| 25 | Mamba_8 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 26 | Add_8_attn | Add | 1 × 131072 × 4480 |
| 27 | RMSNorm_9_2 | RMSNorm | 1 × 131072 × 4480 |
| 28 | FFN_9 | Feed Forward | 1 × 131072 × 4480 |
| 29 | Add_9_ffn | Add | 1 × 131072 × 4480 |
| 30 | RMSNorm_10_1 | RMSNorm | 1 × 131072 × 4480 |
| 31 | Mamba_10 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 32 | Add_10_attn | Add | 1 × 131072 × 4480 |
| 33 | RMSNorm_11_2 | RMSNorm | 1 × 131072 × 4480 |
| 34 | FFN_11 | Feed Forward | 1 × 131072 × 4480 |
| 35 | Add_11_ffn | Add | 1 × 131072 × 4480 |
| 36 | RMSNorm_12_1 | RMSNorm | 1 × 131072 × 4480 |
| 37 | Mamba_12 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 38 | Add_12_attn | Add | 1 × 131072 × 4480 |
| 39 | RMSNorm_13_2 | RMSNorm | 1 × 131072 × 4480 |
| 40 | FFN_13 | Feed Forward | 1 × 131072 × 4480 |
| 41 | Add_13_ffn | Add | 1 × 131072 × 4480 |
| 42 | RMSNorm_14_1 | RMSNorm | 1 × 131072 × 4480 |
| 43 | Mamba_14 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 44 | Add_14_attn | Add | 1 × 131072 × 4480 |
| 45 | RMSNorm_15_1 | RMSNorm | 1 × 131072 × 4480 |
| 46 | Attention_15 | Grouped Query Attn | 1 × 131072 × 4480 |
| 47 | Add_15_attn | Add | 1 × 131072 × 4480 |
| 48 | RMSNorm_16_2 | RMSNorm | 1 × 131072 × 4480 |
| 49 | FFN_16 | Feed Forward | 1 × 131072 × 4480 |
| 50 | Add_16_ffn | Add | 1 × 131072 × 4480 |
| 51 | RMSNorm_17_1 | RMSNorm | 1 × 131072 × 4480 |
| 52 | Mamba_17 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 53 | Add_17_attn | Add | 1 × 131072 × 4480 |
| 54 | RMSNorm_18_2 | RMSNorm | 1 × 131072 × 4480 |
| 55 | FFN_18 | Feed Forward | 1 × 131072 × 4480 |
| 56 | Add_18_ffn | Add | 1 × 131072 × 4480 |
| 57 | RMSNorm_19_1 | RMSNorm | 1 × 131072 × 4480 |
| 58 | Mamba_19 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 59 | Add_19_attn | Add | 1 × 131072 × 4480 |
| 60 | RMSNorm_20_2 | RMSNorm | 1 × 131072 × 4480 |
| 61 | FFN_20 | Feed Forward | 1 × 131072 × 4480 |
| 62 | Add_20_ffn | Add | 1 × 131072 × 4480 |
| 63 | RMSNorm_21_1 | RMSNorm | 1 × 131072 × 4480 |
| 64 | Mamba_21 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 65 | Add_21_attn | Add | 1 × 131072 × 4480 |
| 66 | RMSNorm_22_1 | RMSNorm | 1 × 131072 × 4480 |
| 67 | Attention_22 | Grouped Query Attn | 1 × 131072 × 4480 |
| 68 | Add_22_attn | Add | 1 × 131072 × 4480 |
| 69 | RMSNorm_23_2 | RMSNorm | 1 × 131072 × 4480 |
| 70 | FFN_23 | Feed Forward | 1 × 131072 × 4480 |
| 71 | Add_23_ffn | Add | 1 × 131072 × 4480 |
| 72 | RMSNorm_24_1 | RMSNorm | 1 × 131072 × 4480 |
| 73 | Mamba_24 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 74 | Add_24_attn | Add | 1 × 131072 × 4480 |
| 75 | RMSNorm_25_2 | RMSNorm | 1 × 131072 × 4480 |
| 76 | FFN_25 | Feed Forward | 1 × 131072 × 4480 |
| 77 | Add_25_ffn | Add | 1 × 131072 × 4480 |
| 78 | RMSNorm_26_1 | RMSNorm | 1 × 131072 × 4480 |
| 79 | Mamba_26 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 80 | Add_26_attn | Add | 1 × 131072 × 4480 |
| 81 | RMSNorm_27_2 | RMSNorm | 1 × 131072 × 4480 |
| 82 | FFN_27 | Feed Forward | 1 × 131072 × 4480 |
| 83 | Add_27_ffn | Add | 1 × 131072 × 4480 |
| 84 | RMSNorm_28_1 | RMSNorm | 1 × 131072 × 4480 |
| 85 | Mamba_28 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 86 | Add_28_attn | Add | 1 × 131072 × 4480 |
| 87 | RMSNorm_29_2 | RMSNorm | 1 × 131072 × 4480 |
| 88 | FFN_29 | Feed Forward | 1 × 131072 × 4480 |
| 89 | Add_29_ffn | Add | 1 × 131072 × 4480 |
| 90 | RMSNorm_30_1 | RMSNorm | 1 × 131072 × 4480 |
| 91 | Mamba_30 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 92 | Add_30_attn | Add | 1 × 131072 × 4480 |
| 93 | RMSNorm_31_1 | RMSNorm | 1 × 131072 × 4480 |
| 94 | Attention_31 | Grouped Query Attn | 1 × 131072 × 4480 |
| 95 | Add_31_attn | Add | 1 × 131072 × 4480 |
| 96 | RMSNorm_32_2 | RMSNorm | 1 × 131072 × 4480 |
| 97 | FFN_32 | Feed Forward | 1 × 131072 × 4480 |
| 98 | Add_32_ffn | Add | 1 × 131072 × 4480 |
| 99 | RMSNorm_33_1 | RMSNorm | 1 × 131072 × 4480 |
| 100 | Mamba_33 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 101 | Add_33_attn | Add | 1 × 131072 × 4480 |
| 102 | RMSNorm_34_2 | RMSNorm | 1 × 131072 × 4480 |
| 103 | FFN_34 | Feed Forward | 1 × 131072 × 4480 |
| 104 | Add_34_ffn | Add | 1 × 131072 × 4480 |
| 105 | RMSNorm_35_1 | RMSNorm | 1 × 131072 × 4480 |
| 106 | Mamba_35 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 107 | Add_35_attn | Add | 1 × 131072 × 4480 |
| 108 | RMSNorm_36_2 | RMSNorm | 1 × 131072 × 4480 |
| 109 | FFN_36 | Feed Forward | 1 × 131072 × 4480 |
| 110 | Add_36_ffn | Add | 1 × 131072 × 4480 |
| 111 | RMSNorm_37_1 | RMSNorm | 1 × 131072 × 4480 |
| 112 | Mamba_37 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 113 | Add_37_attn | Add | 1 × 131072 × 4480 |
| 114 | RMSNorm_38_2 | RMSNorm | 1 × 131072 × 4480 |
| 115 | FFN_38 | Feed Forward | 1 × 131072 × 4480 |
| 116 | Add_38_ffn | Add | 1 × 131072 × 4480 |
| 117 | RMSNorm_39_1 | RMSNorm | 1 × 131072 × 4480 |
| 118 | Mamba_39 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 119 | Add_39_attn | Add | 1 × 131072 × 4480 |
| 120 | RMSNorm_40_1 | RMSNorm | 1 × 131072 × 4480 |
| 121 | Attention_40 | Grouped Query Attn | 1 × 131072 × 4480 |
| 122 | Add_40_attn | Add | 1 × 131072 × 4480 |
| 123 | RMSNorm_41_2 | RMSNorm | 1 × 131072 × 4480 |
| 124 | FFN_41 | Feed Forward | 1 × 131072 × 4480 |
| 125 | Add_41_ffn | Add | 1 × 131072 × 4480 |
| 126 | RMSNorm_42_1 | RMSNorm | 1 × 131072 × 4480 |
| 127 | Mamba_42 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 128 | Add_42_attn | Add | 1 × 131072 × 4480 |
| 129 | RMSNorm_43_2 | RMSNorm | 1 × 131072 × 4480 |
| 130 | FFN_43 | Feed Forward | 1 × 131072 × 4480 |
| 131 | Add_43_ffn | Add | 1 × 131072 × 4480 |
| 132 | RMSNorm_44_1 | RMSNorm | 1 × 131072 × 4480 |
| 133 | Mamba_44 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 134 | Add_44_attn | Add | 1 × 131072 × 4480 |
| 135 | RMSNorm_45_1 | RMSNorm | 1 × 131072 × 4480 |
| 136 | Mamba_45 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 137 | Add_45_attn | Add | 1 × 131072 × 4480 |
| 138 | RMSNorm_46_2 | RMSNorm | 1 × 131072 × 4480 |
| 139 | FFN_46 | Feed Forward | 1 × 131072 × 4480 |
| 140 | Add_46_ffn | Add | 1 × 131072 × 4480 |
| 141 | RMSNorm_47_1 | RMSNorm | 1 × 131072 × 4480 |
| 142 | Mamba_47 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 143 | Add_47_attn | Add | 1 × 131072 × 4480 |
| 144 | RMSNorm_48_2 | RMSNorm | 1 × 131072 × 4480 |
| 145 | FFN_48 | Feed Forward | 1 × 131072 × 4480 |
| 146 | Add_48_ffn | Add | 1 × 131072 × 4480 |
| 147 | RMSNorm_49_1 | RMSNorm | 1 × 131072 × 4480 |
| 148 | Mamba_49 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 149 | Add_49_attn | Add | 1 × 131072 × 4480 |
| 150 | RMSNorm_50_2 | RMSNorm | 1 × 131072 × 4480 |
| 151 | FFN_50 | Feed Forward | 1 × 131072 × 4480 |
| 152 | Add_50_ffn | Add | 1 × 131072 × 4480 |
| 153 | RMSNorm_51_1 | RMSNorm | 1 × 131072 × 4480 |
| 154 | Mamba_51 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 155 | Add_51_attn | Add | 1 × 131072 × 4480 |
| 156 | RMSNorm_52_2 | RMSNorm | 1 × 131072 × 4480 |
| 157 | FFN_52 | Feed Forward | 1 × 131072 × 4480 |
| 158 | Add_52_ffn | Add | 1 × 131072 × 4480 |
| 159 | RMSNorm_53_1 | RMSNorm | 1 × 131072 × 4480 |
| 160 | Mamba_53 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 161 | Add_53_attn | Add | 1 × 131072 × 4480 |
| 162 | RMSNorm_54_2 | RMSNorm | 1 × 131072 × 4480 |
| 163 | FFN_54 | Feed Forward | 1 × 131072 × 4480 |
| 164 | Add_54_ffn | Add | 1 × 131072 × 4480 |
| 165 | RMSNorm_55_1 | RMSNorm | 1 × 131072 × 4480 |
| 166 | Mamba_55 | Mamba-2 (SSD) | 1 × 131072 × 4480 |
| 167 | Add_55_attn | Add | 1 × 131072 × 4480 |
| 168 | RMSNorm_56_2 | RMSNorm | 1 × 131072 × 4480 |
| 169 | FFN_56 | Feed Forward | 1 × 131072 × 4480 |
| 170 | Add_56_ffn | Add | 1 × 131072 × 4480 |
| 171 | Final_RMSNorm | RMSNorm | 1 × 131072 × 4480 |
| 172 | LM_Head | Linear | 1 × 131072 × 131072 |
| 173 | Output | Output | 1 × 131072 × 131072 |
What the verifier says
attention-no-pe
What changed upstream
The change tracker follows nvidia/NVIDIA-Nemotron-Nano-9B-v2: 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 nvidia/NVIDIA-Nemotron-Nano-9B-v2 --plan --share