Models / qwen3
Qwen3.6-27B-DFlash: GPU memory to fine-tune
Fine-tuning Qwen3.6-27B-DFlash at batch 1 and 2048 tokens takes about 84.5 GB of GPU memory for a full fine-tune (fits one H200 141 GB), and 13.4 GB with LoRA r=16 on a bf16 base (borderline on one T4 16 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. 147K 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. `dflash.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 | batch 1, borderline | batch 111 |
| L4 24 GB | does not fit at batch 1 | batch 2 | batch 250 |
| A100 40 GB | does not fit at batch 1 | batch 5 | batch 526 |
| A100 / H100 80 GB | 2 cards at batch 1 (33 + 1 layers) | batch 12 | batch 1217 |
| H200 141 GB | batch 8 | batch 22 | batch 2271 |
Training: 2048 tokens per sample (2048, or the model's context when shorter; the structure table is at the config's maximum, 262144), 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; 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
36 nodes. Output shapes are propagated from the input shape, batch dimension excluded, at 262144 tokens: the config's maximum context, not the 2048 the memory above is sized at.
| Layer | Type | Output shape | |
|---|---|---|---|
| 1 | Input | Input | 1 × 262144 |
| 2 | Embedding | Embedding | 1 × 262144 × 5120 |
| 3 | RoPE | RoPE | 1 × 262144 × 5120 |
| 4 | RMSNorm_1_1 | RMSNorm | 1 × 262144 × 5120 |
| 5 | Attention_1 | Local Attention | 1 × 262144 × 5120 |
| 6 | Add_1_attn | Add | 1 × 262144 × 5120 |
| 7 | RMSNorm_1_2 | RMSNorm | 1 × 262144 × 5120 |
| 8 | FFN_1 | SwiGLU | 1 × 262144 × 5120 |
| 9 | Add_1_ffn | Add | 1 × 262144 × 5120 |
| 10 | RMSNorm_2_1 | RMSNorm | 1 × 262144 × 5120 |
| 11 | Attention_2 | Local Attention | 1 × 262144 × 5120 |
| 12 | Add_2_attn | Add | 1 × 262144 × 5120 |
| 13 | RMSNorm_2_2 | RMSNorm | 1 × 262144 × 5120 |
| 14 | FFN_2 | SwiGLU | 1 × 262144 × 5120 |
| 15 | Add_2_ffn | Add | 1 × 262144 × 5120 |
| 16 | RMSNorm_3_1 | RMSNorm | 1 × 262144 × 5120 |
| 17 | Attention_3 | Local Attention | 1 × 262144 × 5120 |
| 18 | Add_3_attn | Add | 1 × 262144 × 5120 |
| 19 | RMSNorm_3_2 | RMSNorm | 1 × 262144 × 5120 |
| 20 | FFN_3 | SwiGLU | 1 × 262144 × 5120 |
| 21 | Add_3_ffn | Add | 1 × 262144 × 5120 |
| 22 | RMSNorm_4_1 | RMSNorm | 1 × 262144 × 5120 |
| 23 | Attention_4 | Local Attention | 1 × 262144 × 5120 |
| 24 | Add_4_attn | Add | 1 × 262144 × 5120 |
| 25 | RMSNorm_4_2 | RMSNorm | 1 × 262144 × 5120 |
| 26 | FFN_4 | SwiGLU | 1 × 262144 × 5120 |
| 27 | Add_4_ffn | Add | 1 × 262144 × 5120 |
| 28 | RMSNorm_5_1 | RMSNorm | 1 × 262144 × 5120 |
| 29 | Attention_5 | Grouped Query Attn | 1 × 262144 × 5120 |
| 30 | Add_5_attn | Add | 1 × 262144 × 5120 |
| 31 | RMSNorm_5_2 | RMSNorm | 1 × 262144 × 5120 |
| 32 | FFN_5 | SwiGLU | 1 × 262144 × 5120 |
| 33 | Add_5_ffn | Add | 1 × 262144 × 5120 |
| 34 | Final_RMSNorm | RMSNorm | 1 × 262144 × 5120 |
| 35 | LM_Head | Linear | 1 × 262144 × 248320 |
| 36 | Output | Output | 1 × 262144 × 248320 |
What the verifier says
huge-linear-params
What changed upstream
The change tracker follows z-lab/Qwen3.6-27B-DFlash: 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 z-lab/Qwen3.6-27B-DFlash --plan --share